blob: d6225d8b47c307df053c9afe38cec830e453a48b [file] [log] [blame]
2018-02-01 Chris Dumez <cdumez@apple.com>
We no longer need to queue service worker jobs until the connection to the service worker process has been established
https://bugs.webkit.org/show_bug.cgi?id=182375
Reviewed by Youenn Fablet.
We no longer need to queue service worker jobs until the connection to the service worker process
has been established. We initially did this to work around the fact that registrations restored
from disk would not have an active worker until the service worker process had been established.
However, this issue has been fixed in r227696.
This is basically a revert of r227220, which is no longer needed after r227696.
No new tests, initial fix was covered by an API test that still passes.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:
2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Shift + mouse scroll should scroll horizontally
https://bugs.webkit.org/show_bug.cgi?id=181629
Reviewed by Michael Catanzaro.
We currently turn vertical scroll into horizontal when scrolling over the horizontal scrollbar. When Shift key is
pressed, we still want to scroll in the scrollbar direction when scrolling over a scrollbar, so we need to swap
directions in both scrollbars depending on whther the Shift key is pressed or not.
* page/EventHandler.cpp:
(WebCore::EventHandler::shouldSwapScrollDirection const): Renamed.
(WebCore::EventHandler::handleWheelEvent): Use the new name.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
* page/EventHandler.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copySwappingDirection const): Swap the direction of the event.
(WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks const): Deleted.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::shouldSwapScrollDirection const): Take into account whether the Shift key is present.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Problem with Washington Post images
https://bugs.webkit.org/show_bug.cgi?id=181421
Reviewed by Carlos Alberto Lopez Perez.
This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
washingtonpost.com.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):
2018-02-01 Carlos Garcia Campos <cgarcia@igalia.com>
[SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
https://bugs.webkit.org/show_bug.cgi?id=182328
Reviewed by Michael Catanzaro.
soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but
soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore
Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to
prepend the '.' if missing.
Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
* platform/network/soup/CookieSoup.cpp:
(WebCore::Cookie::toSoupCookie const):
2018-02-01 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182374
<rdar://problem/37102005>
Reviewed by Antti Koivisto.
It's only called from RenderTreeBuilder.
No change in functionality.
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
* rendering/RenderTableRow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
* rendering/updating/RenderTreeBuilderTable.h:
2018-02-01 Chris Dumez <cdumez@apple.com>
Queue a microtask when a waitUntil() promise is settled
https://bugs.webkit.org/show_bug.cgi?id=182372
<rdar://problem/37101019>
Reviewed by Mark Lam.
Queue a microtask when a waitUntil() promise is settled, as per:
- https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil (step 5)
Otherwise, we decrement m_pendingPromiseCount too quickly and it may cause
following calls to waitUntil() to throw when they shouldn't.
No new tests, rebaselined existing test.
* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::addExtendLifetimePromise):
2018-02-01 Antti Koivisto <antti@apple.com>
Invalidate style for sibling combinators accurately on class change
https://bugs.webkit.org/show_bug.cgi?id=182336
Reviewed by Zalan Bujtas.
Use Style::Invalidator to invalidate only those elements that may be affected by a class
change for sibling combinators and nth pseudo classes.
* css/RuleFeature.cpp:
Add new AllSiblings MatchElement to use for nth pseudo classes with subselectors.
(WebCore::isSiblingOrSubject):
Add a helper.
(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
Compute and propage MatchElement::AllSiblings.
* css/RuleFeature.h:
* dom/Node.cpp:
(WebCore::Node::updateAncestorsForStyleRecalc):
Don't need to test for childrenAffectedByPropertyBasedBackwardPositionalRules anymore (an oddly named bit for nth pseudo classes).
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
Invalidate only the potentially affected elements.
The old code would just unconditionally invalidate the current element. This would propagate to descedants of siblings via
affectedByPreviousSibling bits. That mechanism can be removed when everything has been switched to accurate invalidation.
2018-01-31 Simon Fraser <simon.fraser@apple.com>
Use different debug red colors for different contexts
https://bugs.webkit.org/show_bug.cgi?id=182362
Reviewed by Tim Horton.
Pure red is used elsehwere in the system as a debug color indicator, so use different
shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
so they are identifiable.
* page/FrameView.cpp:
(WebCore::FrameView::paintContents):
2018-01-31 Don Olmstead <don.olmstead@sony.com>
[CMake] Make JavaScriptCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182303
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:
2018-01-31 Per Arne Vollan <pvollan@apple.com>
Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181204
<rdar://problem/36256274>
Reviewed by Ryosuke Niwa.
When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
the frame will be detached when removed from its previous position in the DOM tree. When being
detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
However, this method will return early when executed in a beforeunload handler, since navigation
is not allowed then. The end result is a detached frame which will continue to load, and hitting
asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
possible to stop a frame load, even when executing a beforeunload handler.
No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable): Fix a failing API test by allowing scripts to be executed
under the PageCache::prune method.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isStopLoadingAllowed const):
(WebCore::FrameLoader::stopAllLoaders):
* loader/FrameLoader.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::~SVGImage): Disable scripts disallowed assertions in this scope, since it is
safe in this context.
2018-01-31 Javier Fernandez <jfernandez@igalia.com>
inline-block baseline not computed correctly for vertical-lr
https://bugs.webkit.org/show_bug.cgi?id=170176
Reviewed by Manuel Rego Casasnovas.
When computing the baseline position of inline-block elements we use the
InlineFlow logicalTop and the FontMetrics ascent. The issue comes from
the fact that these units are incompatible. The logicalTop of a
vertical-lr element is offset to the left edge, while the ascent is the
distance from the right edge.
We need to either use logical value for the FontMetrics ascent so we can
compute the correctly the baselines of vertical-lr elements, or just using
the logicalBottom for these cases.
The approach based on a logicalAscent API for FontMetrics would require
a lot of work because inline-block logic assumes everything is vertical-rl
and at some point, flips the elements along the block-axis in case of
vertical-lr mode.
While it'd be desirable to get rid of this flipping logic, this patch tries
first the simpler approach of using logicalBottom, which aligns with the
currently implemented logic.
Tests: fast/inline-block/baseline-vertical-01.html
fast/inline-block/baseline-vertical-02.html
fast/inline-block/baseline-vertical-03.html
fast/inline-block/baseline-vertical-04.html
fast/inline-block/baseline-vertical-05.html
fast/inline-block/baseline-vertical-06.html
fast/inline-block/baseline-vertical-07.html
fast/inline-block/baseline-vertical-08.html
* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
2018-01-31 Said Abou-Hallawa <sabouhallawa@apple.com>
BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
https://bugs.webkit.org/show_bug.cgi?id=182277
Reviewed by Simon Fraser.
BitmapImage::drawPattern() needs to destroy the incomplete decoded frame
before trying to draw it as a pattern.
Test: http/tests/images/draw-pattern-slow-load-large-image.html
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::updateBufferInternal): We need to disable CachedImage
data buffering for testing. This simulates slow network where intervals
between data chunks can last for seconds.
* loader/cache/CachedImage.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern): Destroy the incomplete decoded frame
before drawing this frame as a pattern. We do not destroy incomplete decoded
frame once new data is received because it may be drawn by async image
drawing while waiting for the newer frame to finish decoding.
* testing/Internals.cpp:
(WebCore::Internals::setForceUpdateImageDataEnabledForTesting):
* testing/Internals.h:
* testing/Internals.idl:
2018-01-31 Ryosuke Niwa <rniwa@webkit.org>
Add a release assertion to ensure timers are deleted in the right thread
https://bugs.webkit.org/show_bug.cgi?id=182351
Reviewed by David Kilzer.
Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.
We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
when WebThread is being used.
* platform/Timer.cpp:
(WebCore::TimerBase::~TimerBase): Added the assertion.
* platform/Timer.h:
(WebCore::TimerBase::m_thread): Always store the current thread in a timer.
2018-01-31 Youenn Fablet <youenn@apple.com>
Change SWServer::claim to set the iterator value as soon as possible
https://bugs.webkit.org/show_bug.cgi?id=182337
Reviewed by Chris Dumez.
No change of behavior, this is a "let's go safe way" fix.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::claim):
2018-01-31 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder.
https://bugs.webkit.org/show_bug.cgi?id=182348
<rdar://problem/37082837>
Reviewed by Antti Koivisto.
All the callsites are in the RenderTreeUpdater by now.
No change in functionality.
* rendering/RenderObject.cpp:
(WebCore::isAnonymousAndSafeToDelete): Deleted.
(WebCore::findDestroyRootIncludingAnonymous): Deleted.
(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
* rendering/RenderObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::isAnonymousAndSafeToDelete):
(WebCore::findDestroyRootIncludingAnonymous):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):
2018-01-31 Ryosuke Niwa <rniwa@webkit.org>
Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk
https://bugs.webkit.org/show_bug.cgi?id=182319
<rdar://problem/36904312>
Reviewed by Chris Dumez.
The crash was caused by a wrong release assertion. Handle author scripts shrinking the resource timing buffer
while resourcetimingbufferfull event is being dispatched.
Also fixed a bug that a superflous resourcetimingbufferfull event will be fired when new resource timing entries
are queued while resourcetimingbufferfull event is being dispatched.
Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html
http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html
* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired):
2018-01-31 Youenn Fablet <youenn@apple.com>
com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration
https://bugs.webkit.org/show_bug.cgi?id=182316
<rdar://problem/37025976>
Reviewed by Chris Dumez.
SWServer.m_clientToControllingWorker and SWServerRegistration.m_clientsUsingRegistration might currently get out of sync.
This is a defensive fix to ensure storage process will not crash in Release.
We keep the ASSERT as this probably means there is an abnormal situation that other patches might fix.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::removeClientUsingRegistration):
2018-01-31 Antoine Quint <graouts@apple.com>
[Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
https://bugs.webkit.org/show_bug.cgi?id=182297
Reviewed by Jon Lee and Eric Carlson.
We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
cases where the play/pause button would never actually become visible because we would first set it as one of
the buttons in the left container in the bottom controls bar before we would identify that we should show the
prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
though it wasn't visible.
Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
the "x" and "visible" properties which we set while performing layout.
This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
other modern-media-controls tests that could have been affected by this unexpected behavior.
* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.willRemoveChild):
(ButtonsContainer.prototype.didChangeChildren):
(ButtonsContainer.prototype.layout):
(ButtonsContainer.prototype.get buttons): Deleted.
(ButtonsContainer.prototype.set buttons): Deleted.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._updateBottomControlsBarLabel):
(InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
(InlineMediaControls):
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):
(LayoutNode.prototype.addChild):
(LayoutNode.prototype.removeChild):
(LayoutNode.prototype.willRemoveChild):
(LayoutNode.prototype.didChangeChildren):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
data-auto-hide-delay on a <video> element.
2018-01-31 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
https://bugs.webkit.org/show_bug.cgi?id=182315
<rdar://problem/37048160>
Reviewed by Antti Koivisto.
resolveMovedChild() is only called from RenderTreeBuilder.
No change in functionality.
* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::resolveMovedChild const): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
* rendering/updating/RenderTreeBuilderMultiColumn.h:
2018-01-31 Philippe Normand <pnormand@igalia.com>
[GStreamer] Silent WebAudio buffers support
https://bugs.webkit.org/show_bug.cgi?id=143869
Reviewed by Carlos Garcia Campos.
* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
enables downstream elements to optimize the buffer processing.
2018-01-31 Xabier Rodriguez Calvar <calvaris@igalia.com>
[EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
https://bugs.webkit.org/show_bug.cgi?id=182324
Reviewed by Žan Doberšek.
* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::tryNextSupportedConfiguration): Fix
candidateCofiguration typo.
2018-01-30 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
https://bugs.webkit.org/show_bug.cgi?id=182093
Reviewed by Alex Christensen.
WebKit draws texts doubly by shifting 1px for fonts without bold
fonts but bold font is desired. This synthetic bold method draws
fonts with embedded bitmap fonts look like double strike in HiDPI.
No new tests (Covered by the existing tests).
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::createGDIFont): Overwrite lfWeight if the desired weight
is bold and matched font weight is't bold and in WinCairo port.
Fix wrong indentation.
2018-01-30 Youenn Fablet <youenn@apple.com> and Oleksandr Skachkov <gskachkov@gmail.com>
FetchResponse should support ConsumeData callback on chunk data is received
https://bugs.webkit.org/show_bug.cgi?id=181600
<rdar://problem/36932547>
Reviewed by Alex Christensen.
Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html
Apply same read-by-chunk strategy for body coming from network as for body coming from ReadableStream.
Refactor to have one consumeBodyReceivedByChunk method for both cases.
This allows streaming data from a service worker to WebProcess as would be done by NetworkProcess.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::addAll):
(WebCore::DOMCache::put):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveData):
(WebCore::FetchResponse::BodyLoader::consumeDataByChunk):
(WebCore::FetchResponse::consumeBody):
(WebCore::FetchResponse::consumeBodyReceivedByChunk):
* Modules/fetch/FetchResponse.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
2018-01-30 Don Olmstead <don.olmstead@sony.com>
JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
https://bugs.webkit.org/show_bug.cgi?id=182312
Reviewed by Michael Catanzaro.
No new tests. No change in behavior.
* config.h:
2018-01-30 Chris Nardi <cnardi@chromium.org>
Use double-quotes when serializing font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=182201
According to the CSSOM spec, all strings should be serialized with double-quotes. The feature
tag value was previously serialized with single-quotes; change this to double-quotes to match
the spec and non-WebKit browsers.
Reviewed by Myles C. Maxfield.
Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
and fast/text/font-face-javascript.html.
* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::customCSSText const):
2018-01-30 Brent Fulgham <bfulgham@apple.com>
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>
Reviewed by Chris Dumez.
Part 2: Add telemetry for the Storage Access API case
Adds a new convenience method to identify origin/page/frame combinations that
have been granted access to the Storage Access API. This is used for debug
logging in the NetworkProcess. It is not used in production builds.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Added.
2018-01-30 Ryosuke Niwa <rniwa@webkit.org>
Release assert in updateLayout() via AXObjectCache::childrenChanged
https://bugs.webkit.org/show_bug.cgi?id=182279
<rdar://problem/36994456>
Reviewed by Antti Koivisto.
Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it
would require a large architectural refactoring of the accessibility code.
Test: accessibility/accessibility-object-update-during-style-resolution-crash.html
* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here.
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable.
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable.
2018-01-30 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
https://bugs.webkit.org/show_bug.cgi?id=182306
<rdar://problem/37041440>
Reviewed by Antti Koivisto.
With all the ruby mutation code moving, only RenderTreeBuilder calls RenderRubyRun::rubyBaseSafe.
No change in functionality.
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyText const):
(WebCore::RenderRubyRun::rubyBase const):
(WebCore::RenderRubyRun::firstLineBlock const):
(WebCore::RenderRubyRun::takeChild):
(WebCore::RenderRubyRun::rubyBaseSafe): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-01-30 Fujii Hironori <Hironori.Fujii@sony.com>
Unified sources for FEMorphology.cpp seems to break the windows build.
https://bugs.webkit.org/show_bug.cgi?id=178847
Reviewed by Yusuke Suzuki.
Fix a compilation error.
platform/graphics/filters/SpotLightSource.cpp(45): error C2027: use of undefined type 'WebCore::FilterEffect'
No new tests (No behavior change)
* Sources.txt: Removed @no-unify for FEMorphology.cpp.
* platform/graphics/filters/SpotLightSource.cpp: Added #include "FilterEffect.h".
2018-01-30 Myles C. Maxfield <mmaxfield@apple.com>
Test fix after r227776
https://bugs.webkit.org/show_bug.cgi?id=180951
Unreviewed.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::mandatoryAttributesForUserInstalledFonts):
2018-01-30 Dean Jackson <dino@apple.com>
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>
Removing a misleading comment based on Zalan Bujtas's feedback.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):
2018-01-30 Dean Jackson <dino@apple.com>
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>
Reviewed by Simon Fraser.
Mostly speculative fix for the case where a scrollTo moves an
animated SVG image into view, causing its animation to restart during
a paint operation. This was causing a release ASSERT, so we now defer
the resumption of the animation into a timer.
Test: svg/animated-svgImage-scroll.html
* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
animation if it is an SVGImage.
* svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::startAnimationTimerFired):
(WebCore::SVGImage::enqueueStartAnimation):
(WebCore::SVGImage::stopAnimation):
* svg/graphics/SVGImage.h:
2018-01-30 Chris Dumez <cdumez@apple.com>
Service worker registration soft updates happen too frequently
https://bugs.webkit.org/show_bug.cgi?id=182296
<rdar://problem/37031862>
Reviewed by Youenn Fablet.
Move code that updates the registration's last update check time from after
the script bytecheck to before, as per:
- https://w3c.github.io/ServiceWorker/#update (step 7.19)
This way, the last update check time gets updated even if the newly fetched
script is identical to the previous one, which is the common case.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
2018-01-30 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182265
<rdar://problem/37004459>
Reviewed by Antti Koivisto.
Move the mutation code that wraps/unwraps a child element when its flow state changes
from(to) in-flow to(from) floating/out-of-flow.
No change in functionality.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::childBecameNonInline): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::childBecameNonInline): Deleted.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::handleDynamicFloatPositionChange): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::childBecameNonInline): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::splitFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::childBecameNonInline):
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
* rendering/updating/RenderTreeBuilderInline.h:
2018-01-30 Brent Fulgham <bfulgham@apple.com>
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>
Reviewed by Chris Dumez.
Partial roll-out of r227755.
The original patch assumed the WebContent process kept track of user interaction. This is
only tracked in the UIProcess, so we can get rid of some of the logging code adding in
r227755.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Deleted.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Deleted.
* loader/ResourceLoadObserver.h:
2018-01-30 Chris Dumez <cdumez@apple.com>
Make sure we never create a WebSWClientConnection with an invalid sessionID
https://bugs.webkit.org/show_bug.cgi?id=182276
<rdar://problem/36582633>
Reviewed by Alex Christensen.
Make sure we never create a WebSWClientConnection with an invalid sessionID as this
could corrupt our hash tables.
* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::ensureSWClientConnection):
2018-01-30 Antti Koivisto <antti@apple.com>
Avoid traversing too much when doing class change invalidation
https://bugs.webkit.org/show_bug.cgi?id=181604
Reviewed by Zalan Bujtas.
We are now collecting information about which part of the tree a change in class can potentially affect.
Use the information to traverse only the required elements in Style::Invalidator.
The same mechanism can be later used for attribute and id change invalidation.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::classInvalidationRuleSets const):
(WebCore::DocumentRuleSets::subjectClassRules const): Deleted.
(WebCore::DocumentRuleSets::ancestorClassRules const): Deleted.
Remove separate subject and ancestor invalidation RuleSets. Instead collect all invalidation rulesets
to a vector along with their MatchElements.
* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
(WebCore::RuleFeatureSet::collectFeatures):
Similarly collect all class invalidation RuleFeatures to a general HashMap along with the MatchElement.
(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
* css/RuleFeature.h:
(WebCore::RuleFeature::RuleFeature):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
Find out InvalidationRuleSets to use.
(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
Pass them to Style::Invalidator.
* style/ClassChangeInvalidation.h:
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForTree):
(WebCore::Style::Invalidator::invalidateStyleForDescendants):
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):
Traverse only the part of the tree needed by the given MatchElement.
* style/StyleInvalidator.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::classNamesAffectedByRules const):
2018-01-30 Javier Fernandez <jfernandez@igalia.com>
[css-align] The 'baseline' value must be invalid for the 'justify-content' property
https://bugs.webkit.org/show_bug.cgi?id=181794
Reviewed by Antti Koivisto.
The CSS WG has resolved that it doesn't make sense to define Baseline
Content-Alignment in the inline/main axis.
https://github.com/w3c/csswg-drafts/issues/1184
The spec has been updated so that <baseline-postion> is not valid for
the 'justify-content' property's syntax. This CL updates our parsing
logic to match the new spec, including the parsing logic of the
place-content shorthand.
Additionally, this CL updates the computed value of the
<baseline-position> values to match other browsers.
We don't implement support for <baseline-position> values in the
Content Distribution properties (align-content and justify-content),
so I don't expect this change to break content of sites using the CSS
Box Alignment feature.
No new tests, just adapt the Web Platform Tests we already have to the new CSS syntax.
* css/parser/CSSPropertyParser.cpp:
(WebCore::getBaselineKeyword):
(WebCore::consumeBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::consumeSimplifiedItemPosition):
2018-01-30 Basuke Suzuki <Basuke.Suzuki@sony.com>
[WinCairo] Fix forwarding header conflict of WebKit on WinCairo
https://bugs.webkit.org/show_bug.cgi?id=177202
Reviewed by Alex Christensen.
* PlatformWin.cmake:
2018-01-30 Myles C. Maxfield <mmaxfield@apple.com>
A disallowed user-installed font may be used if its PostScript name is specified
https://bugs.webkit.org/show_bug.cgi?id=180951
Reviewed by Brent Fulgham.
This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
fonts which WebKit creates. It also adds this attribute to web fonts, so that font
fallback will happen according to our rules about user-installed fonts. It also marks
these font attributes as "mandatory" so CoreText will be guaranteed to follow the
policy.
Test: fast/text/user-installed-fonts/disable.html
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForUserInstalledFonts):
(WebCore::mandatoryAttributesForUserInstalledFonts):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):
2018-01-29 Youenn Fablet <youenn@apple.com>
Cache API should make sure to resolve caches.open promises in the same order as called
https://bugs.webkit.org/show_bug.cgi?id=182193
<rdar://problem/36930363>
Reviewed by Chris Dumez.
Covered by LayoutTests/http/wpt/cache-storage/cache-open-delete-in-parallel.https.html.
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::doRemove): Removed optimization consisting in removing the cache from DOMCacheStorage object synchronously.
This optimization prevents going to the network process to try deleting the cache.
2018-01-29 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Add a compile-time feature flag
https://bugs.webkit.org/show_bug.cgi?id=182211
<rdar://problem/36936365>
Reviewed by Brent Fulgham.
Add a compile-time feature flag for WebAuthN as most of the functionality is platform
dependent.
No tests.
* Configurations/FeatureDefines.xcconfig:
* Modules/credentialmanagement/BasicCredential.cpp:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/Authenticator.cpp:
* Modules/webauthn/Authenticator.h:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
* Modules/webauthn/AuthenticatorAssertionResponse.h:
* Modules/webauthn/AuthenticatorAssertionResponse.idl:
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
* Modules/webauthn/AuthenticatorAttestationResponse.h:
* Modules/webauthn/AuthenticatorAttestationResponse.idl:
* Modules/webauthn/AuthenticatorResponse.cpp:
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/PublicKeyCredentialType.h:
* Modules/webauthn/PublicKeyCredentialType.idl:
* bindings/js/JSAuthenticatorResponseCustom.cpp:
* bindings/js/JSBasicCredentialCustom.cpp:
2018-01-29 John Wilander <wilander@apple.com>
Resource Load Statistics: Introduce debug mode as experimental feature
https://bugs.webkit.org/show_bug.cgi?id=182199
<rdar://problem/36930364>
Reviewed by Alex Christensen.
No new tests. This adds an experimental feature.
The only changes to default behavior are:
- Increased resolution on timestamps which is needed to be able to set shorter
timeouts in debug mode.
- Only update partitioning and blocking table when needed. This is an optimization
which pays off in less XPC with shorter timeouts.
* loader/ResourceLoadObserver.cpp:
(WebCore::reduceTimeResolution):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::reduceToHourlyTimeResolution): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode):
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const):
* page/Settings.yaml:
2018-01-29 Oleksandr Skachkov <gskachkov@gmail.com>
FetchResponse should support ConsumeData callback on chunk data is received: handling ReadableStream bodies
https://bugs.webkit.org/show_bug.cgi?id=182008
Reviewed by Youenn Fablet.
Modify FetchResponse to support ConsumeData callback with
handling of ReadableStream by chunks
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::consumeBodyFromReadableStream):
* Modules/fetch/FetchResponse.h:
* Modules/streams/ReadableStreamChunk.h: Added.
* Modules/streams/ReadableStreamSink.cpp:
(WebCore::ReadableStreamToSharedBufferSink::enqueue):
(WebCore::ReadableStreamToSharedBufferSink::close):
* Modules/streams/ReadableStreamSink.h:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):
2018-01-29 Andy Estes <aestes@apple.com>
[iOS] Restrict synthetic clicks to the origin that handled the underlying touch event
https://bugs.webkit.org/show_bug.cgi?id=182252
<rdar://problem/21555881>
Reviewed by Tim Horton.
Test: http/tests/events/touch/ios/cross-frame-single-tap-same-origin.https.html
* dom/Document.h:
(WebCore::Document::handlingTouchEvent const):
* page/EventHandler.h:
(WebCore::EventHandler::touchEventTargetSubframe const):
(WebCore::EventHandler::touches const):
Exposed some information needed by WebPage::updatePotentialTapSecurityOrigin().
* page/Frame.h:
* page/ios/FrameIOS.mm:
(WebCore::Frame::betterApproximateNode):
(WebCore::Frame::qualifyingNodeAtViewportLocation):
Changed NodeQualifier from a function pointer to a WTF::Function.
(WebCore::Frame::nodeRespondingToClickEvents):
Turned ancestorRespondingToClickEvents() into a lambda that captures originRestriction. In
the lambda, if there is an origin restriction, return nullptr if the hit test result's inner
Node is not in the restricted origin.
(WebCore::Frame::nodeRespondingToScrollWheelEvents):
Turned ancestorRespondingToScrollWheelEvents() into a lambda.
(WebCore::ancestorRespondingToScrollWheelEvents):
Moved to lambda in nodeRespondingToScrollWheelEvents().
(WebCore::ancestorRespondingToClickEvents):
Moved to lambda in nodeRespondingToClickEvents().
2018-01-29 Emilio Cobos Álvarez <emilio@crisal.io>
Trivially cleanup std::optional usage in RenderBlockFlow.
https://bugs.webkit.org/show_bug.cgi?id=182142
Reviewed by Antti Koivisto.
No new tests, no behavior change.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::firstLineBaseline const):
(WebCore::RenderBlockFlow::inlineBlockBaseline const):
2018-01-29 Brent Fulgham <bfulgham@apple.com>
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>
Reviewed by Chris Dumez.
Part 1: Add telemetry for the user interaction case
This patch adds telemetry to track how frequently third-party cookies are
used in a first party context due to user interaction. This will help
understand cases where the new Storage Access API can help, and to help
us understand if we have considered relevant use cases in its design.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Let the observer
know the first party interaction duration.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Added.
(WebCore::ResourceLoadObserver::logFrameNavigation): Note when a third party
resource is accessed as a first party due to user interaction.
(WebCore::ResourceLoadObserver::logSubresourceLoading): Ditto.
* loader/ResourceLoadObserver.h:
* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::encode const): Handle new fields.
(WebCore::ResourceLoadStatistics::decode): Ditto.
* loader/ResourceLoadStatistics.h:
2018-01-29 Antti Koivisto <antti@apple.com>
CalcExpressionBlendLength::evaluate hits stack limit
https://bugs.webkit.org/show_bug.cgi?id=182243
Reviewed by Zalan Bujtas.
Speculative fix to prevent nesting of CalcExpressionBlendLength.
No test, don't know how to make one.
* platform/CalculationValue.cpp:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
CalcExpressionBlendLength is only used in Length values of animated style. Normally such styles are not used
as input for further blending but there are some paths where this could in principle happen. Repeated
application (for each animation frame) could construct CalcExpressionBlendLength expression that blows
the stack when evaluated.
Speculatively fix by flattening any nesting.
* platform/CalculationValue.h:
(WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength): Deleted.
2018-01-29 Chris Dumez <cdumez@apple.com>
Drop unnecessary "ServiceWorker Task Thread" in SWServer
https://bugs.webkit.org/show_bug.cgi?id=182253
Reviewed by Youenn Fablet.
Drop unnecessary "ServiceWorker Task Thread" in SWServer. We're spinning a thread for
each SWServer that is never used.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::~SWServer):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::taskThreadEntryPoint): Deleted.
(WebCore::SWServer::postTask): Deleted.
(WebCore::SWServer::postTaskReply): Deleted.
(WebCore::SWServer::handleTaskRepliesOnMainThread): Deleted.
* workers/service/server/SWServer.h:
2018-01-29 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r227731.
This caused and assertion failure in API tests.
Reverted changeset:
"Layout Test fast/events/beforeunload-dom-manipulation-
crash.html is crashing"
https://bugs.webkit.org/show_bug.cgi?id=181204
https://trac.webkit.org/changeset/227731
2018-01-29 Brady Eidson <beidson@apple.com>
Make it possible for apps that use both WK1 and WK2 to use MessagePorts.
https://bugs.webkit.org/show_bug.cgi?id=182229
Reviewed by Chris Dumez.
Covered by existing LayoutTests and a new API test.
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::checkRemotePortForActivity): Don't use the global singleton
provider. Instead use the provider that belongs to the owning registry.
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::MessagePortChannelProviderImpl): Pass a reference
to *this to the Registry.
* dom/messageports/MessagePortChannelProviderImpl.h:
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::MessagePortChannelRegistry): Keep a Provider member so
MessagePortChannels can get to it instead of relying on the global singleton provider.
* dom/messageports/MessagePortChannelRegistry.h:
(WebCore::MessagePortChannelRegistry::provider):
2018-01-29 Per Arne Vollan <pvollan@apple.com>
Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181204
<rdar://problem/36256274>
Reviewed by Ryosuke Niwa.
When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
the frame will be detached when removed from its previous position in the DOM tree. When being
detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
However, this method will return early when executed in a beforeunload handler, since navigation
is not allowed then. The end result is a detached frame which will continue to load, and hitting
asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
possible to stop a frame load, even when executing a beforeunload handler.
No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isStopLoadingAllowed const):
(WebCore::FrameLoader::stopAllLoaders):
* loader/FrameLoader.h:
2018-01-29 Miguel Gomez <magomez@igalia.com>
[CoordnatedGraphics] A child layer of a semitransparent layer isn't clipped properly
https://bugs.webkit.org/show_bug.cgi?id=181080
Reviewed by Žan Doberšek.
Check whether the applied clipping area is empty before drawing the children of a TextureMapperLayer. If
the area is empty no children will be drawn, so we can avoid drawing them.
No new tests -- no change in behavior.
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintSelfAndChildren):
2018-01-29 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Add GraphicsContextImplCairo::createFactory() helpers
https://bugs.webkit.org/show_bug.cgi?id=182238
Reviewed by Carlos Garcia Campos.
Instead of duplicating lambdas that return a newly-created
GraphicsContextImplCairo object, provide static createFactory() helpers
on that class that produce GraphicsContextImplFactory wrappers which are
then invoked in the GraphicsContext constructor. The static functions
accept either the PlatformContextCairo reference or the cairo_t pointer,
invoking the proper GraphicsContextImplCairo constructor in the returned
lambda wrapper.
No new tests -- no change in functionality.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::createFactory):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::strokeBoundingRect const):
(WebCore::Path::strokeContains const):
* platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::PaintingContextCairo):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
2018-01-29 Zan Dobersek <zdobersek@igalia.com>
Construct GraphicsContext with NonPaintingReasons::NoReason in FrameView::adjustPageHeightDeprecated()
https://bugs.webkit.org/show_bug.cgi?id=182235
Reviewed by Carlos Garcia Campos.
Pass the NonPaintingReasons::NoReason value to the GraphicsContext
constructor in FrameView::adjustPageHeightDeprecated(). This has the
same effect as when passing a null PlatformGraphicsContext to the
constructor, which effectively disables any painting through that
GraphicsContext, but doesn't have a platform-specific connotation.
No new tests -- no change in functionality.
* page/FrameView.cpp:
(WebCore::FrameView::adjustPageHeightDeprecated):
2018-01-29 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Remove the GraphicsContext(cairo_t*) constructor
https://bugs.webkit.org/show_bug.cgi?id=182234
Reviewed by Carlos Garcia Campos.
Instead of using the GraphicsContext(cairo_t*) constructor, leverage the
GraphicsContextImplCairo class and work with an existing Cairo context
through that GraphicsContextImpl implementation.
A new GraphicsContextImplCairo constructor is added, expecting pointer
to the cairo_t object. With that, a PlatformContextCairo object is
created, with ownership of that object now being handled by the
GraphicsContextImplCairo class.
Call sites of the GraphicsContext(cairo_t*) constructor are adjusted to
instead provide a factory function that returns a fresh
GraphicsContextImplCairo object, passing that cairo_t object to its
constructor.
No new tests -- no change in behavior.
* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::GraphicsContext): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::GraphicsContextImplCairo::GraphicsContextImplCairo):
(WebCore::m_private):
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::strokeBoundingRect const):
(WebCore::Path::strokeContains const):
* platform/graphics/win/ImageCairoWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
2018-01-28 Minsheng Liu <lambda@liu.ms>
Overflow of formulas is hidden for display mathematics
https://bugs.webkit.org/show_bug.cgi?id=160547
Reviewed by Frédéric Wang.
Previously, <math> with display="block" uses its container's logical width as logical width.
However, that behavior will truncate overflowed contents. The patch fixes it by setting
the logical width as its content width rather than its container's logical width
if the former is wider than the latter.
Test: mathml/presentation/display-math-horizontal-overflow.html
* rendering/mathml/RenderMathMLRow.cpp:
(WebCore::RenderMathMLRow::layoutBlock):
2018-01-26 Antoine Quint <graouts@apple.com>
[Web Animations] Distinguish between an omitted and a null timeline argument to the Animation constructor
https://bugs.webkit.org/show_bug.cgi?id=179065
<rdar://problem/36869046>
Reviewed by Dean Jackson.
The Web Animations specification requires that a missing or undefined "timeline" parameter means that the
document's timeline should be used, but a null value should be supported. To support this, we need to provide
a custom Animation constructor where we can check on the ExecState whether the second argument passed is
undefined, which is true if an explicit "undefined" value is passed or if the argument does not exist.
* Sources.txt: Add the new JSWebAnimationCustom.cpp file.
* WebCore.xcodeproj/project.pbxproj: Add the new JSWebAnimationCustom.cpp file.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::create): Add a create() variant that doesn't provide an AnimationTimeline parameter
to clearly indicate that the provided Document's timeline should be used.
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* bindings/js/JSWebAnimationCustom.cpp: Added.
(WebCore::constructJSWebAnimation): Provide a custom Animation constructor where we check whether the second
argument, the timeline, is undefined.
* dom/Element.cpp:
(WebCore::Element::animate): Use the new create() variant since passing "nullptr" now means a null timeline.
2018-01-26 Ricky Mondello <rmondello@apple.com>
Use the standard -webkit-autofill color on iOS
https://bugs.webkit.org/show_bug.cgi?id=182182
Reviewed by Tim Horton.
* css/html.css:
(input:-webkit-autofill, input:-webkit-autofill-strong-password):
2018-01-26 Dean Jackson <dino@apple.com>
REGRESSION (r222961): Clear function not clearing whole screen when antialias is set to false
https://bugs.webkit.org/show_bug.cgi?id=179368
<rdar://problem/36111549>
Reviewed by Sam Weinig.
When we changed from using a CAOpenGLLayer to a regular CALayer, we should
have also swapped the "opaque" property to "contentsOpaque".
Covered by the existing test: fast/canvas/webgl/context-attributes-alpha.html
(when run on some hardware!)
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]):
2018-01-26 Mark Lam <mark.lam@apple.com>
Add infrastructure for pointer preparation.
https://bugs.webkit.org/show_bug.cgi?id=182191
<rdar://problem/36889194>
Reviewed by JF Bastien.
No new tests because this patch does not introduce any behavior change.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestDOMJIT.cpp:
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
* bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
* bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
2018-01-26 Simon Fraser <simon.fraser@apple.com>
REGRESSiON (r226492): Crash under Element::absoluteEventBounds() on a SVGPathElement which has not been laid out yet
https://bugs.webkit.org/show_bug.cgi?id=182185
rdar://problem/36836262
Reviewed by Zalan Bujtas.
Document::absoluteRegionForEventTargets() can fire when layout is dirty, and SVGPathElement's path() can be null if it
hasn't been laid out yet. So protect against a null path in getBBox().
Not easily testable because internals.nonFastScrollableRects() forces layout, and the crash depends on the timing of
absoluteRegionForEventTargets().
* svg/SVGPathElement.cpp:
(WebCore::SVGPathElement::getBBox):
2018-01-26 Chris Dumez <cdumez@apple.com>
Offlined content does not work for apps on home screen
https://bugs.webkit.org/show_bug.cgi?id=182070
<rdar://problem/36843906>
Reviewed by Youenn Fablet.
Already registered service workers were unable to intercept the very first
load because registration matching was happening after the registration
was loaded from disk, but *before* its active worker was populated.
We now initialize the registrations' active worker as soon as we load
them from disk. We do not necessarily have a SW Context process connection
identifier yet at this point so I made it optional on the SWServerWorker.
This identifier gets set on the SWServerWorker when the worker is actually
launched and gets cleared when the SWServerWorker gets terminated.
Covered by new API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::workerContextTerminated):
(WebCore::SWServer::fireInstallEvent):
(WebCore::SWServer::fireActivateEvent):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::contextConnectionIdentifier const):
(WebCore::SWServerWorker::setContextConnectionIdentifier):
2018-01-26 Chris Nardi <cnardi@chromium.org>
Addressing post-review comments after r226614
https://bugs.webkit.org/show_bug.cgi?id=182151
Reviewed by Myles C. Maxfield.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::sanitizeUserInputValue):
* html/TextFieldInputType.cpp:
(WebCore::limitLength):
* platform/LocalizedStrings.cpp:
(WebCore::truncatedStringForLookupMenuItem):
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2018-01-26 Antoine Quint <graouts@apple.com>
[iOS] prefers-reduced-motion media query is not working
https://bugs.webkit.org/show_bug.cgi?id=182169
<rdar://problem/36801631>
Reviewed by Dean Jackson.
The code that would eventually query UIKit for the system setting was not run since USE(NEW_THEME) is off on iOS.
Adding a PLATFORM(IOS) flag here allows the code to run.
* css/MediaQueryEvaluator.cpp:
(WebCore::prefersReducedMotionEvaluate):
2018-01-26 Youenn Fablet <youenn@apple.com>
CSP post checks should be done for service worker responses
https://bugs.webkit.org/show_bug.cgi?id=182160
Reviewed by Daniel Bates.
Covered by updated test.
Add security checks when receiving a service worker response.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse):
* loader/cache/CachedResourceLoader.h:
2018-01-26 Manuel Rego Casasnovas <rego@igalia.com>
[css-multicol] Support percentages in column-gap
https://bugs.webkit.org/show_bug.cgi?id=182004
Reviewed by Javier Fernandez.
This patch adds percentage support to column-gap property.
Most of the changes are related to the parsing logic,
the column-gap property now accepts both length and percentages,
on top of the "normal" initial value.
A new utility class GapLength has been added, as it'll be useful
to implement row-gap in the future.
Apart from that the muticolumn layout code has been modified
to resolve the percentage gaps (treating them as zero while computing
preferred widths) and resolving them during layout.
This doesn't follow the current text on the spec, but there is an
ongoing discussion that might cause the text is changed:
https://github.com/w3c/csswg-drafts/issues/509#issuecomment-355242101
We could update the implementation once we have a definitive answer
from the CSS WG.
Test: web-platform-tests/css/css-multicol/multicol-gap-percentage-001.html
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertGapLength):
* css/StyleBuilderCustom.h:
(WebCore::forwardInheritedValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeGapLength):
(WebCore::CSSPropertyParser::parseSingleValue):
* page/FrameView.cpp:
(WebCore::FrameView::applyPaginationToViewport):
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFunc):
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::columnGap const):
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::columnGap const):
* rendering/style/GapLength.cpp: Added.
(WebCore::operator<<):
* rendering/style/GapLength.h: Added.
(WebCore::GapLength::GapLength):
(WebCore::GapLength::isNormal const):
(WebCore::GapLength::length const):
(WebCore::GapLength::operator== const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::columnGap const):
(WebCore::RenderStyle::setColumnGap):
(WebCore::RenderStyle::initialColumnGap):
* rendering/style/StyleMultiColData.cpp:
(WebCore::StyleMultiColData::StyleMultiColData):
(WebCore::StyleMultiColData::operator== const):
* rendering/style/StyleMultiColData.h:
* style/StyleResolveForDocument.cpp:
(WebCore::Style::resolveForDocument):
2018-01-26 Emilio Cobos Álvarez <emilio@crisal.io>
Remove unused RenderFragmentedFlow::createFragmentedFlowStyle.
https://bugs.webkit.org/show_bug.cgi?id=182138
Reviewed by Manuel Rego Casasnovas.
Has no callers.
No new tests, just removes unused code so no behavior change.
* rendering/RenderFragmentedFlow.cpp:
* rendering/RenderFragmentedFlow.h:
2018-01-26 Emilio Cobos Álvarez <emilio@crisal.io>
Remove useless RenderBlockFlow overrides.
https://bugs.webkit.org/show_bug.cgi?id=182139
Reviewed by Manuel Rego Casasnovas.
I think these are leftovers from the CSS regions removal, looking at
blame.
No new tests, no behavior change.
* rendering/RenderBlockFlow.cpp:
* rendering/RenderBlockFlow.h:
2018-01-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Add InspectorShaderProgram to Unified Sources build
https://bugs.webkit.org/show_bug.cgi?id=182084
Reviewed by Dan Bernstein.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* Sources.txt:
Move to Sources.txt always.
* inspector/InspectorShaderProgram.cpp:
Add ENABLE(WEBGL) guard to contents.
2018-01-25 Ryosuke Niwa <rniwa@webkit.org>
Make scrolling to the focused element async
https://bugs.webkit.org/show_bug.cgi?id=181575
<rdar://problem/36459767>
Reviewed by Simon Fraser.
Made the revealing of the focused element asynchronous in Element::focus. Like selection, schedule a timer when
a new element is focused, and only scroll to the focused element when the timer fires. If any other scrolling
happens meanwhile, we cancel this timer.
There are two Web exposed behavioral changes:
1. The scrolling position doesn't change immediately when calling Element::focus.
2. Only the last focused element will be revealed.
Both behavioral changes pose its own compatibility risks but we're making a conscious decision here since
the scrolling asynchronous has a clear performance benefit.
There is one edge case to cosnider: when the history controller restores the scrolling position, canceling the
timer results in a focused element in an overflow: hidden element to be never revealed. Expediate revealing of
the focused element in this one case instead of canceling.
Tests: fast/scrolling/scroll-to-focused-element-asynchronously.html
fast/scrolling/scroll-to-focused-element-canceled-by-fragment-navigation.html
* dom/Element.cpp:
(WebCore::Element::focus): Call updateFocusAppearance on focusAppearanceUpdateTarget to handle HTMLAreaElement
which delegates the focus appearance update to its image element.
(WebCore::Element::focusAppearanceUpdateTarget): Extracted. Returns "this" element for all but HTMLAreaElement.
(WebCore::Element::updateFocusAppearance): Schedule the revealing of the focused element in FrameView instead of
synchronously scrolling to the focused element.
* dom/Element.h:
(WebCore::Element::defaultFocusTextStateChangeIntent):
* html/HTMLAreaElement.cpp:
(WebCore::HTMLAreaElement::focusAppearanceUpdateTarget): Extracted from updateFocusAppearance.
(WebCore::HTMLAreaElement::updateFocusAppearance): Deleted.
* html/HTMLAreaElement.h:
* loader/HistoryController.cpp:
(WebCore::HistoryController::restoreScrollPositionAndViewState): Reveal the focused element
prior to restoring the scrolling location of the fragment navigation. This is needed to reveal a focused element
inside overflow: hidden element which got focused.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView): Added a boolean flag and a timer for scrolling to the focused element.
(WebCore::FrameView::reset): Stop the timer and clear the flag.
(WebCore::FrameView::maintainScrollPositionAtAnchor): Ditto when scrolling to an anchor.
(WebCore::FrameView::setScrollPosition): Ditto when some other programatic scroll or the user scrolls the view.
(WebCore::FrameView::scheduleScrollToFocusedElement): Added.
(WebCore::FrameView::scrollToFocusedElementImmediatelyIfNeeded): Added.
(WebCore::FrameView::scrollToFocusedElementTimerFired): Added.
(WebCore::FrameView::scrollToAnchor): Stop the timer and clear the flag when scrolling to an achor.
(WebCore::FrameView::setWasScrolledByUser): Ditto when the user scrolls.
* page/FrameView.h:
2018-01-25 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r217236): [iOS] PDFDocumentImage does not update its cached ImageBuffer if it has a sub-rectangle of the image
https://bugs.webkit.org/show_bug.cgi?id=182083
Reviewed by Simon Fraser.
Test: fast/images/pdf-as-image-dest-rect-change.html
Revert the change r217236 back. Fix the issue of throwing out the cached
ImageBuffer of the PDF document image when moving its rectangle.
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::cacheParametersMatch): Return the if-statement
which was deleted in r217236 back but intersect it with dstRect. The context
clipping rectangle can be more than the dstRect.
(WebCore::PDFDocumentImage::updateCachedImageIfNeeded):
-- Remove a wrong optimization which used to work for Mac only if the context
interpolation quality is not set to low or none quality. This optimization
does not consider the case when srcRect or destRect change after caching
the ImageBuffer. Or even if m_cachedImageRect does not include the
whole clipping rectangle.
-- Move back the call to cacheParametersMatch() before changing the
m_cachedImageRect.
-- Always intersect the clipping rectangle with the dstRect to ensure we
only look at the dirty rectangle inside the image boundary.
-- If cacheParametersMatch() returns true, set m_cachedDestinationRect to
dstRect and move m_cachedImageRect by the difference between the new
and the old dstRects since no re-caching will happen.
* platform/graphics/cg/PDFDocumentImage.h:
* testing/Internals.cpp:
(WebCore::pdfDocumentImageFromImageElement):
(WebCore::Internals::pdfDocumentCachingCount):
* testing/Internals.h:
* testing/Internals.idl:
Add an internal API which returns the number of drawing the PDF into an
ImageBuffer.
2018-01-25 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Remove unnecessary developerExtrasEnabled checks
https://bugs.webkit.org/show_bug.cgi?id=182156
Reviewed by Matt Baker.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::didLoadResourceFromMemoryCacheImpl):
(WebCore::InspectorInstrumentation::frameDocumentUpdatedImpl):
(WebCore::InspectorInstrumentation::didCreateWebSocketImpl):
These checks should not be needed. The step above bails if there is
no inspector frontend, and there can be no inspector frontend unless
developer extras enabled are enabled.
2018-01-25 Wenson Hsieh <wenson_hsieh@apple.com>
Add localizable strings for extra-zoomed form controls
https://bugs.webkit.org/show_bug.cgi?id=182080
Reviewed by Tim Horton.
Add new localizable strings. Additionally, run `update-webkit-localizable-strings` to re-sort
Localizable.strings.
* English.lproj/Localizable.strings:
* platform/LocalizedStrings.cpp:
(WebCore::formControlCancelButtonTitle):
(WebCore::formControlHideButtonTitle):
(WebCore::formControlGoButtonTitle):
(WebCore::formControlSearchButtonTitle):
(WebCore::textInputModeWriteButton):
(WebCore::textInputModeSpeechButton):
* platform/LocalizedStrings.h:
2018-01-25 Chris Dumez <cdumez@apple.com>
Access to service workers / Cache API should be disabled in sandboxed frames without allow-same-origin flag
https://bugs.webkit.org/show_bug.cgi?id=182140
<rdar://problem/36879952>
Reviewed by Youenn Fablet.
Throw a SecurityError when accessing navigator.serviceWorker or window.caches inside a sandboxed iframe
without the allow-same-origin flag. This behavior is consistent with Chrome. Firefox, however, seems
to return these objects but have their API reject promises with a SecurityError instead.
No new tests, rebaselined existing tests.
* Modules/cache/DOMWindowCaches.cpp:
(WebCore::DOMWindowCaches::caches): Deleted.
* Modules/cache/DOMWindowCaches.h:
* Modules/cache/DOMWindowCaches.idl:
* page/NavigatorBase.cpp:
* page/NavigatorBase.h:
* page/NavigatorServiceWorker.idl:
2018-01-25 Chris Dumez <cdumez@apple.com>
Clients.get(id) should only returns clients in the service worker's origin
https://bugs.webkit.org/show_bug.cgi?id=182149
<rdar://problem/36882310>
Reviewed by Youenn Fablet.
When looking for SW clients with a given identifier, only look in the list of
clients that have the same origin as the service worker.
No new tests, rebaselined existing test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::serviceWorkerClientWithOriginByID const):
(WebCore::SWServer::serviceWorkerClientByID const): Deleted.
* workers/service/server/SWServer.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::findClientByIdentifier const):
* workers/service/server/SWServerWorker.h:
2018-01-25 Youenn Fablet <youenn@apple.com>
WebPluginInfoProvider should handle null host queries
https://bugs.webkit.org/show_bug.cgi?id=182112
Reviewed by Chris Dumez.
No change of behavior.
Removed assertion that is not always true, as shown by API tests.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):
2018-01-25 Youenn Fablet <youenn@apple.com>
ShapeOutside should use same origin credentials mode
https://bugs.webkit.org/show_bug.cgi?id=182141
Reviewed by Chris Dumez.
Covered by updated test.
As per https://drafts.csswg.org/css-shapes/#shape-outside-property, ShapeOutside images
should be fetched with anonymous cors mode, meaning credentials should be set to same-origin.
* style/StylePendingResources.cpp:
(WebCore::Style::loadPendingImage):
2018-01-25 John Wilander <wilander@apple.com>
Make sure we have a frame as we iterate in ResourceLoadObserver::nonNullOwnerURL()
https://bugs.webkit.org/show_bug.cgi?id=182116
<rdar://problem/36210134>
Reviewed by Alex Christensen.
No new tests. No known repro case, just crash logs.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::nonNullOwnerURL const):
2018-01-25 Jer Noble <jer.noble@apple.com>
Move ImageDecoderAVFObjC from using AVSampleBufferGenerator to AVAssetReaderOutput for parsing
https://bugs.webkit.org/show_bug.cgi?id=182091
Reviewed by Eric Carlson.
No new tests; should be covered by existing tests.
AVSampleBufferGenerator is not available on iOS, so in order to enable ImageDecoderAVFObjC there,
we must adopt a similar API which is available both on iOS and macOS: AVAssetReaderOutput. Unlike
the generator, AVAssetReaderOutput doesn't necessarily generate samples in decode order, so we'll
repurpose the SampleMap from EME to hold the decoded samples as well as their generated images.
* Modules/mediasource/SampleMap.cpp:
* Modules/mediasource/SampleMap.h:
(WebCore::SampleMap::size const):
* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::isSupportedImageVideoOrSVGMIMEType):
* platform/MediaSample.h:
(WebCore::MediaSample::hasAlpha const):
* platform/graphics/ImageDecoder.cpp:
(WebCore::ImageDecoder::create):
(WebCore::ImageDecoder::supportsMediaType):
* platform/graphics/avfoundation/MediaSampleAVFObjC.h: Make non-final.
(WebCore::MediaSampleAVFObjC::sampleBuffer const):
(WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
(WebCore::ImageDecoderAVFObjCSample::create):
(WebCore::ImageDecoderAVFObjCSample::sampleBuffer const):
(WebCore::ImageDecoderAVFObjCSample::image const):
(WebCore::ImageDecoderAVFObjCSample::setImage):
(WebCore::ImageDecoderAVFObjCSample::ImageDecoderAVFObjCSample):
(WebCore::ImageDecoderAVFObjCSample::cacheMetadata):
(WebCore::toSample):
(WebCore::ImageDecoderAVFObjC::readSamples):
(WebCore::ImageDecoderAVFObjC::storeSampleBuffer):
(WebCore::ImageDecoderAVFObjC::advanceCursor):
(WebCore::ImageDecoderAVFObjC::setTrack):
(WebCore::ImageDecoderAVFObjC::encodedDataStatus const):
(WebCore::ImageDecoderAVFObjC::repetitionCount const):
(WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const):
(WebCore::ImageDecoderAVFObjC::frameDurationAtIndex const):
(WebCore::ImageDecoderAVFObjC::frameHasAlphaAtIndex const):
(WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex):
(WebCore::ImageDecoderAVFObjC::setData):
(WebCore::ImageDecoderAVFObjC::clearFrameBufferCache):
(WebCore::ImageDecoderAVFObjC::sampleAtIndex const):
(WebCore::ImageDecoderAVFObjC::readSampleMetadata): Deleted.
2018-01-25 Youenn Fablet <youenn@apple.com>
DocumentThreadableLoader should ensure service worker is not reused if redirection comes from the network
https://bugs.webkit.org/show_bug.cgi?id=182137
Reviewed by Chris Dumez.
Covered by rebased test.
In case redirection does not come from memory cache or service worker, disable service worker interception when following the redirection.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):
2018-01-25 Youenn Fablet <youenn@apple.com>
DocumentLoader should interrupt ongoing load when getting a redirection from network that matches a service worker
https://bugs.webkit.org/show_bug.cgi?id=182115
Reviewed by Alex Christensen.
Covered by rebased test.
In case a navigation load is going to the network process,
we need to interrupt it if having a redirection that leads to a new request going to a service worker.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
2018-01-25 Chris Dumez <cdumez@apple.com>
Registering same scope as the script directory without the last slash should fail
https://bugs.webkit.org/show_bug.cgi?id=182122
<rdar://problem/36877167>
Reviewed by Youenn Fablet.
This aligns our behavior with Firefox and Chrome.
No new tests, rebaselined existing test.
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::didReceiveResponse):
2018-01-25 Antoine Quint <graouts@apple.com>
[Web Animations] Expose the reverse() method
https://bugs.webkit.org/show_bug.cgi?id=182100
<rdar://problem/36867117>
Reviewed by Dean Jackson.
We expose and implement the reverse() method on Animation as specified.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::setPlaybackRate):
(WebCore::WebAnimation::reverse):
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
2018-01-25 Antoine Quint <graouts@apple.com>
[Web Animations] Account for provided easings when computing progress and resolving keyframe effect values
https://bugs.webkit.org/show_bug.cgi?id=182098
<rdar://problem/36866149>
Reviewed by Dean Jackson.
We now account for the timing functions provided through the "easing" propreties on whole animation effects
and individual keyframes. Exposing those exposed shortcomings of our keyframe resolution in general through
WPT tests so we now implement the "effect value of a keyframe effect" procedure from the spec to correctly
resolve keyframes in KeyframeEffect::setAnimatedPropertiesInStyle(). The tests also showed some shortcomings
in our TimingFunction code where our step() function resolution wasn't fully compliant and our cubic-bezier()
resolution not accurate enough. We now have microsecond accuracy when resolving cubic-bezier() timing functions
and identify cubic-bezier(0, 0, 0, 0), cubic-bezier(0, 0, 1, 1) and cubic-bezier(1, 1, 1, 1) as linear timing
functions, as called out by the WPT tests.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::transformedProgress const): Account for the effect-wide timing function when computing
the progress.
(WebCore::AnimationEffect::iterationProgress const): Use the transformed progress now that we support this procedure.
* animation/AnimationEffect.h:
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::apply): We now use the computed progress from AnimationEffect rather than compute based
on the provided time, which we've dropped as an argument.
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): Implement the "effect value of a keyframe effect" procedure
in full as specified (save for composite operations).
(WebCore::KeyframeEffect::applyAtLocalTime): Deleted.
* animation/KeyframeEffect.h:
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::resolve):
* css/CSSTimingFunctionValue.h: Fix a small error made in a previous patch where we used "int" instead of "unsigned".
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
2018-01-25 Antoine Quint <graouts@apple.com>
[Web Animations] Avoid querying the current time multiple time when resolving the play state
https://bugs.webkit.org/show_bug.cgi?id=182099
Reviewed by Dean Jackson.
No test change since this shouldn't cause any change in behavior.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::playState const):
2018-01-25 Youenn Fablet <youenn@apple.com>
Set integrity fetch options for loading scripts and CSS
https://bugs.webkit.org/show_bug.cgi?id=182077
Reviewed by Chris Dumez.
Covered by updated test.
Set integrity fetch option in script and CSS loading.
* bindings/js/CachedModuleScriptLoader.cpp:
(WebCore::CachedModuleScriptLoader::load):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestModuleScript const):
(WebCore::CachedScriptFetcher::requestScriptWithCache const):
* bindings/js/CachedScriptFetcher.h:
* dom/LoadableClassicScript.cpp:
(WebCore::LoadableClassicScript::load):
* dom/ScriptElementCachedScriptFetcher.cpp:
(WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
* dom/ScriptElementCachedScriptFetcher.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
2018-01-25 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use GraphicsContextImplCairo in Nicosia::PaintingContextCairo
https://bugs.webkit.org/show_bug.cgi?id=182094
Reviewed by Carlos Garcia Campos.
Have Nicosia::PaintingContextCairo create a GraphicsContext object that
utilizes a factory function which returns a freshly-allocated
GraphicsContextImplCairo through which all the painting is then done.
This moves GraphicsLayer painting over to using the GraphicsContextImpl
infrastructure.
No new tests -- no changes in behavior.
* platform/graphics/nicosia/NicosiaPaintingContextCairo.cpp:
(Nicosia::PaintingContextCairo::PaintingContextCairo):
2018-01-24 Frederic Wang <fwang@igalia.com>
ScrollingStateNode::reconcileLayerPositionForViewportRect is only called on direct children of the root
https://bugs.webkit.org/show_bug.cgi?id=179946
Reviewed by Simon Fraser.
ScrollingStateNode::reconcileLayerPositionForViewportRect is currently only called on the
direct children of root of the scrolling tree. Hence nodes like "position: fixed" will not
update their layers after scrolling when they are deeper in the tree. This is already
possible on iOS with overflow nodes and will happen with subframes when async scrolling is
implemented. This commit fixes that issue by recursively calling the function
ScrollingStateNode::reconcileLayerPositionForViewportRect on the scrolling tree.
Test: fast/scrolling/ios/reconcile-layer-position-recursive.html
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Just call
reconcileLayerPositionForViewportRect on the root node.
* page/scrolling/ScrollingStateNode.cpp:
(WebCore::ScrollingStateNode::reconcileLayerPositionForViewportRect): By default, this
function now recursively calls reconcileLayerPositionForViewportRect on the children.
* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingStateFixedNode.cpp:
(WebCore::ScrollingStateFixedNode::reconcileLayerPositionForViewportRect): Call the function
on children.
* page/scrolling/ScrollingStateStickyNode.cpp:
(WebCore::ScrollingStateStickyNode::reconcileLayerPositionForViewportRect): Ditto.
2018-01-24 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use GraphicsContextImplCairo for ImageBuffer context
https://bugs.webkit.org/show_bug.cgi?id=181977
Reviewed by Carlos Garcia Campos.
Enhance the GraphicsContextImpl interface to the point of enabling the
Cairo-based implementation to be used for GraphicsContext construction
in ImageBufferCairo.cpp.
In order to enable GraphicsContextImpl implementations to properly
manage PlatformGraphicsContext objects, the hasPlatformContext() and
platformContext() methods are added. Cairo implementation returns true
in the first method, and returns pointer to the PlatformContextCairo
object in the second. The DisplayList::Recorder, due to its recording
nature, doesn't manage such an object, so it returns false and nullptr,
respectively.
GraphicsContextImpl also gains the setCTM(), getCTM(), clipBounds() and
roundToDevicePixels() methods, corresponding to the GraphicsContext
methods that now invoke these new methods on any existing m_impl object.
GraphicsContextImplCairo implementations mimic the existing behavior in
the Cairo-specific GraphicsContext methods, but DisplayList::Recorder
implementations remain no-op, logging the invocation but doing nothing
otherwise.
drawImage() and drawTiledImage() methods on the GraphicsContextImpl
interface are changed to return the ImageDrawResult value, corresponding
to what's been done in the method. In DisplayList::Recorder, the methods
return ImageDrawResult::DidRecord, while in GraphicsContextImplCairo the
methods return the return result of Image::draw() or Image::drawTiled()
call.
To make the protected Image::draw() and Image::drawTiled() methods
accessible, invocations of those are packed into static drawImageImpl()
and drawTiledImageImpl() functions on the GraphicsContextImpl class.
This makes it possible to simply declare GraphicsContextImpl class as a
friend class of Image, and not every specific GraphicsContextImpl
derivation. Implementations of these functions mirror behavior of the
drawImage() and drawTiledImage() methods on the GraphicsContext class,
when an m_impl object isn't present, constructing a scope-tied
InterpolationQualityMaintainer object and invoking the relevant Image
method.
To make immediate use of the new GraphicsContextImplCairo functionality,
the GraphicsContext construction in Cairo-specific ImageBuffer
implementation now uses a factory function that returns a new
GraphicsContextImplCairo object through which the given
PlatformContextCairo is used for painting.
No new tests -- no change in functionality.
* platform/graphics/GraphicsContext.cpp:
(WebCore::GraphicsContext::hasPlatformContext const):
(WebCore::GraphicsContext::drawImage):
(WebCore::GraphicsContext::drawTiledImage):
* platform/graphics/GraphicsContext.h:
(WebCore::GraphicsContext::hasPlatformContext const): Deleted.
* platform/graphics/GraphicsContextImpl.cpp:
(WebCore::GraphicsContextImpl::drawImageImpl):
(WebCore::GraphicsContextImpl::drawTiledImageImpl):
* platform/graphics/GraphicsContextImpl.h:
* platform/graphics/Image.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::platformContext const):
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::roundToDevicePixels):
(WebCore::GraphicsContext::setCTM):
* platform/graphics/cairo/GraphicsContextImplCairo.cpp:
(WebCore::m_private):
(WebCore::GraphicsContextImplCairo::~GraphicsContextImplCairo):
(WebCore::GraphicsContextImplCairo::hasPlatformContext const):
(WebCore::GraphicsContextImplCairo::platformContext const):
(WebCore::GraphicsContextImplCairo::updateState):
(WebCore::GraphicsContextImplCairo::setLineCap):
(WebCore::GraphicsContextImplCairo::setLineDash):
(WebCore::GraphicsContextImplCairo::setLineJoin):
(WebCore::GraphicsContextImplCairo::setMiterLimit):
(WebCore::GraphicsContextImplCairo::fillRect):
(WebCore::GraphicsContextImplCairo::fillRoundedRect):
(WebCore::GraphicsContextImplCairo::fillRectWithRoundedHole):
(WebCore::GraphicsContextImplCairo::fillPath):
(WebCore::GraphicsContextImplCairo::fillEllipse):
(WebCore::GraphicsContextImplCairo::strokeRect):
(WebCore::GraphicsContextImplCairo::strokePath):
(WebCore::GraphicsContextImplCairo::strokeEllipse):
(WebCore::GraphicsContextImplCairo::clearRect):
(WebCore::GraphicsContextImplCairo::drawGlyphs):
(WebCore::GraphicsContextImplCairo::drawImage):
(WebCore::GraphicsContextImplCairo::drawTiledImage):
(WebCore::GraphicsContextImplCairo::drawNativeImage):
(WebCore::GraphicsContextImplCairo::drawPattern):
(WebCore::GraphicsContextImplCairo::drawRect):
(WebCore::GraphicsContextImplCairo::drawLine):
(WebCore::GraphicsContextImplCairo::drawLinesForText):
(WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
(WebCore::GraphicsContextImplCairo::drawEllipse):
(WebCore::GraphicsContextImplCairo::drawFocusRing):
(WebCore::GraphicsContextImplCairo::save):
(WebCore::GraphicsContextImplCairo::restore):
(WebCore::GraphicsContextImplCairo::translate):
(WebCore::GraphicsContextImplCairo::rotate):
(WebCore::GraphicsContextImplCairo::scale):
(WebCore::GraphicsContextImplCairo::concatCTM):
(WebCore::GraphicsContextImplCairo::setCTM):
(WebCore::GraphicsContextImplCairo::getCTM):
(WebCore::GraphicsContextImplCairo::beginTransparencyLayer):
(WebCore::GraphicsContextImplCairo::endTransparencyLayer):
(WebCore::GraphicsContextImplCairo::clip):
(WebCore::GraphicsContextImplCairo::clipOut):
(WebCore::GraphicsContextImplCairo::clipPath):
(WebCore::GraphicsContextImplCairo::clipBounds):
(WebCore::GraphicsContextImplCairo::roundToDevicePixels):
(WebCore::m_platformContext): Deleted.
* platform/graphics/cairo/GraphicsContextImplCairo.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::ImageBuffer):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::clipBounds const):
(WebCore::GraphicsContext::setCTM):
(WebCore::GraphicsContext::getCTM const):
(WebCore::GraphicsContext::roundToDevicePixels):
* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawImage):
(WebCore::DisplayList::Recorder::drawTiledImage):
(WebCore::DisplayList::Recorder::drawNativeImage):
(WebCore::DisplayList::Recorder::setCTM):
(WebCore::DisplayList::Recorder::getCTM):
(WebCore::DisplayList::Recorder::clipBounds):
(WebCore::DisplayList::Recorder::roundToDevicePixels):
* platform/graphics/displaylists/DisplayListRecorder.h:
2018-01-24 Christopher Reid <chris.reid@sony.com>
Linker error in ShareableBitmapCairo.cpp undefined reference to WebCore::Cairo::ShadowState::ShadowState
https://bugs.webkit.org/show_bug.cgi?id=182060
Reviewed by Žan Doberšek.
No new tests, no change in behavior.
Added exports to WebCore::Cairo::ShadowState::ShadowState.
* platform/graphics/cairo/CairoOperations.h:
2018-01-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Implement didSendData client callback.
https://bugs.webkit.org/show_bug.cgi?id=182063
Reviewed by Alex Christensen.
No new tests (covered by existing tests).
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::willSendData):
* platform/network/curl/CurlRequestClient.h:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidSendData):
* platform/network/curl/ResourceHandleCurlDelegate.h:
2018-01-24 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement PublicKeyCredential’s [[DiscoverFromExternalSource]] with a dummy authenticator
https://bugs.webkit.org/show_bug.cgi?id=182032
<rdar://problem/36459922>
Reviewed by Brent Fulgham.
This patch implements PublicKeyCredential's [[DiscoverFromExternalSource]] from
https://www.w3.org/TR/webauthn/#getAssertion as of 5 December 2017. In order to
do testing, a dummy authenticator is implemented to exercise a failure and a
pass path. A number of dependencies need to be resolved later in order to comply
with the spec, which are marked by FIXME in the patch and tracked by proper
bugs. Those dependencies will be addressed once the first prototype is finshed.
Tests: http/tests/webauthn/public-key-credential-get-with-invalid-parameters.https.html
http/wpt/credential-management/credentialscontainer-store-basics.https.html
http/wpt/webauthn/public-key-credential-get-failure.https.html
http/wpt/webauthn/public-key-credential-get-success.https.html
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
Fixes some minor issues.
* Modules/webauthn/Authenticator.cpp:
(WebCore::Authenticator::getAssertion const):
* Modules/webauthn/Authenticator.h:
(WebCore::Authenticator::AssertionReturnBundle::AssertionReturnBundle):
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::collectFromCredentialStore):
Changed a parameter type.
(WebCore::PublicKeyCredential::discoverFromExternalSource):
(WebCore::PublicKeyCredential::create):
Improved some comments.
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
(): Deleted.
* bindings/js/JSAuthenticatorResponseCustom.cpp:
(WebCore::toJSNewlyCreated):
2018-01-24 Dean Jackson <dino@apple.com>
Move WebGL's colorspace code into IOSurface
https://bugs.webkit.org/show_bug.cgi?id=182076
<rdar://problem/36846863>
Reviewed by Simon Fraser, with assistance from Tim Horton.
Rather than have WebGLLayer talk directly to an IOSurfaceRef,
use a helper function on WebCore::IOSurface.
No behaviour change.
* platform/graphics/cocoa/IOSurface.h:
* platform/graphics/cocoa/IOSurface.mm:
(WebCore::IOSurface::migrateColorSpaceToProperties): Add new helper.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]): The
newly created IOSurfaces call the helper to set up their colorspace.
2018-01-24 Dean Jackson <dino@apple.com>
Add a note about not implementing these functions without discussion.
<rdar://problem/36666458>
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::clientWaitSync):
(WebCore::WebGL2RenderingContext::getSyncParameter):
2018-01-24 Youenn Fablet <youenn@apple.com>
Opaque being-loaded responses should clone their body
https://bugs.webkit.org/show_bug.cgi?id=182056
Reviewed by Brady Eidson.
Test: http/wpt/service-workers/clone-opaque-being-loaded-response.https.html
When cloning a being-loaded response, make sure we create a ReadableStream.
Before the patch, the readableStream was not created in that case for opaque responses.
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::readableStream):
(WebCore::FetchBodyOwner::createReadableStream):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::clone):
2018-01-24 Chris Dumez <cdumez@apple.com>
close() operation should not be exposed inside a ServiceWorkerGlobalScope
https://bugs.webkit.org/show_bug.cgi?id=182057
Reviewed by Youenn Fablet.
Move close() from WorkerGlobalScope to DedicatedWorkerGlobalScope as per:
- https://html.spec.whatwg.org/multipage/workers.html#dedicatedworkerglobalscope
This change to the specification was made to avoid exposing this deprecated
features to service workers (which are new).
No new tests, rebaselined existing test.
* workers/DedicatedWorkerGlobalScope.idl:
* workers/WorkerGlobalScope.idl:
2018-01-24 David Hyatt <hyatt@apple.com>
Implement line clamp for mail.
https://bugs.webkit.org/show_bug.cgi?id=180818
Reviewed by Dean Jackson.
This patch implements a form of clamping that can clamp lines at both the top
and the bottom, and the interior can be replaced with a DOM element (identified
by id) that replaces the middle section.
The implementation derives from the multicolumn classes, but ultimately the
clamp should derive from the fragmentset classes instead (with most of the current
multicolumn code moving into base classes).
The virtualization of many of the multicolumn functions is something that would happen
once we move pages/printing over to this pagination model anyway.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
Add the new clamp classes.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSProperties.json:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp):
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
* css/parser/CSSParserMode.h:
(WebCore::CSSParserContextHash::hash):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeLinesClamp):
(WebCore::CSSPropertyParser::parseSingleValue):
Implement the new CSS property, webkit-lines-clamp. This is only exposed if a preference
is set, so it is not exposed to the Web.
* page/Settings.yaml:
Add a new setting to control allowing access to the new CSS property.
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):
Make sure columns are created when lines clamp is set.
(WebCore::getHeightForLineCount):
(WebCore::RenderBlockFlow::logicalHeightForLineCount):
(WebCore::RenderBlockFlow::logicalHeightExcludingLineCount):
(WebCore::RenderBlockFlow::layoutExcludedChildren):
(WebCore::RenderBlockFlow::heightForLineCount): Deleted.
* rendering/RenderBlockFlow.h:
Re-use the same clamping logic as the old line clamp code, but modernize it to work
with writing modes and to be able to go backwards from the end of the block.
* rendering/RenderDeprecatedFlexibleBox.cpp:
(WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
The line count method got renamed to have the word "logical" in it, since it now
works with vertical writing.
* rendering/RenderFragmentContainer.cpp:
(WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const):
* rendering/RenderFragmentContainer.h:
Since line clamp sets have variable page heights, this new method takes the offset
as an argument so that it can return the appropriate page for the given offset.
This method will eventually be used by printing/page sets as well, since pages
can have variable heights.
* rendering/RenderFragmentedFlow.cpp:
(WebCore::RenderFragmentedFlow::validateFragments):
(WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
(WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
* rendering/RenderFragmentedFlow.h:
Support for variable page heights in a fragment set.
* rendering/RenderLinesClampFlow.cpp: Added.
(WebCore::RenderLinesClampFlow::RenderLinesClampFlow):
(WebCore::RenderLinesClampFlow::renderName const):
(WebCore::RenderLinesClampFlow::layout):
(WebCore::RenderLinesClampFlow::createMultiColumnSet):
(WebCore::RenderLinesClampFlow::isChildAllowedInFragmentedFlow const):
(WebCore::RenderLinesClampFlow::layoutFlowExcludedObjects):
* rendering/RenderLinesClampFlow.h: Added.
* rendering/RenderLinesClampSet.cpp: Added.
(WebCore::RenderLinesClampSet::RenderLinesClampSet):
(WebCore::RenderLinesClampSet::recalculateColumnHeight):
(WebCore::RenderLinesClampSet::computeLogicalHeight const):
(WebCore::RenderLinesClampSet::columnCount const):
(WebCore::RenderLinesClampSet::columnRectAt const):
(WebCore::RenderLinesClampSet::columnIndexAtOffset const):
(WebCore::RenderLinesClampSet::pageLogicalTopForOffset const):
(WebCore::RenderLinesClampSet::pageLogicalHeightForOffset const):
(WebCore::RenderLinesClampSet::fragmentedFlowPortionRectAt const):
(WebCore::RenderLinesClampSet::fragmentedFlowPortionOverflowRect):
(WebCore::RenderLinesClampSet::customBlockProgressionAdjustmentForColumn const):
(WebCore::RenderLinesClampSet::renderName const):
* rendering/RenderLinesClampSet.h: Added.
The new classes. They subclass all the methods necessary to do multi-pass layout,
and to determine the page heights of each section.
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const):
(WebCore::isValidColumnSpanner):
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
(WebCore::RenderMultiColumnFlow::createMultiColumnSet):
* rendering/RenderMultiColumnFlow.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::collectLayerFragments):
(WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
* rendering/RenderMultiColumnSet.h:
(WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const):
(WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const):
Virtualized methods so that lines clamp can subclass and change behavior.
* rendering/RenderObject.h:
(WebCore::RenderObject::isRenderLinesClampFlow const):
(WebCore::RenderObject::isRenderLinesClampSet const):
Add new functions for type checking.
* rendering/RenderRubyText.cpp:
Include adjustment.
* rendering/style/LineClampValue.h:
(WebCore::LinesClampValue::LinesClampValue):
(WebCore::LinesClampValue::isNone const):
(WebCore::LinesClampValue::operator== const):
(WebCore::LinesClampValue::operator!= const):
(WebCore::LinesClampValue::start const):
(WebCore::LinesClampValue::end const):
(WebCore::LinesClampValue::center const):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::linesClamp const):
(WebCore::RenderStyle::hasLinesClamp const):
(WebCore::RenderStyle::setLinesClamp):
(WebCore::RenderStyle::initialLinesClamp):
(WebCore::RenderStyle::hasInlineColumnAxis const):
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
(WebCore::StyleRareNonInheritedData::operator== const):
* rendering/style/StyleRareNonInheritedData.h:
The front end style implementation of the new property.
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
Make sure to build the correct renderer when lines clamp is set.
2018-01-24 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Allocate CurlSSLVerifier only when it is required.
https://bugs.webkit.org/show_bug.cgi?id=182061
CurlSSLVerifier was a member function of CurlRequest. This patch do
lazy initialization of it only when actually it is required.
Also configuration method is not required by moving those stuff to
constructor of SSLVerifier which makes much safer because there's
no change to change its behavior from outside.
Reviewed by Alex Christensen.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::willSetupSslCtx):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::finalizeTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlSSLVerifier.cpp:
(WebCore::CurlSSLVerifier::CurlSSLVerifier):
(WebCore::CurlSSLVerifier::setSslCtx): Deleted.
* platform/network/curl/CurlSSLVerifier.h:
(WebCore::CurlSSLVerifier::setCurlHandle): Deleted.
(WebCore::CurlSSLVerifier::setHostName): Deleted.
2018-01-24 Antti Koivisto <antti@apple.com>
Assertion failure in RenderMultiColumnSet::requiresBalancing() on fast/multicol/spanner-crash-when-adding-summary.html
https://bugs.webkit.org/show_bug.cgi?id=179308
<rdar://problem/34592771>
Reviewed by Zalan Bujtas.
The issue here is that we fail to tear down render tree for a summary element because adding another summary element
takes it out of the composed tree. This leaves behind renderers that break some multicolumn assumptions.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownLeftoverShadowHostChildren):
When tearing down renderers go through the real children of the shadow hosts at the end and see if we left any renderers behind.
If so, tear them down too.
* rendering/updating/RenderTreeUpdater.h:
2018-01-24 Daniel Bates <dabates@apple.com>
[CSP] Check policy for targeted windows when navigating to a JavaScript URL
https://bugs.webkit.org/show_bug.cgi?id=182018
<rdar://problem/36795781>
Reviewed by Brent Fulgham.
Move the CSP check to be earlier in the function.
Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-with-target-blocked.html
* loader/FrameLoader.cpp:
(WebCore::createWindow):
2018-01-24 Chris Dumez <cdumez@apple.com>
Add a IPC::SendSyncOption indicating we should not process incoming IPC while waiting for the sync reply
https://bugs.webkit.org/show_bug.cgi?id=182021
<rdar://problem/21629943>
Reviewed by Ryosuke Niwa.
Add layout testing infrastructure for the new flag.
Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* testing/Internals.h:
* testing/Internals.idl:
2018-01-24 Alex Christensen <achristensen@webkit.org>
Remove pre-Sierra-OS-specific code in WebCore
https://bugs.webkit.org/show_bug.cgi?id=182026
Reviewed by Tim Horton.
* page/cocoa/UserAgent.mm:
(WebCore::systemMarketingVersionForUserAgentString):
* page/scrolling/mac/ScrollingMomentumCalculatorMac.mm:
(WebCore::ScrollingMomentumCalculatorMac::retargetedScrollOffsetDidChange):
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::bitmapPNGFileType):
* platform/graphics/FontPlatformData.cpp:
* platform/graphics/FontPlatformData.h:
* platform/graphics/avfoundation/objc/VideoFullscreenLayerManager.mm:
(WebCore::VideoFullscreenLayerManager::setVideoFullscreenLayer):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(layerContentsFormat):
(PlatformCALayerCocoa::updateContentsFormat):
(PlatformCALayerCocoa::backingStoreBytesPerPixel const):
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::linearRGBColorSpaceRef):
(WebCore::extendedSRGBColorSpaceRef):
* platform/graphics/cg/PDFDocumentImage.cpp:
(WebCore::PDFDocumentImage::drawPDFPage):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::getCSSAttribute):
(WebCore::capabilitiesForFontDescriptor):
(WebCore::findClosestFont):
(WebCore::platformFontLookupWithFamily):
(WebCore::lookupFallbackFont):
(WebCore::fontWeightFromCoreText): Deleted.
* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::variantCapsSupportsCharacterForSynthesis const):
(WebCore::Font::platformWidthForGlyph const):
(WebCore::advanceForColorBitmapFont): Deleted.
(WebCore::canUseFastGlyphAdvanceGetter): Deleted.
* platform/graphics/cocoa/FontPlatformDataCocoa.mm:
(WebCore::FontPlatformData::FontPlatformData):
(WebCore::FontPlatformData::hash const):
(WebCore::FontPlatformData::platformIsEqual const):
(WebCore::FontPlatformData::ctFont const):
* platform/graphics/cocoa/GraphicsContextCocoa.mm:
(WebCore::linearRGBColorSpaceRef): Deleted.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::setTimebase):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):
* platform/mac/PlatformScreenMac.mm:
(WebCore::screenSupportsExtendedColor):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::didCreateScrollerImp):
(WebCore::ScrollbarThemeMac::isLayoutDirectionRTL):
* platform/mac/ThemeMac.mm:
(WebCore::ThemeMac::userPrefersReducedMotion const):
* platform/network/cocoa/ResourceRequestCocoa.mm:
(WebCore::ResourceRequest::doUpdatePlatformRequest):
* platform/text/mac/TextBoundaries.mm:
(WebCore::findNextWordFromIndex):
* rendering/RenderLayerModelObject.cpp:
(WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
* testing/Internals.mm:
(WebCore::Internals::userPrefersReducedMotion const):
2018-01-24 Alex Christensen <achristensen@webkit.org>
Remove WebProcess authentication code
https://bugs.webkit.org/show_bug.cgi?id=182020
Reviewed by Brady Eidson.
We were keeping it around for pre-NetworkSession media loading, which is gone now.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
* html/HTMLMediaElement.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveAuthenticationChallenge):
* loader/ResourceLoader.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::shouldWaitForResponseToAuthenticationChallenge): Deleted.
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerClient::mediaPlayerShouldWaitForResponseToAuthenticationChallenge): Deleted.
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForResponseToAuthenticationChallenge:]):
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForResponseToAuthenticationChallenge): Deleted.
2018-01-24 Joanmarie Diggs <jdiggs@igalia.com>
AX: SVG AAM mapping trumps ARIA role attribute in the case of SVG root
https://bugs.webkit.org/show_bug.cgi?id=181994
Reviewed by Chris Fleizach.
Only return AccessibilityRole::Group if we have no author-provided
ARIA role attribute value.
Test: accessibility/svg-element-with-aria-role.html
* accessibility/AccessibilitySVGRoot.cpp:
(WebCore::AccessibilitySVGRoot::roleValue const):
* accessibility/AccessibilitySVGRoot.h:
2018-01-24 Alex Christensen <achristensen@webkit.org>
Remove unused QTKit preference
https://bugs.webkit.org/show_bug.cgi?id=181968
Reviewed by Alexey Proskuryakov.
They weren't used and didn't do anything.
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
2018-01-24 Antoine Quint <graouts@apple.com>
[Web Animations] Compute the progress and currentIteration properties on getComputedTiming()
https://bugs.webkit.org/show_bug.cgi?id=182039
<rdar://problem/36813568>
Reviewed by Dean Jackson.
Compute the "progress" and "currentIteration" properties on the dictionary returned by getComputedTiming().
To support this we implement several procedures from the specification implemented separately with links
and steps copied from the specification. There is one last procedure we don't implement, which is to obtain
the transformed time following the application of the provided easing, which will be the next patch.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::phase const):
(WebCore::AnimationEffect::activeTime const):
(WebCore::AnimationEffect::overallProgress const):
(WebCore::AnimationEffect::simpleIterationProgress const):
(WebCore::AnimationEffect::currentIteration const):
(WebCore::AnimationEffect::currentDirection const):
(WebCore::AnimationEffect::directedProgress const):
(WebCore::AnimationEffect::iterationProgress const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h:
2018-01-24 Daniel Bates <dabates@apple.com>
REGRESSION (r226138): Selecting a line that ends with zero-width joiner (ZWJ) may cause text transformation
https://bugs.webkit.org/show_bug.cgi?id=181993
<rdar://problem/36421080>
Reviewed by David Hyatt.
Re-implement paint optimization that was inadvertently removed in r226138. This optimization
works around an issue where selecting the last printable character in a line that is followed
followed by a zero-width joiner transforms the selected character.
We need to fix <https://bugs.webkit.org/show_bug.cgi?id=181964> to improve the interaction
of selection and zero-width joiner characters. For now, re-implement a paint optimization
to perform a single paint operation when the style of the non-selected text is identical
to the style of the selected text.
Test: fast/text/mac/select-character-before-zero-width-joiner.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::MarkerSubrangeStyle::areBackgroundMarkerSubrangeStylesEqual):
(WebCore::InlineTextBox::MarkerSubrangeStyle::areForegroundMarkerSubrangeStylesEqual):
(WebCore::InlineTextBox::MarkerSubrangeStyle::areDecorationMarkerSubrangeStylesEqual):
Add helper functions to determine when marker styles are identical. We make use of these
equality functions to coalesce adjacent subranges that have the same visual style and
hence reduce the number of drawing commands to paint all the subranges in a line.
(WebCore::InlineTextBox::paint): Coalesce subranges before painting.
(WebCore::InlineTextBox::subdivideAndResolveStyle): Split out the logic to coalesce
subranges with the same style into its own function InlineTextBox::coalesceAdjacentSubranges()
and kept this function focused on subdivision and style resolution. Manually compute
the frontmost subranges so that we can resolve style for each subrange with respect to
the correct base style. Formerly we always resolved style with respect the specified
base style. Now we resolve style with respect the previous frontmost subrange to ensure
styles cascade as expected. This change causes no visual difference now. Once we implement
<https://bugs.webkit.org/show_bug.cgi?id=175784> we will be able to test this change
with respect to selection of ::spelling-error/::grammar-error pseudo elements.
(WebCore::InlineTextBox::coalesceAdjacentSubranges): Extracted logic from InlineTextBox::subdivideAndResolveStyle().
(WebCore::InlineTextBox::MarkerSubrangeStyle::operator== const): Deleted.
(WebCore::InlineTextBox::MarkerSubrangeStyle::operator!= const): Deleted.
Comparing MarkerSubrangeStyle objects should be performed using the appropriate
are*MarkerSubrangeStylesEqual() non-member function.
* rendering/InlineTextBox.h:
* rendering/MarkerSubrange.cpp:
(WebCore::subdivide): Remove overlap strategy FrontmostWithLongestEffectiveRange
as this strategy is now implemented by InlineTextBox::subdivideAndResolveStyle() and
InlineTextBox::coalesceAdjacentSubranges() that compute the set of frontmost subranges and
coalesces adjacent subranges with the same style into the longest effective subrange,
respectively. Unlike WebCore::subdivide(), InlineTextBox knows what the base style should
be for the subranges and can more aggressively coalesce adjacent subranges of different
types that have the same visual style.
* rendering/MarkerSubrange.h:
2018-01-24 Youenn Fablet <youenn@apple.com>
Fetch response should copy its url from the request if null
https://bugs.webkit.org/show_bug.cgi?id=182048
Reviewed by Chris Dumez.
No change of behavior.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived): Add assertion to check that the response URL is not null.
2018-01-24 Youenn Fablet <youenn@apple.com>
Account for memory cache in DocumentThreadableLoader::didReceiveResponse assertion
https://bugs.webkit.org/show_bug.cgi?id=182049
Reviewed by Chris Dumez.
No change of behavior.
A response served from Service Worker may be cached in Memory Cache and reused later on.
Update DTL assertion to handle that case.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::didReceiveResponse):
2018-01-24 Eric Carlson <eric.carlson@apple.com>
REGRESSION(r227457): Release assert in updateLayout while destructing a media element
https://bugs.webkit.org/show_bug.cgi?id=182038
<rdar://problem/36812083>
Reviewed by Jer Noble.
* html/MediaElementSession.cpp:
(WebCore::isMainContentForPurposesOfAutoplay): Early return if element.isSuspended().
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::clientCharacteristicsChanged): Call scheduleUpdateNowPlayingInfo
instead of updateNowPlayingInfo.
2018-01-24 Chris Fleizach <cfleizach@apple.com>
AX: Provide a way for VoiceOver to uniquely identify a web session
https://bugs.webkit.org/show_bug.cgi?id=181894
Reviewed by Joanmarie Diggs.
Add a way for VoiceOver to uniquely track a web page session.
Test: accessibility/mac/session-id.html
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeNames]):
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
2018-01-24 Antti Koivisto <antti@apple.com>
RenderBlockRareData::m_enclosingFragmentedFlow should be WeakPtr
https://bugs.webkit.org/show_bug.cgi?id=182045
<rdar://problem/36334787>
Reviewed by Zalan Bujtas.
For safety.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::cachedEnclosingFragmentedFlow const):
(WebCore::RenderBlock::updateCachedEnclosingFragmentedFlow const):
(WebCore::RenderBlock::locateEnclosingFragmentedFlow const):
2018-01-23 Dean Jackson <dino@apple.com>
REGRESSION (r222961?): sRGB images shown in WebGL are over-saturated on a wide gamut monitor
https://bugs.webkit.org/show_bug.cgi?id=182033
<rdar://problem/36377780>
Reviewed by Antoine Quint.
My fix for YouTube360 changed the way we composite WebGL on macOS. Unfortunately it dropped
a flag telling the compositor the colorspace of the content should be sRGB. Reinstate this
by explicitly setting the colorspace on the IOSurface we use for WebGL back buffers.
This *should* be covered by the test in:
fast/canvas/webgl/match-page-color-space.html
... however, it shows a problem with our testing infrastructure. As long as it is not
testing on a Wide Gamut display, and explicitly setting the color profile, an automated
test won't pick up this regression. I could add an Internals helper to query the colorspace
of the WebGL content, but that doesn't actually verify the composited result, which is
all that matters.
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
2018-01-24 Ms2ger <Ms2ger@igalia.com>
[GTK] Fix some test failures in ATK selection handling.
https://bugs.webkit.org/show_bug.cgi?id=168369
<rdar://problem/30534881>
Reviewed by Joanmarie Diggs.
In r208479, selectionBelongsToObject was changed to return false if the
intersectsNode call returns an exception.
In particular, this caused accessibility/gtk/text-at-offset-textarea.html
to fail. In this test, the selection is situated in the shadow DOM of the
textarea, while the node that is checked for intersection is the textarea
itself. In line with the standard, intersectsNode returns an exception in
this case.
This caused webkitAccessibleText{Word, Line, Sentence}ForBoundary to stop
returning the expected text in the tested case. Removing this check fixes
the test, along with some others.
Tests: accessibility/gtk/text-at-offset-textarea.html
accessibility/gtk/text-at-offset-textinput.html
accessibility/selected-text-range-aria-elements.html
accessibility/textarea-selected-text-range.html
* accessibility/atk/WebKitAccessibleInterfaceText.cpp:
(getSelectionOffsetsForObject): Remove the selectionBelongsToObject() call.
2018-01-18 Sergio Villar Senin <svillar@igalia.com>
[WebVR] Add OpenVR to the tree and to the build
https://bugs.webkit.org/show_bug.cgi?id=177298
Reviewed by Žan Doberšek.
Added build dependencies with the OpenVR library.
* CMakeLists.txt:
2018-01-23 Wenson Hsieh <wenson_hsieh@apple.com>
Harden against layout passes triggered when iterating through HTMLFormElement::associatedElements
https://bugs.webkit.org/show_bug.cgi?id=182037
<rdar://problem/36747812>
Reviewed by Ryosuke Niwa.
Observe that HTMLFormElement::associatedElements returns a const reference to a Vector of raw
FormAssociatedElement pointers. In various call sites that iterate through these associated elements using this
function, some require synchronous layout updates per iteration, which can lead to a bad time when combined with
the first observation.
To address this, we introduce HTMLFormElement::copyAssociatedElementsVector. This returns a new vector
containing strong Refs to each associated element. From each call site that may trigger synchronous layout and
execute arbitrary script while iterating over associated form elements, we instead use iterate over protected
FormAssociatedElements.
From each call site that currently doesn't (and shouldn't) require a layout update, we use the old version that
returns a list of raw FormAssociatedElement pointers, but add ScriptDisallowedScopes to ensure that we never
execute script there in the future.
Test: fast/forms/form-data-associated-element-iteration.html
* html/DOMFormData.cpp:
(WebCore::DOMFormData::DOMFormData):
Change to use copyAssociatedElementsVector().
* html/FormController.cpp:
(WebCore::recordFormStructure):
(WebCore::FormController::restoreControlStateIn):
Change to use copyAssociatedElementsVector().
* html/HTMLFieldSetElement.cpp:
(WebCore::HTMLFieldSetElement::copyAssociatedElementsVector const):
(WebCore:: const):
(WebCore::HTMLFieldSetElement::length const):
Refactor to use unsafeAssociatedElements().
* html/HTMLFieldSetElement.h:
* html/HTMLFormControlsCollection.cpp:
(WebCore:: const):
(WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const):
(WebCore::HTMLFormControlsCollection::customElementAfter const):
(WebCore::HTMLFormControlsCollection::updateNamedElementCache const):
Refactor these to use unsafeAssociatedElements().
* html/HTMLFormControlsCollection.h:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::unsafeAssociatedElements const):
(WebCore::HTMLFormElement::copyAssociatedElementsVector const):
* html/HTMLFormElement.h:
* loader/FormSubmission.cpp:
(WebCore::FormSubmission::create):
Refactor to use copyAssociatedElementsVector().
2018-01-23 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Fix wrong redirection with relative url when it happens from
different host than original host.
https://bugs.webkit.org/show_bug.cgi?id=181873
Reviewed by Alex Christensen.
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::willSendRequest):
2018-01-23 Eric Carlson <eric.carlson@apple.com>
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>
Reviewed by Jer Noble.
Updated API test.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
so NowPlaying status will be updated.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Return early when the media
element has been suspended.
(WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
for NowPlaying status in an inactive document or when element has been suspended.
(WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
style because HitTest can force a layout.
(WebCore::MediaElementSession::updateIsMainContent const): Ditto.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
ports.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
whenever status changes.
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
in the base class.
2018-01-23 Alex Christensen <achristensen@webkit.org>
Use CompletionHandlers for ResourceHandleClient::didReceiveResponseAsync
https://bugs.webkit.org/show_bug.cgi?id=181961
Reviewed by Michael Catanzaro.
No change in behavior.
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::didReceiveResponseAsync):
* loader/ResourceLoader.h:
* loader/appcache/ApplicationCacheGroup.cpp:
(WebCore::ApplicationCacheGroup::didReceiveResponseAsync):
* loader/appcache/ApplicationCacheGroup.h:
* platform/network/BlobResourceHandle.cpp:
(WebCore::BlobResourceHandle::notifyResponseOnSuccess):
(WebCore::BlobResourceHandle::notifyResponseOnError):
(WebCore::BlobResourceHandle::continueDidReceiveResponse): Deleted.
* platform/network/BlobResourceHandle.h:
* platform/network/PingHandle.h:
* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::didReceiveResponse):
* platform/network/ResourceHandle.h:
* platform/network/ResourceHandleClient.h:
* platform/network/SynchronousLoaderClient.cpp:
(WebCore::SynchronousLoaderClient::didReceiveResponseAsync):
* platform/network/SynchronousLoaderClient.h:
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::continueDidReceiveResponse): Deleted.
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::handleDataURL):
(WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse): Deleted.
* platform/network/mac/ResourceHandleMac.mm:
(WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate continueDidReceiveResponse]): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::nextMultipartResponsePartCallback):
(WebCore::sendRequestCallback):
(WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
2018-01-23 Chris Dumez <cdumez@apple.com>
Unreviewed, rollout r227216 as it seems to be causing deadlocks
https://bugs.webkit.org/show_bug.cgi?id=182013
* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
2018-01-23 Ali Juma <ajuma@chromium.org>
REGRESSION (r226622): ASSERTION FAILED: !m_frame in WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame()
https://bugs.webkit.org/show_bug.cgi?id=181756
Reviewed by Simon Fraser.
Don't create a VisualViewport for a suspended DOMWindow. When a DOMWindow is suspended
for document suspension, all DOMWindowProperties are disconnected from their frame.
Creating a new VisualViewport while in this state means unexpectedly having a DOMWindowProperty
that's connected to a frame, and this leads to an assertion failure.
Test: http/tests/navigation/https-in-page-cache.html
* page/DOMWindow.cpp:
(WebCore::DOMWindow::visualViewport const):
Don't create a VisualViewport while suspended.
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
Handle null DOMWindow::visualViewport.
2018-01-23 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] CurlRequest must protect its client from disposal while it's on duty.
https://bugs.webkit.org/show_bug.cgi?id=181875
Reviewed by Alex Christensen.
No new tests. It's covered by existing tests.
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::callClient):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/CurlRequestClient.h:
* platform/network/curl/ResourceHandleCurlDelegate.h:
2018-01-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r227437.
https://bugs.webkit.org/show_bug.cgi?id=182011
broke build (Requested by alexchristensen on #webkit).
Reverted changeset:
"Remove unused QTKit preference"
https://bugs.webkit.org/show_bug.cgi?id=181968
https://trac.webkit.org/changeset/227437
2018-01-23 Antoine Quint <graouts@apple.com>
[Web Animations] Expose getKeyframes() and parsing of remaining keyframe properties
https://bugs.webkit.org/show_bug.cgi?id=181978
Not reviewed.
Fix failures for http/wpt/web-animations/interfaces/AnimationEffectTiming/easing.html introduced in the previous patch.
Those keyword values are not expected.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::cssText const):
2018-01-23 Simon Fraser <simon.fraser@apple.com>
feMorphology stops applying if either x or y radius is 0 but should not.
https://bugs.webkit.org/show_bug.cgi?id=181903
Reviewed by Dean Jackson.
feMorphology should allow the radius on one axis to be zero but still apply the effect
(it's akin to a blur on just one axis). Also, any negative radius, or zero on both axes
should act like a pass-through, rather than outputting transparent blank (this is a spec
change from SVG 1.1 to SVG 2).
Tests: svg/filters/feMorphology-zero-radius-one-axis-expected.svg
svg/filters/feMorphology-zero-radius-one-axis.svg
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplyDegenerate):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::createImageBufferResult):
2018-01-23 Alex Christensen <achristensen@webkit.org>
Remove unused MediaPlayerSupportsTypeClient
https://bugs.webkit.org/show_bug.cgi?id=182003
Reviewed by Sam Weinig.
This was used for a QTKit-specific hack I removed in r227372.
* Modules/encryptedmedia/CDM.cpp:
(WebCore::CDM::getSupportedCapabilitiesForAudioVideoType):
* Modules/mediasource/MediaSource.cpp:
(WebCore::MediaSource::isTypeSupported):
* dom/DOMImplementation.cpp:
(WebCore::DOMImplementation::createDocument):
(WebCore::DOMImplementationSupportsTypeClient::DOMImplementationSupportsTypeClient): Deleted.
(): Deleted.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::canPlayType const):
(WebCore::HTMLMediaElement::selectNextSourceChild):
(WebCore::HTMLMediaElement::mediaPlayerNeedsSiteSpecificHacks const): Deleted.
(WebCore::HTMLMediaElement::mediaPlayerDocumentHost const): Deleted.
* html/HTMLMediaElement.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::supportsType):
* platform/graphics/MediaPlayer.h:
(WebCore::MediaPlayerSupportsTypeClient::mediaPlayerNeedsSiteSpecificHacks const): Deleted.
(WebCore::MediaPlayerSupportsTypeClient::mediaPlayerDocumentHost const): Deleted.
2018-01-23 Alex Christensen <achristensen@webkit.org>
Remove unused QTKit preference
https://bugs.webkit.org/show_bug.cgi?id=181968
Reviewed by Alexey Proskuryakov.
They weren't used and didn't do anything.
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::setQTKitEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::isQTKitEnabled): Deleted.
2018-01-23 Javier Fernandez <jfernandez@igalia.com>
[css-align] 'left' and 'right' should parse as invalid in block/cross-axis alignment
https://bugs.webkit.org/show_bug.cgi?id=181792
Reviewed by Antti Koivisto.
The CSS WG resolved to remove the 'left' and 'right' values from the
block/cross axis alignment properties.
https://github.com/w3c/csswg-drafts/issues/1403
This patch changes the CSS parsing logic of all the CSS Box Alignment
properties, both block-axis (align-{self, items, content} and
inline-axis (justify-{self, items, content}).
Additionally, the alignment shorthands (place-{self, items, content})
have been also changed to respect the new syntax.
Despite the number of layout tests changed, I don't think this
change will break any content in current sites. The CSS values
'left' and 'right' were introduced by the new CSS Box Alignment
spec and only implemented by the CSS Grid Layout feature, shipped
last year. Additionally, the removed values have no effect on the
layout result when they are applied to the block/cross-axis CSS
Alignment properties.
Tests: imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-001.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-002.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-003.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-004.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-align-content-005.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-001.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-002.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-003.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-004.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/parse-justify-content-005.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-003.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-005.html
imported/w3c/web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/justify-items-legacy-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-002.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-003.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-004.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-align-items-005.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-002.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-004.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-005.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/parse-justify-items-006.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-003.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-005.html
imported/w3c/web-platform-tests/css/css-align/default-alignment/place-items-shorthand-006.html
imported/w3c/web-platform-tests/css/css-align/distribution-values/space-evenly-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-002.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-003.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-004.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-align-self-005.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-002.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-003.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-004.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/parse-justify-self-005.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-003.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-005.html
imported/w3c/web-platform-tests/css/css-align/self-alignment/place-self-shorthand-006.html
* css/parser/CSSPropertyParser.cpp:
(WebCore::isLeftOrRightKeyword):
(WebCore::isContentPositionKeyword):
(WebCore::isContentPositionOrLeftOrRightKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::isSelfPositionKeyword):
(WebCore::isSelfPositionOrLeftOrRightKeyword):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::consumeAlignItems):
(WebCore::consumeJustifyItems):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::consumeSimplifiedItemPosition):
(WebCore::CSSPropertyParser::consumePlaceItemsShorthand):
(WebCore::CSSPropertyParser::consumePlaceSelfShorthand):
2018-01-23 Simon Fraser <simon.fraser@apple.com>
Element with position:fixed stops scrolling at the bottom of the page, but is painted in the right place on Chacos.com.
https://bugs.webkit.org/show_bug.cgi?id=181741
rdar://problem/36593581
Reviewed by Tim Horton.
The #ifdef for iOS was wrong; on iOS, visibleSize() is in content coordinates and matches
unscaledDocumentRect, so there's no need to scale it. Doing so computed the wrong unscaledMaximumScrollPosition
which broke hit-testing when the document minimum scale was > 1.
Test: fast/visual-viewport/ios/min-scale-greater-than-one.html
* page/FrameView.cpp:
(WebCore::FrameView::unscaledMaximumScrollPosition const):
2018-01-23 Antoine Quint <graouts@apple.com>
[Web Animations] Expose getKeyframes() and parsing of remaining keyframe properties
https://bugs.webkit.org/show_bug.cgi?id=181978
<rdar://problem/36772586>
Reviewed by Dean Jackson.
We finish our implementation of multiple keyframes by exposing the getKeyframes() method on KeyframeEffect and
parsing the remaining properties that can be exposed on keyframes: "easing" and "composite". And since we parse
those properties on keyframes, we also parse "easing" on AnimationEffectTiming and "composite" and "iterationComposite"
on KeyframeEffect.
To support this, we implement a new TimingFunction::createFromCSSText() method which takes in a string that is
a value provided directly via the JS API. As its converse, we expose a TimingFunction::cssText() method which
provides a string that can be sent back to JS to represent a timing function, using keywords when the timing
function matches one and ommitting default values.
We now also keep track of the original "offset" value provided through the JS API since that value is required
when calling getKeyframes() and distinct from the "computedOffset". These original offsets, composite operations
and timing functions are kept as separate Vectors from the KeyframeList since this type does not support exposing
those. We may consider improving that in a future patch.
Finally, we make some adjustments in the keyframe parsing to comply with the specification and correctly parse
all provided timing functions, regardless of the number of keyframes and timing functions provided.
Note that this patch is only about parsing, storing and returning provided easing and composite operations but
that such values will only be used for the resolution of animation effects in future patches.
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::getComputedTiming): Set the "easing" property on the getComputedTiming() return value
now that we expose "easing" on AnimationEffectTiming.
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming): Create a linear TimingFunction by default.
(WebCore::AnimationEffectTiming::setEasing): Parse the "easing" value and propagate an exception for invalid values.
* animation/AnimationEffectTiming.h: Expose the new "easing" property and backing TimingFunction.
* animation/AnimationEffectTiming.idl: Expose the new "easing" property.
* animation/KeyframeEffect.cpp:
(WebCore::CSSPropertyIDToIDLAttributeName): Provide a way to convert the name of a CSS property to a string that can
be used to generate a JS property name for use by getKeyframes().
(WebCore::computeMissingKeyframeOffsets): Implement the full steps of the spec.
(WebCore::processIterableKeyframes): Fix a problematic declaration for the easing variable.
(WebCore::processPropertyIndexedKeyframes): Now that ProcessedKeyframe has both an offset and a computedOffset, use
computed offsets. We also fix a couple of loops to fix compliance issues revealed by WPT tests.
(WebCore::KeyframeEffect::create): Parse the provided "easing" property on the KeyframeEffectOptions object.
(WebCore::KeyframeEffect::getKeyframes): Implement the getKeyframes() method as mandated by the spec.
(WebCore::KeyframeEffect::processKeyframes): Keep a list of unused easings so these might be parsed as well, and
potentially throw exceptions, as mandated by the spec. For valid easings, store their matching TimingFunction in
m_timingFunctions, original offset values in m_offsets and CompositeOperation values in m_compositeOperations.
* animation/KeyframeEffect.h: Switch the order in which we specify some of the Variant types so that default values
are correctly used.
* animation/KeyframeEffect.idl: Switch the order in which we specify some of the Variant types so that default values
are correctly used.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::createFromCSSText):
(WebCore::TimingFunction::cssText const):
* platform/animation/TimingFunction.h:
2018-01-23 Brady Eidson <beidson@apple.com>
Allow passing MessagePorts across processes (e.g. ServiceWorkers).
https://bugs.webkit.org/show_bug.cgi?id=181178
Reviewed by Andy Estes.
Test: http/tests/workers/service/basic-messageport.html
* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::entanglePortWithProcess):
* dom/messageports/MessagePortChannel.h:
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorker):
* workers/service/context/SWContextManager.h:
2018-01-23 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r227279 and r227373.
https://bugs.webkit.org/show_bug.cgi?id=181988
The LayoutTest crash fix introduced an API test failure.
(Requested by ryanhaddad on #webkit).
Reverted changesets:
"Resign NowPlaying status when no media element is eligible"
https://bugs.webkit.org/show_bug.cgi?id=181914
https://trac.webkit.org/changeset/227279
"Resign NowPlaying status when no media element is eligible"
https://bugs.webkit.org/show_bug.cgi?id=181914
https://trac.webkit.org/changeset/227373
2018-01-23 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, fix some format specifiers added in r227190
https://bugs.webkit.org/show_bug.cgi?id=181454
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::takeAllMessagesForPort):
2018-01-23 Ting-Wei Lan <lantw44@gmail.com>
[GTK] Add user agent quirk for Microsoft Outlook Web App
https://bugs.webkit.org/show_bug.cgi?id=181982
Reviewed by Michael Catanzaro.
Microsoft Outlook Web App forces users to switch to the lite version on
the login page with our standard user agent on all non-macOS systems.
Since it is an application that can be installed by different companies,
schools and organizations, it is not possible to fix the issue unless
we keep a big list of host names that are known to run it. We check the
host name instead of the base domain name here because it is not
expected to run all sites under a base domain on this webmail and
calendar application.
https://mail.ntu.edu.tw is a site that is known to run Microsoft Outlook
Web App for several years, and it is not likely to change. When there
are other sites found to run it and having the same user agent problem,
we can expand the list to include them.
* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresMacintoshPlatform):
2018-01-23 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME] Add support of multi keys from different sessions in CDMinstanceClearKey
https://bugs.webkit.org/show_bug.cgi?id=180083
Reviewed by Xabier Rodriguez-Calvar.
Add support of multi keys from different MediaKeySession in CDMInstanceClearKey.
Currently the CDMInstanceClearKey manages two "m_keys", one is a WTF::Vector
where it stores the list of last added keys, an other which is defined in the
ClearKeyState::singleton it is a WTF::HashMap, in this last one, it stores the
keys lists of each created session.
The method "keys()" of CDMInstanceClearKey returns the first "m_keys" which
contains just the list of last keys.
The goal of this commit is to return all keys lists of all sessions, thus
we remove the "m_keys" which is WTF::Vector and we modify the method
"keys()" to return all keys lists, which is stored in "m_keys" WTF::HashMap,
in one Vector instead of return just the list of last keys.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::CDMInstanceClearKey::keys const):
(WebCore::CDMInstanceClearKey::updateLicense):
* platform/encryptedmedia/clearkey/CDMClearKey.h:
2018-01-22 Simon Fraser <simon.fraser@apple.com>
Optimize building the non-fast scrollable region with multiple iframes
https://bugs.webkit.org/show_bug.cgi?id=181971
Reviewed by Zalan Bujtas.
AsyncScrollingCoordinator::frameViewLayoutUpdated() is called every time a subframe lays out.
We don't need to eagerly update the non-fast scrollable region at this time; we can just mark
it dirty, and rely on the existing scrolling tree commit code to recompute it.
On my machine this makes fast/frames/lots-of-objects.html no longer a timeout.
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
2018-01-22 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement PublicKeyCredential's [[Create]] with a dummy authenticator
https://bugs.webkit.org/show_bug.cgi?id=181928
<rdar://problem/36459893>
Reviewed by Brent Fulgham.
This patch implements PublicKeyCredential's [[Create]] from https://www.w3.org/TR/webauthn/#createCredential
as of 5 December 2017. In order to do testing, a dummy authenticator is implemented to exercise a failure
and a pass path. A number of dependencies need to be resolved later in order to comply with the spec.
Also, the current architecture of handling async WebAuthN operations including dispatching, timeout, and aborting
might need a redesign once the underlying authenticator is clear. Since this is our first attempt to implement
a prototype, all those limitations, in my opinion, can be marked as non-blocking to accelerate the whole
process. Those limitations will then be addressed once the first prototype is finshed.
Tests: http/tests/webauthn/public-key-credential-create-with-invalid-parameters.https.html
http/tests/webauthn/public-key-credential-same-origin-with-ancestors-2.https.html
http/tests/webauthn/public-key-credential-same-origin-with-ancestors.https.html
http/wpt/webauthn/idl.https.html
http/wpt/webauthn/public-key-credential-create-failure.https.html
http/wpt/webauthn/public-key-credential-create-success.https.html
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::PendingPromise::PendingPromise):
(WebCore::CredentialsContainer::dispatchTask):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess const):
(WebCore::CredentialsContainer::preventSilentAccess): Deleted.
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::PendingPromise::create):
* Modules/webauthn/Authenticator.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.cpp.
(WebCore::Authenticator::singleton):
(WebCore::Authenticator::makeCredential const):
* Modules/webauthn/Authenticator.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialCreationOptions.h.
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
(WebCore::AuthenticatorAssertionResponse::authenticatorData const):
(WebCore::AuthenticatorAssertionResponse::signature const):
(WebCore::AuthenticatorAssertionResponse::userHandle const):
(WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse): Deleted.
(WebCore::AuthenticatorAssertionResponse::authenticatorData): Deleted.
(WebCore::AuthenticatorAssertionResponse::signature): Deleted.
(WebCore::AuthenticatorAssertionResponse::userHandle): Deleted.
* Modules/webauthn/AuthenticatorAssertionResponse.h:
(WebCore::AuthenticatorAssertionResponse::create):
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
(WebCore::AuthenticatorAttestationResponse::attestationObject const):
(WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse): Deleted.
(WebCore::AuthenticatorAttestationResponse::attestationObject): Deleted.
* Modules/webauthn/AuthenticatorAttestationResponse.h:
(WebCore::AuthenticatorAttestationResponse::create):
* Modules/webauthn/AuthenticatorResponse.cpp:
(WebCore::AuthenticatorResponse::clientDataJSON const):
(WebCore::AuthenticatorResponse::~AuthenticatorResponse): Deleted.
(WebCore::AuthenticatorResponse::clientDataJSON): Deleted.
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredentialInternal::produceClientDataJson):
(WebCore::PublicKeyCredentialInternal::produceClientDataJsonHash):
(WebCore::PublicKeyCredentialInternal::getIdFromAttestationObject):
(WebCore::PublicKeyCredential::PublicKeyCredential):
(WebCore::PublicKeyCredential::discoverFromExternalSource):
(WebCore::PublicKeyCredential::create):
(WebCore::PublicKeyCredential::rawId const):
(WebCore::PublicKeyCredential::response const):
(WebCore::PublicKeyCredential::getClientExtensionResults const):
(WebCore::PublicKeyCredential::rawId): Deleted.
(WebCore::PublicKeyCredential::response): Deleted.
(WebCore::PublicKeyCredential::getClientExtensionResults): Deleted.
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
(): Deleted.
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSAuthenticatorResponseCustom.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorAttestationResponse.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSBasicCredentialCustom.cpp: Copied from Source/WebCore/Modules/webauthn/AuthenticatorResponse.cpp.
(WebCore::toJSNewlyCreated):
(WebCore::toJS):
* bindings/js/JSBindingsAllInOne.cpp:
2018-01-22 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Support font collections
https://bugs.webkit.org/show_bug.cgi?id=181826
<rdar://problem/36455137>
Reviewed by Dean Jackson.
Use the CoreText call CTFontManagerCreateFontDescriptorsFromData() to get all the descriptors inside
the collection file. We select which one by using the fragment identifier at the end of the url linking
to the remote font. For example, to select the 4th font inside a TTC file, the @font-face block would
look like:
@font-face {
font-family: "MyFont";
src: url("path/to/font.ttc#4");
}
Note that these numbers are 1-indexed.
The CSS Fonts spec states:
> Fragment identifiers are used to indicate which font to load. If a container format lacks a defined
> fragment identifier scheme, implementations should use a simple 1-based indexing scheme (e.g.
> "font-collection#1" for the first font, "font-collection#2" for the second font).
Not only are TTC font collections supported, but WOFF2 font collections are also supported, which is
increasingly important web standard.
No new tests because I don't have a font collection file with the appropriate license for the
WebKit repository. I tested manually.
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::load):
* loader/cache/CachedFont.cpp:
(WebCore::CachedFont::calculateIndex const):
(WebCore::CachedFont::ensureCustomFontData):
(WebCore::CachedFont::createCustomFontData):
* loader/cache/CachedFont.h:
* platform/graphics/cairo/FontCustomPlatformData.h:
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/mac/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformData.cpp:
(WebCore::createFontCustomPlatformData):
* platform/graphics/win/FontCustomPlatformData.h:
* platform/graphics/win/FontCustomPlatformDataCairo.cpp:
(WebCore::createFontCustomPlatformData):
2018-01-22 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r227011): fast/frames/hidpi-position-iframe-on-device-pixel.html times out
https://bugs.webkit.org/show_bug.cgi?id=181959
Reviewed by Zalan Bujtas.
This test creates 300 iframes, which became slow after r227011 because they all became part
of the non-fast scrollable region, slowing down ScrollingCoordinator::absoluteEventTrackingRegionsForFrame().
Fix by not adding non-scrollable iframes, and making FrameView::isScrollable() more efficient for frames
that have not done layout yet.
* page/FrameView.cpp:
(WebCore::FrameView::isScrollable):
(WebCore::FrameView::addChild):
2018-01-22 Dan Bernstein <mitz@apple.com>
Fixed building for macOS 10.12 with the macOS 10.13 SDK after r227156.
* Configurations/WebCore.xcconfig:
2018-01-22 Simon Fraser <simon.fraser@apple.com>
REGRESSION (r226981): ASSERTION FAILED: startY >= 0 && endY <= height && startY < endY in WebCore::FEMorphology::platformApplyGeneric
https://bugs.webkit.org/show_bug.cgi?id=181836
Reviewed by Tim Horton.
All the filters that use ParallelJobs<> has the same type of bug where very wide but not tall
filter regions could result in computing an optimalThreadNumber that was greater than the
number of rows to process, which resulted in jobs with zero rows to process.
Since we split the work by rows, cap the maximum number of threads to height/8 so that each job
has at least 8 rows of pixels to process. Add some assertions to detect jobs with zero rows.
FEMorphology was also using implicit float -> int conversion to detect integer overflow of radius,
so change that to use explicit clamping.
Tests: svg/filters/feLighting-parallel-jobs.svg
svg/filters/feTurbulence-parallel-jobs-wide.svg
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::platformApplyGenericPaint):
(WebCore::FELighting::platformApplyGeneric):
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::platformApplyGeneric):
(WebCore::FEMorphology::platformApply):
(WebCore::FEMorphology::platformApplyDegenerate):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FETurbulence.cpp:
(WebCore::FETurbulence::fillRegion const):
(WebCore::FETurbulence::platformApplySoftware):
2018-01-22 Eric Carlson <eric.carlson@apple.com>
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>
Reviewed by Jer Noble.
No new tests, these changes prevent existing tests from crashing.
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::playbackPermitted const): Return early when the media
element has been suspended.
(WebCore::MediaElementSession::canShowControlsManager const): Return false when the
media element has been suspended.
(WebCore::isMainContentForPurposesOfAutoplay): Return early if it isn't safe to update
style because HitTest can force a layout.
(WebCore::MediaElementSession::updateIsMainContent const): Ditto.
2018-01-22 Alex Christensen <achristensen@webkit.org>
Begin removing QTKit code
https://bugs.webkit.org/show_bug.cgi?id=181951
Reviewed by Jer Noble.
QTKit was being used on El Capitan and before.
* Configurations/WebCore.xcconfig:
* SourcesMac.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/MediaPlayer.cpp:
(WebCore::buildMediaEnginesVector):
(WebCore::MediaPlayer::supportsType):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h: Removed.
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm: Removed.
* platform/graphics/mac/MediaTimeQTKit.h: Removed.
* platform/graphics/mac/MediaTimeQTKit.mm: Removed.
* platform/mac/WebVideoFullscreenController.mm:
(-[WebVideoFullscreenController setVideoElement:]):
(-[WebVideoFullscreenController updatePowerAssertions]):
2018-01-22 Per Arne Vollan <pvollan@apple.com>
[Win] Null pointer crash under WebCore::RenderStyle::colorIncludingFallback.
https://bugs.webkit.org/show_bug.cgi?id=181801
<rdar://problem/35614900>
Reviewed by Brent Fulgham.
Do not paint synchronously when popup items have been added or changed while the popup is visible.
If new popup items have been added after the popup was shown, a synchronous paint operation will
possibly access their style before it is ready, leading to a null pointer crash. The invalidated
area will be painted asynchronously.
No new tests. To reproduce this crash, it is necessary to open a popup with JavaScript, add new
popup items, and then end the test. Opening the popup can be done by sending a mousedown event
with the eventsender. However, on Windows the mousedown event is sent synchronously, and will
block as long as the popup is open and running the popup event loop. This means no JS can be
executed until the popup is closed, causing the test to always time out before new popup items
can be added. I have verified the fix with a manual test case.
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenuWin::updateFromElement):
2018-01-22 Chris Dumez <cdumez@apple.com>
RELEASE_ASSERT(registration) hit in SWServer::installContextData(const ServiceWorkerContextData&)
https://bugs.webkit.org/show_bug.cgi?id=181941
<rdar://problem/36744892>
Reviewed by Youenn Fablet.
Make sure we clear SWServer::m_pendingContextDatas & SWServer::m_pendingJobs as needed
when clearing Website data. Otherwise, we will hit assertion when those gets processed
after the connection to the SW process has been established (not to mentioned we failed
to clear some in-memory data even though the user asked us to).
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
2018-01-22 Ryosuke Niwa <rniwa@webkit.org>
Blob conversion and sanitization doesn't work with Microsoft Word for Mac 2011
https://bugs.webkit.org/show_bug.cgi?id=181616
<rdar://problem/36484908>
Reviewed by Wenson Hsieh.
The bug was caused by WebContentReader::readHTML and WebContentMarkupReader::readHTML not sanitizing plain HTML string
as done for web archives even when custom pasteboard data is enabled. Fixed the bug by doing the sanitization.
Unfortunately, we can't make file URLs available in this case because WebContent process doesn't have sandbox extensions
to access local files referenced by the HTML source in the clipboard, and we can't make WebContent process request for
a sandbox extension¸on an arbitrary local file, as it would defeat the whole point of sandboxing.
Instead, we strip away all HTML attributes referencing a URL whose scheme is not HTTP, HTTPS, or data when sanitizing
text/html from the clipboard to avoid exposing local file paths, which can reveal privacy & security sensitive data
such as the user's full name, and the location of private containers of other applications in the system.
Tests: PasteHTML.DoesNotSanitizeHTMLWhenCustomPasteboardDataIsDisabled
PasteHTML.DoesNotStripFileURLsWhenCustomPasteboardDataIsDisabled
PasteHTML.ExposesHTMLTypeInDataTransfer
PasteHTML.KeepsHTTPURLs
PasteHTML.SanitizesHTML
PasteHTML.StripsFileURLs
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readHTML): Fixed the bug by sanitizing the markup, and stripping away file URLs.
(WebCore::WebContentMarkupReader::readHTML): Ditto.
* editing/markup.cpp:
(WebCore::removeSubresourceURLAttributes): Added.
(WebCore::sanitizeMarkup): Added.
* editing/markup.h:
2018-01-22 Chris Dumez <cdumez@apple.com>
Add release logging to help debug issues related to service workers
https://bugs.webkit.org/show_bug.cgi?id=181935
<rdar://problem/36735900>
Reviewed by Brady Eidson.
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::ServiceWorker):
(WebCore::ServiceWorker::scheduleTaskToUpdateState):
(WebCore::ServiceWorker::postMessage):
(WebCore::ServiceWorker::isAlwaysOnLoggingAllowed const):
* workers/service/ServiceWorker.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
(WebCore::ServiceWorkerContainer::isAlwaysOnLoggingAllowed const):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
(WebCore::ServiceWorkerRegistration::updateStateFromServer):
(WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::scriptContextFailedToStart):
(WebCore::SWServer::didFinishInstall):
(WebCore::SWServer::didFinishActivation):
(WebCore::SWServer::terminateWorkerInternal):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::didResolveRegistrationPromise):
(WebCore::SWServerJobQueue::runRegisterJob):
2018-01-22 Youenn Fablet <youenn@apple.com>
Safari Tech Preview can't use GitHub login at forums.swift.org
https://bugs.webkit.org/show_bug.cgi?id=181908
<rdar://problem/36715111>
Reviewed by Chris Dumez.
Test: http/wpt/service-workers/navigation-redirect.https.html
For subresource loads, redirections will not change who is in charge of continuing the load (service worker or network process).
For navigation loads, we need to match the registration for every redirection since this is using the Manual redirect mode.
This allows starting the load with a service worker and finishing the load with another service worker, which will become the controller.
Implement this by wrapping the registration matching of an URL within DocumentLoader::matchRegistration.
Use that method in DocumentLoader::redirectReceived.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::matchRegistration):
(WebCore::doRegistrationsMatch):
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
2018-01-22 Antti Koivisto <antti@apple.com>
REGRESSION (Safari 11): Buttons inside a fieldset legend cannot be clicked on in Safari 11
https://bugs.webkit.org/show_bug.cgi?id=179666
<rdar://problem/35534292>
Reviewed by Zalan Bujtas.
The legend element of a fieldset is in the border area, outside the clip rect.
With overflow:hidden mouse events won't reach it.
Test case by Dhaya Benmessaoud.
Test: fast/forms/legend-overflow-hidden-hit-test.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::nodeAtPoint):
(WebCore::RenderBlock::hitTestExcludedChildrenInBorder):
Add a special case to hit testing to handle legend, similarly to what is done for painting.
* rendering/RenderBlock.h:
2018-01-22 Joanmarie Diggs <jdiggs@igalia.com>
AX: Implement support for Graphics ARIA roles
https://bugs.webkit.org/show_bug.cgi?id=181796
Reviewed by Chris Fleizach.
Add mappings for the three new roles (graphics-document, graphics-object,
and graphics-symbol) as per the Graphics Accessibility API Mappings spec.
No new tests; instead, new test cases added to roles-computedRoleString.html
and roles-exposed.html.
* accessibility/AccessibilityObject.cpp:
(WebCore::initializeRoleMap):
(WebCore::AccessibilityObject::computedRoleString const):
* accessibility/AccessibilityObject.h:
* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(atkRole):
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(createAccessibilityRoleMap):
(-[WebAccessibilityObjectWrapper subrole]):
(-[WebAccessibilityObjectWrapper roleDescription]):
2018-01-22 Antti Koivisto <antti@apple.com>
REGRESSION(r224535): Can't write reviews in the App Store
https://bugs.webkit.org/show_bug.cgi?id=181936
<rdar://problem/36670246>
Reviewed by Zalan Bujtas.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::updateStyleForLayout):
r224535 was about media queries but it also removed a seemingly spurious call to SyleScope::didChangeStyleSheetEnvironment
from the path that does not involve media queries.
Turns out UITextContentView somehow depended on it, so revert this specific change.
2018-01-22 Brady Eidson <beidson@apple.com>
In WebKit2, make the MessagePortChannelRegistry live in the UI process.
https://bugs.webkit.org/show_bug.cgi?id=181922
Reviewed by Andy Estes.
No new tests (Refactor, no behavior change)
Add encoder/decoders and EXPORT a whole bunch of stuff.
* WebCore.xcodeproj/project.pbxproj:
* dom/MessagePort.h:
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::processForPort):
* dom/messageports/MessagePortChannel.h:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelRegistry.h:
* dom/messageports/MessageWithMessagePorts.h:
(WebCore::MessageWithMessagePorts::encode const):
(WebCore::MessageWithMessagePorts::decode):
2018-01-22 Youenn Fablet <youenn@apple.com>
Fetch Headers from an Opaque response should be filtered out
https://bugs.webkit.org/show_bug.cgi?id=181926
Reviewed by Chris Dumez.
Covered by updated test.
Refactor to use the same FetchResponse::create for Cache API and cloning.
In this method, ensure that response and headers are filtered correctly according response tainting.
Make also sure that synthetic responses do not get filtered (not needed since created by JavaScript).
Introduce helper routine to set the header map of a resource response.
Use this routine when cloning a synthetic response as in that case, m_internalResponse has no header at all.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::updateRecords):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create):
(WebCore::FetchResponse::clone):
* Modules/fetch/FetchResponse.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setHTTPHeaderFields):
* platform/network/ResourceResponseBase.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
2018-01-22 Javier Fernandez <jfernandez@igalia.com>
[css-align] 'overflow' keyword must precede the self-position and content-position value
https://bugs.webkit.org/show_bug.cgi?id=181793
Reviewed by Antti Koivisto.
There were several discussions to avoid ambiguities with the complex
values, specially when it comes to define the place-xxx shorthands.
One of the sources of problems is the 'overflow-position' keyword. The
CSS WG has decided to change the syntax of all the CSS Box Alignment
properties so that the 'overflow-position' keyword always precede the
'self-position' or the 'content-position' keywords.
https://github.com/w3c/csswg-drafts/issues/1446#event-1125715434
In order to apply this change to the Content Distribution properties'
(align-content and justify-content) syntax I had to completely
re-implement their parsing function. Thanks to this I addressed also
the issue with the content-distribution fallback, which cannot be
specified explicitly now.
https://github.com/w3c/csswg-drafts/issues/1002#ref-commit-c38cac4
No new tests, just rebaselined the expected results of the test cases affected.
Despite the so many layout tests affected by this change, it's
unlikely that it might break any content in current web
sites. This patch changes the new CSS syntax, obviously backward
compatible, defined by the new CSS Box Alignment. The
'overflow-position' keyword is only used by the layout models
implementing the new spec, so far only CSS Grid Layout.
Considering that CSS Grid has been shipped last year, it's unlikely
that many sites are using the new CSS values.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::valueForItemPositionWithOverflowAlignment):
(WebCore::valueForContentPositionAndDistributionWithOverflowAlignment):
* css/CSSContentDistributionValue.cpp:
(WebCore::CSSContentDistributionValue::customCSSText const):
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSelfOrDefaultAlignmentData):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeOverflowPositionKeyword):
(WebCore::consumeContentPositionKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
2018-01-22 Chris Nardi <csnardi1@gmail.com>
Parse calc() in CSS media queries
https://bugs.webkit.org/show_bug.cgi?id=181716
calc() was previously unsupported inside of media queries. This change
adds in support for parsing calc inside of media queries.
Reviewed by Antti Koivisto.
Tests: Imported web-platform-tests/css/mediaqueries
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent): Updated function to take a CSSPrimitiveValue.
(WebCore::featureWithValidDensity): Updated function to take a CSSPrimitiveValue instead of a CSSParserToken.
(WebCore::featureWithValidPositiveLength): Ditto.
(WebCore::featureExpectingPositiveInteger): Ditto.
(WebCore::featureWithPositiveInteger): Ditto.
(WebCore::featureWithPositiveNumber): Ditto.
(WebCore::featureWithZeroOrOne): Ditto.
(WebCore::MediaQueryExpression::MediaQueryExpression): Use CSSPropertyParserHelpers for consuming.
* css/MediaQueryExpression.h:
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeResolution): Added function for use in media query expression parsing.
* css/parser/CSSPropertyParserHelpers.h:
* css/parser/MediaQueryParser.cpp:
(WebCore::MediaQueryParser::readRestrictor): Updated functions to take a CSSParserTokenRange in order to use CSSPropertyParserHelpers.
(WebCore::MediaQueryParser::readMediaNot): Ditto.
(WebCore::MediaQueryParser::readMediaType): Ditto.
(WebCore::MediaQueryParser::readAnd): Ditto.
(WebCore::MediaQueryParser::readFeatureStart): Ditto.
(WebCore::MediaQueryParser::readFeature): Ditto.
(WebCore::MediaQueryParser::readFeatureColon): Ditto.
(WebCore::MediaQueryParser::readFeatureValue): Ditto.
(WebCore::MediaQueryParser::readFeatureEnd): Ditto.
(WebCore::MediaQueryParser::skipUntilComma): Ditto.
(WebCore::MediaQueryParser::skipUntilBlockEnd): Ditto.
(WebCore::MediaQueryParser::processToken): Ditto.
(WebCore::MediaQueryParser::parseInternal): Ditto.
(WebCore::MediaQueryData::clear): Removed reference to m_valueList
(WebCore::MediaQueryData::addExpression): Use CSSParserTokenRange.
(WebCore::MediaQueryData::lastExpressionValid): New helper function.
(WebCore::MediaQueryData::removeLastExpression): New helper function.
* css/parser/MediaQueryParser.h:
2018-01-22 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Refactor PlatformContextCairo::drawSurfaceToContext() into a Cairo operation
https://bugs.webkit.org/show_bug.cgi?id=181930
Reviewed by Carlos Garcia Campos.
Move the PlatformContextCairo::drawSurfaceToContext() code into the
Cairo namespace as an operation, renaming it to drawSurface(). Mirroring
other operations, the PlatformContextCairo object is now passed through
a reference as the first argument to the function, and cairo_t context
object is retrieved from that.
Call sites of the PlatformContextCairo::drawSurfaceToContext() method
are adjusted to now call Cairo::drawSurface() and properly pass the
PlatformContextCairo object to the function.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareForStroking): Make this static.
(WebCore::Cairo::drawPatternToCairoContext):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::drawSurface):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::drawPatternToCairoContext): Deleted.
(WebCore::PlatformContextCairo::drawSurfaceToContext): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-01-22 Manuel Rego Casasnovas <rego@igalia.com>
[css-grid] Spanning Grid item has too much space at the bottom / is too high
https://bugs.webkit.org/show_bug.cgi?id=181677
Reviewed by Javier Fernandez.
In IndefiniteSizeStrategy::findUsedFlexFraction() we were not
subtracting the size of the gutters when we call findFrUnitSize().
If an item spans several tracks, we cannot pass the maxContentForChild()
directly, we need to subtract the gutters as they are treated
as fixed size tracks in the algorithm.
The spec text is pretty clear regarding this
(https://drafts.csswg.org/css-grid/#algo-find-fr-size):
"Let leftover space be the space to fill minus the base sizes
of the non-flexible grid tracks."
Gutters are treated as fixed-size tracks for the purpose
of the track sizing algorithm, so we need to subtract them from the
leftover space while finding the size of an "fr".
Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-find-fr-size-gutters-001.html
imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-find-fr-size-gutters-002.html
* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithm::findFrUnitSize const):
(WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const):
2018-01-21 Ryosuke Niwa <rniwa@webkit.org>
Turning off custom pasteboard data doesn't actually turn it off in WK2
https://bugs.webkit.org/show_bug.cgi?id=181920
<rdar://problem/36686429>
Reviewed by Wenson Hsieh.
Replaced the global settings for custom pasteboard data by regular runtime enabled flags.
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):
(WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::commitToPasteboard):
* dom/DataTransferItemList.cpp:
(WebCore::shouldExposeTypeInItemList):
* editing/Editor.cpp:
(WebCore::createDataTransferForClipboardEvent):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentAndAddResources):
(WebCore::WebContentReader::readWebArchive):
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
(WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setCustomPasteboardDataEnabled):
2018-01-21 Wenson Hsieh <wenson_hsieh@apple.com>
Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
https://bugs.webkit.org/show_bug.cgi?id=181918
Reviewed by Tim Horton.
Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default). No change in behavior.
* Configurations/FeatureDefines.xcconfig:
2018-01-19 Ryosuke Niwa <rniwa@webkit.org>
Release assertion in canExecuteScript when executing scripts during page cache restore
https://bugs.webkit.org/show_bug.cgi?id=181902
Reviewed by Antti Koivisto.
The crash was caused by an erroneous instantiation of ScriptDisallowedScope::InMainThread in CachedPage::restore.
It can execute arbitrary scripts since CachedFrame::open can update style, layout, and evaluate media queries.
This is fine because there is no way to put this page back into a page cache until the load is commited via
FrameLoader::commitProvisionalLoad is invoked later which only happens after CachedPage::restore had exited.
Also added a release assert to make sure this condition holds.
Tests: fast/history/page-cache-execute-script-during-restore.html
fast/history/page-cache-navigate-during-restore.html
* history/CachedPage.cpp:
(WebCore::CachedPageRestorationScope::CachedPageRestorationScope): Added.
(WebCore::CachedPageRestorationScope::~CachedPageRestorationScope): Added.
(WebCore::CachedPage::restore): Don't instantiate ScriptDisallowedScope::InMainThread. Set isRestoringCachedPage
on the cached pate to release-assert that there won't be any attempt to put this very page back into the cache.
* history/PageCache.cpp:
(WebCore::canCachePage): Added a release assert to make sure the page which is in the process of being restored
from the page cache is not put into the page cache.
* page/Page.h:
(WebCore::Page::setIsRestoringCachedPage): Added.
(WebCore::Page::isRestoringCachedPage const): Added.
2018-01-21 Eric Carlson <eric.carlson@apple.com>
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>
Reviewed by Jer Noble.
Updated API test.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
so NowPlaying status will be updated.
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
for NowPlaying status in an inactive document.
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
ports.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
whenever status changes.
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
in the base class.
2018-01-21 Jer Noble <jer.noble@apple.com>
REGRESSION (macOS 10.13.2): imported/w3c/web-platform-tests/media-source/mediasource-* LayoutTests failing
https://bugs.webkit.org/show_bug.cgi?id=181891
Reviewed by Eric Carlson.
In macOS 10.13.2, CoreMedia changed the definition of CMSampleBufferGetDuration() to return
the presentation duration rather than the decode duration. For media streams where those two
durations are identical (or at least, closely similar), this isn't a problem. But the media
file used in the WPT tests have an unusual frame cadence: decode durations go {3000, 1, 5999,
1, 5999,...} and presentation durations go {3000, 2999, 3000, 2999}. This caused one check in
the "Coded Frame Processing" algorithm to begin failing, where it checks that the delta
between the last sample's decode time and the new decode time is no more than 2x as far as
the last sample's duration. That's not a problem as long as the "duration" is the "decode
duration" and the samples are all adjacent. Once the "duration" is "presentation duration",
all the assumptions in the algorithm are invalidated. In the WPT test case, the delta between
decode times is 5999, and 2 * the presentation duration is 5998, causing all samples up to
the next sync sample to be dropped.
To work around this change in behavior, we'll adopt the same technique used by Mozilla's MSE
implementation, which was done for similar reasons. Rather than track the "last frame duration",
we'll record the "greatest frame duration", and use actual decode timestamps to derive this
duration. The "greatest frame duration" field will be reset at the same times as "last frame
duration", and will be used only in the part of the algorithm that checks for large decode
timestamp gaps.
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
2018-01-21 Andy Estes <aestes@apple.com>
[ios] LayoutTest imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html is crashing in JSC::JSONParse
https://bugs.webkit.org/show_bug.cgi?id=177832
<rdar://problem/34805315>
Reviewed by Tim Horton.
Test: http/tests/paymentrequest/rejects_if_not_active.https.html
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show): Rejected promise if the document is not active.
2018-01-20 Brady Eidson <beidson@apple.com>
Make garbage collection of MessagePort objects be asynchronous.
https://bugs.webkit.org/show_bug.cgi?id=181910
Reviewed by Andy Estes.
No new tests (Covered by existing tests, including GC-specific ones).
The basic premise here is as follows:
- You can *always* GC a MessagePort that is closed
- You can *always* GC a MessagePort that has no onmessage handler, as incoming messages cannot
possibly revive it.
- You can GC a MessagePort, even if it has a message handler, as long as there are no messages
in flight between it and the remote port, and as long as the remote port is "maybe eligible for GC."
A MessagePort is considered "maybe eligible for GC" once hasPendingActivity is asked once.
A MessagePort loses "maybe eligible for GC" status once it is used for sending or receiving a message.
The changes to MessagePort.cpp implement the above with a tiny little bool-driven state machine.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::registerLocalActivity):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::isLocallyReachable const):
(WebCore::MessagePort::addEventListener):
(WebCore::MessagePort::removeEventListener):
* dom/MessagePort.h:
- Remove the lock and any background-thread code paths
- Add ASSERT(isMainThread())s throughout
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::includesPort):
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::closePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::checkRemotePortForActivity):
(WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
* dom/messageports/MessagePortChannel.h:
Add a callback for a MessagePortChannel to go ask the remote MessagePort object about local activity:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
(WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
(WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync): Deleted.
* dom/messageports/MessagePortChannelProviderImpl.h:
- Remove the lock and any background-thread code paths
- Add ASSERT(isMainThread())s throughout
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
(WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
(WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
(WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
(WebCore::MessagePortChannelRegistry::didCloseMessagePort):
(WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
(WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
(WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): Deleted.
* dom/messageports/MessagePortChannelRegistry.h:
2018-01-20 Andy Estes <aestes@apple.com>
[Apple Pay] Stop eagerly loading PassKit.framework
https://bugs.webkit.org/show_bug.cgi?id=181911
<rdar://problem/36555369>
Reviewed by Tim Horton.
r226458 and r226123 added code that caused PassKit.framework to be eagerly loaded when
initializing a WKWebView. This is costly and should only be done when Apple Pay is first used.
To avoid eagerly loading PassKit, this patch does two things:
1. Instead of sending the available payment networks as part of WebPageCreationParameters,
PaymentCoordinator asks for them using a syncrhonous message the first time they are needed.
2. Instead of setting the Apple Pay preference to false when PassKit can't be loaded,
the following API entry points check for a missing PassKit and return false, or throw
exceptions, or reject promises:
- ApplePaySession.canMakePayments()
- ApplePaySession.canMakePaymentsWithActiveCard()
- ApplePaySession.openPaymentSetup()
- ApplePaySession.begin()
No new tests for (1), which causes no change in behavior. (2) was manually verified by
locally moving aside PassKit.framework, but that's not possible to do in an automated test.
* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::PaymentCoordinator):
(WebCore::PaymentCoordinator::validatedPaymentNetwork const):
(WebCore::toHashSet): Deleted.
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* loader/EmptyClients.cpp:
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):
Removed PaymentCoordinator::m_availablePaymentNetworks and made
PaymentCoordinator::validatedPaymentNetwork() call
PaymentCoordinatorClient::validatedPaymentNetwork() instead.
* page/PageConfiguration.h:
Removed availablePaymentNetworks from PageConfiguration.
* testing/Internals.cpp:
(WebCore::Internals::Internals):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::validatedPaymentNetwork):
* testing/MockPaymentCoordinator.h:
Implemented PaymentCoordinatorClient::validatedPaymentNetwork().
2018-01-20 Jer Noble <jer.noble@apple.com>
Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
https://bugs.webkit.org/show_bug.cgi?id=181840
<rdar://problem/36186214>
Reviewed by Simon Fraser.
Test: media/video-fullscreen-reload-crash.html
Short circuit play() or pause() operations if the document is suspended or stopped.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):
2018-01-20 Youenn Fablet <youenn@apple.com>
fetch redirect is incompatible with "no-cors" mode
https://bugs.webkit.org/show_bug.cgi?id=181866
<rdar://problem/35827140>
Reviewed by Chris Dumez.
Covered by updated tests.
Return a network error when no-cors mode and redirect mode is manual or error.
Update preflight implementation to no longer use manual redirect mode to simulate https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
Instead implement redirectReceived callback to treat any redirect response as the preflight response.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::redirectReceived):
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/CrossOriginPreflightChecker.h:
2018-01-19 Wenson Hsieh <wenson_hsieh@apple.com>
[macOS] [WK2] Drag location is computed incorrectly when dragging content from subframes
https://bugs.webkit.org/show_bug.cgi?id=181896
<rdar://problem/35479043>
Reviewed by Tim Horton.
In r218837, I packaged most of the information needed to start a drag into DragItem, which is propagated to the client layer
via the startDrag codepath. However, this introduced a bug in computing the event position and drag location in window
coordinates. Consider the case where we're determining the drag image offset for a dragged element in a subframe:
Before the patch, the drag location (which starts out in the subframe's content coordinates) would be converted to root view
coordinates, which would then be converted to mainframe content coordinates, which would then be converted to window coordinates
using the mainframe's view. After the patch, we carry out the same math until the last step, where we erroneously use the
_subframe's_ view to convert to window coordinates from content coordinates. This results in the position of the iframe relative
to the mainframe being accounted for twice.
To fix this, we simply use the main frame's view to convert from mainframe content coordinates to window coordinates while
computing the drag location. As for the event position in window coordinates, this is currently unused by any codepath in WebKit,
so we can just remove it altogether.
Since this bug only affects drag and drop in the macOS WebKit2 port, there's currently no way to test this. I'll be using
<https://bugs.webkit.org/show_bug.cgi?id=181898> to track adding test support for drag and drop on macOS WebKit2. Manually tested
dragging in both WebKit1 and WebKit2 on macOS. dragLocationInWindowCoordinates isn't used at all for iOS drag and drop.
* page/DragController.cpp:
(WebCore::DragController::doSystemDrag):
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):
2018-01-19 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r227235.
The test for this change consistently times out on High
Sierra.
Reverted changeset:
"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/227235
2018-01-19 Youenn Fablet <youenn@apple.com>
Cache storage errors like Quota should trigger console messages
https://bugs.webkit.org/show_bug.cgi?id=181879
<rdar://problem/36669048>
Reviewed by Chris Dumez.
Covered by rebased test.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords):
(WebCore::DOMCache::batchDeleteOperation):
(WebCore::DOMCache::batchPutOperation):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::errorToException):
(WebCore::DOMCacheEngine::logErrorAndConvertToException):
* Modules/cache/DOMCacheEngine.h:
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::doOpen):
(WebCore::DOMCacheStorage::doRemove):
2018-01-19 Youenn Fablet <youenn@apple.com>
Do not go to the storage process when registering a service worker client if there is no service worker registered
https://bugs.webkit.org/show_bug.cgi?id=181740
<rdar://problem/36650400>
Reviewed by Chris Dumez.
Register a document as service worker client only if there is an existing service worker connection.
This allows not creating any connection if no service worker is registered.
Add internals API to test whether a service worker connection was created or not.
This is used by API tests that cover the changes.
* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange): No need to create a service worker connection if client is not registered yet.
(WebCore::Document::setServiceWorkerConnection): No need to unregister/register if service worker connection is the same.
Similarly, if Document is to be destroyed or suspended, we should not register it.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerConnection):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:
2018-01-19 Dean Jackson <dino@apple.com>
REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
https://bugs.webkit.org/show_bug.cgi?id=181817
<rdar://problem/35274055>
Add a setting for controlling whether touch listeners are passive
by default on document/window/body.
Updated existing test.
* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* page/Settings.yaml:
2018-01-19 Daniel Bates <dabates@apple.com>
Update frame-ancestor directive to match Content Security Policy Level 3
https://bugs.webkit.org/show_bug.cgi?id=178891
<rdar://problem/35209458>
Reviewed by Alex Christensen.
Derived from Blink e667cc2e501fabab3605b838e4ee0d642a9c4a59:
<https://chromium.googlesource.com/chromium/src.git/+/e667cc2e501fabab3605b838e4ee0d642a9c4a59>
Update frame-ancestor directive to match against the origin of the ancestor document per the
Content Security Policy Level 3 spec.: <https://w3c.github.io/webappsec-csp/> (15 January 2018).
Specifically this change in behavior was made to CSP 3 in <https://github.com/w3c/webappsec/issues/311>.
In earlier versions of the spec, the frame-ancestor directive matched against the URL of the
ancestor document.
Disregarding allow-same-origin sandboxed iframes, a document with policy "frame-ancestor 'self'"
will be blocked from loading in a sandboxed iframe as a result of this change.
Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow.html
http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block.html
* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):
2018-01-19 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Add timeout support to XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=181876
Reviewed by Alex Christensen
* platform/network/ResourceRequestBase.cpp:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setTimeout):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
(WebCore::ResourceError::httpError):
2018-01-19 Yoav Weiss <yoav@yoav.ws>
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657
Reviewed by Darin Adler.
Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.
Test: http/tests/preconnect/link-header-rel-preconnect-http.php
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
(WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
* loader/LinkLoader.h:
2018-01-19 Joseph Pecoraro <pecoraro@apple.com>
AppCache: Log a Deprecation warning to the Console when AppCache is used
https://bugs.webkit.org/show_bug.cgi?id=181778
Reviewed by Alex Christensen.
* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):
2018-01-19 Chris Dumez <cdumez@apple.com>
ASSERT(registration || isTerminating()) hit in SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181761
<rdar://problem/36594564>
Reviewed by Youenn Fablet.
There is a short period of time, early in the registration process where a
SWServerWorker object exists for a registration but is not in the registration's
installing/waiting/active slots yet. As a result, if a registration is cleared
during this period (for e.g. due to the user clearing all website data), that
SWServerWorker will not be terminated. We then hit assertion later on when this
worker is trying to do things (like call skipWaiting).
To address the issue, we now keep a reference this SWServerWorker on the
registration, via a new SWServerRegistration::m_preInstallationWorker data member.
When the registration is cleared, we now take care of terminating this worker.
No new tests, covered by existing tests that crash flakily in debug builds.
* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
if the mutex is locked, then the worker thread is still starting. We spin the
runloop and try to stop again later. This avoids the deadlock shown in
Bug 181763 as the worker thread may need to interact with the main thread
during startup.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::installContextData):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::install):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::~SWServerRegistration):
(WebCore::SWServerRegistration::setPreInstallationWorker):
(WebCore::SWServerRegistration::clear):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::preInstallationWorker const):
2018-01-19 Chris Dumez <cdumez@apple.com>
Service worker registrations restored from disk may not be reused when the JS calls register() again
https://bugs.webkit.org/show_bug.cgi?id=181810
<rdar://problem/36591711>
Reviewed by Youenn Fablet.
The issue was that when restoring a registration from disk, we would not set its active worker right
away. We only set it later in installContextData(). installContextData() is only called after we’ve
launched the service worker process and established a connection to it.
However, we would start processing jobs (such as registrations) before we’ve established the connection
to the service worker process. SWServerJobQueue::runRegisterJob(), in order to reuse an existing
registration checks the registration’s active worker has the right script URL. The issue was that when
this code would execute, we may not have set the registration’s active service worker yet, in which case,
we would update the existing registration instead of reusing it as-is.
To address the issue, we now delay the processing of jobs until the connection to the service worker
process has been established and we've installed all pending contexts via installContextData().
Changed is covered by new API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::scheduleJobInServer):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:
2018-01-19 James Craig <jcraig@apple.com>
AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=181281
<rdar://problem/36291776>
Reviewed by Simon Fraser.
Updated "Smart Invert" to include img and picture element inversion and tests.
Tests: accessibility/smart-invert-reference.html
accessibility/smart-invert.html
* css/html.css:
(@media (inverted-colors)):
(img:not(picture>img), picture, video):
2018-01-19 Chris Dumez <cdumez@apple.com>
The WebContent process should not process incoming IPC while waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=181560
Reviewed by Ryosuke Niwa.
Add internals API for testing purposes.
Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html
* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* testing/Internals.h:
* testing/Internals.idl:
2018-01-19 Keith Miller <keith_miller@apple.com>
HaveInternalSDK includes should be "#include?"
https://bugs.webkit.org/show_bug.cgi?id=179670
Reviewed by Dan Bernstein.
* Configurations/Base.xcconfig:
2018-01-19 Daniel Bates <dabates@apple.com>
Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.
* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willDetachRenderers):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::willDetachRenderer):
(WebCore::PluginViewBase::willDetatchRenderer): Deleted.
2018-01-19 Jonathan Bedard <jbedard@apple.com>
Unreviewed build fix, remove unused lambda captures.
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::takeAllMessagesForPort):
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
2018-01-19 Antoine Quint <graouts@apple.com>
[Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
https://bugs.webkit.org/show_bug.cgi?id=181857
<rdar://problem/36660081>
Reviewed by Dean Jackson.
We start the work to implement the rest of the Web Animations timing and animation model by exposing more properties on
AnimationEffectTiming to control delay (delay, endDelay), looping (iterationStart, iterations), fill and direction.
Additionally, we expose the getComputedTiming() method on AnimationEffect, although it currently lacks some computed
properties that will come in later patch as we implement various processes defined by the spec. We also update the
existing duration() method on AnimationEffectTiming to be called iterationDuration() to match the terms used in the
specification.
Finally, we make all new properties, and update existing ones, that expose a time value go through the new utility
function secondsToWebAnimationsAPITime() to guarantee rounded values with microseconds precision, as advised by
the Web Animations specification.
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h:
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::setIterationStart):
(WebCore::AnimationEffectTiming::setIterations):
(WebCore::AnimationEffectTiming::bindingsDuration const):
(WebCore::AnimationEffectTiming::setBindingsDuration):
(WebCore::AnimationEffectTiming::endTime const):
(WebCore::AnimationEffectTiming::activeDuration const):
* animation/AnimationEffectTiming.h:
* animation/AnimationEffectTiming.idl:
* animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
(WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::bindingsCurrentTime):
* animation/ComputedTimingProperties.h: Added.
* animation/ComputedTimingProperties.idl: Added. We set nullable double values to a default value of "null" since
otherwise setting those properties to a null value would not set the properties in the converted JS dictionary.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Handle new timing properties passed in the KeyframeEffectOptions dictionary.
(WebCore::KeyframeEffect::applyAtLocalTime):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::startOrStopAccelerated):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::bindingsCurrentTime const):
(WebCore::WebAnimation::effectEndTime const):
(WebCore::WebAnimation::timeToNextRequiredTick const):
* animation/WebAnimationUtilities.h: Added.
(WebCore::secondsToWebAnimationsAPITime):
2018-01-19 Alex Christensen <achristensen@webkit.org>
Remove dead networking code
https://bugs.webkit.org/show_bug.cgi?id=181813
Reviewed by Tim Horton.
CFURLConnection is only used on Windows.
* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData const):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):
2018-01-19 Alex Christensen <achristensen@webkit.org>
Remove unused WebViewPrivate _allowCookies
https://bugs.webkit.org/show_bug.cgi?id=181812
Reviewed by Tim Horton.
This SPI was in the original iOS upstreaming and has not been used in many years.
* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setDefaultAllowCookies): Deleted.
(WebCore::ResourceRequestBase::defaultAllowCookies): Deleted.
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::ResourceRequestBase):
2018-01-18 Brady Eidson <beidson@apple.com>
Make in-process MessagePorts be (mostly) asynchronous
https://bugs.webkit.org/show_bug.cgi?id=181454
Reviewed by Alex Christensen.
No new tests (Covered *brutally* by existing tests)
Part of making MessagePorts be a thing we can pass across processes is making them work async.
The existing "MessagePortChannel" method of abstraction was not cut out for this.
This patch gets rid of MessagePortChannel and adds a new MessagePortChannelProvider abstraction.
It then gets the new machinery working in-process (with some pieces of out-of-process in place)
One synchronous behavior this patch maintains is the hasPendingActivity() check used to support GC.
That will (creatively) be made async in the next followup.
More generally from MessagePorts, this patch also adds a "MessageWithMessagePorts" object to be used
with all forms of postMessage(). Much better.
* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* dom/InProcessMessagePortChannel.cpp: Removed.
* dom/InProcessMessagePortChannel.h: Removed.
* dom/MessagePortChannel.cpp: Removed.
* dom/MessagePortChannel.h: Removed.
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::create):
(WebCore::MessageChannel::MessageChannel):
(WebCore::m_port2): Deleted.
* dom/MessageChannel.h:
(WebCore::MessageChannel::create): Deleted.
* dom/MessagePort.cpp:
(WebCore::MessagePort::create):
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::messageAvailable):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::locallyEntangledPort const):
(WebCore::MessagePort::disentanglePorts):
(WebCore::MessagePort::entanglePorts):
(WebCore::MessagePort::entangleWithRemote): Deleted.
* dom/MessagePort.h:
* dom/MessagePortIdentifier.h:
(WebCore::MessagePortIdentifier::logString const):
* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessageWithMessagePortsSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon): Deleted.
* dom/ScriptExecutionContext.h:
Add a single object that represents two intertwined ports, tracks their pending
messages, tracks which process they're in, etc etc:
* dom/messageports/MessagePortChannel.cpp: Added.
(WebCore::MessagePortChannel::create):
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::~MessagePortChannel):
(WebCore::MessagePortChannel::includesPort):
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::closePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
* dom/messageports/MessagePortChannel.h: Added.
(WebCore::MessagePortChannel::port1 const):
(WebCore::MessagePortChannel::port2 const):
(WebCore::MessagePortChannel::logString const):
Abstraction for creating and operating on MessagePorts in a potentially cross-process way:
* dom/messageports/MessagePortChannelProvider.cpp: Added.
(WebCore::MessagePortChannelProvider::singleton):
(WebCore::MessagePortChannelProvider::setSharedProvider):
* dom/messageports/MessagePortChannelProvider.h: Added.
(WebCore::MessagePortChannelProvider::~MessagePortChannelProvider):
Adds a concrete implementation of that provider to be used in-process (e.g. WK1):
* dom/messageports/MessagePortChannelProviderImpl.cpp: Added.
(WebCore::MessagePortChannelProviderImpl::~MessagePortChannelProviderImpl):
(WebCore::MessagePortChannelProviderImpl::performActionOnAppropriateThread):
(WebCore::MessagePortChannelProviderImpl::createNewMessagePortChannel):
(WebCore::MessagePortChannelProviderImpl::entangleLocalPortInThisProcessToRemote):
(WebCore::MessagePortChannelProviderImpl::messagePortDisentangled):
(WebCore::MessagePortChannelProviderImpl::messagePortClosed):
(WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
(WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
(WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync):
* dom/messageports/MessagePortChannelProviderImpl.h: Added.
Adds a main thread object to handle the set of all MessagePortChannels that are open.
For now it lives in the WebProcess, but for out-of-process it will live in the UIProcess:
* dom/messageports/MessagePortChannelRegistry.cpp: Added.
(WebCore::MessagePortChannelRegistry::~MessagePortChannelRegistry):
(WebCore::MessagePortChannelRegistry::didCreateMessagePortChannel):
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
(WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
(WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
(WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
(WebCore::MessagePortChannelRegistry::didCloseMessagePort):
(WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): This is named against style
and weird on purpose - to call attention to how bad it is and how it's temporary.
(WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
* dom/messageports/MessagePortChannelRegistry.h: Added.
Add an object that represents a "SerializedScriptValue for the message payload and the ports
that are being transferred along with that payload". This is used in all forms of postMessage():
* dom/messageports/MessageWithMessagePorts.cpp: Added.
* dom/messageports/MessageWithMessagePorts.h: Added.
* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer):
(WebCore::PostMessageTimer::event):
(WebCore::DOMWindow::postMessage):
* platform/Logging.h:
* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):
* workers/Worker.cpp:
(WebCore::Worker::postMessage):
* workers/WorkerGlobalScopeProxy.h:
* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:
* workers/WorkerObjectProxy.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::fireMessageEvent):
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.h:
2018-01-18 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed build fix, removed unused lambda capture.
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
2018-01-18 Chris Dumez <cdumez@apple.com>
We should be able to terminate service workers that are unresponsive
https://bugs.webkit.org/show_bug.cgi?id=181563
<rdar://problem/35280031>
Reviewed by Alex Christensen.
Test: http/tests/workers/service/postmessage-after-terminating-hung-worker.html
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
Before calling WorkerThread::stop(), set a timer with the given timeout parameter.
If the worker thread has not stopped when the timer fires, forcefully exit the
service worker process. The StorageProcess will take care of relaunching the
service worker process if it exits abruptly.
(WebCore::SWContextManager::serviceWorkerFailedToTerminate):
Log error message if we failed to terminate a service worker and call exit().
(WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):
* workers/service/context/SWContextManager.h:
2018-01-18 Youenn Fablet <youenn@apple.com>
Do not go to the storage process when loading a main resource if there is no service worker registered
https://bugs.webkit.org/show_bug.cgi?id=181395
Reviewed by Chris Dumez.
No observable behavior change.
Instead of creating a connection to know whether there is a potential service worker,
Ask the service worker provider that will use the connection if needed.
Otherwise, it will use a default value provided by the UIProcess.
Tested by cleaning all service workers and checking the computed value of the default value,
then observing whether pages registering service workers work well.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
* workers/service/ServiceWorkerProvider.h:
2018-01-18 Dan Bernstein <mitz@apple.com>
[Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
https://bugs.webkit.org/show_bug.cgi?id=181803
Reviewed by Tim Horton.
* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
useful for defining settings that depend on the target macOS version.
2018-01-18 Chris Dumez <cdumez@apple.com>
Service Workers restored from persistent storage have 'redundant' state
https://bugs.webkit.org/show_bug.cgi?id=181749
<rdar://problem/36556486>
Reviewed by Youenn Fablet.
Tested by new API test.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::installContextData):
Make sure the SWServerWorker's state is set to "activated" after it is assigned to
the registrations' active slot. Otherwise, it stays in its default state (redundant).
2018-01-18 Antti Koivisto <antti@apple.com>
REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
https://bugs.webkit.org/show_bug.cgi?id=181460
<rdar://problem/36379776>
Reviewed by Ryosuke Niwa.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
Don't do the expensive security origin test if the supplied sheet base URL is null. This
is true for rules coming from the same document.
2018-01-18 Antti Koivisto <antti@apple.com>
REGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
https://bugs.webkit.org/show_bug.cgi?id=181795
<rdar://problem/36334524>
Reviewed by David Kilzer.
<noscript> disallows renderer generation outside CSS mechanisms, however we would still construct
PseudoElements for them during style resolution. These were never removed properly because the
pseudo element removal was tied to render tree teardown. Without proper removal the associated
animations were also not canceled.
Test: fast/css-generated-content/noscript-pseudo-anim-crash.html
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):
Take care to get rid of PseudoElements when the element is removed from the tree.
This also cancels any associated animations.
2018-01-18 Chris Fleizach <cfleizach@apple.com>
AX: Aria-activedescendant not supported
https://bugs.webkit.org/show_bug.cgi?id=161734
<rdar://problem/28202679>
Reviewed by Joanmarie Diggs.
When a combo-box owns/controls a list/listbox/grid/tree, the owned element needs to check the active-descendant of the combobox when
checking if it has selected children.
The target of the selection change notification should also be the owned element in these cases.
Test: accessibility/aria-combobox-controlling-list.html
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectedListItem):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):
2018-01-17 Per Arne Vollan <pvollan@apple.com>
REGRESSION (r224780): Text stroke not applied to video captions.
https://bugs.webkit.org/show_bug.cgi?id=181743
<rdar://problem/35874338>
Reviewed by Simon Fraser.
Tests: media/track/track-css-visible-stroke-expected.html
media/track/track-css-visible-stroke.html
After r224780, it is no longer possible to mix text stroke styles with webkit
legacy text stroke styles.
* css/StyleResolver.cpp:
(WebCore::isValidCueStyleProperty):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):
2018-01-18 Andy Estes <aestes@apple.com>
[Payment Request] Support a default shipping address for Apple Pay
https://bugs.webkit.org/show_bug.cgi?id=181754
<rdar://problem/36009733>
Reviewed by Brady Eidson.
Move shippingContact from ApplePayPaymentRequest to ApplePayRequestBase. This allows
merchants to specify a default shipping address when using Apple Pay with Payment Request.
This also fixes a bug found during testing where
+[NSPersonNameComponentsFormatter localizedStringFromPersonNameComponents:style:options:]
would throw an exception when passed a nil NSPersonNameComponents.
Test: http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html
* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::version const):
(WebCore::ApplePaySessionPaymentRequest::setVersion):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
* testing/MockPaymentCoordinator.h:
2018-01-18 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS] Specify -[NSURL _title] for the associated URL when copying an image element
https://bugs.webkit.org/show_bug.cgi?id=181783
<rdar://problem/35785445>
Reviewed by Ryosuke Niwa.
Always specify the -[NSURL _title] to be either the title specified in a PasteboardImage's inner PasteboardURL,
or if no title is specified, fall back to the user-visible URL string. This is because at least one internal
client always tries to use the -_title property to determine the title of a pasted URL, or if none is specified,
the -suggestedName. Since we need to set suggestedName to the preferred file name of the copied image and we
don't want the suggested name to become the title of the link, we need to explicitly set the link title.
In doing so, this patch also fixes a bug wherein we forget to set the _title of the NSURL we're registering to
an NSItemProvider.
Tests: ActionSheetTests.CopyImageElementWithHREFAndTitle (new)
ActionSheetTests.CopyImageElementWithHREF (modified)
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):
2018-01-17 Jer Noble <jer.noble@apple.com>
WebVTT served via HLS never results in cues
https://bugs.webkit.org/show_bug.cgi?id=181773
Reviewed by Eric Carlson.
Test: http/tests/media/hls/hls-webvtt-tracks.html
Three independant errors conspired to keep in-band WebVTT samples from parsing:
- The definition of ISOWebVTTCue::boxTypeName() was incorrect.
- ISOWebVTTCue::parse() didn't call it's superclass's parse() method (leading to an incorrect size and offset).
- Use String::fromUTF8() rather than String.adopt(StringVector&&).
* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::parse):
* platform/graphics/iso/ISOVTTCue.h:
(WebCore::ISOWebVTTCue::boxTypeName):
2018-01-17 John Wilander <wilander@apple.com>
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>
Reviewed by Alex Christensen.
Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
* platform/network/NetworkStorageSession.h:
Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
Fixes the FIXME.
2018-01-17 Dean Jackson <dino@apple.com>
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770
Reviewed by Eric Carlson.
Remove a very old linked-on-or-after test.
* platform/graphics/ca/GraphicsLayerCA.cpp:
2018-01-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r227098.
This broke the build.
Reverted changeset:
"Remove linked-on test for Snow Leopard"
https://bugs.webkit.org/show_bug.cgi?id=181770
https://trac.webkit.org/changeset/227098
2018-01-17 Dean Jackson <dino@apple.com>
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770
Reviewed by Eric Carlson.
Remove a very old linked-on-or-after test.
* platform/graphics/ca/GraphicsLayerCA.cpp:
2018-01-17 Stephan Szabo <stephan.szabo@sony.com>
[Curl] Use ResourceRequest::encodeWithPlatformData()
https://bugs.webkit.org/show_bug.cgi?id=181768
Reviewed by Alex Christensen.
No new tests, assertion hit in downstream port, should be covered by
existing tests.
* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData const):
(WebCore::ResourceRequest::decodeWithPlatformData):
2018-01-17 Eric Carlson <eric.carlson@apple.com>
Use existing RGB colorspace instead of creating a new one
https://bugs.webkit.org/show_bug.cgi?id=181765
<rdar://problem/36595753>
Reviewed by Dean Jackson.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Use sRGBColorSpaceRef instead
of creating a new static colorspace.
2018-01-17 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r227076.
This breaks internal builds
Reverted changeset:
"Resource Load Statistics: Block cookies for prevalent
resources without user interaction"
https://bugs.webkit.org/show_bug.cgi?id=177394
https://trac.webkit.org/changeset/227076
2018-01-17 Ryosuke Niwa <rniwa@webkit.org>
input and textarea elements should reveal selection in setSelection when focused
https://bugs.webkit.org/show_bug.cgi?id=181715
<rdar://problem/36570546>
Reviewed by Zalan Bujtas.
Made input and textarea elements reveal selection in FrameSelection::setSelection instead of by directly
invoking FrameSelection::revealSelection in their respective updateFocusAppearance to unify code paths.
Also added options to reveal selection up to the main frame to SetSelectionOption to be used in iOS.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::moveWithoutValidationTo): Takes SelectionRevealMode as an argument and converts
sets appropriate selection options.
(WebCore::FrameSelection::setSelection): Reconstruct SelectionRevealMode out of selection option sets.
(WebCore::FrameSelection::updateAndRevealSelection):
* editing/FrameSelection.h:
(WebCore::FrameSelection): Added RevealSelectionUpToMainFrame as a SelectionRevealMode and replaced
m_shouldRevealSelection by m_selectionRevealMode.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance): Pass SelectionRevealMode to HTMLTextFormControlElement's
select and restoreCachedSelection instead of directly invoking FrameSelection::revealSelection.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updateFocusAppearance): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::restoreCachedSelection):
* html/HTMLTextFormControlElement.h:
2018-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
WEBKIT_FRAMEWORK should not modify file-global include directories
https://bugs.webkit.org/show_bug.cgi?id=181656
Reviewed by Konstantin Tokarev.
* CMakeLists.txt:
* PlatformWPE.cmake:
2018-01-17 Michael Catanzaro <mcatanzaro@igalia.com>
[GTK] Try even harder not to static link WTF into libwebkit2gtk
https://bugs.webkit.org/show_bug.cgi?id=181751
Reviewed by Alex Christensen.
We don't want two copies of WTF. It should only be in libjavascriptcoregtk.
* PlatformGTK.cmake:
2018-01-17 Zalan Bujtas <zalan@apple.com>
Multicol: RenderMultiColumnFlow should not inherit the flow state
https://bugs.webkit.org/show_bug.cgi?id=181762
<rdar://problem/35448565>
Reviewed by Simon Fraser.
Do not compute the inherited flow state flag for RenderMultiColumnFlow.
It is (by definition) always inside a fragmented flow.
Test: fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFragmentedFlowState):
2018-01-17 Alex Christensen <achristensen@webkit.org>
Deprecate Application Cache
https://bugs.webkit.org/show_bug.cgi?id=181764
Reviewed by Geoffrey Garen.
* features.json:
2018-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
[iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage is failing
https://bugs.webkit.org/show_bug.cgi?id=181758
Reviewed by Tim Horton.
This test is failing because Editor::clientReplacementURLForResource expects a MIME type, but on iOS, the type
paramter passed into WebContentReader::readImage is a UTI; subsequently, the bundle editing delegate receives
a MIME type that's actually a UTI, which is incorrect. To address this, ensure that a MIME type is passed to
bundle SPI by converting the type in WebContentReader::readImage to a MIME type.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readImage):
2018-01-17 Antti Koivisto <antti@apple.com>
REGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator::evaluate const + 32
https://bugs.webkit.org/show_bug.cgi?id=181742
<rdar://problem/36334726>
Reviewed by David Kilzer.
Test: fast/media/mediaqueryevaluator-crash.html
* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
Use WeakPtr<Document> instead of a plain Frame pointer.
(WebCore::MediaQueryEvaluator::evaluate const):
Get the frame via document.
* css/MediaQueryEvaluator.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):
Take care to clear style resolver.
2018-01-17 Youenn Fablet <youenn@apple.com>
Put fetch request keepAlive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592
Reviewed by Chris Dumez.
No change of behavior.
* Modules/fetch/FetchRequest.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fetchAPIKeepAliveEnabled const):
(WebCore::RuntimeEnabledFeatures::setFetchAPIKeepAliveEnabled):
2018-01-17 Per Arne Vollan <pvollan@apple.com>
[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
https://bugs.webkit.org/show_bug.cgi?id=181686
Reviewed by Alex Christensen.
No new tests, covered by existing tests.
A switch will make the function easier on the eyes. Also, use the function in places where the ResourceRequestCachePolicy
is just casted to a platform cache policy.
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy):
2018-01-17 John Wilander <wilander@apple.com>
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>
Reviewed by Alex Christensen.
Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html
* platform/network/NetworkStorageSession.h:
Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
Fixes the FIXME.
2018-01-17 Daniel Bates <dabates@apple.com>
REGRESSION (r222795): Cardiogram never signs in
https://bugs.webkit.org/show_bug.cgi?id=181693
<rdar://problem/36286293>
Reviewed by Ryosuke Niwa.
Exempt Cardiogram from the XHR header restrictions in r222795.
Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Cardiogram also depends on such functionality.
Test: fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html
* page/Settings.yaml:
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isCardiogram):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):
2018-01-17 Daniel Bates <dabates@apple.com>
ASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
https://bugs.webkit.org/show_bug.cgi?id=181746
<rdar://problem/36586248>
Reviewed by Chris Dumez.
Call PingHandle::pingLoadComplete() with an error when NSURLConnection queries
whether the ping is able to respond to an authentication request. (Pings do not
respond to authenticate requests.) It will call the completion handler, nullify
the completion handler, and deallocate the PingHandle. Nullifying the completion
handler is necessary to avoid the assertion failure in ~PingHandle().
Test: http/tests/misc/before-unload-load-image.html
* platform/network/PingHandle.h:
2018-01-17 Daniel Bates <dabates@apple.com>
WebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWithOperationQueue may
be deleted in main thread callback
https://bugs.webkit.org/show_bug.cgi?id=181747
<rdar://problem/36588120>
Reviewed by Alex Christensen.
Retain the delegate (e.g. WebCoreResourceHandleAsOperationQueueDelegate) before scheduling
a main thread callback and blocking on a semaphore for its reply because the main thread
callback can do anything, including deleting the delegate, before the non-main thread
has a chance to execute. For instance, a PingHandle will delete itself (and hence delete
its resource handle delegate) in most of the code paths invoked by the delegate.
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
2018-01-17 Chris Dumez <cdumez@apple.com>
'fetch' event may be sent to a service worker before its state is set to 'activated'
https://bugs.webkit.org/show_bug.cgi?id=181698
<rdar://problem/36554856>
Reviewed by Youenn Fablet.
'fetch' event may be sent to a service worker before its state is set to 'activated'.
When the registration's active worker needs to intercept a load, and its state is 'activating',
we queue the request to send the fetch event in SWServerWorker::m_whenActivatedHandlers.
Once the SWServerWorker::setState() is called with 'activated' state, we then call the
handlers in m_whenActivatedHandlers to make send the fetch event now that the worker is
activated. The issue is that even though the worker is activated and its state was set to
'activated' on Storage process side, we had not yet notified the ServiceWorker process
of the service worker's new state yet.
To address the issue, we now make sure that SWServerWorker::m_whenActivatedHandlers are
called *after* we've sent the IPC to the ServiceWorker process to update the worker's
state to 'activated'. Also, we now call ServiceWorkerFetch::dispatchFetchEvent()
asynchronously in a postTask() as the service worker's state is also updated asynchronously
in a postTask. This is as per specification [1], which says to "queue a task" to fire
the fetch event.
[1] https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
No new tests, covered by imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
which hits the new assertion without the fix.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
Add assertions to make sure that we dispatch the fetch event on the right worker and
that the worker is in 'activated' state.
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postFetchTask):
Queue a task to fire the fetch event as per:
- https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
We need to match the specification exactly here or things will happen in the wrong
order. In particular, things like "update registration state" and "update worker state"
might happen *after* firing the fetch event, even though the IPC for "update registration/worker
state" was sent before the "fire fetch event" one, because the code for updating a registration/
worker state already queues a task, as per the specification.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateWorkerState):
* workers/service/server/SWServerRegistration.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
Move code to send the IPC to the Service Worker process whenever the service worker's state
needs to be updated from SWServerRegistration::updateWorkerState() to SWServerWorker::setState().
This way, we can make sure the IPC is sent *before* we call the m_whenActivatedHandlers handlers,
as they may also send IPC to the Service Worker process, and we need to make sure this IPC happens
after so that the service worker is in the right state.
2018-01-17 Stephan Szabo <stephan.szabo@sony.com>
Page.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE(VIDEO) is off
https://bugs.webkit.org/show_bug.cgi?id=181713
Reviewed by Darin Adler.
No new tests (build fix).
* page/Page.cpp: Add include for ApplicationStateChangeListener
2018-01-17 Wenson Hsieh <wenson_hsieh@apple.com>
Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
https://bugs.webkit.org/show_bug.cgi?id=181637
<rdar://problem/36508471>
Reviewed by Tim Horton.
Before carrying out blob URL conversion for pasted or dropped rich content, let the editor client replace
subresource URLs in WebKit2 by calling out to new injected bundle SPI. See comments below for more detail.
Tests: WKAttachmentTests.InjectedBundleReplaceURLsWhenPastingAttributedString
WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage
* editing/Editor.cpp:
(WebCore::Editor::clientReplacementURLForResource):
* editing/Editor.h:
Add a new helper to call out to the editor client for a URL string to replace a given ArchiveResource. In
WebKit2, this calls out to the injected bundle's new `replacementURLForResource` SPI hook.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldReplaceSubresourceURL):
(WebCore::replaceRichContentWithAttachments):
(WebCore::replaceSubresourceURLsWithURLsFromClient):
Add a new static helper to replace subresource URLs in the given DocumentFragment with URLs supplied by the
editor client. Additionally builds a list of ArchiveResources that have not been replaced, for use at call sites
so that we don't unnecessarily create more Blobs for ArchiveResources that have already been replaced.
(WebCore::createFragmentAndAddResources):
(WebCore::sanitizeMarkupWithArchive):
Tweak web content reading codepaths to first replace subresource URLs with editor-client-supplied URLs.
(WebCore::WebContentReader::readImage):
(WebCore::shouldConvertToBlob): Deleted.
Rename this helper to shouldReplaceSubresourceURL, blob URL replacement is no longer the only scenario in which
we replace resource URLs, but in both cases, we still want to ignore `http:`-family and `data:` URLs.
* loader/EmptyClients.cpp:
* page/EditorClient.h:
2018-01-17 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey decryptor
https://bugs.webkit.org/show_bug.cgi?id=180080
Reviewed by Xabier Rodriguez-Calvar.
Currently the GStreamer clearKey decryptor doesn't support the full-sample encryption,
where the buffer is entirely encrypted, it supports only the sub-sample encryption.
Test: media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt):
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
Unreviewed follow-up to r227051.
* platform/graphics/cairo/CairoOperations.h: Fix declaration of the
fillRoundedRect() function by removing the bool parameter that's not
used at all in the definition. This went unspotted due to the unified
source build including the implementation file before fillRoundedRect()
usage in GrapihcsContextCairo.cpp, leaving the declaration undefined
and instead using the definition directly.
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
https://bugs.webkit.org/show_bug.cgi?id=181725
Reviewed by Carlos Garcia Campos.
Don't duplicate global alpha and image interpolation quality state
values on the PlatformContextCairo. Instead, retrieve them from
the managing GraphicsContextState when necessary.
For Cairo operations, the FillSource and StrokeSource containers now
store the global alpha value, using it during the operation executions.
For drawNativeImage(), the global alpha and interpolation quality values
are passed through arguments.
In PlatformContextCairo, the two values are no longer stored on the
internally-managed stack, and the getter-setter pairs for the two values
are removed. In drawSurfaceToContext(), the two values are now expected
to be passed through the method arguments.
No new tests -- no change in behavior.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setGlobalAlpha): Deleted.
(WebCore::Cairo::State::setImageInterpolationQuality): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::setPlatformAlpha):
(WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::save):
(WebCore::PlatformContextCairo::drawSurfaceToContext):
(WebCore::PlatformContextCairo::State::State): Deleted.
(WebCore::PlatformContextCairo::setImageInterpolationQuality): Deleted.
(WebCore::PlatformContextCairo::imageInterpolationQuality const): Deleted.
(WebCore::PlatformContextCairo::globalAlpha const): Deleted.
(WebCore::PlatformContextCairo::setGlobalAlpha): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-01-17 Philippe Normand <pnormand@igalia.com>
REGRESSION(r226973/r226974): Four multimedia tests failing
https://bugs.webkit.org/show_bug.cgi?id=181696
Reviewed by Carlos Garcia Campos.
This patch reverts some of the changes of the above revisions so as to fix layout test failures.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Properly
prepare stalled event when an error was detected.
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Revert to previous version.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
Emit progress event also when streaming but not when an error was
detected.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const): use isLiveStream like everywhere else.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Revert to keep-alive FALSE by default.
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Move prepareForFilling(), prepareForStroking() code to CairoOperations
https://bugs.webkit.org/show_bug.cgi?id=181721
Reviewed by Carlos Garcia Campos.
Move the prepareForFilling() and prepareForStroking() code off of the
PlatformContextCairo class and into static functions inside the
CairoOperations implementation files. The original methods weren't
called from any place other than the Cairo operations, and they only
operated with the cairo_t object that's stored in and retrievable from
the PlatformContextCairo object.
No new tests -- no change in behavior.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::reduceSourceByAlpha):
(WebCore::Cairo::prepareCairoContextSource):
(WebCore::Cairo::clipForPatternFilling):
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::reduceSourceByAlpha): Deleted.
(WebCore::prepareCairoContextSource): Deleted.
(WebCore::PlatformContextCairo::prepareForFilling): Deleted.
(WebCore::PlatformContextCairo::prepareForStroking): Deleted.
(WebCore::PlatformContextCairo::clipForPatternFilling): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use one-time ShadowBlur objects when performing shadowing
https://bugs.webkit.org/show_bug.cgi?id=181720
Reviewed by Carlos Garcia Campos.
Don't maintain a ShadowBlur object in the PlatformContextCairo class.
Instead, use temporary ShadowBlur objects whenever shadowing is needed,
providing all the shadow state information to it and drawing shadow into
the given GraphicsContext object.
ShadowBlur constructors are cleaned up. The 'shadows ignored' argument
can now also be provided to the variant that accepts explicit shadow
attributes, but the argument is false by default.
In CairoOperations, the ShadowBlurUsage functionality is rolled into the
new ShadowState class. ShadowState parameter is now used for operations
that might need to perform shadow painting. Call sites are modified
accordingly.
Cairo::State::setShadowValues() and Cairo::State::clearShadow() are
removed, since the ShadowBlur object that was modified through those is
being removed from the PlatformContextCairo class. We still have to flip
the Y-axis of the shadow offset in GraphicsContext::setPlatformShadow()
when shadows are ignoring transformations.
No new tests -- no change in behavior.
* platform/graphics/ShadowBlur.cpp:
(WebCore::ShadowBlur::ShadowBlur):
* platform/graphics/ShadowBlur.h:
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowState::ShadowState):
(WebCore::Cairo::ShadowState::isVisible const):
(WebCore::Cairo::ShadowState::isRequired const):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRoundedRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setShadowValues): Deleted.
(WebCore::Cairo::State::clearShadow): Deleted.
(WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage): Deleted.
(WebCore::Cairo::ShadowBlurUsage::required const): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::restorePlatformState):
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::setPlatformShadow):
(WebCore::GraphicsContext::clearPlatformShadow):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::platformFillRoundedRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::drawSurfaceToContext):
* platform/graphics/cairo/PlatformContextCairo.h:
(WebCore::PlatformContextCairo::shadowBlur): Deleted.
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):
2018-01-17 Zan Dobersek <zdobersek@igalia.com>
CanvasImageData: createImageData() parameter should not be nullable
https://bugs.webkit.org/show_bug.cgi?id=181670
Reviewed by Sam Weinig.
createImageData() method on the CanvasImageData interface should not
treat the ImageData parameter as nullable, but should instead reject any
null values with a TypeError, as demanded by the specification.
No new tests -- current tests covering createImageData(null) are updated
to properly cover new behavior of throwing a TypeError exception.
* html/canvas/CanvasImageData.idl:
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createImageData const):
* html/canvas/CanvasRenderingContext2DBase.h:
2018-01-16 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake] Remove WebCoreDerivedSources library target
https://bugs.webkit.org/show_bug.cgi?id=181664
Reviewed by Carlos Garcia Campos.
After unified source build has been introduced, CMake Visual
Studio build suffers complicated unnecessary recompilation issues
because Visual Studio invokes scripts twice in both WebCore and
WebCoreDerivedSources projects (Bug 181117).
WebCoreDerivedSources library has been introduced in r198766 to
avoid command line length limit of CMake Ninja build on macOS.
Fortunately, unified source build has reduced the number of source
files to compile, WebCore doesn't need to be split anymore.
No new tests (No behavior change)
* CMakeLists.txt: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES. Removed WebCoreDerivedSources library target.
Do not compile each JavaScript Builtins.cpp files because the unified source WebCoreJSBuiltins.cpp is already included.
* PlatformGTK.cmake: Replaced WebCore_DERIVED_SOURCES with WebCore_SOURCES.
* PlatformWin.cmake: Ditto.
2018-01-16 Simon Fraser <simon.fraser@apple.com>
Can't scroll iframe after toggling it to display:none and back
https://bugs.webkit.org/show_bug.cgi?id=181708
rdar://problem/13234778
Reviewed by Tim Horton.
Nothing updated the FrameView's set of scrollable areas when a subframe came back from display:none.
Mirror the existing virtual removeChild() by making addChild() virtual, and using it to mark
the FrameView's scrollable area set as dirty.
Test: tiled-drawing/scrolling/non-fast-region/non-fast-scrollable-region-hide-show-iframe.html
* page/FrameView.cpp:
(WebCore::FrameView::addChild):
* page/FrameView.h:
* platform/ScrollView.h:
2018-01-16 Chris Dumez <cdumez@apple.com>
SWServerWorker::m_contextConnectionIdentifier may get out of date
https://bugs.webkit.org/show_bug.cgi?id=181687
<rdar://problem/36548111>
Reviewed by Brady Eidson.
SWServerWorker::m_contextConnectionIdentifier may get out of date. This happens when the
context process crashes and is relaunched.
No new tests, added assertion in terminateWorkerInternal() that hits without this fix.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::terminateWorkerInternal):
(WebCore::SWServer::unregisterServiceWorkerClient):
* workers/service/server/SWServerWorker.h:
(WebCore::SWServerWorker::setContextConnectionIdentifier):
2018-01-16 Jer Noble <jer.noble@apple.com>
Reset MediaSourcePrivateAVFObjC's m_sourceBufferWithSelectedVideo when the underlying SourceBufferPrivate is removed.
https://bugs.webkit.org/show_bug.cgi?id=181707
<rdar://problem/34809474>
Reviewed by Eric Carlson.
Test: media/media-source/media-source-remove-unload-crash.html
* platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm:
(WebCore::MediaSourcePrivateAVFObjC::removeSourceBuffer):
2018-01-12 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Implement dummy WebAuthN IDLs
https://bugs.webkit.org/show_bug.cgi?id=181627
<rdar://problem/36459864>
Reviewed by Alex Christensen.
This patch implements dummy WebAuthN IDLs and connect them with Credential Management as well.
All implementations in this patch are subject to change when real implementations land. The
purpose here on the other hand is to have IDLs, bindings and implementations connected. This
patch should handle all IDLs that we need.
No tests.
* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.cpp.
(WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
(WebCore::AuthenticatorAssertionResponse::~AuthenticatorAssertionResponse):
(WebCore::AuthenticatorAssertionResponse::authenticatorData):
(WebCore::AuthenticatorAssertionResponse::signature):
(WebCore::AuthenticatorAssertionResponse::userHandle):
* Modules/webauthn/AuthenticatorAssertionResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorAssertionResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/AuthenticatorAttestationResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
(WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::~AuthenticatorAttestationResponse):
(WebCore::AuthenticatorAttestationResponse::attestationObject):
* Modules/webauthn/AuthenticatorAttestationResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorAttestationResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/AuthenticatorResponse.cpp: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
(WebCore::AuthenticatorResponse::AuthenticatorResponse):
(WebCore::AuthenticatorResponse::~AuthenticatorResponse):
(WebCore::AuthenticatorResponse::clientDataJSON):
* Modules/webauthn/AuthenticatorResponse.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/AuthenticatorResponse.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredential.cpp:
(WebCore::PublicKeyCredential::rawId):
(WebCore::PublicKeyCredential::response):
(WebCore::PublicKeyCredential::getClientExtensionResults):
(WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl: Added.
* Modules/webauthn/PublicKeyCredentialDescriptor.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
* Modules/webauthn/PublicKeyCredentialDescriptor.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredentialRequestOptions.h: Copied from Source/WebCore/Modules/credentialmanagement/CredentialCreationOptions.h.
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl: Copied from Source/WebCore/Modules/credentialmanagement/CredentialRequestOptions.h.
* Modules/webauthn/PublicKeyCredentialType.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Modules/webauthn/PublicKeyCredentialType.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredential.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
2018-01-16 Zalan Bujtas <zalan@apple.com>
AX: Do not trigger layout in updateBackingStore() unless it is safe to do so
https://bugs.webkit.org/show_bug.cgi?id=181703
<rdar://problem/36365706>
Reviewed by Ryosuke Niwa.
Document::isSafeToUpdateStyleOrLayout() can tell whether it is safe to run layout.
Unable to create test with WebInspector involved.
* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::updateBackingStore):
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayout):
(WebCore::isSafeToUpdateStyleOrLayout): Deleted.
* dom/Document.h:
2018-01-16 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r226962.
The LayoutTest added with this change is a flaky timeout.
Reverted changeset:
"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/226962
2018-01-16 Simon Fraser <simon.fraser@apple.com>
Text looks bad on some CSS spec pages
https://bugs.webkit.org/show_bug.cgi?id=181700
rdar://problem/36552107
Reviewed by Tim Horton.
When making new tiles in a TileController, we failed to set their "supports antialiased layer text"
setting, so tile caches could end up with a mixture of layers that do and do not support
antialiased layer text.
No tests because the tiled drawing tests don't dump out tiles inside of tile caches.
* platform/graphics/ca/TileController.cpp:
(WebCore::TileController::createTileLayer):
2018-01-16 Said Abou-Hallawa <sabouhallawa@apple.com>
REGRESSION(r221292): svg/animations/animateTransform-pattern-transform.html crashes with security assertion
https://bugs.webkit.org/show_bug.cgi?id=179986
Reviewed by Simon Fraser.
This patch reverts all or parts of the following changes-sets
<http://trac.webkit.org/changeset/221292>
<http://trac.webkit.org/changeset/197967>
<http://trac.webkit.org/changeset/196670>
A JS statement like this:
var item = text.x.animVal.getItem(0);
Creates the following C++ objects:
SVGAnimatedListPropertyTearOff<SVGLengthListValues> for 'text.x'
SVGListPropertyTearOff<SVGLengthListValues> for 'text.x.animVal'
SVGPropertyTearOff<SVGLengthValue> for 'text.x.animVal.getItem(0)'
If 'item' changes, the attribute 'x' of the element '<text>' will change
as well. But this binding works only in one direction. If the attribute
'x' of the element '<text>' changes, e.g.:
text.setAttribute('x', '10,20,30');
This will detach 'item' from the element <text> and any further changes
in 'item' won't affect the attribute 'x' of element <text>.
The one direction binding can only work if this chain of tear-off objects
is kept connected. This is implemented by RefCounted back pointers from
SVGPropertyTearOff and SVGListPropertyTearOff to SVGAnimatedListPropertyTearOff.
The security crashes and the memory leaks are happening because of the
raw forward pointers:
-- SVGAnimatedListPropertyTearOff maintains raw pointers of type
SVGListPropertyTearOff for m_baseVal and m_animVal
-- The m_wrappers and m_animatedWrappers of SVGAnimatedListPropertyTearOff
are vectors of raw pointer Vector<SVGLength*>
To control the life cycle of the raw pointers, SVGListPropertyTearOff and
SVGPropertyTearOff call SVGAnimatedListPropertyTearOff::propertyWillBeDeleted()
to notify it they are going to be deleted. In propertyWillBeDeleted(), we
clear the pointers so they are not used after being freed. This mechanism
has been error-prone and we've never got it 100% right.
The solution we need to adopt with SVG tear-off objects is the following:
-- All the forward pointers should be weak pointers.
-- All the back pointers should be ref pointers.
This solution may not look intuitive but it solves the bugs and keeps the
one direction binding. The forward weak pointers allows the tear-off
objects to go aways if no reference from JS exists. The back ref pointers
maintains the chain of objects and guarantees the correct binding.
* svg/SVGPathSegList.h:
* svg/SVGTransformList.h:
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::baseVal):
(WebCore::SVGAnimatedListPropertyTearOff::animVal):
* svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
* svg/properties/SVGAnimatedProperty.h:
(WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
(WebCore::SVGAnimatedProperty::propertyWillBeDeleted): Deleted.
* svg/properties/SVGAnimatedPropertyTearOff.h:
* svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
* svg/properties/SVGListProperty.h:
(WebCore::SVGListProperty::initializeValuesAndWrappers):
(WebCore::SVGListProperty::getItemValuesAndWrappers):
(WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
(WebCore::SVGListProperty::replaceItemValuesAndWrappers):
(WebCore::SVGListProperty::removeItemValuesAndWrappers):
(WebCore::SVGListProperty::appendItemValuesAndWrappers):
(WebCore::SVGListProperty::createWeakPtr const):
* svg/properties/SVGListPropertyTearOff.h:
(WebCore::SVGListPropertyTearOff::removeItemFromList):
(WebCore::SVGListPropertyTearOff::~SVGListPropertyTearOff): Deleted.
* svg/properties/SVGPropertyTearOff.h:
(WebCore::SVGPropertyTearOff::createWeakPtr const):
(WebCore::SVGPropertyTearOff::~SVGPropertyTearOff):
2018-01-16 Eric Carlson <eric.carlson@apple.com>
AVSampleBufferDisplayLayer should be flushed when application activates
https://bugs.webkit.org/show_bug.cgi?id=181623
<rdar://problem/36487738>
Reviewed by Darin Adler.
No new tests, I wasn't able to reproduce it in a test.
* WebCore.xcodeproj/project.pbxproj:
* dom/Document.cpp:
(WebCore::Document::addApplicationStateChangeListener): New.
(WebCore::Document::removeApplicationStateChangeListener): Ditto.
(WebCore::Document::forEachApplicationStateChangeListener): Ditto.
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::registerWithDocument): Register for application state changes.
(WebCore::HTMLMediaElement::unregisterWithDocument): Unregister.
(WebCore::HTMLMediaElement::applicationWillResignActive): Pass through to the player.
(WebCore::HTMLMediaElement::applicationDidBecomeActive): Ditto.
* html/HTMLMediaElement.h:
* page/ApplicationStateChangeListener.h: Added.
(WebCore::ApplicationStateChangeListener::applicationWillResignActive):
(WebCore::ApplicationStateChangeListener::applicationDidBecomeActive):
* page/Page.cpp:
(WebCore::Page::forEachDocument):
(WebCore::Page::applicationWillResignActive):
(WebCore::Page::applicationDidEnterBackground):
(WebCore::Page::applicationWillEnterForeground):
(WebCore::Page::applicationDidBecomeActive):
* page/Page.h:
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::applicationWillResignActive):
(WebCore::MediaPlayer::applicationDidBecomeActive):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::applicationWillResignActive):
(WebCore::MediaPlayerPrivateInterface::applicationDidBecomeActive):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::MediaPlayerPrivateMediaStreamAVFObjC): Switch
to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::~MediaPlayerPrivateMediaStreamAVFObjC): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueCorrectedVideoSample): Split out of enqueueVideoSample.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): Move code that updates
the display later to enqueueCorrectedVideoSample. Rearrange logic to the image painter sample
buffer has the correct timestamp.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerErrorDidChange): Switch to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::layerStatusDidChange): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::applicationDidBecomeActive): f the display
layer is in the "failed" state, flush the renderer and update the display mode.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): Switch to release logging.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::load): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::cancelLoad): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::prepareToPlay): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::pause): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setVolume): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::setMuted): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateReadyState) Ditto.:
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::logChannel const): Ditto.
(WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateSampleTimes): Deleted.
2018-01-16 Michael Catanzaro <mcatanzaro@igalia.com>
PAL should link to JavaScriptCore rather than WTF
https://bugs.webkit.org/show_bug.cgi?id=181683
Reviewed by Konstantin Tokarev.
Do not link directly to JavaScriptCore. Get it via PAL.
* CMakeLists.txt:
2018-01-16 Zach Li <zachli@apple.com>
Add pop-up policy support in website policies.
https://bugs.webkit.org/show_bug.cgi?id=181544.
rdar://problem/30521400.
Reviewed by Alex Christensen.
* loader/DocumentLoader.h:
Introduce pop-up policy getter and setter. Initialize
the policy as Default.
(WebCore::DocumentLoader::popUpPolicy const):
(WebCore::DocumentLoader::setPopUpPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
Pop-up policy specified on a per-page basis holds
precedence over the global policy. If no pop-up policy
is specified during navigation, global policy is used.
2018-01-16 Jer Noble <jer.noble@apple.com>
Crash playing audio-only HLS stream via hls.js (MSE)
https://bugs.webkit.org/show_bug.cgi?id=181691
<rdar://problem/32967295>
Reviewed by Eric Carlson.
Add a weak-link check to the block called by -[AVSampleBufferDisplayLayer requestMediaDataWhenReadyOnQueue:usingBlock:].
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled):
(WebCore::SourceBufferPrivateAVFObjC::notifyClientWhenReadyForMoreSamples):
(WebCore::SourceBufferPrivateAVFObjC::setVideoLayer):
2018-01-16 Simon Fraser <simon.fraser@apple.com>
Rename applyHorizontalScale/applyVerticalScale in SVG filters, and related cleanup
https://bugs.webkit.org/show_bug.cgi?id=181684
Reviewed by Alex Christensen.
Rename the confusing applyHorizontalScale/applyVerticalScale to scaledByFilterResolution(),
and have it take and return a FloatSize. Change callers to do math in terms of FloatSizes.
Add inflate(size) to each of the rect classes.
* platform/graphics/FloatRect.h:
(WebCore::FloatRect::inflate):
* platform/graphics/IntRect.h:
(WebCore::IntRect::inflate):
* platform/graphics/LayoutRect.h:
(WebCore::LayoutRect::inflate):
* platform/graphics/filters/FEDisplacementMap.cpp:
(WebCore::FEDisplacementMap::platformApplySoftware):
* platform/graphics/filters/FEDropShadow.cpp:
(WebCore::FEDropShadow::determineAbsolutePaintRect):
(WebCore::FEDropShadow::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.cpp:
(WebCore::FEGaussianBlur::calculateUnscaledKernelSize):
(WebCore::FEGaussianBlur::calculateKernelSize):
(WebCore::FEGaussianBlur::determineAbsolutePaintRect):
(WebCore::FEGaussianBlur::platformApplySoftware):
* platform/graphics/filters/FEGaussianBlur.h:
* platform/graphics/filters/FEMorphology.cpp:
(WebCore::FEMorphology::determineAbsolutePaintRect):
(WebCore::FEMorphology::platformApplySoftware):
* platform/graphics/filters/FEOffset.cpp:
(WebCore::FEOffset::determineAbsolutePaintRect):
(WebCore::FEOffset::platformApplySoftware):
* platform/graphics/filters/Filter.h:
(WebCore::Filter::setSourceImage):
(WebCore::Filter::scaledByFilterResolution const):
(WebCore::Filter::applyHorizontalScale const): Deleted.
(WebCore::Filter::applyVerticalScale const): Deleted.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::outsetSizeForBlur):
* rendering/FilterEffectRenderer.h:
* svg/graphics/filters/SVGFilter.cpp:
(WebCore::SVGFilter::scaledByFilterResolution const):
(WebCore::SVGFilter::applyHorizontalScale const): Deleted.
(WebCore::SVGFilter::applyVerticalScale const): Deleted.
* svg/graphics/filters/SVGFilter.h:
2018-01-16 Fujii Hironori <Hironori.Fujii@sony.com>
[CMake][Mac] Fix the build errors
https://bugs.webkit.org/show_bug.cgi?id=181665
Reviewed by Alex Christensen.
No new tests (No behavior change)
* CMakeLists.txt: Added Modules/paymentrequest/MerchantValidationEvent.idl to compile.
* PlatformMac.cmake: Added Modules/paymentrequest/MerchantValidationEvent.cpp to compile.
Added workers/service/context and Modules/applicationmanifest as forwarding header paths.
2018-01-16 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Provide the `src` of an attachment to the UI delegate when an attachment is inserted
https://bugs.webkit.org/show_bug.cgi?id=181638
<rdar://problem/36508702>
Reviewed by Dan Bernstein.
Adjust the `didInsertAttachment` codepath to additionally propagate the attachment element's `src`.
Additionally, fix an issue with insertion and removal client notifications wherein the client can receive
insertion calls without corresponding removal calls, or vice versa. This is an existing issue, but matters more
now because we actually need to access the attachment element for its `src` when propagating changes to the
client. See below for details.
Test: WKAttachmentTests.AttachmentUpdatesWhenInsertingRichMarkup
* dom/Document.h:
(WebCore::Document::attachmentElementsByIdentifier const):
* editing/Editor.cpp:
(WebCore::Editor::notifyClientOfAttachmentUpdates):
* page/EditorClient.h:
(WebCore::EditorClient::didInsertAttachment):
* page/Frame.cpp:
(WebCore::Frame::setDocument):
When a Frame's document changes, inform the client that the attachments in the previous document are going away.
For each attachment currently connected to the document, we have either (1) already informed the client that it
was inserted, or (2) the attachment is pending an insertion call to the client. If (1) is the case, then we'll
tell the client that the attachment is removed, which will balance out the earlier insertion call. If (2) is the
case, then we'll remove the previously inserted attachment identifier from the set of attachment identifiers
pending insertion, and the client won't be informed of insertions or removals.
2018-01-16 Antoine Quint <graouts@apple.com>
Use traits for animation timing functions
https://bugs.webkit.org/show_bug.cgi?id=181651
Reviewed by Dean Jackson.
Cleaning up Dean's previous patch as suggested by Darin's post-commit review comments. The
downcast function can match const automatically and it's a better style to put the * inside
the downcast call rather than outside.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::toCAMediaTimingFunction):
2018-01-16 Philippe Normand <pnormand@igalia.com>
[GStreamer] Live streaming cleanups
https://bugs.webkit.org/show_bug.cgi?id=181672
Reviewed by Michael Catanzaro.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Switch to
streaming code path when no content-length was reported by the
http source element.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const): Return early when streaming.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::responseReceived): Emit headers as
an element message, like souphttpsrc.
2018-01-15 Philippe Normand <pnormand@igalia.com>
[GStreamer] misc fixes and cleanups
https://bugs.webkit.org/show_bug.cgi?id=181647
Reviewed by Michael Catanzaro.
* platform/graphics/MediaPlayer.cpp:
(WebCore::convertEnumerationToString): New utility function to convert preload enum to string.
* platform/graphics/MediaPlayerEnums.h: Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::load): Debug tweak
(WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): Ditto
(WebCore::MediaPlayerPrivateGStreamer::play): Ditto
(WebCore::MediaPlayerPrivateGStreamer::paused const): Ditto
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Prevent useless state update.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Debug tweak.
(WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
Remove useless handlesSyncMessage method.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Prevent useless state update.
(WebCore::MediaPlayerPrivateGStreamerBase::muted const): Debug tweak.
(WebCore::MediaPlayerPrivateGStreamerBase::setStreamVolumeElement): Ditto.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Enable keepAlive by default like in souphttpsrc.
(webKitWebSrcStart): Debug tweak.
(webKitWebSrcQueryWithParent): Ditto.
(webKitWebSrcNeedData): Ditto.
(CachedResourceStreamingClient::responseReceived): Change appsrc
stream-type when we wan't seek. Also update caps like souphttpsrc
does.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: Add forward declaration of MediaPlayer.
* platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:
(WebCore::MediaSourceClientGStreamerMSE::append): Fix compilation warning.
2018-01-16 Yacine Bandou <yacine.bandou_ext@softathome.com>
[WPE] Two clearkey tests failing since r226621
https://bugs.webkit.org/show_bug.cgi?id=181532
Reviewed by Xabier Rodriguez-Calvar.
Whith a fake initData, we can have a pssh size nul, thus we should check it.
We saw this issue in the subtest "initData longer than 64Kb characters" in
the clearkey-generate-request-disallowed-input layout test.
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::extractKeyidsLocationFromCencInitData):
2018-01-15 Yoav Weiss <yoav@yoav.ws>
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657
Reviewed by Darin Adler.
Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.
Test: http/tests/preconnect/link-header-rel-preconnect-http.php
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnect.
(WebCore::LinkLoader::preconnect): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::preload): Renamed `preloadIfNeeded` to `preload`.
(WebCore::LinkLoader::loadLink): Call preconnect.
* loader/LinkLoader.h:
2018-01-15 Michael Catanzaro <mcatanzaro@igalia.com>
Improve use of ExportMacros
https://bugs.webkit.org/show_bug.cgi?id=181652
Reviewed by Konstantin Tokarev.
Remove a comment.
* platform/PlatformExportMacros.h:
2018-01-15 Konstantin Tokarev <annulen@yandex.ru>
image-rendering should affect scaling of border-image
https://bugs.webkit.org/show_bug.cgi?id=169440
Reviewed by Michael Catanzaro.
Test: fast/borders/border-image-pixelated.html
* rendering/style/NinePieceImage.cpp:
(WebCore::NinePieceImage::paint):
2018-01-15 Tomas Popela <tpopela@redhat.com>
2.19.3 ACCELERATED_2D_CANVAS support is broken
https://bugs.webkit.org/show_bug.cgi?id=180799
Reviewed by Michael Catanzaro.
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::didDraw):
2018-01-15 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Enable HTTP/2
https://bugs.webkit.org/show_bug.cgi?id=181551
Reviewed by Michael Catanzaro.
Start supporting HTTP/2 protocol. The first step is just enabling the HTTP/2 on Curl backend.
Next step will be to enable multiplexing feature.
No new tests because we don't have HTTP/2 test backend yet.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlContext::isHttp2Enabled const):
(WebCore::CurlHandle::enableHttp):
(WebCore::CurlHandle::enableHttpGetRequest):
(WebCore::CurlHandle::enableHttpHeadRequest):
(WebCore::CurlHandle::enableHttpPostRequest):
(WebCore::CurlHandle::enableHttpPutRequest):
(WebCore::CurlHandle::setHttpCustomRequest):
* platform/network/curl/CurlContext.h:
2018-01-15 Dean Jackson <dino@apple.com>
Use a helper function for checked arithmetic in WebGL validation
https://bugs.webkit.org/show_bug.cgi?id=181620
<rdar://problem/36485879>
Reviewed by Eric Carlson.
Eric recommended using a templated helper function to do
a common arithmetic check in WebGL validation.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::validateDrawArrays):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
2018-01-15 Dean Jackson <dino@apple.com>
Use traits for animation timing functions
https://bugs.webkit.org/show_bug.cgi?id=181651
<rdar://problem/36525328>
Reviewed by Antoine Quint.
Use the type traits for TimingFunction classes, so
we can is<> and downcast<>.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationHasStepsTimingFunction):
(WebCore::animationHasFramesTimingFunction):
* platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm:
(WebCore::toCAMediaTimingFunction):
2018-01-15 Youenn Fablet <youenn@apple.com>
RealtimeMediaSource should be ThreadSafeRefCounted
https://bugs.webkit.org/show_bug.cgi?id=181649
Reviewed by Eric Carlson.
Difficult to write a test as this is really racy.
RealtimeIncomingVideoSourceCocoa::OnFrame is taking a reference on a background thread
to send a task to the main thread.
This requires it to be thread safe ref counted.
* platform/mediastream/RealtimeMediaSource.h:
2018-01-15 Philippe Normand <pnormand@igalia.com>
Prevent useless MediaPlayer mute state notifications
https://bugs.webkit.org/show_bug.cgi?id=181646
Reviewed by Carlos Garcia Campos.
On GTK port the mute change notification was triggering the test
runner to think the whole page mute state had changed and that
media elements were muted. The simplest solution is to propagate
the notification only if the state actually changed.
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::muteChanged): Propagate mute notification
only if the mute state actually changed.
2018-01-15 Sebastian Dröge <sebastian@centricular.com>
[GStreamer] Don't wait for draw condition variable when shutting down.
https://bugs.webkit.org/show_bug.cgi?id=180978
Reviewed by Carlos Garcia Campos.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
(WebCore::MediaPlayerPrivateGStreamerBase::cancelRepaint):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
By also waiting for the draw condition variable while shutting down,
it is possible that the GStreamer video sink is waiting for the main
thread to actually render the current frame, while at the same time
the main thread is waiting for the GStreamer video sink to shut down,
resulting in a deadlock.
2018-01-13 Minsheng Liu <lambda@liu.ms>
MathML Lengths should take zoom level into account
https://bugs.webkit.org/show_bug.cgi?id=180029
Reviewed by Frédéric Wang.
The patch applies the effective zoom factor to physical units in toUserUnits().
Test: mathml/presentation/mspace-units-with-zoom.html
* rendering/mathml/RenderMathMLBlock.cpp:
(WebCore::toUserUnits):
2018-01-12 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181603
<rdar://problem/36476050>
Reviewed by Youenn Fablet.
No new tests, covered by existing tests that crash flakily.
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::terminateWorkerInternal):
If the connection to the context process is gone, make sure we make the worker as terminated
so that it does not stay in Running state and in SWServer::m_runningOrTerminatingWorkers.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::~SWServerRegistration):
Add assertions to make sure none of the registration's workers are still running when
the registration is destroyed.
(WebCore::SWServerRegistration::updateRegistrationState):
Make sure registration workers that are overwritten are not still running.
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
If a worker's state is set to redundant, make sure we also terminate it.
2018-01-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226927.
https://bugs.webkit.org/show_bug.cgi?id=181621
Breaks 32-bit and iOS release for some reason that i don't
understand yet (Requested by dino on #webkit).
Reverted changeset:
"Use a helper function for checked arithmetic in WebGL
validation"
https://bugs.webkit.org/show_bug.cgi?id=181620
https://trac.webkit.org/changeset/226927
2018-01-12 Myles C. Maxfield <mmaxfield@apple.com>
Data URL fonts split in the middle of an alphabet cause random letters to disappear
https://bugs.webkit.org/show_bug.cgi?id=175845
<rdar://problem/33996578>
Reviewed by Brent Fulgham.
It is fairly common practice for a font foundry to split a font up into two files such that a semi-random
half of the alphabet is present in one of the files, and the other half is present in the other file. This
practice involves representing the files as data URLs, so as to minimize the time it takes to load them.
Because resource loading is asynchronous (even for data URLs), it is possible today to get a paint after
the first file is loaded but before the second file is loaded. Indeed, because of the way font fallback
works, we will never start loading the second file until a layout has occurred with the first font.
Because a site usually only uses this pattern for a handful of fonts, and I've never seen this pattern
being used for CJK fonts, it isn't very expensive to opportunistically decode these data URLs eagerly.
Using this method doesn't actually guarantee that the two fonts will load in between successive paints,
but it at least makes this much more likely. This patch implements this strategy, along with a size
threshold to make sure that we won't decode any super large data URLs when it isn't necessary.
Test: fast/text/font-load-data-partitioned-alphabet.html
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::opportunisticallyStartFontDataURLLoading):
* css/CSSFontFace.h:
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::opportunisticallyStartFontDataURLLoading):
* css/CSSFontFaceSource.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::opportunisticallyStartFontDataURLLoading):
* css/CSSFontSelector.h:
* platform/graphics/FontCascadeFonts.cpp:
(WebCore::opportunisticallyStartFontDataURLLoading):
(WebCore::FontCascadeFonts::glyphDataForVariant):
* platform/graphics/FontSelector.h:
2018-01-12 Alex Christensen <achristensen@webkit.org>
History state should be updated during client redirects with asynchronous policy decisions
https://bugs.webkit.org/show_bug.cgi?id=181358
<rdar://problem/35547689>
Reviewed by Andy Estes.
When decidePolicyForNavigationAction is responded to asynchronously during a client redirect,
HistoryController::updateForRedirectWithLockedBackForwardList does not update the history because
the document loader has not been marked as a client redirect because the FrameLoader only looks
at its provisional document loader to mark it as a client redirect. When decidePolicyForNavigationAction
is responded to asynchronously, though, the FrameLoader's provisional document loader has moved to
its policy document loader. To get both asynchronous and synchronous cases, let's just mark the document
loader as a client redirect whether it's the provisional or policy document loader.
Covered by a new API test.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadPostRequest):
2018-01-12 Dean Jackson <dino@apple.com>
Use a helper function for checked arithmetic in WebGL validation
https://bugs.webkit.org/show_bug.cgi?id=181620
<rdar://problem/36485879>
Reviewed by Eric Carlson.
Eric recommended using a templated helper function to do
a common arithmetic check in WebGL validation.
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative):
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::checkedAddAndMultiply): New helper.
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::validateDrawArrays):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0):
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0):
* html/canvas/WebGLRenderingContextBase.h:
2018-01-12 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] CTFontCopyDefaultCascadeListForLanguages() can return nullptr
https://bugs.webkit.org/show_bug.cgi?id=181615
<rdar://problem/36334637>
Reviewed by Jon Lee.
Speculative fix. We are getting crash reports saying that this call can return nullptr, and we
don't check for it.
No new tests because I couldn't find the specific input that causes it to return nullptr. (I
tried running this code with every 0, 1, and 2 length locale string, every weight value, and
every italic value, and couldn't get it to crash. I also inspected the code to figure out what
values would cause it to return nullptr, and I couldn't find anything other than if the system
has a totally busted font setup.)
* platform/graphics/cocoa/FontDescriptionCocoa.cpp:
(WebCore::SystemFontDatabase::computeCascadeList):
2018-01-11 Dean Jackson <dino@apple.com>
[WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
https://bugs.webkit.org/show_bug.cgi?id=181558
<rdar://problem/36189833>
Reviewed by Eric Carlson.
Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
our simulated vertexAttrib0 buffer might be too large. We need
to check for out-of-memory, but we can also detect some of the issues
earlier in our validation code. Additionally, make sure that we don't
accidentally cast an unsigned to a signed.
Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
code to look for overflow, rather than relying on looking for sign changes.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
use GC3Duint, since that's what the indicies are.
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
(WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
* html/canvas/WebGLRenderingContextBase.h:
2018-01-12 Wenson Hsieh <wenson_hsieh@apple.com>
Large in-place attachment elements cause the document width to expand when inserted
https://bugs.webkit.org/show_bug.cgi?id=181614
Reviewed by Dan Bernstein.
Make in-place images and videos have a max-width of 100%, so that large attachments aren't inserted with full
display size, causing the document and viewport width to expand.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
2018-01-12 Keith Rollin <krollin@apple.com>
Logged JSON should escape "'s and \'s in strings.
https://bugs.webkit.org/show_bug.cgi?id=181608
Reviewed by Brent Fulgham.
No new tests -- no new functionality, just changed logging. The
efficacy of the logging was verified by inspecting its output.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
2018-01-12 Dean Jackson <dino@apple.com>
drawElements should be invalid if vertexAttrib0 doesn't have data
https://bugs.webkit.org/show_bug.cgi?id=181609
<rdar://problem/36392883>
Reviewed by Antoine Quint.
If a vertex attribute has been enabled, but no data provided, then
draw validation should fail.
Test: fast/canvas/webgl/drawElements-empty-vertex-data.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateVertexAttributes): If there were
never any data in the vertex buffer, then we incorrectly compared with 0.
2018-01-12 Youenn Fablet <youenn@apple.com>
FormDataElement::lengthInBytes should use ThreadableBlobRegistry
https://bugs.webkit.org/show_bug.cgi?id=181554
Reviewed by Chris Dumez.
Covered by updated test.
Fix blobRegistry() use and add support for creating a response that may trigger the issue.
* platform/network/FormData.cpp:
(WebCore::FormDataElement::lengthInBytes const): Was using directly blobRegistry() while ThreadableBlobRegistry is more appropriate
in case this is called from workers.
* Modules/fetch/FetchBody.h:
* Modules/fetch/FetchResponse.h:
* fileapi/Blob.h:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::createOpaqueWithBlobBodyResponse):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
2018-01-12 Jer Noble <jer.noble@apple.com>
Wrap CDMFairPlayStreaming and related classes in ENABLE(ENCRYPTED_MEDIA) checks
https://bugs.webkit.org/show_bug.cgi?id=181602
Reviewed by Maciej Stachowiak.
* platform/graphics/avfoundation/CDMFairPlayStreaming.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
* platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
2018-01-12 Youenn Fablet <youenn@apple.com>
WebProcess should pass the registration identifier and not the worker identifier for fetch events
https://bugs.webkit.org/show_bug.cgi?id=181591
Reviewed by Chris Dumez.
Test: http/wpt/service-workers/update-service-worker.https.html
Store service worker registration identifier in ResourceLoaderOptions instead of service worker identifier.
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
(WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
* loader/ResourceLoaderOptions.h:
* loader/WorkerThreadableLoader.cpp:
(WebCore::WorkerThreadableLoader::MainThreadBridge::MainThreadBridge):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::prepareFetch):
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerRegistrationIdentifierIfNeeded):
(WebCore::CachedResourceRequest::setNavigationServiceWorkerRegistrationData):
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded): Deleted.
* loader/cache/CachedResourceRequest.h:
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadSynchronously):
(WebCore::WorkerScriptLoader::loadAsynchronously):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::activeWorkerFromRegistrationID):
* workers/service/server/SWServer.h:
2018-01-12 Fujii Hironori <Hironori.Fujii@sony.com>
[Win][CMake] Remove all-in-one file for WebCore DerivedSources
https://bugs.webkit.org/show_bug.cgi?id=181582
Reviewed by Alex Christensen.
Those source files are compiled in unified source build nowadays.
No new tests (No behavior change)
* CMakeLists.txt: Removed calling PROCESS_ALLINONE_FILE.
* DerivedSources.cpp: Removed.
* WebCoreMacros.cmake: Removed a macro PROCESS_ALLINONE_FILE.
2018-01-12 Fujii Hironori <Hironori.Fujii@sony.com>
[WinCairo][CMake] Use ${CURL_LIBRARY} instead of specifying the library name libcurl_imp explicitly
https://bugs.webkit.org/show_bug.cgi?id=181578
Reviewed by Alex Christensen.
vcpkg has libcurl.lib, not libcurl_imp.lib.
No new tests because no behavior change.
* PlatformWinCairo.cmake: Link ${CURL_LIBRARY} instead of libcurl_imp.
2018-01-12 Jer Noble <jer.noble@apple.com>
WebGL video texture black in Safari 11.0.2 and wrong colored in Safari Preview 11.1
https://bugs.webkit.org/show_bug.cgi?id=181445
<rdar://problem/36383183>
Reviewed by Dean Jackson.
Tests: added compile-time correctness tests for YCbCrMatrix values.
Perform the derivation from YCbCr coefficients into matrices in constexpr expressions
at compile-time. This allows us to also perform compile-time correctness checks to catch
regressions which may cause incorrect color conversions.
Since we now have general-purpose derivation of matrix values from coefficients,
adding missing specificed matrices is trivial, so add support for SMPTE 240M and BT.2020
matrices.
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::GLfloatColor::GLfloatColor):
(WebCore::GLfloatColor::abs):
(WebCore::GLfloatColor::isApproximatelyEqualTo const):
(WebCore::YCbCrMatrix::operator Vector<GLfloat> const):
(WebCore::YCbCrMatrix::YCbCrMatrix):
(WebCore::YCbCrMatrix::operator* const):
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
2018-01-12 Antoine Quint <graouts@apple.com>
Add support for the frames() timing function
https://bugs.webkit.org/show_bug.cgi?id=181585
<rdar://problem/36463317>
Reviewed by Dean.
Implement the frames() timing function as specified in the CSS Timing Functions Level 1
specification, specifically https://www.w3.org/TR/css-timing-1/#frames-timing-functions.
A frames timing function is a type of timing function that divides the input time into a
specified number of intervals of equal length.
Test: transitions/frames-timing-function.html
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::createTimingFunctionValue):
* css/CSSTimingFunctionValue.cpp:
(WebCore::CSSFramesTimingFunctionValue::customCSSText const):
(WebCore::CSSFramesTimingFunctionValue::equals const):
* css/CSSTimingFunctionValue.h:
* css/CSSToStyleMap.cpp:
(WebCore::CSSToStyleMap::mapAnimationTimingFunction):
* css/CSSValue.cpp:
(WebCore::CSSValue::equals const):
(WebCore::CSSValue::cssText const):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isFramesTimingFunctionValue const):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSteps):
(WebCore::consumeFrames):
(WebCore::consumeAnimationTimingFunction):
* platform/animation/TimingFunction.cpp:
(WebCore::operator<<):
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
(WebCore::TimingFunction::isFramesTimingFunction const):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::animationHasFramesTimingFunction):
(WebCore::GraphicsLayerCA::animationCanBeAccelerated const):
2018-01-12 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226721.
https://bugs.webkit.org/show_bug.cgi?id=181583
Lets do a slightly different fix (Requested by anttik on
#webkit).
Reverted changeset:
"REGRESSION(r225650): The scores of MotionMark tests Multiply
and Leaves dropped by 8%"
https://bugs.webkit.org/show_bug.cgi?id=181460
https://trac.webkit.org/changeset/226721
2018-01-11 Keith Miller <keith_miller@apple.com>
Rename ENABLE_ASYNC_ITERATION to ENABLE_JS_ASYNC_ITERATION
https://bugs.webkit.org/show_bug.cgi?id=181573
Reviewed by Simon Fraser.
* Configurations/FeatureDefines.xcconfig:
2018-01-11 Jiewen Tan <jiewen_tan@apple.com>
[WebAuthN] Import a CBOR coder from Chromium
https://bugs.webkit.org/show_bug.cgi?id=181522
<rdar://problem/36055729>
Reviewed by Brent Fulgham.
This patch imports a CBOR coder including encoder and decoder from Chromium. CBOR encoder
is needed for WebAuthN to encode attestation object into binaries. When supporting extensions
in the future, CBOR encoder/decoder will be needed as well. Implementating and maintaining
a fully-fledged CBOR coder doesn't seem to align with WebKit's best interests. Therefore,
importing a most suitable third party implementation will be wise.
In this patch, it fully integrate the whole coder into our codebase. Those changes includes:
1. Substitute data structures that enjoy a better WTF version.
2. Replacing marcos.
3. Implementating workarounds for some functionalities that we lack fundamental types' support.
4. Changing the coding style to match ours.
This patch doesn't intend to improve the logic of the original codebase. Hence some of the
coding logic might not match what WebKit ususally has.
Here is a full list of Chromium changes that constructed this CBOR coder in chronological order:
6efcf495521d18d060027762f48bb292d6979136,
9eb43fd347890b4c6cf54c4bd7ec1bbb88e381e1,
31c85e74fd567772f18e0a41be468d04af721f21,
68672fdcad280a8ff69b91927d38d0eabf2c87f2,
0ca8667c0584fb21c0748ebd7468d32889759a07,
df763d790d7e45d70116bdefacbfd4f9faa8995e,
6d30c4a621c65314db63eb56e87c19ab75627b26,
50fe92953f4739f17a62303fedbf8db9234317c8,
47be22c3603424d1832d046a348ff3f982500288,
98a59e46948b2c71608926004fac8192b0ff2208,
07540c6d850ed6e0fa508d63c20a8ce96d751de6,
06ae32d640c8e4b86ea8914a80ee419ea16e56d8.
Covered by API tests.
* Modules/webauthn/cbor/CBORBinary.h: Added.
* Modules/webauthn/cbor/CBORReader.cpp: Added.
(cbor::CBORReader::CBORReader):
(cbor::CBORReader::~CBORReader):
(cbor::CBORReader::read):
(cbor::CBORReader::decodeCBOR):
(cbor::CBORReader::readVariadicLengthInteger):
(cbor::CBORReader::decodeValueToNegative):
(cbor::CBORReader::decodeValueToUnsigned):
(cbor::CBORReader::readSimpleValue):
(cbor::CBORReader::readString):
Workarounds applied.
(cbor::CBORReader::readBytes):
(cbor::CBORReader::readCBORArray):
(cbor::CBORReader::readCBORMap):
(cbor::CBORReader::canConsume):
(cbor::CBORReader::checkMinimalEncoding):
(cbor::CBORReader::checkExtraneousData):
(cbor::CBORReader::checkDuplicateKey):
(cbor::CBORReader::hasValidUTF8Format):
Workarounds applied.
(cbor::CBORReader::checkOutOfOrderKey):
(cbor::CBORReader::getErrorCode):
(cbor::CBORReader::errorCodeToString):
* Modules/webauthn/cbor/CBORReader.h: Added.
* Modules/webauthn/cbor/CBORValue.cpp: Added.
(cbor::CBORValue::CBORValue):
(cbor::CBORValue::operator=):
(cbor::CBORValue::~CBORValue):
(cbor::CBORValue::clone const):
(cbor::CBORValue::getInteger const):
(cbor::CBORValue::getUnsigned const):
(cbor::CBORValue::getNegative const):
(cbor::CBORValue::getString const):
(cbor::CBORValue::getByteString const):
(cbor::CBORValue::getArray const):
(cbor::CBORValue::getMap const):
(cbor::CBORValue::getSimpleValue const):
(cbor::CBORValue::internalMoveConstructFrom):
(cbor::CBORValue::internalCleanup):
* Modules/webauthn/cbor/CBORValue.h: Added.
* Modules/webauthn/cbor/CBORWriter.cpp: Added.
(cbor::CBORWriter::~CBORWriter):
(cbor::CBORWriter::write):
(cbor::CBORWriter::CBORWriter):
(cbor::CBORWriter::encodeCBOR):
Workarounds applied.
(cbor::CBORWriter::startItem):
(cbor::CBORWriter::setAdditionalInformation):
(cbor::CBORWriter::setUint):
(cbor::CBORWriter::getNumUintBytes):
* Modules/webauthn/cbor/CBORWriter.h: Added.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
2018-01-11 Chris Dumez <cdumez@apple.com>
Setting Window.opener to null should disown its opener
https://bugs.webkit.org/show_bug.cgi?id=181505
<rdar://problem/36443151>
Reviewed by Ryosuke Niwa.
Setting Window.opener to null should disown its opener as per:
- https://html.spec.whatwg.org/#dom-opener
With this change, tabs opened by clicking link inside Gmail no
longer have the Gmail window as opener.
Tests: fast/dom/Window/window-opener-set-to-null.html
fast/dom/Window/window-opener-shadowing.html
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::JSDOMWindow::setOpener):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::disownOpener):
* page/DOMWindow.h:
* page/DOMWindow.idl:
2018-01-11 Myles C. Maxfield <mmaxfield@apple.com>
[Cocoa] Star character disappears when bolded
https://bugs.webkit.org/show_bug.cgi?id=181568
<rdar://problem/18755569>
Reviewed by Simon Fraser.
We had some code in ComplexTextController to ask the FontCache for a font, given the name
of a particular font CoreText used inside a CTRun. This is wrong for two reasons: fonts
are not identifiable by PostScript name (in the general case), and because the lookup
procedure requires a FontDescription, the result may yield a font that is not the one
looked up. The goal of this code was simply to preserve the rendering mode of the font,
but we removed support for these rendering modes years ago. So the solution is to skip
that lookup and use the CoreText font directly.
Test: fast/text/unknown-font.html
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
2018-01-11 Keith Rollin <krollin@apple.com>
Add optional logging of ITP-related user interaction information
https://bugs.webkit.org/show_bug.cgi?id=181556
Reviewed by Brent Fulgham.
In order to support the tracking of the efficacy of Intelligent
Tracking Protection, add some logging indicating when the user
interacts with a page in a way that affects cookie partitioning. This
logging is off by default, and is enabled with `defaults write -g
WebKitLogCookieInformation -bool true`.
No new tests -- no changed functionality.
* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
* loader/ResourceLoadObserver.h:
(WebCore::ResourceLoadObserver::shouldLogUserInteraction const):
(WebCore::ResourceLoadObserver::setShouldLogUserInteraction):
2018-01-11 James Craig <jcraig@apple.com>
AX: when invert colors is on, double-invert video elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=168447
<rdar://problem/30559874>
Reviewed by Simon Fraser.
Double-invert video when platform "invert colors" setting is enabled. Behavior matches
current "Smart Invert" feature of Safari Reader on macOS/iOS and other iOS native apps.
Tests: accessibility/smart-invert-reference.html
accessibility/smart-invert.html
* Modules/modern-media-controls/controls/media-controls.css:
(@media (inverted-colors)):
(:host):
(picture):
* css/html.css:
(@media (inverted-colors)):
(video):
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
Don't load inline data when requesting info for an attachment element backed by a file path
https://bugs.webkit.org/show_bug.cgi?id=181550
Reviewed by Tim Horton.
When requesting data for an attachment element that is backed by a file path, we currently trigger a load in the
web process to fetch contents of the attachment data as inline data in the AttachmentInfo. This is unnecessary,
since the file path of the attachment element must have come from the UI process anyways, so it is sufficient to
simply send the file path to the UI process and have the UI process read the contents of the path as a memory-
mapped NSData.
This patch lets HTMLAttachmentElement skip over resource loading codepaths when creating an AttachmentInfo for
the client, and also teaches _WKAttachment to read a AttachmentInfo's filepath as memory-mapped data if a file
path is present, and no inline data was specified.
Covered by existing API tests.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::requestInfo):
2018-01-10 Ryosuke Niwa <rniwa@webkit.org>
Make elements of zero width or height focusable
https://bugs.webkit.org/show_bug.cgi?id=181516
Reviewed by Chris Dumez.
Don't check render box's size or bounding rect when deciding whether an element is focusable.
New behavior matches that of Firefox and Chrome.
Test: fast/events/focus-zero-size-element.html
* dom/Element.cpp:
(WebCore::Element::isFocusable): Only update the style.
* html/HTMLFormControlElement.cpp:
(WebCore::HTMLFormControlElement::isFocusable const): Deleted.
* html/HTMLFormControlElement.h:
* mathml/MathMLElement.cpp:
(WebCore::MathMLElement::isFocusable const): Deleted. As far as I can tell, no math ml element is focusable.
* mathml/MathMLElement.h:
* svg/SVGAElement.cpp:
(WebCore::SVGAElement::isFocusable const): Deleted.
* svg/SVGAElement.h:
2018-01-11 Filip Pizlo <fpizlo@apple.com>
Rename MarkedAllocator to BlockDirectory and AllocatorAttributes to CellAttributes
https://bugs.webkit.org/show_bug.cgi?id=181543
Rubber stamped by Michael Saboff.
No new tests because I'm just renaming things.
* ForwardingHeaders/heap/BlockDirectoryInlines.h: Copied from Source/WebCore/ForwardingHeaders/heap/MarkedAllocatorInlines.h.
* ForwardingHeaders/heap/MarkedAllocatorInlines.h: Removed.
* bindings/js/DOMGCOutputConstraint.cpp:
2018-01-11 Alex Christensen <achristensen@webkit.org>
REGRESSION(r225003): Loading hangs in environments where dispatch_async does not work
https://bugs.webkit.org/show_bug.cgi?id=181553
<rdar://problem/35733938>
Reviewed by Eric Carlson.
There is an environment where dispatch_async does not work, but performSelectorOnMainThread works.
r225003 broke loading in this environment. This fixes it and updates the test that r225003 fixed.
It failed sometimes because loading was happening in a different order than html parsing, so I made
the test not depend on html parsing timing by updating media/video-src-remove.html.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
2018-01-11 Dean Jackson <dino@apple.com>
Rolling out 226814. It crashes on some bots.
2018-01-11 Dean Jackson <dino@apple.com>
[WebGL] Simulated vertexAttrib0 can sometimes cause OUT_OF_MEMORY errors
https://bugs.webkit.org/show_bug.cgi?id=181558
<rdar://problem/36189833>
Reviewed by Eric Carlson.
Very large element indices in the ELEMENT_ARRAY_BUFFER meant that
our simulated vertexAttrib0 buffer might be too large. We need
to check for out-of-memory, but we can also detect some of the issues
earlier in our validation code. Additionally, make sure that we don't
accidentally cast an unsigned to a signed.
Test: fast/canvas/webgl/simulated-vertexAttrib0-invalid-indicies.html
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::validateIndexArrayConservative): Update validation
code to look for overflow, rather than relying on looking for sign changes.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::validateIndexArrayConservative): Ditto.
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise):
(WebCore::WebGLRenderingContextBase::drawArrays): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElements):
(WebCore::WebGLRenderingContextBase::validateSimulatedVertexAttrib0): Update validation code, and
use GC3Duint, since that's what the indicies are.
(WebCore::WebGLRenderingContextBase::simulateVertexAttrib0): Ditto.
(WebCore::WebGLRenderingContextBase::drawArraysInstanced): Check that we were able to simulate.
(WebCore::WebGLRenderingContextBase::drawElementsInstanced):
* html/canvas/WebGLRenderingContextBase.h:
2018-01-11 Chris Dumez <cdumez@apple.com>
ASSERTION FAILED: registration in WebCore::SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181222
<rdar://problem/36332686>
Reviewed by Youenn Fablet.
Replace assertion in SWServerWorker::skipWaiting() that assumes the worker
has a registration. Nowadays, a SWServerWorker can stay alive for a short
period without having a registration, while it is terminating.
No new tests, unskipped existing test.
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::skipWaiting):
2018-01-11 Antti Koivisto <antti@apple.com>
Don't call RenderElement::setStyle when nothing changes
https://bugs.webkit.org/show_bug.cgi?id=181530
Reviewed by Zalan Bujtas.
* style/StyleChange.h:
Remove 'Force' value. This essentially meant 'compute style for all descendants and call setStyle unconditionally'.
Using this value lost information about whether anything actually changed in a particular style as it was automatically
inherited by all descendants. The 'compute all descendants' part of the behavior is what is actually needed.
Instead add separate DescendantsToResolve enum for communicating what else to compute.
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::Parent::Parent):
(WebCore::Style::computeDescendantsToResolve):
Figure out which descendants will need resolving based on how the current elements style changed.
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
(WebCore::Style::TreeResolver::pushParent):
(WebCore::Style::shouldResolveElement):
Use DescendantsToResolve as input.
(WebCore::Style::TreeResolver::resolveComposedTree):
* style/StyleTreeResolver.h:
* style/StyleUpdate.h:
(WebCore::Style::ElementUpdates::ElementUpdates):
Add DescendantsToResolve.
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
Send PromisedBlobInfo to the client through DragItem instead of DragClient::prepareToDragPromisedBlob
https://bugs.webkit.org/show_bug.cgi?id=181497
Reviewed by Tim Horton.
Refactor drag initiation with DOMFile-backed attachment elements. See WebKit ChangeLog for more information. No
change in behavior; promised blob dragging covered by WKAttachment API tests.
* loader/EmptyClients.cpp:
* page/DragClient.h:
(WebCore::DragClient::prepareToDragPromisedBlob): Deleted.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
(WebCore::DragController::doImageDrag):
(WebCore::DragController::doSystemDrag):
(WebCore::DragController::promisedBlobInfo):
(WebCore::DragController::dragAttachmentElement): Deleted.
* page/DragController.h:
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):
2018-01-11 Youenn Fablet <youenn@apple.com>
RTCController should disable ICE candidate filtering in case of getUserMedia based on the RTCPerrConnection origin
https://bugs.webkit.org/show_bug.cgi?id=180851
Reviewed by Eric Carlson.
Test: http/wpt/webrtc/third-party-frame-ice-candidate-filtering.html
RTCController now stores all the client origins (top+frame origins) of frames that got access to camera/microphone access.
For any such client origin, PeerConnection objects ICE candidate filtering is disabled.
ICE candidate filtering is reset whenever navigating/reloading the page.
* Modules/mediastream/RTCController.cpp:
(WebCore::RTCController::reset):
(WebCore::matchDocumentOrigin):
(WebCore::RTCController::shouldDisableICECandidateFiltering):
(WebCore::RTCController::add):
(WebCore::RTCController::disableICECandidateFilteringForAllOrigins):
(WebCore::RTCController::disableICECandidateFiltering):
(WebCore::RTCController::enableICECandidateFiltering):
* Modules/mediastream/RTCController.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::create):
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::allow):
* page/Page.cpp:
(WebCore::Page::disableICECandidateFiltering):
* testing/Internals.cpp:
(WebCore::Internals::setICECandidateFiltering):
2018-01-11 Ali Juma <ajuma@chromium.org>
window.visualViewport should behave as [SameObject]
https://bugs.webkit.org/show_bug.cgi?id=181548
Reviewed by Chris Dumez.
Add 'GenerateIsReachable' to VisualViewport so that window.visualViewport's
JS wrapper object doesn't get garbage collected too soon.
Test: fast/visual-viewport/visual-viewport-same-object.html
* page/VisualViewport.idl:
2018-01-11 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Extract multipart handling from ResourceHandle to CurlRequest.
https://bugs.webkit.org/show_bug.cgi?id=181506
Reviewed by Alex Christensen.
Rename old MultipartHandle class to CurlMultipartHandle and modernize it. Also move the responsibility
of handling multi part from ResourceHandle to CurlRequest. This is required for upcoming NetworkLoadTask.
No new tests because no new behavior.
* platform/Curl.cmake:
* platform/network/curl/CurlMultipartHandle.cpp: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.cpp.
(WebCore::CurlMultipartHandle::createIfNeeded):
(WebCore::CurlMultipartHandle::extractBoundary):
(WebCore::CurlMultipartHandle::extractBoundaryFromContentType):
(WebCore::CurlMultipartHandle::CurlMultipartHandle):
(WebCore::CurlMultipartHandle::didReceiveData):
(WebCore::CurlMultipartHandle::didComplete):
(WebCore::CurlMultipartHandle::processContent):
(WebCore::CurlMultipartHandle::checkForBoundary):
(WebCore::CurlMultipartHandle::matchedLength):
(WebCore::CurlMultipartHandle::parseHeadersIfPossible):
* platform/network/curl/CurlMultipartHandle.h: Renamed from Source/WebCore/platform/network/curl/MultipartHandle.h.
(WebCore::CurlMultipartHandle::~CurlMultipartHandle):
* platform/network/curl/CurlMultipartHandleClient.h: Added.
(WebCore::CurlMultipartHandleClient::~CurlMultipartHandleClient):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didReceiveHeaderFromMultipart):
(WebCore::CurlRequest::didReceiveDataFromMultipart):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::invokeDidReceiveResponse):
(WebCore::CurlRequest::completeDidReceiveResponse):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::createCurlRequest):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveBuffer):
(WebCore::ResourceHandleCurlDelegate::curlDidComplete):
* platform/network/curl/ResourceHandleCurlDelegate.h:
2018-01-11 Zalan Bujtas <zalan@apple.com>
RenderTreeUpdater::current() returns null_ptr when mutation is done through Document::resolveStyle.
https://bugs.webkit.org/show_bug.cgi?id=181513
<rdar://problem/36367085>
Reviewed by Antti Koivisto.
This patch ensures that we use a valid RenderTreeBuilder even when
Document::resolveStyle (incorrectly) triggers tree mutation.
It can be reverted soon after the incorrect mutations are taken care of.
Test: fast/forms/button-set-text-crash.html
* rendering/RenderButton.cpp:
(WebCore::RenderButton::setText):
* rendering/RenderMenuList.cpp:
(RenderMenuList::setText):
2018-01-11 Antoine Quint <graouts@apple.com>
Only listen to webkitplaybacktargetavailabilitychanged when media controls are visible to the user
https://bugs.webkit.org/show_bug.cgi?id=181547
<rdar://problem/35947650>
Reviewed by Eric Carlson.
Because listening to "webkitplaybacktargetavailabilitychanged" events incurs some higher power usage on iOS,
we only listen to such events when controls are visible to the user. In other words, the MediaControls need to
have both "visible" set to "true" and "faded" set to "false". To support this, we add a delegate method on
MediaControls such that it can tell the MediaController that the "visible" property changed. With this message,
MediaController can inform its MediaControllerSupport objects that user visibility of the controls changed, which
lets AirplaySupport disable itself when controls are no longer visible.
Test: media/modern-media-controls/airplay-support/airplay-support-disable-event-listeners-with-hidden-controls.html
* Modules/modern-media-controls/controls/media-controls.js:
(MediaControls.prototype.set visible):
* Modules/modern-media-controls/media/airplay-support.js:
(AirplaySupport.prototype.controlsUserVisibilityDidChange):
* Modules/modern-media-controls/media/media-controller-support.js:
(MediaControllerSupport.prototype.controlsUserVisibilityDidChange):
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.mediaControlsVisibilityDidChange):
(MediaController.prototype.mediaControlsFadedStateDidChange):
(MediaController.prototype._controlsUserVisibilityDidChange):
2018-01-11 Antoine Quint <graouts@apple.com>
[iOS] There should be no controls markup generated in fullscreen
https://bugs.webkit.org/show_bug.cgi?id=181540
<rdar://problem/35060379>
Reviewed by Eric Carlson.
We completely forgo the display of any content when fullscreen on iOS by setting the
"visible" flag to "false" on the MediaControls, which will prevent any DOM content from
being added.
* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.handleEvent):
(MediaController.prototype._updateiOSFullscreenProperties):
(MediaController):
(MediaController.prototype._updateSupportingObjectsEnabledState): Deleted.
2018-01-11 Alex Christensen <achristensen@webkit.org>
Revert changes accidentally committed with r226789.
https://bugs.webkit.org/show_bug.cgi?id=181423
I had some local changes I did not mean to commit.
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(scheduledWithCustomRunLoopMode):
(-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]):
(WebCore::if): Deleted.
(WebCore::>::fromCallable): Deleted.
2018-01-10 Simon Fraser <simon.fraser@apple.com>
On macOS, getBoundingClientRect gives incorrect values when pinch-zoomed
https://bugs.webkit.org/show_bug.cgi?id=181511
rdar://problem/33741427
Reviewed by Zalan Bujtas.
When reverting "client coordinates are relative to layout viewport" in r219829
I broke documentToClientOffset() on macOS by failing to take pinch zoom scale into
account (frameScaleFactor() is always 1 on iOs, so this bug doesn't manifest there).
Covered by existing tests.
* page/FrameView.cpp:
(WebCore::FrameView::documentToClientOffset const):
2018-01-11 Youenn Fablet <youenn@apple.com>
Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legacy flag by default
https://bugs.webkit.org/show_bug.cgi?id=181480
Reviewed by Eric Carlson.
No change of behavior.
* page/RuntimeEnabledFeatures.h: Set default value to false.
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Support moving attachment elements in editable areas using drag and drop
https://bugs.webkit.org/show_bug.cgi?id=181337
<rdar://problem/36324813>
Reviewed by Tim Horton.
Makes slight adjustments to attachment-specific drag and drop logic to ensure that moving attachments via drag
and drop behaves correctly. See per-change comments for more detail.
Tests: WKAttachmentTests.DragInPlaceVideoAttachmentElement
WKAttachmentTests.MoveAttachmentElementAsIconByDragging
WKAttachmentTests.MoveInPlaceAttachmentElementByDragging
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getPasteboardTypesAndDataForAttachment):
Stop vending the private web archive pasteboard type for attachments, for now. This works around issues where an
attachment element that is dragged and dropped within the same page may lose its blob backing data if we try to
remove and insert it as a fragment from the archive. Providing a web archive would allow us to avoid destroying
and recreating an attachment element when dragging within the same page, but this is a nice-to-have optimization
we can re-enable after investigation in a subsequent patch.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary):
Add `draggable=false` to the image element of an in-place attachment element.
* page/DragController.cpp:
(WebCore::enclosingAttachmentElement):
(WebCore::DragController::draggableElement const):
Tweak single-selected-attachment handling to account for in-place attachments. Since the hit-tested node is
inside the shadow subtree of the attachment element, the condition needs to check for the startElement as well
as the startElement's shadow host.
(WebCore::DragController::startDrag):
Make two tweaks here. First, don't require a RenderAttachment to drag an attachment element (this is required
for dragging in-place attachments). This was added in r217083 to address <rdar://problem/32282831>, but is no
longer correct, since attachments may now be displayed in-place.
Secondly, only restore the previous selection if the attachment is in a richly contenteditable area. This was
added to prevent the selection highlight from appearing in when dragging non-editable attachment elements in the
Mail viewer. However, to allow drag moves to occur, we need the selection to persist after drag start.
2018-01-04 Filip Pizlo <fpizlo@apple.com>
CodeBlocks should be in IsoSubspaces
https://bugs.webkit.org/show_bug.cgi?id=180884
Reviewed by Saam Barati.
No new tests because no new behavior.
Adopting new parallel constraint API, so that more of the logic of doing parallel
constraint solving is shared between the DOM's output constraints and JSC's output
constraints.
* bindings/js/DOMGCOutputConstraint.cpp:
(WebCore::DOMGCOutputConstraint::executeImpl):
(WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
(WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
* bindings/js/DOMGCOutputConstraint.h:
2018-01-11 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Support dragging attachment elements out as files on iOS
https://bugs.webkit.org/show_bug.cgi?id=181199
<rdar://problem/36299316>
Reviewed by Tim Horton, Andy Estes and Joseph Pecoraro.
Adds support for dragging "files" (i.e. creating item providers with preferred attachment presentation styles)
from attachment elements on iOS for Mail. See below for more detail.
Tests: WKAttachmentTestsIOS.DragAttachmentInsertedAsData
WKAttachmentTestsIOS.DragAttachmentInsertedAsFile
* page/DragController.cpp:
(WebCore::DragController::platformContentTypeForBlobType const):
(WebCore::DragController::dragAttachmentElement):
* page/DragController.h:
* page/mac/DragControllerMac.mm:
(WebCore::DragController::platformContentTypeForBlobType const):
Add a private method to convert the type of a promised blob to a platform type. For Cocoa platforms, this
converts the blob type (either a UTI or a MIME type) to a UTI for the platform to consume.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
Refactor WebItemProviderRegistrationInfo. WebItemProviderRegistrationInfo currently encapsulates a single item
provider registration call, and contains either a type identifier and data buffer, or an NSItemProviderWriting-
conformant object. To register an item provider using a WebItemProviderRegistrationInfo, the item provider
pasteboard currently checks to see whether the info contains an object or a type and data.
This patch removes WebItemProviderRegistrationInfo and replaces it with WebItemProviderDataRegistrar. Objects
that implement this protocol know how to take an NSItemProvider and register data to it. So far, there are
three implementations below.
(-[WebItemProviderDataRegistrar initWithData:type:]):
(-[WebItemProviderDataRegistrar typeIdentifier]):
(-[WebItemProviderDataRegistrar data]):
(-[WebItemProviderDataRegistrar typeIdentifierForClient]):
(-[WebItemProviderDataRegistrar dataForClient]):
(-[WebItemProviderDataRegistrar registerItemProvider:]):
(-[WebItemProviderDataRegistrar description]):
A data registrar takes a UTI and data buffer, and registers the UTI to the data. This replaces a
WebItemProviderRegistrationInfo with both a type and data, but no representing object.
(-[WebItemProviderWritableObjectRegistrar initWithObject:]):
(-[WebItemProviderWritableObjectRegistrar representingObjectForClient]):
(-[WebItemProviderWritableObjectRegistrar registerItemProvider:]):
(-[WebItemProviderWritableObjectRegistrar description]):
The writable object registrar writes an NSItemProviderWriting-conformant object to an item provider. This
replaces a WebItemProviderRegistrationInfo with only a representing object.
(-[WebItemProviderPromisedFileRegistrar initWithType:callback:]):
(-[WebItemProviderPromisedFileRegistrar registerItemProvider:]):
(-[WebItemProviderPromisedFileRegistrar description]):
(-[WebItemProviderRegistrationInfoList addData:forType:]):
(-[WebItemProviderRegistrationInfoList addRepresentingObject:]):
(-[WebItemProviderRegistrationInfoList addPromisedType:fileCallback:]):
Helper methods to add new registrars to a registration info list.
(-[WebItemProviderRegistrationInfoList itemAtIndex:]):
(-[WebItemProviderRegistrationInfoList enumerateItems:]):
(-[WebItemProviderRegistrationInfoList itemProvider]):
(-[WebItemProviderRegistrationInfoList description]):
(-[WebItemProviderRegistrationInfo initWithRepresentingObject:typeIdentifier:data:]): Deleted.
(-[WebItemProviderRegistrationInfo representingObject]): Deleted.
(-[WebItemProviderRegistrationInfo typeIdentifier]): Deleted.
2018-01-11 Michael Saboff <msaboff@apple.com>
Add a DOM gadget for Spectre testing
https://bugs.webkit.org/show_bug.cgi?id=181351
Reviewed by Ryosuke Niwa.
This change is used to test Spectre mitigations.
Added a new DOM class to test for Spectre issues in the DOM layer.
This additional functionality is disabled by default and must be enabled
through the JSC option "enableSpectreGadgets".
* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* dom/SpectreGadget.cpp: Added.
(WebCore::SpectreGadget::SpectreGadget):
(WebCore::SpectreGadget::create):
(WebCore::SpectreGadget::setReadLength):
(WebCore::SpectreGadget::charCodeAt):
(WebCore::SpectreGadget::clflushReadLength):
* dom/SpectreGadget.h: Added.
* dom/SpectreGadget.idl: Added.
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
* page/RuntimeEnabledFeatures.h:
2018-01-11 Philippe Normand <pnormand@igalia.com>
[GTK] media/muted-video-is-playing-audio.html is timing out
https://bugs.webkit.org/show_bug.cgi?id=163781
Reviewed by Carlos Garcia Campos.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Sprinkle some debugging.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setMuted): Ditto.
2018-01-10 Andy Estes <aestes@apple.com>
[Payment Request] Rename ApplePayMerchantValidationEvent to MerchantValidationEvent
https://bugs.webkit.org/show_bug.cgi?id=181437
<rdar://problem/36376481>
Reviewed by Tim Horton.
Renamed ApplePayMerchantValidationEvent to MerchantValidationEvent and changed complete() to accept a Promise.
Test: http/tests/paymentrequest/payment-request-merchant-validation.https.html
* DerivedSources.make:
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::merchantValidationCompleted):
(WebCore::ApplePayPaymentHandler::validateMerchant):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/MerchantValidationEvent.cpp: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.cpp.
(WebCore::MerchantValidationEvent::create):
(WebCore::MerchantValidationEvent::MerchantValidationEvent):
(WebCore::MerchantValidationEvent::eventInterface const):
(WebCore::MerchantValidationEvent::complete):
* Modules/paymentrequest/MerchantValidationEvent.h: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.h.
* Modules/paymentrequest/MerchantValidationEvent.idl: Renamed from Source/WebCore/Modules/applepay/paymentrequest/ApplePayMerchantValidationEvent.idl.
* Modules/paymentrequest/PaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::completeMerchantValidation):
* Modules/paymentrequest/PaymentRequest.h:
* Modules/paymentrequest/PaymentRequest.idl:
* WebCore.xcodeproj/project.pbxproj:
* dom/EventNames.h:
* dom/EventNames.in:
2018-01-10 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Cross-protocol, cross-site scripting (XPXSS) using HTML forms
Nhttps://bugs.webkit.org/show_bug.cgi?id=153088
Reviewed by Alex Christensen.
No new tests because it's covered by existing tests.
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getHttpVersion):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didReceiveHeader):
* platform/network/curl/CurlResponse.h:
(WebCore::CurlResponse::isolatedCopy const):
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::ResourceResponse):
(WebCore::ResourceResponse::setStatusLine):
2018-01-10 Wenson Hsieh <wenson_hsieh@apple.com>
REGRESSION(r222507): Composition highlight doesn't render when using IME
https://bugs.webkit.org/show_bug.cgi?id=181485
<rdar://problem/35896516>
Reviewed by Ryosuke Niwa.
Fixes the order of arguments passed to paintTextSubrangeBackground from paintCompositionBackground.
Test: editing/marked-text-appearance.html
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionBackground):
2018-01-10 Youenn Fablet <youenn@apple.com>
Use no-cache fetch mode when loading main documents with location.reload()
https://bugs.webkit.org/show_bug.cgi?id=181285
Reviewed by Alex Christensen.
Covered by rebased tests.
Start to translate cache policy used for navigation as FetchOptions::Cache.
This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
Keep reload mode for ReloadFromOrigin.
* loader/DocumentLoader.cpp:
(WebCore::toFetchOptionsCache):
(WebCore::DocumentLoader::loadMainResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::defaultRequestCachingPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/NavigationScheduler.cpp:
2018-01-10 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226667 and r226673.
https://bugs.webkit.org/show_bug.cgi?id=181488
This caused a flaky crash. (Requested by mlewis13 on #webkit).
Reverted changesets:
"CodeBlocks should be in IsoSubspaces"
https://bugs.webkit.org/show_bug.cgi?id=180884
https://trac.webkit.org/changeset/226667
"REGRESSION (r226667): CodeBlocks should be in IsoSubspaces"
https://bugs.webkit.org/show_bug.cgi?id=180884
https://trac.webkit.org/changeset/226673
2018-01-10 Antti Koivisto <antti@apple.com>
REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
https://bugs.webkit.org/show_bug.cgi?id=181460
<rdar://problem/36379776>
Reviewed by Ryosuke Niwa.
* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):
Don't do the expensive security origin test if the sheet base URL and document URL are identical.
This is true for inline style and inline stylesheets.
2018-01-10 Antti Koivisto <antti@apple.com>
Try to fix windows build.
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::computeNextMatchElement):
2018-01-10 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderRuby's moveChildren logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181470
<rdar://problem/36397683>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* rendering/RenderBlockFlow.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveChildren): Deleted.
(WebCore::RenderRubyBase::mergeChildrenWithBase): Deleted.
(WebCore::RenderRubyBase::moveInlineChildren): Deleted.
(WebCore::RenderRubyBase::moveBlockChildren): Deleted.
* rendering/RenderRubyBase.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::moveRubyChildren):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::moveInlineChildren):
(WebCore::RenderTreeBuilder::Ruby::moveBlockChildren):
(WebCore::RenderTreeBuilder::Ruby::moveChildren):
(WebCore::RenderTreeBuilder::Ruby::moveChildrenInternal):
(WebCore::RenderTreeBuilder::Ruby::insertChild):
* rendering/updating/RenderTreeBuilderRuby.h:
2018-01-10 Philippe Normand <pnormand@igalia.com>
[GStreamer] fix critical GObject warning
Rubber-stamped by Carlos Garcia Campos.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): No need to
resort to complicated things to get the element name...
2018-01-10 Philippe Normand <pnormand@igalia.com>
[GStreamer] REGRESSION(r226629): broke media/video-interruption-with-resume-allowing-play.html
https://bugs.webkit.org/show_bug.cgi?id=181471
<rdar://problem/36402323>
Reviewed by Carlos Garcia Campos.
This patch mainly reduces the amount of playback state changes
emitted by the GStreamer player to its client. Emitting those
notifications too often has bad side effects.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::paused const): Add debug messages.
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): This debug message appears too much. Demote.
(WebCore::MediaPlayerPrivateGStreamer::maxTimeLoaded const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Try to emit
playback state change notification only when going to PLAYING.
(WebCore::MediaPlayerPrivateGStreamer::loadingFailed): Add warning message.
2018-01-10 Youenn Fablet <youenn@apple.com>
Add Service Worker CSP persistency
https://bugs.webkit.org/show_bug.cgi?id=181434
Reviewed by Alex Christensen.
Covered by manual testing.
Future work on service worker test infrastructure should allow automating such tests.
Add support for service worker CSP data persistency.
Add a version parameter to increment each time the schema is changing.
This allows the same store to be used by multiple WebKits.
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
2018-01-10 Antti Koivisto <antti@apple.com>
Invalidate current element style on class change accurately
https://bugs.webkit.org/show_bug.cgi?id=181210
Reviewed by Zalan Bujtas.
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::subjectClassRules const):
New rule set containing class rules affecting the subject element.
(WebCore::DocumentRuleSets::ancestorClassRules const):
* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
Classify selector components into various buckets based on the elements they match relative to
the subject element. There are more categories than this patch strictly needs, for future use.
(WebCore::RuleFeatureSet::collectFeatures):
(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
* css/RuleFeature.h:
* css/StyleResolver.h:
(WebCore::StyleResolver::hasSelectorForClass const): Deleted.
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::elementNeedsInvalidation):
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):
Don't invalidate current element unconditionally on class change. Instead find the subject rulesets
that might affect it use them to perform invalidation.
(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
(WebCore::Style::ClassChangeInvalidation::invalidateStyle): Deleted.
(WebCore::Style::ClassChangeInvalidation::invalidateDescendantStyle): Deleted.
* style/ClassChangeInvalidation.h:
(WebCore::Style::ClassChangeInvalidation::ClassChangeInvalidation):
(WebCore::Style::ClassChangeInvalidation::~ClassChangeInvalidation):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::classNamesAffectedByRules const):
2018-01-09 Antoine Quint <graouts@apple.com>
[Web Animations] Expose the id property on Animation
https://bugs.webkit.org/show_bug.cgi?id=181450
<rdar://problem/36383600>
Reviewed by Dean Jackson.
Expose the "id" property on Animation and handle the "id" property on the optional KeyframeAnimationOptions object
passed to Element.animate(). All of the WPT tests related to this property are now passing.
* animation/WebAnimation.h:
* animation/WebAnimation.idl:
* dom/Element.cpp:
(WebCore::Element::animate):
2018-01-09 Chris Dumez <cdumez@apple.com>
Make service workers behave correctly with regards to Page Cache
https://bugs.webkit.org/show_bug.cgi?id=181446
<rdar://problem/36164291>
Reviewed by Youenn Fablet.
Make service workers behave correctly with regards to Page Cache:
1. If a document has an active service worker, do not let it go into PageCache
2. When a document goes into page cache, unregister it from the list of service worker clients
3. When a document is restored from page cache, add it nack to the list of service worker clients
Tests: http/tests/workers/service/client-added-to-clients-when-restored-from-page-cache.html
http/tests/workers/service/client-removed-from-clients-while-in-page-cache.html
http/tests/workers/service/no-page-cache-when-controlled.html
http/tests/workers/service/other_resources/test.html
* dom/Document.cpp:
(WebCore::Document::suspend):
(WebCore::Document::resume):
* history/PageCache.cpp:
(WebCore::canCacheFrame):
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
* page/DiagnosticLoggingKeys.h:
2018-01-09 Chris Dumez <cdumez@apple.com>
We should not return undefined for most properties of a detached Window
https://bugs.webkit.org/show_bug.cgi?id=181416
<rdar://problem/36162489>
Reviewed by Ryosuke Niwa.
We should not return undefined for most properties on a detached Window. WebKit previously only exposed "closed"
and "close" properties on detached / frameless windows. However, this does not match the HTML specification [1]
or the behavior of Firefox and Chrome.
Note that Chrome does not seem to fully follow the HTML specification either, it seems to treat detached windows
the same way as cross-origin ones. As a result, it only exposed properties that are visible cross-origin when
a window is detached / frameless.
[1] https://html.spec.whatwg.org/#windowproxy-get
No new tests, updated existingt tests.
* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
(WebCore::JSDOMWindow::getOwnPropertySlot):
(WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
2018-01-09 Darin Adler <darin@apple.com>
Further refinement to list item and counter code after "list-item" counter fix
https://bugs.webkit.org/show_bug.cgi?id=181426
Reviewed by Zalan Bujtas.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritCounter): Use auto.
(WebCore::StyleBuilderCustom::applyValueCounter): Use auto, removed unneeded
null checks for things that can never be null, moved the saturated addition
here and got rid of the addIncrementValue function from CounterDirectives.
Use the saturatedAddition function from SaturatedArithmetic.h instead of the
much less efficient one that did the same thing, CounterDirectives::addClamped.
* rendering/RenderCounter.cpp:
(WebCore::listItemCounterDirectives): Use aggregate syntax for the return
statements.
(WebCore::planCounter): Changed to use a struct return value instead of two
out arguments. Use the saturatedAddition function from SaturatedArithmetic.h
instead of the much less efficient one that did the same thing,
CounterDirectives::addClamped.
(WebCore::findPlaceForCounter): Changed to use a struct return value instead
of two out arguments.
(WebCore::makeCounterNode): Updated for the above changes. Changed code to
use add instead of both get and set. Updated to keep the counter maps inside
the values of the "map of maps" instead of using a unique_ptr and allocating
each one on the heap.
(WebCore::destroyCounterNodeWithoutMapRemoval): Changed argument to a reference
instead of a pointer. Updated for changes to the map. Use RefPtr more
consistently.
(WebCore::RenderCounter::destroyCounterNodes): Use iterators less.
(WebCore::RenderCounter::destroyCounterNode): Ditto.
(WebCore::RenderCounter::rendererRemovedFromTree): Add a check of
hasCounterNodeMap here before calling destroyCounterNodes, so that function
can assume the flag is true (both other callers already check it).
(WebCore::updateCounters): Use auto and update for changes above.
(WebCore::RenderCounter::rendererStyleChanged): Use modern for loops instead
of iterators.
(showCounterRendererTree): Use auto and udpate for changes above.
* rendering/RenderListItem.cpp:
(WebCore::enclosingList): Stop referring to elements as "nodes". Changed
the local variable names for clarity.
(WebCore::nextListItemHelper): Renamed from nextListItem since it's not
intended to be called directly and we want to use a function pointer to
nextListItem. Fixed the algorithm to correctly handle ad hoc "lists" that
are not actually HTML list elements, using the definition in the enclosingList
function as the previousListItem function already did.
(WebCore::nextListItem): Updated for name changes.
(WebCore::firstListItem): Renamed from nextListItem for clarity.
(WebCore::previousListItem): Rewrote loop so it doesn't have to do things
so strangely when we find another list.
(WebCore::RenderListItem::updateItemValuesForOrderedList): Use auto and
update local variable names.
(WebCore::RenderListItem::itemCountForOrderedList): Ditto.
(WebCore::RenderListItem::updateValueNow const): Rewrote to use an iterative
algorithm instead of a recursive one. Fixes the FIXME here.
(WebCore::RenderListItem::updateValue): Use m_valueWasSetExplicitly
instead of m_explicitValue.
(WebCore::RenderListItem::explicitValueChanged): Use auto and simplified
the loop a bit.
(WebCore::RenderListItem::setExplicitValue): Set m_valueWasSetExplicitly
instead of m_explicitValue.
(WebCore::previousOrNextItem): Deleted.
(WebCore::RenderListItem::updateListMarkerNumbers): Streamlined the loop
a bit and used a fucntion pointer to handle the two different directions.
(WebCore::RenderListItem::isInReversedOrderedList const): Simplified by
getting rid of an unneeded use of pointers and local variables.
* rendering/RenderListItem.h: Use a boolean, m_valueWasSetExplicitly,
instead of a separate optional m_explicitValue.
* rendering/style/CounterDirectives.h: Since all the code in this file was
rewritten, removed old copyrights. Deleted the addIncrementValue function,
since it is clear enough in the one call site in the style builder.
Deleted the addClamped function because it was just a much slower
version of the saturatedAddition function. Made == and != into constexpr
functions since they are simple enough to be.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::getCounterDirectives const): Deleted. Caller can
handle this just fine without a helper function.
* rendering/style/RenderStyle.h: Ditto.
2018-01-09 Myles C. Maxfield <mmaxfield@apple.com>
font-display:fallback can cause a visual flash (which is supposed to be impossible)
https://bugs.webkit.org/show_bug.cgi?id=181374
Reviewed by Simon Fraser.
A FontCascade represents an entire font-family fallback list, but sometimes we need to pull out a single
representative font from the list to calculate things like line height. Previously, if the first item in
the font-family list was in the middle of being downloaded, this representative font was hardcoded to be
Times. However, when actually laying out and drawing the glyphs, we have logic to skip the interstitial
Times if there are any installed fonts present in the font-family list (so you wouldn't ever actually
see Times). This means that line height (among other things) was being calculated as if Times was used,
but in reality, some other font from the font-family list was being used.
Alone, this isn't a huge problem, but font-display:fallback makes a font transition between "timed out"
and "failed," and when the font hits the failed state, the representative font skips over the cancelled
item and hits the next item in the fallback list. This means that line heights will change, which causes
a visual flash, even when font-display:fallback is specified.
The solution is simply to educate the logic which identifies this representative font so that it
understands what to do for currently-loading fonts.
Tests: fast/text/font-display/swap-flash.html
* platform/graphics/FontCascadeFonts.h:
(WebCore::FontCascadeFonts::primaryFont):
* rendering/line/BreakingContext.h:
(WebCore::textWidth):
2018-01-04 Filip Pizlo <fpizlo@apple.com>
CodeBlocks should be in IsoSubspaces
https://bugs.webkit.org/show_bug.cgi?id=180884
Reviewed by Saam Barati.
No new tests because no new behavior.
Adopting new parallel constraint API, so that more of the logic of doing parallel
constraint solving is shared between the DOM's output constraints and JSC's output
constraints.
* bindings/js/DOMGCOutputConstraint.cpp:
(WebCore::DOMGCOutputConstraint::executeImpl):
(WebCore::DOMGCOutputConstraint::doParallelWorkImpl): Deleted.
(WebCore::DOMGCOutputConstraint::finishParallelWorkImpl): Deleted.
* bindings/js/DOMGCOutputConstraint.h:
2018-01-08 Simon Fraser <simon.fraser@apple.com>
Clean up Marquee-related enums
https://bugs.webkit.org/show_bug.cgi?id=181347
Reviewed by Anders Carlsson.
Modernize EMarqueeBehavior and EMarqueeDirection enums. Stop using the weird negative
values in the MarqueeDirection and do manual reverse direction mapping.
Make some member functions of RenderMarquee private.
Stop using bitfields in RenderMarquee because the memory saving is not worth it, and doing so
allows us to use modern initialization.
No behavior change.
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator MarqueeBehavior const):
(WebCore::CSSPrimitiveValue::operator MarqueeDirection const):
(WebCore::CSSPrimitiveValue::operator EMarqueeBehavior const): Deleted.
(WebCore::CSSPrimitiveValue::operator EMarqueeDirection const): Deleted.
* css/StyleResolver.cpp:
(WebCore::StyleResolver::adjustRenderStyle):
* rendering/RenderBox.cpp:
(WebCore::RenderBox::sizesLogicalWidthToFitContent const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderMarquee.cpp:
(WebCore::RenderMarquee::RenderMarquee):
(WebCore::reverseDirection):
(WebCore::RenderMarquee::direction const):
(WebCore::RenderMarquee::isHorizontal const):
(WebCore::RenderMarquee::computePosition):
(WebCore::RenderMarquee::start):
(WebCore::RenderMarquee::updateMarqueePosition):
(WebCore::RenderMarquee::updateMarqueeStyle):
(WebCore::RenderMarquee::timerFired):
* rendering/RenderMarquee.h:
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::marqueeBehavior const):
(WebCore::RenderStyle::marqueeDirection const):
(WebCore::RenderStyle::setMarqueeDirection):
(WebCore::RenderStyle::setMarqueeBehavior):
(WebCore::RenderStyle::initialMarqueeBehavior):
(WebCore::RenderStyle::initialMarqueeDirection):
* rendering/style/RenderStyleConstants.h:
* rendering/style/StyleMarqueeData.cpp:
(WebCore::StyleMarqueeData::StyleMarqueeData):
* rendering/style/StyleMarqueeData.h:
2018-01-09 Jer Noble <jer.noble@apple.com>
Many CVDisplayLink threads created and destroyed while watching a YouTube video
https://bugs.webkit.org/show_bug.cgi?id=181396
Reviewed by Simon Fraser.
When watching some YouTube videos (or any video with default controls), event handlers for
the "timeupdate" event which use rAF will cause the underlying platform objects to be
destroyed in between "timeupdate" events being fired, since they occur every 250ms, and rAF
objects are destroyed every 166ms (or 10/60hz). Update this constant to destroy the
underlying objects every 333ms (or 20/60hz) so that this common pattern doesn't lead to
excessive rAF platform object turnover.
* platform/Logging.h:
* platform/graphics/DisplayRefreshMonitor.h:
(WebCore::DisplayRefreshMonitor::shouldBeTerminated const):
* platform/graphics/DisplayRefreshMonitor.cpp:
(WebCore::DisplayRefreshMonitor::displayDidRefresh):
* platform/graphics/DisplayRefreshMonitorManager.cpp:
(WebCore::DisplayRefreshMonitorManager::createMonitorForClient):
(WebCore::DisplayRefreshMonitorManager::displayDidRefresh):
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderElement addChild mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181451
<rdar://problem/36385562>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::addChild):
(WebCore::RenderElement::childRequiresTable const): Deleted.
* rendering/RenderElement.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderElement):
(WebCore::RenderTreeBuilder::childRequiresTable):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::newChildIsInline):
(WebCore::newChildIsInline): Deleted.
* rendering/updating/RenderTreeBuilderInline.h:
2018-01-09 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r226531.
This caused test failures on macOS WK2.
Reverted changeset:
"Use no-cache fetch mode when loading main documents with
location.reload()"
https://bugs.webkit.org/show_bug.cgi?id=181285
https://trac.webkit.org/changeset/226531
2018-01-09 Michael Saboff <msaboff@apple.com>
Unreviewed, rolling out r226600 and r226603
https://bugs.webkit.org/show_bug.cgi?id=181351
Add a DOM gadget for Spectre testing
* dom/Comment.cpp:
(WebCore::Comment::Comment):
(WebCore::Comment::setReadLength): Deleted.
(WebCore::Comment::charCodeAt): Deleted.
(WebCore::Comment::clflushReadLength): Deleted.
* dom/Comment.h:
* dom/Comment.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const): Deleted.
* page/RuntimeEnabledFeatures.h:
2018-01-09 Don Olmstead <don.olmstead@sony.com>
Add additional WEBCORE_EXPORTs
https://bugs.webkit.org/show_bug.cgi?id=181414
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* dom/Document.h:
* dom/ViewportArguments.h:
* page/DOMWindow.h:
* page/FrameView.h:
* page/PageOverlayController.h:
* platform/ContextMenuItem.h:
* platform/Pasteboard.h:
* platform/SharedBuffer.h:
* platform/UserAgent.h:
* platform/graphics/GLContext.h:
* platform/graphics/GraphicsContext.h:
* platform/graphics/GraphicsLayerTransform.h:
* platform/graphics/PlatformDisplay.h:
* platform/graphics/cairo/BackingStoreBackendCairoImpl.h:
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/cairo/RefPtrCairo.h:
* platform/graphics/nicosia/NicosiaBuffer.h:
* platform/graphics/nicosia/NicosiaPaintingEngine.h:
* platform/graphics/texmap/TextureMapper.h:
* platform/graphics/texmap/TextureMapperAnimation.h:
* platform/graphics/texmap/TextureMapperBackingStore.h:
* platform/graphics/texmap/TextureMapperFPSCounter.h:
* platform/graphics/texmap/TextureMapperLayer.h:
(WebCore::TextureMapperLayer::TextureMapperLayer): Deleted.
(WebCore::TextureMapperLayer::setID): Deleted.
(WebCore::TextureMapperLayer::id): Deleted.
(WebCore::TextureMapperLayer:: const): Deleted.
(WebCore::TextureMapperLayer::setScrollClient): Deleted.
(WebCore::TextureMapperLayer::setIsScrollable): Deleted.
(WebCore::TextureMapperLayer::isScrollable const): Deleted.
(WebCore::TextureMapperLayer::textureMapper const): Deleted.
(WebCore::TextureMapperLayer::setTextureMapper): Deleted.
(WebCore::TextureMapperLayer::drawsContent const): Deleted.
(WebCore::TextureMapperLayer::contentsAreVisible const): Deleted.
(WebCore::TextureMapperLayer::size const): Deleted.
(WebCore::TextureMapperLayer::opacity const): Deleted.
(WebCore::TextureMapperLayer::transform const): Deleted.
(WebCore::TextureMapperLayer::hasFilters const): Deleted.
(WebCore::TextureMapperLayer::isShowingRepaintCounter const): Deleted.
(WebCore::TextureMapperLayer::fixedToViewport const): Deleted.
(WebCore::TextureMapperLayer::rootLayer const): Deleted.
(WebCore::TextureMapperLayer::texture): Deleted.
(WebCore::TextureMapperLayer::adjustedPosition const): Deleted.
(WebCore::TextureMapperLayer::layerRect const): Deleted.
(WebCore::TextureMapperLayer::State::State): Deleted.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
(WebCore::CoordinatedGraphicsLayer::isScrollable const): Deleted.
(WebCore::CoordinatedGraphicsLayer::id const): Deleted.
(WebCore::CoordinatedGraphicsLayer::coverRect const): Deleted.
(WebCore::CoordinatedGraphicsLayer::fixedToViewport const): Deleted.
* platform/graphics/texmap/coordinated/CoordinatedImageBacking.h:
(WebCore::CoordinatedImageBacking::id const): Deleted.
* platform/graphics/texmap/coordinated/TiledBackingStore.h:
* platform/graphics/texmap/coordinated/UpdateAtlas.h:
* platform/network/AuthenticationChallengeBase.h:
* platform/network/CredentialBase.h:
* platform/network/ProtectionSpaceBase.h:
* platform/network/curl/SocketStreamHandleImpl.h:
* replay/UserInputBridge.h:
2018-01-09 Basuke Suzuki <Basuke.Suzuki@sony.com>
[Curl] Move FormData related tasks into new CurlFormDataStream class.
https://bugs.webkit.org/show_bug.cgi?id=181106
Reviewed by Alex Christensen.
No new tests because no behavior change.
* platform/Curl.cmake:
* platform/network/curl/CurlFormDataStream.cpp: Added.
(WebCore::CurlFormDataStream::CurlFormDataStream):
(WebCore::CurlFormDataStream::~CurlFormDataStream):
(WebCore::CurlFormDataStream::clean):
(WebCore::CurlFormDataStream::shouldUseChunkTransfer):
(WebCore::CurlFormDataStream::totalSize):
(WebCore::CurlFormDataStream::computeContentLength):
(WebCore::CurlFormDataStream::read):
(WebCore::CurlFormDataStream::readFromFile):
(WebCore::CurlFormDataStream::readFromData):
* platform/network/curl/CurlFormDataStream.h: Renamed from Source/WebCore/platform/network/curl/FormDataStreamCurl.h.
(WebCore::CurlFormDataStream::elementSize):
(WebCore::CurlFormDataStream::totalReadSize):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::willSendData):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::setupPUT):
(WebCore::CurlRequest::setupPOST):
(WebCore::CurlRequest::setupSendData):
(WebCore::CurlRequest::resolveBlobReferences): Deleted.
(WebCore::CurlRequest::setupFormData): Deleted.
* platform/network/curl/CurlRequest.h:
* platform/network/curl/FormDataStreamCurl.cpp: Removed.
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move MathML addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181443
<rdar://problem/36380228>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/mathml/RenderMathMLFenced.cpp:
(WebCore::RenderMathMLFenced::addChild):
(WebCore::RenderMathMLFenced::createMathMLOperator): Deleted.
(WebCore::RenderMathMLFenced::makeFences): Deleted.
* rendering/mathml/RenderMathMLFenced.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderMathMLFenced):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::mathMLBuilder):
2018-01-09 Antti Koivisto <antti@apple.com>
Blank page except for inner iframes because pending stylesheets cause style.isNotFinal() to be true
https://bugs.webkit.org/show_bug.cgi?id=180940
<rdar://problem/36116507>
Reviewed by Darin Adler.
Test: http/tests/local/loading-stylesheet-import-remove.html
If a <link> referencing a stylesheet containing an @import that was still loading was removed
from the document, the loading state was never cleared. For head stylesheets this blocked
rendering permanently.
Test reduction by Justin Ridgewell.
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::removedFromAncestor):
Test if the stylesheet it loading before clearing the pointer.
2018-01-09 Dan Bernstein <mitz@apple.com>
Removed some empty directories that were left behind
* Modules/indieui: Removed.
* Modules/vibration: Removed.
* platform/graphics/ca/mac: Removed.
* platform/mediastream/gstreamer: Removed.
2018-01-09 Antoine Quint <graouts@apple.com>
Refactor timing function solving code
https://bugs.webkit.org/show_bug.cgi?id=181428
Reviewed by Dean Jackson.
We have duplicated code to solve "cubic" and "steps" timing functions in AnimationBase and TextureMapperAnimation,
and we will soon need similar code to deal with timing functions in Web Animations. We move this code into TimingFunction
with a single transformTime() function that can be called directly on the timing function rather than having callers
figure out what type timing functions are to solve them.
No test as there shouldn't be any behavior change.
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::progress const):
(WebCore::solveEpsilon): Deleted.
(WebCore::solveCubicBezierFunction): Deleted.
(WebCore::solveStepsFunction): Deleted.
(WebCore::solveSpringFunction): Deleted.
* platform/animation/TimingFunction.cpp:
(WebCore::TimingFunction::transformTime const):
* platform/animation/TimingFunction.h:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::apply):
(WebCore::solveEpsilon): Deleted.
(WebCore::solveCubicBezierFunction): Deleted.
(WebCore::solveStepsFunction): Deleted.
(WebCore::applyTimingFunction): Deleted.
2018-01-09 Michael Catanzaro <mcatanzaro@igalia.com>
Unreviewed, silence -Wunused-parameter warning
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setupNewlyCreatedServiceWorker):
2018-01-09 Said Abou-Hallawa <sabouhallawa@apple.com>
Check Image::m_image is not null in ImageLoader::decode()
https://bugs.webkit.org/show_bug.cgi?id=180386
<rdar://problem/34634483>
Reviewed by Tim Horton.
Ensure ImageLoader::m_image is not null before referencing it.
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::decode):
2018-01-09 Yusuke Suzuki <utatane.tea@gmail.com>
[FreeType] Use FastMalloc for FreeType
https://bugs.webkit.org/show_bug.cgi?id=181387
Reviewed by Michael Catanzaro.
Add custom memory allocator for FreeType to use FastMalloc.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::initializeFreeTypeLibrary):
(WebCore::createFontCustomPlatformData):
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderTable* addChild mutation logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181424
<rdar://problem/36368628>
Reviewed by Antti Koivisto.
This is about moving code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
Covered by existing tests.
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::insertChildToRenderTable):
(WebCore::RenderTreeBuilder::insertChildToRenderTableSection):
(WebCore::RenderTreeBuilder::insertChildToRenderTableRow):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::insertChild):
* rendering/updating/RenderTreeBuilderTable.h:
2018-01-09 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Transition Render*::addChild() calls to RenderTreeBuilder::insertChildToRender*()
https://bugs.webkit.org/show_bug.cgi?id=181407
<rdar://problem/36361176>
Reviewed by Antti Koivisto.
Eventually all mutation will be going through the RenderTreeBuilder.
No change in functionality.
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::addChild):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::findOrCreateParentForChild):
2018-01-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Ensure SleepDisabler is not held by pages in page cache
https://bugs.webkit.org/show_bug.cgi?id=180197
Reviewed by Eric Carlson.
The sleep disabler is now checked again whenever the media player
playback state or other characteristic has changed in the media
engine.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerPlaybackStateChanged):
Check if the sleep disabler state needs to be updated or not.
(WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto.
(WebCore::HTMLMediaElement::shouldDisableSleep const): Enable
sleep disabler for GTK and WPE ports.
2018-01-09 Philippe Normand <pnormand@igalia.com>
[GStreamer] Missing notifications to player client
https://bugs.webkit.org/show_bug.cgi?id=181432
Reviewed by Carlos Garcia Campos.
We now properly emit playback state changes and characteristic
updates to the client when the pipeline state changes and when
audio/video tracks changes are detected.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
This debug message appears too often in logs. Demote.
(WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): Emit
charasteristicChanged notification.
(WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::updateStates): Keep track
of old and current pipeline state.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
2018-01-09 Youenn Fablet <youenn@apple.com>
Add CSP support to service workers
https://bugs.webkit.org/show_bug.cgi?id=181385
Reviewed by Chris Dumez.
Covered by rebased tests.
Added recovery of CSP information from WorkerScriptLoader.
Added plumbing to pass the CSP information to Service Workers.
Did not add persistency support for the CSP information as this requires changing the SQL database schema.
This will be done in a follow-up.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::contentSecurityPolicy const):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::finishedFetchingScript):
(WebCore::SWClientConnection::failedFetchingScript):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_contentSecurityPolicy):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:
2018-01-09 Antoine Quint <graouts@apple.com>
Provide a method to obtain a CSS value from a RenderStyle by CSSPropertyID
https://bugs.webkit.org/show_bug.cgi?id=181429
Reviewed by Antti Koivisto.
The KeyframeEffect.getKeyframes() method from Web Animations requires that we return all styles applied at a given
animation effect keyframe. When we parse keyframes, we create RenderStyle objects that are stored in a KeyframeList,
as well as a list of CSSPropertyIDs that are animated. In order to provide the list of animated properties and their
values when calling getKeyframes(), we need to be able to read back from the RenderStyle we create. As a first step
towards this goal, we factor some code in ComputedStyleExtractor::propertyValue() out into a new method
ComputedStyleExtractor::valueForPropertyinStyle() which takes in an explicit RenderStyle.
No test as this is simply refactoring that doesn't change or add behavior.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
(WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
* css/CSSComputedStyleDeclaration.h:
2018-01-09 Youenn Fablet <youenn@apple.com>
SWClientConnection should not keep references to service worker jobs
https://bugs.webkit.org/show_bug.cgi?id=181381
Reviewed by Chris Dumez.
Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
Instead pass job identifiers and related data to the main thread.
Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::scheduleJob):
(WebCore::SWClientConnection::failedFetchingScript):
(WebCore::SWClientConnection::postTaskForJob):
(WebCore::SWClientConnection::jobRejectedInServer):
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::unregistrationJobResolvedInServer):
(WebCore::SWClientConnection::startScriptFetchForServer):
(WebCore::SWClientConnection::clearPendingJobs):
(WebCore::SWClientConnection::finishedFetchingScript): Deleted.
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::rejectJob):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::resolveUnregistrationJob):
(WebCore::SWServer::startScriptFetch):
* workers/service/server/SWServer.h:
2018-01-09 Carlos Garcia Campos <cgarcia@igalia.com>
REGRESSION(r224460): Text fields sometimes get "messed up"
https://bugs.webkit.org/show_bug.cgi?id=181115
Reviewed by Zalan Bujtas.
Add the scroll position to paint offset before computing the clip rectangle. Before r224460, scroll position was
substracted after the clip rectangle was computed.
* rendering/LayoutState.cpp:
(WebCore::LayoutState::computeClipRect):
2018-01-09 Ali Juma <ajuma@chromium.org>
Implement VisualViewport API events
https://bugs.webkit.org/show_bug.cgi?id=179386
Reviewed by Frédéric Wang.
Implement the events (resize and scroll) defined by the Visual Viewport API
(https://wicg.github.io/visual-viewport/#events).
This is behind the VisualViewportAPI experimental feature flag.
In order to detect when events need to be fired, change the computation of
Visual Viewport attributes to happen whenever the layout viewport is updated
rather than only on-demand.
Tests: fast/visual-viewport/resize-event-fired-window-resized.html
fast/visual-viewport/resize-event-fired.html
fast/visual-viewport/scroll-event-fired.html
* dom/Document.cpp:
(WebCore::Document::addListenerTypeIfNeeded):
Add support for tracking resize event listeners.
* dom/Document.h:
* dom/DocumentEventQueue.cpp:
(WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
(WebCore::DocumentEventQueue::enqueueScrollEvent):
Factored out of enqueueOrDispatchScrollEvent so that this logic can be reused
for Visual Viewport scroll events.
(WebCore::DocumentEventQueue::enqueueResizeEvent):
(WebCore::DocumentEventQueue::pendingEventTimerFired):
* dom/DocumentEventQueue.h:
* page/FrameView.cpp:
(WebCore::FrameView::updateLayoutViewport):
* page/VisualViewport.cpp:
(WebCore::VisualViewport::addEventListener):
(WebCore::layoutIfNonNull):
(WebCore::VisualViewport::offsetLeft const):
Remove attribute computation logic since this now happens during update().
(WebCore::VisualViewport::offsetTop const): Ditto.
(WebCore::VisualViewport::pageLeft const): Ditto.
(WebCore::VisualViewport::pageTop const): Ditto.
(WebCore::VisualViewport::width const): Ditto.
(WebCore::VisualViewport::height const): Ditto.
(WebCore::VisualViewport::scale const):
(WebCore::VisualViewport::update):
Added. Computes all of the Visual Viewport attributes and determines
whether events need to be fired.
(WebCore::VisualViewport::enqueueResizeEvent):
(WebCore::VisualViewport::enqueueScrollEvent):
(WebCore::getFrameViewAndLayoutIfNonNull): Deleted.
* page/VisualViewport.h:
2018-01-09 Yacine Bandou <yacine.bandou_ext@softathome.com>
[EME] Add the CENC initData support in ClearKey CDM
https://bugs.webkit.org/show_bug.cgi?id=180081
Reviewed by Xabier Rodriguez-Calvar.
Add the "cenc" initDataType support in ClearKey CDM.
Parse the CENC initData and extract the KIDs by following the W3C spec
https://www.w3.org/TR/eme-initdata-cenc/#common-system
Tests: media/encrypted-media/clearKey/clearKey-message-cenc-event.html
media/encrypted-media/clearKey/clearKey-message-cenc-event-mse.html
* platform/encryptedmedia/clearkey/CDMClearKey.cpp:
(WebCore::extractKeyidsLocationFromCencInitData):
(WebCore::isCencInitData):
(WebCore::extractKeyidsFromCencInitData):
(WebCore::CDMPrivateClearKey::supportsInitDataType const):
(WebCore::CDMPrivateClearKey::supportsInitData const):
(WebCore::CDMInstanceClearKey::requestLicense):
2018-01-09 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Pass state values directly to Cairo operations
https://bugs.webkit.org/show_bug.cgi?id=181389
Reviewed by Carlos Garcia Campos.
Instead of passing reference to the GraphicsContextState object to
various Cairo operations, only pass the required state values. This
makes it explicit what state values are used in these operations, at the
expense of some long parameter lists, but this will be better addressed
by future refactoring of this code into more concise functions.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::dashedLineCornerWidthForStrokeWidth):
(WebCore::Cairo::dashedLinePatternWidthForStrokeWidth):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawRect):
(WebCore::Cairo::drawLine):
(WebCore::Cairo::drawEllipse):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawRect):
(WebCore::GraphicsContext::drawLine):
(WebCore::GraphicsContext::drawEllipse):
2018-01-09 Ryosuke Niwa <rniwa@webkit.org>
Release assert in addResourceTiming when a cache resource is requested during style recalc
https://bugs.webkit.org/show_bug.cgi?id=181137
<rdar://problem/35666574>
Reviewed by Simon Fraser.
Make the dispatching of resourcetimingbufferfull event asynchronous to avoid dispatching it
synchronously during a style resolution when CachedResourceLoader::requestImage requests
a previously loaded image.
We now schedule a timer when the resource timing buffer becomes full, and dispatch the event
when the timer fires. Meanwhile, we have a backup buffer to which additional resource timing
entries would be added. Once the event is dispatched, we refill the buffer exposed to author
scripts. When refilling the buffer results in it becoming full again, we keep repeating the
process of firing resourcetimingbufferfull and re-filling the buffer until either we stop
making progress (i.e. the script didn't increase the number of empty entires in the buffer)
or the backup buffer (at the time we started this process) becomes empty.
Also fixed a bug that we were firing resourcetimingbufferfull event when the last entry that
fits within the buffer size was added instead of when an entry is being added to an already
full buffer. To make this work, the patch introduces m_resourceTimingBufferFullFlag,
representing the concept "resource timing buffer full" flag in the resource timing specification.
Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-crash.html
* page/Performance.cpp:
(WebCore::Performance::Performance):
(WebCore::Performance::clearResourceTimings):
(WebCore::Performance::setResourceTimingBufferSize):
(WebCore::Performance::addResourceTiming):
(WebCore::Performance::resourceTimingBufferFullTimerFired):
* page/Performance.h:
2018-01-08 Chris Nardi <csnardi1@gmail.com>
::first-letter incorrectly selects grapheme pairs
https://bugs.webkit.org/show_bug.cgi?id=181315
Reviewed by Darin Adler.
Grapheme pairs were incorrectly selected by ::first-letter. This
change fixes their selection.
Tests: Updated fast/css/first-letter-punctuation.html and imported
LayoutTests/imported/w3c/web-platform-tests/css/css-pseudo-4/first-letter-004.html
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::isPunctuationForFirstLetter):
(WebCore::shouldSkipForFirstLetter):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
2018-01-08 Darin Adler <darin@apple.com>
Special list-item counter starts from an incorrect number for ::before and ::after
https://bugs.webkit.org/show_bug.cgi?id=181084
Reviewed by Zalan Bujtas.
Test: fast/css/counters/counter-list-item.html
* Sources.txt: Removed CounterDirectives.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::counterToCSSValue): Updated for changes to the CounterDirectives struct.
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInheritCounter): Ditto.
(WebCore::StyleBuilderCustom::applyValueCounter): Ditto.
* html/HTMLLIElement.cpp:
(WebCore::HTMLLIElement::parseValue): Call setExplicitValue(std::nullopt) instead
of clearExplicitValue since we are using std::optional now.
* rendering/RenderCounter.cpp:
(WebCore::listItemCounterDirectives): Added. Computes the counter directives that
express the effects on the list-item counter from list item and list elements.
Used something as close to what the CSS 3 draft says as possible. This uses a
negative increment when creating a list to counteract the positive increment done
by a list element, except in the case of an unordered list. This is where the bug
fix actually lies. Also fixed handling of reversed ordered lists at the same time.
(WebCore::planCounter): Refactored to use the function above. Also changed the
code to pay attention to both the counter directives and the implicit ones from
list item and list elements, getting as close as possible to what the specification
seems to call for.
* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::RenderListItem): Since we are using std::optional and no
longer using bit fields, simplified the constructor for each list item.
(WebCore::RenderListItem::calcValue const): Deleted.
(WebCore::RenderListItem::updateValueNow const): Merged in all the code from the
old calcValue function, but it is also simpler now since m_value is std::optional.
(WebCore::RenderListItem::updateValue): Updated to use std::optional.
(WebCore::RenderListItem::setExplicitValue): Ditto.
(WebCore::RenderListItem::clearExplicitValue): Deleted.
(WebCore::RenderListItem::updateListMarkerNumbers): Updated to use std::optional.
(WebCore::RenderListItem::isInReversedOrderedList const): Added. This is used by
the counter code so it can decrement instead of incrementing.
* rendering/RenderListItem.h: Updated to use std::optional. Also marked functions
final instead of override and initialized m_notInList after making it not be a
bitfield any more.
* rendering/style/CounterDirectives.cpp: Removed.
* rendering/style/CounterDirectives.h: Removed most of the CounterDirectives
class and replaced it with a struct with two std::optional. Added an addClamped
function so the counter code can share it with the addIncrementValue function.
If we want to make a faster version that doesn't use double, we can come back
and do that. Also moved the == function to the header since the implementation
is so trivial.
* rendering/style/StyleAllInOne.cpp: Removed CounterDirectives.cpp.
* rendering/style/StyleRareNonInheritedData.cpp:
(WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): Updated to
use std::make_unique directly instead of using a clone function.
2018-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Expose HTMLAttachmentElement.uniqueIdentifier to bindings
https://bugs.webkit.org/show_bug.cgi?id=181420
<rdar://problem/36365827>
Reviewed by Alex Christensen.
Add a new IDL definition for uniqueIdentifier on HTMLAttachmentElement. This allows clients to relate attachment
elements in the DOM to _WKAttachments delivered via Objective-C SPI.
Adjusted existing tests in WKAttachmentTests.
* html/HTMLAttachmentElement.idl:
2018-01-08 Don Olmstead <don.olmstead@sony.com>
AccessibilityARIAGrid does not compile when accessibility is disabled
https://bugs.webkit.org/show_bug.cgi?id=181418
<rdar://problem/36365398>
Reviewed by Chris Fleizach.
No new tests. No change in behavior.
* accessibility/AccessibilityARIAGrid.cpp:
2018-01-08 Commit Queue <commit-queue@webkit.org>
Unreviewed, rolling out r226532 and r226540.
https://bugs.webkit.org/show_bug.cgi?id=181422
jessie says basic browsing does not seem to work (Requested by
alexchristensen on #webkit).
Reverted changesets:
"Add CSP support to service workers"
https://bugs.webkit.org/show_bug.cgi?id=181385
https://trac.webkit.org/changeset/226532
"SWClientConnection should not keep references to service
worker jobs"
https://bugs.webkit.org/show_bug.cgi?id=181381
https://trac.webkit.org/changeset/226540
2018-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Expose file name and content type of WKAttachment
https://bugs.webkit.org/show_bug.cgi?id=181390
<rdar://problem/36336837>
Reviewed by Tim Horton.
Add new structs in AttachmentTypes.h and refactor HTMLAttachmentElement::requestData to requestInfo. See below
for more details. Augmented existing API tests in WKAttachmentTests.
* html/AttachmentTypes.h:
Add a struct to represent a snapshot of information about an attachment element.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::requestInfo):
(WebCore::HTMLAttachmentElement::requestData): Deleted.
* html/HTMLAttachmentElement.h:
Change requestData to requestInfo. Instead of fetching and delivering data via callback, requestInfo returns an
AttachmentInfo.
* rendering/RenderThemeIOS.mm:
(WebCore::RenderAttachmentInfo::addLine):
(WebCore::RenderAttachmentInfo::buildWrappedLines):
(WebCore::RenderAttachmentInfo::buildSingleLine):
(WebCore::RenderAttachmentInfo::RenderAttachmentInfo):
(WebCore::RenderThemeIOS::attachmentBaseline const):
(WebCore::paintAttachmentIcon):
(WebCore::paintAttachmentText):
(WebCore::paintAttachmentProgress):
(WebCore::attachmentBorderPath):
(WebCore::RenderThemeIOS::paintAttachment):
(WebCore::AttachmentInfo::addLine): Deleted.
(WebCore::AttachmentInfo::buildWrappedLines): Deleted.
(WebCore::AttachmentInfo::buildSingleLine): Deleted.
(WebCore::AttachmentInfo::AttachmentInfo): Deleted.
Rename AttachmentInfo to RenderAttachmentInfo to resolve a name conflict with the new AttachmentInfo struct.
2018-01-08 Saam Barati <sbarati@apple.com>
Speculative build fix after r226600. We only use clflush on x86 and the `asm volatile` syntax is not available in the Windows build.
No new tests because this is a build fix.
* dom/Comment.cpp:
(WebCore::Comment::clflushReadLength):
2018-01-08 Michael Saboff <msaboff@apple.com>
Add a DOM gadget for Spectre testing
https://bugs.webkit.org/show_bug.cgi?id=181351
Reviewed by Saam Barati.
This change is used to test Spectre mitigations.
Added a side data array to the Comment DOM node to test for Spectre issues in
the DOM layer. This additional functionality is disabled by default and must
be enabled through the JSC option "enableSpectreGadgets".
* dom/Comment.cpp:
(WebCore::Comment::Comment):
(WebCore::Comment::setReadLength):
(WebCore::Comment::charCodeAt):
(WebCore::Comment::clflushReadLength):
* dom/Comment.h:
* dom/Comment.idl:
* page/RuntimeEnabledFeatures.cpp:
(WebCore::RuntimeEnabledFeatures::spectreGadgetsEnabled const):
* page/RuntimeEnabledFeatures.h:
2018-01-08 Said Abou-Hallawa <sabouhallawa@apple.com>
A canvas should not be tainted if it draws a data URL SVGImage with a <foreignObject>
https://bugs.webkit.org/show_bug.cgi?id=180301
Reviewed by Dean Jackson.
Don't taint the canvas if it draws a data URL SVGImage with a <foreignObject>.
There should not be a cross-origin data leak in this case.
Tests: svg/as-image/svg-canvas-data-url-svg-with-feimage-not-tainted.html
svg/as-image/svg-canvas-data-url-svg-with-foreign-object-not-tainted.html
svg/as-image/svg-canvas-data-url-svg-with-image-not-tainted.html
* html/ImageBitmap.cpp:
(WebCore::taintsOrigin):
* html/canvas/CanvasRenderingContext.cpp:
(WebCore::CanvasRenderingContext::wouldTaintOrigin):
2018-01-08 Don Olmstead <don.olmstead@sony.com>
Simplify platform checks in Graphics Context
https://bugs.webkit.org/show_bug.cgi?id=181344
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* platform/graphics/ANGLEWebKitBridge.h:
* platform/graphics/GLContext.h:
* platform/graphics/GraphicsContext3D.h:
* platform/graphics/OpenGLESShims.h:
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::checkVaryingsPacking const):
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move SVG addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181405
<rdar://problem/36360476>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::addChild):
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::addChild):
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::addChild):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToSVGContainer):
(WebCore::RenderTreeBuilder::insertChildToSVGInline):
(WebCore::RenderTreeBuilder::insertChildToSVGRoot):
(WebCore::RenderTreeBuilder::insertChildToSVGText):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::SVGBuilder):
* rendering/updating/RenderTreeBuilderSVG.cpp: Added.
(WebCore::RenderTreeBuilder::SVG::SVG):
(WebCore::RenderTreeBuilder::SVG::insertChild):
* rendering/updating/RenderTreeBuilderSVG.h: Added.
2018-01-08 John Wilander <wilander@apple.com>
Storage Access API: Remove access for all frames under a page when the page is closed
https://bugs.webkit.org/show_bug.cgi?id=181398
<rdar://problem/36357879>
Reviewed by Alex Christensen.
No new tests. Discussed with Alex Christensen and we concluded that
both a layout test and an API test would require a lot of work and
we have existing tests for clearing out storage access for frames.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage):
2018-01-08 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r226385.
The test introduced with this was a flaky since being added.
Reverted changeset:
"AX: when invert colors is on, double-invert certain media
elements in UserAgentStyleSheet"
https://bugs.webkit.org/show_bug.cgi?id=168447
https://trac.webkit.org/changeset/226385
2018-01-08 Youenn Fablet <youenn@apple.com>
SWClientConnection should not keep references to service worker jobs
https://bugs.webkit.org/show_bug.cgi?id=181381
Reviewed by Chris Dumez.
Difficult to test determiniscally but corresponding crash log should no longer happen in debug builds.
Stopped passing ServiceWorkerJob references from ServiceWorkerContainer (potentially in service worker thread) to SWClientConnection (main thread).
Instead pass job identifiers and related data to the main thread.
Minor refactoring to use ServiceWorkerJobIdentifier instead of ServiceWorkerJobDataIdentifier which contains more data than needed.
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::scheduleJob):
(WebCore::SWClientConnection::failedFetchingScript):
(WebCore::SWClientConnection::postTaskForJob):
(WebCore::SWClientConnection::jobRejectedInServer):
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::unregistrationJobResolvedInServer):
(WebCore::SWClientConnection::startScriptFetchForServer):
(WebCore::SWClientConnection::clearPendingJobs):
(WebCore::SWClientConnection::finishedFetchingScript): Deleted.
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::scheduleJob):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::rejectJob):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::resolveUnregistrationJob):
(WebCore::SWServer::startScriptFetch):
* workers/service/server/SWServer.h:
2018-01-08 Wenson Hsieh <wenson_hsieh@apple.com>
Copying, pasting, and then deleting an attachment element breaks attachment data requests
https://bugs.webkit.org/show_bug.cgi?id=181365
<rdar://problem/36340647>
Reviewed by Tim Horton.
Currently, copying and pasting an attachment element within the same document and then deleting backwards to
remove the pasted attachment element causes the original attachment element to be inaccessible via SPI. This is
because there are now two different attachment elements with the same unique identifier, such that Document,
which keeps a map of all unique attachment identifiers to attachment elements, will lose track of the original
attachment element.
To fix this, we ensure that attachment elements should always have unique identifiers when they are inserted
into the document. We make several small adjustments to accomplish this:
1. First, refactor HTMLAttachmentElement's unique identifier so that it no longer depends on the value of the
"webkitattachmentid" attribute, and is instead just a member of HTMLAttachmentElement that is not exposed to
DOM bindings. This means setting and querying an attachment element's uniqueIdentifier can be done without
triggering any side effects, such as layout or mutation events.
2. Next, make "webkitattachmentid" a temporary attribute similar to "webkitattachmentpath" and
"webkitattachmentbloburl", so that it is added only when generating a markup fragment for editing, and
removed upon deserialization.
3. Lastly, shift the responsibility of assigning a unique identifier to an attachment away from places where we
create attachment elements, and instead have Document enforce this when an attachment element is inserted.
Tests: WKAttachmentTests.InsertAndRemoveDuplicateAttachment
WKAttachmentTests.InsertDuplicateAttachmentAndUpdateData
* dom/Document.cpp:
(WebCore::Document::didInsertAttachmentElement):
Assign the unique identifier of an attachment element that has been inserted. If the identifier already tracks
an existing attachment element in the document or is missing, reassign the identifier to a new value.
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentForImageAttachment):
(WebCore::replaceRichContentWithAttachments):
(WebCore::WebContentReader::readFilePaths):
Remove calls to setUniqueIdentifier here, since Document will assign a unique identifier upon insertion.
* editing/markup.cpp:
(WebCore::StyledMarkupAccumulator::appendCustomAttributes):
(WebCore::createFragmentFromMarkup):
Set the attachment's unique identifier to the value of the "webkitattachmentid" attribute. When moving existing
attachments around in the DOM without duplication, this ensures that the attachment will be removed and
reinserted in the document without triggering removal and insertion client delegate methods.
When pasting an attachment element that has the same identifier as an existing attachment, we let Document
realize that the attachment identifier already exists, and reassign it to a unique value.
* html/HTMLAttachmentElement.cpp:
(WebCore::HTMLAttachmentElement::uniqueIdentifier const): Deleted.
(WebCore::HTMLAttachmentElement::setUniqueIdentifier): Deleted.
* html/HTMLAttachmentElement.h:
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlockFlow addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181348
<rdar://problem/36328117>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderBlockFlow):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::blockFlowBuilder):
* rendering/updating/RenderTreeBuilderBlockFlow.cpp: Added.
(WebCore::RenderTreeBuilder::BlockFlow::BlockFlow):
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderBlockFlow.h: Added.
2018-01-08 Youenn Fablet <youenn@apple.com>
Add CSP support to service workers
https://bugs.webkit.org/show_bug.cgi?id=181385
Reviewed by Chris Dumez.
Covered by rebased tests.
Added recovery of CSP information from WorkerScriptLoader.
Added plumbing to pass the CSP information to Service Workers.
Added persistency support for the CSP information.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::loadAsynchronously):
(WebCore::WorkerScriptLoader::didReceiveResponse):
* workers/WorkerScriptLoader.h:
(WebCore::WorkerScriptLoader::contentSecurityPolicy const):
* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::finishedFetchingScript):
(WebCore::SWClientConnection::failedFetchingScript):
* workers/service/SWClientConnection.h:
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::encode const):
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::create):
* workers/service/ServiceWorkerGlobalScope.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::notifyFinished):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::ServiceWorkerThread::createWorkerGlobalScope):
* workers/service/server/RegistrationDatabase.cpp:
(WebCore::v1RecordsTableSchema):
(WebCore::RegistrationDatabase::openSQLiteDatabase):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::installContextData):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_contentSecurityPolicy):
(WebCore::SWServerWorker::contextData const):
* workers/service/server/SWServerWorker.h:
2018-01-08 Youenn Fablet <youenn@apple.com>
Use no-cache fetch mode when loading main documents with location.reload()
https://bugs.webkit.org/show_bug.cgi?id=181285
Reviewed by Alex Christensen.
Covered by rebased tests.
Start to translate cache policy used for navigation as FetchOptions::Cache.
This allows ensuring service workers receive the right cache mode when intercepting navigation loads.
To not change current navigation behavior, ReturnCacheDataElseLoad and ReturnCacheDataDontLoad still trigger default fetch cache mode.
For Reload and ReloadExpiredOnly frame load types, using no-cache mode is more efficient than reload mode,
as a conditional request will be sent if possible. This applies to location.reload which is consistent with other browsers.
Keep reload mode for ReloadFromOrigin.
* loader/DocumentLoader.cpp:
(WebCore::toFetchOptionsCache):
(WebCore::DocumentLoader::loadMainResource):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadFrameRequest):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::load):
(WebCore::FrameLoader::reload):
(WebCore::FrameLoader::defaultRequestCachingPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
* loader/NavigationScheduler.cpp:
2018-01-08 Youenn Fablet <youenn@apple.com>
Stop exposing fetch and extendable events to window
https://bugs.webkit.org/show_bug.cgi?id=181325
Reviewed by Chris Dumez.
Covered by updated tests.
Marked FetchEvent and ExtendableEvent as visible in ServiceWorker environments only.
Moved related Internals testing routines to ServiceWorkerInternals.
* testing/Internals.cpp:
(WebCore::Internals::waitForFetchEventToFinish): Deleted.
(WebCore::Internals::createBeingDispatchedFetchEvent): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* testing/ServiceWorkerInternals.cpp:
(WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
(WebCore::ServiceWorkerInternals::createBeingDispatchedFetchEvent):
* testing/ServiceWorkerInternals.h:
* testing/ServiceWorkerInternals.idl:
* workers/service/ExtendableEvent.idl:
* workers/service/FetchEvent.idl:
2018-01-08 Antti Koivisto <antti@apple.com>
REGRESSION (r219145): Toggling layer borders on a static document no longer works immediately
https://bugs.webkit.org/show_bug.cgi?id=176260
<rdar://problem/34219966>
Reviewed by Simon Fraser.
Optimization reveled bugs in debug indicator painting.
Test: compositing/debug-borders-dynamic.html
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::updateDebugIndicators):
(WebCore::GraphicsLayerCA::updateDebugBorder): Deleted.
- Rename to indicate this is not just about debug borders.
- Trigger display so repaint counters get painted. This helper is only called when the indicators change.
* platform/graphics/ca/GraphicsLayerCA.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
Ensure we do compositing update on debug border change even when there is no layout.
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderInline addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181336
<rdar://problem/36324693>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addChild):
(WebCore::RenderInline::addChildIgnoringContinuation):
(WebCore::RenderInline::childBecameNonInline):
(WebCore::nextContinuation): Deleted.
(WebCore::RenderInline::continuationBefore): Deleted.
(WebCore::newChildIsInline): Deleted.
(WebCore::RenderInline::cloneAsContinuation const): Deleted.
(WebCore::RenderInline::splitInlines): Deleted.
(WebCore::RenderInline::splitFlow): Deleted.
(WebCore::canUseAsParentForContinuation): Deleted.
(WebCore::RenderInline::addChildToContinuation): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderInline):
(WebCore::RenderTreeBuilder::insertChildToRenderInlineIgnoringContinuation):
(WebCore::RenderTreeBuilder::splitFlow):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::inlineBuilder):
* rendering/updating/RenderTreeBuilderInline.cpp: Added.
(WebCore::canUseAsParentForContinuation):
(WebCore::nextContinuation):
(WebCore::continuationBefore):
(WebCore::cloneAsContinuation):
(WebCore::newChildIsInline):
(WebCore::inFlowPositionedInlineAncestor):
(WebCore::RenderTreeBuilder::Inline::Inline):
(WebCore::RenderTreeBuilder::Inline::insertChild):
(WebCore::RenderTreeBuilder::Inline::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Inline::insertChildIgnoringContinuation):
(WebCore::RenderTreeBuilder::Inline::splitFlow):
(WebCore::RenderTreeBuilder::Inline::splitInlines):
* rendering/updating/RenderTreeBuilderInline.h: Added.
2018-01-08 Zalan Bujtas <zalan@apple.com>
[RenderTreeBuilder] Move RenderBlock addChild logic to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=181319
<rdar://problem/36313464>
Reviewed by Antti Koivisto.
This is about moving the code, no cleanup and/or normalization (unfortunately it also means
some temporary changes).
No change in functionality.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::addChild):
(WebCore::RenderBlock::addChildIgnoringContinuation):
(WebCore::RenderBlock::childBecameNonInline):
(WebCore::RenderBlock::continuationBefore): Deleted.
(WebCore::RenderBlock::addChildToContinuation): Deleted.
(WebCore::getInlineRun): Deleted.
(WebCore::RenderBlock::makeChildrenNonInline): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBox.cpp:
(WebCore::markBoxForRelayoutAfterSplit): Deleted.
(WebCore::RenderBox::splitAnonymousBoxesAroundChild): Deleted.
* rendering/RenderBox.h:
* rendering/RenderRubyBase.cpp:
(WebCore::RenderRubyBase::moveChildren):
(WebCore::RenderRubyBase::moveBlockChildren):
* rendering/RenderTable.cpp:
(WebCore::RenderTable::addChild):
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::addChild):
* rendering/RenderTableSection.cpp:
(WebCore::RenderTableSection::addChild):
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::markBoxForRelayoutAfterSplit):
(WebCore::getInlineRun):
(WebCore::RenderTreeBuilder::RenderTreeBuilder):
(WebCore::RenderTreeBuilder::insertChildToRenderBlock):
(WebCore::RenderTreeBuilder::insertChildToRenderBlockIgnoringContinuation):
(WebCore::RenderTreeBuilder::makeChildrenNonInline):
(WebCore::RenderTreeBuilder::splitAnonymousBoxesAroundChild):
* rendering/updating/RenderTreeBuilder.h:
(WebCore::RenderTreeBuilder::blockBuilder):
* rendering/updating/RenderTreeBuilderBlock.cpp: Added.
(WebCore::continuationBefore):
(WebCore::RenderTreeBuilder::Block::Block):
(WebCore::RenderTreeBuilder::Block::insertChild):
(WebCore::RenderTreeBuilder::Block::insertChildToContinuation):
(WebCore::RenderTreeBuilder::Block::insertChildIgnoringContinuation):
* rendering/updating/RenderTreeBuilderBlock.h: Added.
2018-01-08 Jeremy Jones <jeremyj@apple.com>
Standard controls sometimes say video is in pip when it isnt.
https://bugs.webkit.org/show_bug.cgi?id=181095
rdar://problem/36182687
Reviewed by Eric Carlson.
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::exitFullscreen):
2018-01-08 Jer Noble <jer.noble@apple.com>
REGRESSION: [iOS] ASSERTION FAILED: !node.isConnected() in WebCore::notifyNodeInsertedIntoDocument
https://bugs.webkit.org/show_bug.cgi?id=181091
Reviewed by Darin Adler.
Move the work previously performed in insertedIntoAncestor() into didFinishInsertingNode().
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::prepareForLoad):
2018-01-08 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Use isolated fill and stroke source containers
https://bugs.webkit.org/show_bug.cgi?id=181386
Reviewed by Carlos Garcia Campos.
Generate fill and stroke source objects upon invocation of various Cairo
operations, initializing necessary data from the GraphicsContextState
object.
Cairo::FillSource and Cairo::StrokeSource structs are introduced, both
being default-constructible as well as providing a constructor that
accepts a GraphicsContextState object from which the appropriate
resources are created.
The FillSource and StrokeSource objects are then passed to
PlatformContextCairo's prepareForFilling() and prepareForStroking()
methods. Here the helper prepareCairoContextSource() function is now
invoked with cairo_pattern_t objects as pattern or gradient sources, or
the source color if neither cairo_pattern_t object is specified.
The FillSource and StrokeSource constructors mimic the previous behavior
of prepareCairoContextSource(). In case the source is a Pattern object,
a cairo_pattern_t object is created from that. In case of FillSource,
we also retrieve pattern size, transform and repetition information. In
case the source os a Gradient object, we create a 'base' cairo_pattern_t
object for a completely opaque alpha channel. Additionally, if the alpha
value on the state is not 1, we create an alpha-adjusted cairo_pattern_t
that is potentially used for any filling or stroking operation that has
to preserve transparency. If neither Pattern or Gradient objects are set
on the GraphicsContextState, we default to the current fill or stroke
color.
Overall, there's no change in behavior, this is simply a refactoring
that enables us to construct Cairo objects for filling and stroking
sources at the time of Cairo operation dispatch, instead of pulling down
GraphicsContextState deeper into the Cairo-specific code.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::fillRect):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::fillPath):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillPath):
(WebCore::GraphicsContext::strokePath):
(WebCore::GraphicsContext::fillRect):
(WebCore::GraphicsContext::strokeRect):
(WebCore::GraphicsContext::fillRectWithRoundedHole):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::prepareCairoContextSource):
(WebCore::PlatformContextCairo::prepareForFilling):
(WebCore::PlatformContextCairo::prepareForStroking):
(WebCore::PlatformContextCairo::clipForPatternFilling):
* platform/graphics/cairo/PlatformContextCairo.h:
2018-01-08 Youenn Fablet <youenn@apple.com>
navigator.onLine does not work inside service workers
https://bugs.webkit.org/show_bug.cgi?id=181079
<rdar://problem/36178606>
Reviewed by Darin Adler.
Test: http/wpt/service-workers/online.https.html
Added support for onLine by reusing a similar implementation as regular workers.
Added ServiceWorkerInternals as an interface for an object exposed as self.internals in WTR.
This object has currently one method to trigger change in the online/offline status.
This allows writing a test for the onLine feature.
Note that self.internals is inserted asynchronously after the script was evaluated.
When writing a worker script using self.internals, one must make sure to use self.internals when initialized.
online-worker.js for instance makes use of self.internals in a postMessage callback.
* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WorkerScriptController.h:
* dom/ScriptExecutionContext.h:
* testing/ServiceWorkerInternals.cpp: Added.
(WebCore::ServiceWorkerInternals::ServiceWorkerInternals):
(WebCore::ServiceWorkerInternals::setOnline):
* testing/ServiceWorkerInternals.h: Added.
* testing/ServiceWorkerInternals.idl: Added.
* testing/js/WebCoreTestSupport.cpp:
(WebCoreTestSupport::setupNewlyCreateServiceWorker):
* testing/js/WebCoreTestSupport.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::registerServiceWorkerThreadForInstall):
(WebCore::SWContextManager::startedServiceWorker):
* workers/service/context/SWContextManager.h:
(WebCore::SWContextManager::setServiceWorkerCreationCallback):
(WebCore::SWContextManager::workerByID):
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::~ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::networkStateChanged):
(WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-01-08 Zan Dobersek <zdobersek@igalia.com>
[Cairo] Contain shadow blur requirement state in a separate object
https://bugs.webkit.org/show_bug.cgi?id=181380
Reviewed by Carlos Garcia Campos.
Instead of picking up the necessary state parameters from a
GraphicsContextState object, store the necessary parameters in a helper
ShadowBlurUsage struct. Mimicking the mustUseShadowBlur() function that
is being removed, values of the shadow color, shadow blur, and shadow
transform ignorance are stored there. Additionally, the required()
method accepts a PlatformContextCairo object through which it can
retrieve the current CTM and determine whether it's an identity, finally
deciding whether shadow blur can or cannot be ignored.
Goal of this change is to limit usage of GraphicsContextState directly
in operations implemented inside the Cairo namespace. Instead, the
state parameters should be passed directly, or an equivalent but limited
state object should be constructed for invocation of such operations.
This is likely only an intermediate solution. It's possible it will be
replaced by a more complete shadow state struct that would be used for
any operation that is required to draw shadows, if necessary.
No new tests -- no change in functionality.
* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::drawGlyphsShadow):
(WebCore::Cairo::ShadowBlurUsage::ShadowBlurUsage):
(WebCore::Cairo::ShadowBlurUsage::required const):
(WebCore::Cairo::fillRectWithRoundedHole):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::mustUseShadowBlur): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/FontCairo.cpp:
(WebCore::FontCascade::drawGlyphs):
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::fillRectWithRoundedHole):
2018-01-08 Philippe Normand <pnormand@igalia.com>
[GStreamer][Soup] Remove dead getCreateOrReadBuffer code path
https://bugs.webkit.org/show_bug.cgi?id=181376
Reviewed by Carlos Garcia Campos.
This code path is no longer used now that the GStreamer HTTP
source element uses data coming directly from the network process.
* SourcesGTK.txt:
* SourcesWPE.txt:
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResource::getOrCreateReadBuffer): Deleted.
* loader/MediaResourceLoader.h:
* loader/SubresourceLoader.h:
* loader/cache/CachedRawResource.h:
* loader/cache/CachedRawResourceClient.h:
(WebCore::CachedRawResourceClient::finishedTimingForWorkerLoad):
(WebCore::CachedRawResourceClient::getOrCreateReadBuffer): Deleted.
* loader/cache/CachedResource.h:
(WebCore::CachedResource::getOrCreateReadBuffer): Deleted.
* loader/soup/CachedRawResourceSoup.cpp: Removed.
* loader/soup/SubresourceLoaderSoup.cpp: Removed.
* platform/graphics/PlatformMediaResourceLoader.h:
(WebCore::PlatformMediaResourceClient::loadFinished):
(WebCore::PlatformMediaResourceClient::getOrCreateReadBuffer): Deleted.
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(CachedResourceStreamingClient::getOrCreateReadBuffer): Deleted.
* platform/network/ResourceHandleClient.h:
(WebCore::ResourceHandleClient::getOrCreateReadBuffer): Deleted.
* platform/network/soup/ResourceHandleSoup.cpp:
(WebCore::ResourceHandle::ensureReadBuffer):
2018-01-08 Zan Dobersek <zdobersek@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com>
[GStreamer] use FastMalloc-based GstAllocator
https://bugs.webkit.org/show_bug.cgi?id=165793
Reviewed by Philippe Normand.
Add GstAllocatorFastMalloc, a GstAllocator implementation using fast malloc. It's only used when fast malloc is
enabled and can be disabled using an environment variable for debugging purposes.
* platform/GStreamer.cmake:
* platform/graphics/gstreamer/GStreamerUtilities.cpp:
(WebCore::initializeGStreamer):
* platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp: Added.
(gstMemoryFastMallocNew):
(gstAllocatorFastMallocAlloc):
(gstAllocatorFastMallocFree):
(gstAllocatorFastMallocMemMap):
(gstAllocatorFastMallocMemUnmap):
(gstAllocatorFastMallocMemCopy):
(gstAllocatorFastMallocMemShare):
(gstAllocatorFastMallocMemIsSpan):
(gst_allocator_fast_malloc_class_init):
(gst_allocator_fast_malloc_init):
* platform/graphics/gstreamer/GstAllocatorFastMalloc.h: Added.
2018-01-07 Ms2ger <Ms2ger@igalia.com>
Implement createImageBitmap(ImageBitmap)
https://bugs.webkit.org/show_bug.cgi?id=181287
Reviewed by Darin Adler.
Tests: imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html
imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html
* html/ImageBitmap.cpp:
(WebCore::ImageBitmap::createPromise):
2018-01-07 Ryosuke Niwa <rniwa@webkit.org>
Reduce the precision of "high" resolution time to 1ms
https://bugs.webkit.org/show_bug.cgi?id=180910
<rdar://problem/36085943>
Reviewed by Saam Barati.
Reduced the high prevision time's resolution to 1ms, the same precision as Date.now().
Also fixed the bug in fillRTCStats that we weren't reducing the time resolution in RTCStats dictionaries.
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::fillRTCStats):
* page/Performance.cpp:
(WebCore::Performance::reduceTimeResolution):
2018-01-06 Simon Fraser <simon.fraser@apple.com>
Possible crash computing event regions
https://bugs.webkit.org/show_bug.cgi?id=181368
rdar://problem/34847081
Reviewed by Zalan Bujtas.
Don't trigger layout in Element::absoluteEventHandlerBounds(), since this can run arbirary script
which might delete elements or re-enter Document::absoluteRegionForEventTargets().
It's OK to not trigger layout, because if layout is dirty, the next layout will update event regions again.
Add a LayoutDisallowedScope to check that Document::absoluteRegionForEventTargets() doesn't
trigger layout, and move the check for LayoutDisallowedScope::isLayoutAllowed() from Document::updateLayout()
to LayoutContext::layout(), since some layouts don't happen via the former (e.g. the one being removed here).
The test checks that the assertion does not fire. I was not able to get a reliable test for any crash.
Test: fast/events/event-handler-regions-layout.html
* dom/Document.cpp:
(WebCore::Document::updateLayout):
(WebCore::Document::absoluteRegionForEventTargets):
* dom/Element.cpp:
(WebCore::Element::absoluteEventHandlerBounds):
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout):
* rendering/LayoutDisallowedScope.h: Move the #ifdefs around to avoid defining the enum twice.
(WebCore::LayoutDisallowedScope::LayoutDisallowedScope):
(WebCore::LayoutDisallowedScope::isLayoutAllowed):
2018-01-06 Simon Fraser <simon.fraser@apple.com>
Crash under RenderLayer::scrollTo() with marquee
https://bugs.webkit.org/show_bug.cgi?id=181349
rdar://problem/36190168
Reviewed by Zalan Bujtas.
Don't call updateWidgetPositions() synchonously during RenderLayer scrolling, because it
can run arbitrary script which may trigger destruction of this RenderLayer.
Instead, queue up updateWidgetPositions() on a zero-delay timer.
Under some circumstances this may allow a paint to occur before the widgets have been
updated (which could be fixed with a more invasive change), but in practice I saw no
painting issues with plug-ins or iframes inside overflow scroll, in WebKit or LegacyWebKit.
Test: fast/scrolling/marquee-scroll-crash.html
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::updateWidgetPositions):
(WebCore::FrameView::scheduleUpdateWidgetPositions):
(WebCore::FrameView::updateWidgetPositionsTimerFired):
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::scrollTo):
2018-01-05 Dean Jackson <dino@apple.com>
Accurately clip copyTexImage2D and copyTexSubImage2D
https://bugs.webkit.org/show_bug.cgi?id=181356
<rdar://problem/35083877>
Reviewed by Eric Carlson.
The code to make sure copyTexSubImage2D and copyTexImage2D will not try to read
out of bounds had a bad bug introduced here:
https://bugs.webkit.org/show_bug.cgi?id=51421
With appropriate parameters, it would produce a rectangle with
negative dimensions. Most GL drivers just ignored this, but some
are not happy.
Test: fast/canvas/webgl/copy-tex-image-and-sub-image-2d-bad-input.html
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::clip2D): Reimplement this in a more sane manner, and use
checked arithmetic while here.
* html/canvas/WebGLRenderingContextBase.h:
(WebCore::clip1D): Deleted.
(WebCore::clip2D): Deleted.
2018-01-06 Antti Koivisto <antti@apple.com>
Use WeakPtr for RenderTreePosition::m_nextSibling
https://bugs.webkit.org/show_bug.cgi?id=181363
Reviewed by Zalan Bujtas.
For safety. In most cases it is null and won't cause us to instantiate WeakReferences for
many new objects.
* rendering/updating/RenderTreePosition.cpp:
(WebCore::RenderTreePosition::computeNextSibling):
* rendering/updating/RenderTreePosition.h:
(WebCore::RenderTreePosition::RenderTreePosition):
(WebCore::RenderTreePosition::nextSibling const):
2018-01-05 David Kilzer <ddkilzer@apple.com>
Re-enable -Wcast-qual in WebCore for Apple ports
<https://webkit.org/b/177895>
<rdar://problem/34960830>
Reviewed by Joseph Pecoraro.
* Configurations/Base.xcconfig:
(WARNING_CFLAGS): Remove FIXME and add -Wcast-qual back to
arguments.
* crypto/mac/SerializedCryptoKeyWrapMac.mm:
(WebCore::createAndStoreMasterKey):
- Use checked_cf_cast<SecACLRef>().
* editing/cocoa/DataDetection.mm:
(WebCore::detectItemAtPositionWithRange):
- Manually cast CFTypeRef to DDResultRef until
DDResultGetTypeID() is available as SPI.
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::initElementsFromArray):
- Use checked_cf_cast<IOHIDElementRef>().
* platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm:
(WebCore::MediaSampleAVFObjC::createImageSample):
(WebCore::CMSampleBufferIsRandomAccess):
(WebCore::CMSampleBufferIsNonDisplaying):
(WebCore::MediaSampleAVFObjC::createNonDisplayingCopy const):
- Use checked_cf_cast<CFMutableDictionaryRef>() and
checked_cf_cast<CFDictionaryRef>().
* platform/graphics/cocoa/IOSurface.h:
(WebCore::IOSurface::asLayerContents):
- Use reinterpret_cast<id>() to cast from IOSurfaceRef to id.
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::getFirstVideoFrame):
(WebCore::WebCoreDecompressionSession::automaticDequeue):
(WebCore::WebCoreDecompressionSession::imageForTime):
(WebCore::WebCoreDecompressionSession::getDecodeTime):
(WebCore::WebCoreDecompressionSession::getPresentationTime):
(WebCore::WebCoreDecompressionSession::getDuration):
- Use checked_cf_cast<CMSampleBufferRef>().
* platform/graphics/Font.h:
(WebCore::Font::m_kernedCFStringAttributes):
(WebCore::Font::m_nonKernedCFStringAttributes):
- Change type from RetainPtr<CFDictionaryRef> to
RetainPtr<CFMutableDictionaryRef> since that's what they are.
* platform/graphics/mac/SimpleFontDataCoreText.cpp:
(WebCore::Font::getCFStringAttributes const):
- Replace local `mutableAttributes` variable with
`attributesDictionary.get()` since it returns the correct type
now.
* platform/ios/wak/WAKView.mm:
(-[WAKView _initWithViewRef:]):
(_WAKCopyWrapper):
* platform/ios/wak/WKView.mm:
(_WKViewClearSuperview):
(WKViewFirstChild):
(WKViewNextSibling):
- Use static_cast<WKViewRef>(const_cast<void*>()) to convert
const void* variable to WKViewRef.
* platform/mac/PasteboardMac.mm:
(WebCore::flipImageSpec):
(WebCore::setDragImageImpl):
- Use const_cast<> to remove 'const' modifier from
unsigned char pointers. This regressed while -Wcast-qual was
disabled for WebCore.
* platform/mac/SSLKeyGeneratorMac.mm:
(WebCore::signedPublicKeyAndChallengeString):
- Use checked_cf_cast<SecACLRef>().
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp:
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
- Use checked_cf_cast<CFMutableDictionaryRef>().
* platform/network/cf/SocketStreamHandleImplCFNet.cpp:
(WebCore::copyCONNECTProxyResponse):
- Use checked_cf_cast<CFHTTPMessageRef>().
* platform/network/cocoa/ResourceResponseCocoa.mm:
(WebCore::ResourceResponse::platformCertificateInfo const):
- Use checked_cf_cast<SecTrustRef>().
* platform/network/mac/CertificateInfoMac.mm:
(WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate const):
(WebCore::CertificateInfo::dump const):
- Use checked_cf_cast<SecCertificateRef>().
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData):
- Use checked_cf_cast<>() for CFMutable* types.
2018-01-05 John Wilander <wilander@apple.com>
Storage Access API: Refactor to make naming accurate and explicit, simplify access table, and prepare for access removal for page
https://bugs.webkit.org/show_bug.cgi?id=181357
<rdar://problem/36331031>
Reviewed by Alex Christensen.
No new tests. The only changed functionality that isn't covered
by existing tests is cross-origin iframes in the same partition
should be handled as already having access. This cannot be
tested in layout tests since they don't support subdomains.
This change does the following:
- Changes function and message names to reflect how this feature
was eventually implemented, i.e. access per frame.
- Makes it explicit that the UI process is only involved in
granting storage access and not removing storage access.
The latter is done directly by the web process.
- Simplifies the network process' entry map since only needs to
be able to give access to one domain in one frame at a time.
Access goes away on frame navigation so there can only be one
domain at a time per frame. Also, the map now uses pageIDs as
main keys to prepare for efficient access removal for all
frames under a page.
- Fixes a bug in so that a cross-origin iframe with the same
partition as the top frame correctly is handled as already
having access.
* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
The only change here is the changed named of the call to
NetworkStorageSession::hasStorageAccessForFrame().
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const):
(WebCore::NetworkStorageSession::grantStorageAccessForFrame):
(WebCore::NetworkStorageSession::removeStorageAccessForFrame):
(WebCore::NetworkStorageSession::isStorageAccessGranted const): Deleted.
(WebCore::NetworkStorageSession::setStorageAccessGranted): Deleted.
(WebCore::NetworkStorageSession::removeStorageAccess): Deleted.
2018-01-05 Youenn Fablet <youenn@apple.com>
Implement Cache API partitioning based on ClientOrigin
https://bugs.webkit.org/show_bug.cgi?id=181240
Reviewed by Alex Christensen.
Covered by updated tests.
Previously, cache storage was partitioned according the origin of the client, represented as a String.
We now partition according both client and top origins, represented as a ClientOrigin
Minor refactoring to use more makePendingActivity.
Added support for IPC serialization of ClientOrigin.
Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
* Modules/cache/CacheStorageConnection.cpp:
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::retrieveCaches):
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::clearMemoryRepresentation):
(WebCore::CacheStorageConnection::doOpen):
(WebCore::CacheStorageConnection::doRetrieveCaches):
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::open):
(WebCore::DOMCacheStorage::remove):
* Modules/cache/DOMCacheStorage.h:
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
* Modules/cache/WorkerCacheStorageConnection.h:
* page/ClientOrigin.h:
(WebCore::ClientOrigin::isolatedCopy const):
(WebCore::ClientOrigin::encode const):
(WebCore::ClientOrigin::decode):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::debugString const): Deleted.
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::debugString const):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
2018-01-05 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Add a way to write blob data to a file URL from the UI process
https://bugs.webkit.org/show_bug.cgi?id=181236
Reviewed by Brady Eidson.
Add support for writing a blob to a designated file path. See comments below for more detail. No new tests, as
there change in behavior yet. See part 2: https://bugs.webkit.org/show_bug.cgi?id=181199.
* page/DragController.cpp:
(WebCore::DragController::dragAttachmentElement):
* platform/PromisedBlobInfo.h:
Remove PromisedBlobData entirely. This was added with the premise of having the web process deliver blob data to
the UI process. However, the new approach I'm taking just has the UI process tell the network process to write
a blob to a given location, so a data structure to deliver blob data over IPC is no longer necessary.
(WebCore::PromisedBlobData::hasData const): Deleted.
(WebCore::PromisedBlobData::hasFile const): Deleted.
(WebCore::PromisedBlobData::operator bool const): Deleted.
(WebCore::PromisedBlobData::fulfills const): Deleted.
* platform/network/BlobRegistryImpl.cpp:
(WebCore::BlobRegistryImpl::populateBlobsForFileWriting):
Introduce a new helper to build a list of blob data for file writing.
(WebCore::writeFilePathsOrDataBuffersToFile):
Introduce a new static helper to write blob data (a list of file paths and data buffers) to a given file handle.
Automatically closes the given file handle upon exit.
(WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
(WebCore::BlobRegistryImpl::writeBlobToFilePath):
Pull out common logic in writeBlobsToTemporaryFiles and writeBlobToFilePath into helper methods (see above), and
refactor both methods to use the helpers.
* platform/network/BlobRegistryImpl.h:
2018-01-05 Alex Christensen <achristensen@webkit.org>
Forbid < and > in URL hosts
https://bugs.webkit.org/show_bug.cgi?id=181308
<rdar://problem/36012757>
Reviewed by Tim Horton.
https://url.spec.whatwg.org/#forbidden-host-code-point does not include these characters yet, but I think it should.
Firefox fails to parse URLs with < or > in the host. Chrome percent encodes them. Safari needs to do something.
The web platform tests are unclear on this case, and they will need to be updated with the specification.
They do show a change in behavior, though.
* platform/URLParser.cpp:
Add < and > to the list of forbidden host code points.
2018-01-05 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mac screen capture source
https://bugs.webkit.org/show_bug.cgi?id=181333
<rdar://problem/36323219>
Reviewed by Dean Jackson.
* SourcesCocoa.txt: Add ScreenDisplayCaptureSourceMac.mm.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/cocoa/CoreVideoSoftLink.cpp: Declare new constants used.
* platform/cocoa/CoreVideoSoftLink.h:
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::displayReconfigurationCallBack): Call refreshCaptureDevices.
(WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Unregister for display
reconfiguration callbacks.
(WebCore::DisplayCaptureManagerCocoa::captureDevices): Register for display reconfigrations.
(WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Use CGActiveDisplayList to
get list of active screens.
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Validate screen
ID, return CaptureDevice.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::VideoCaptureSourceFactoryMac::createVideoCaptureSource): Deal with screen capture
on macOS.
Implement Mac screen capture with CGDisplayStream.
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: Added.
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::~DisplaySurface):
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::operator=):
(WebCore::ScreenDisplayCaptureSourceMac::DisplaySurface::ioSurface const):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: Added.
(WebCore::roundUpToMacroblockMultiple):
(WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID):
(WebCore::ScreenDisplayCaptureSourceMac::create):
(WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac):
(WebCore::ScreenDisplayCaptureSourceMac::~ScreenDisplayCaptureSourceMac):
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::startProducingData):
(WebCore::ScreenDisplayCaptureSourceMac::stopProducingData):
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
(WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface):
(WebCore::ScreenDisplayCaptureSourceMac::generateFrame):
(WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream):
(WebCore::ScreenDisplayCaptureSourceMac::applySize):
(WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate):
(WebCore::ScreenDisplayCaptureSourceMac::commitConfiguration):
(WebCore::ScreenDisplayCaptureSourceMac::displayWasReconfigured):
(WebCore::ScreenDisplayCaptureSourceMac::displayReconfigurationCallBack):
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
2018-01-05 Don Olmstead <don.olmstead@sony.com>
[curl] Can't load file:// URL with a URL fragment identifier
https://bugs.webkit.org/show_bug.cgi?id=181170
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
2018-01-05 Don Olmstead <don.olmstead@sony.com>
TextCodec uses std::array but does not include it
https://bugs.webkit.org/show_bug.cgi?id=181340
Reviewed by Alex Christensen.
No new tests. No change in behavior.
* platform/text/TextCodec.h:
2018-01-05 Said Abou-Hallawa <sabouhallawa@apple.com>
SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded() should do nothing if the property is not animating
https://bugs.webkit.org/show_bug.cgi?id=181316
<rdar://problem/36147545>
Reviewed by Simon Fraser.
This is a speculative change to fix a crash which appeared after r226065.
The crash is very intermittent and sometimes very hard to reproduce. The
basic code analysis did not show how this crash can even happen.
* svg/SVGAnimatedTypeAnimator.h:
(WebCore::SVGAnimatedTypeAnimator::resetFromBaseValues): For SVG property
with two values, e.g. <SVGAngleValue, SVGMarkerOrientType>, we need to
detach the wrappers of the animated property if the animated values are
going to change. This is similar to what we did in resetFromBaseValue().
* svg/properties/SVGAnimatedListPropertyTearOff.h:
(WebCore::SVGAnimatedListPropertyTearOff::synchronizeWrappersIfNeeded):
2018-01-05 Matt Lewis <jlewis3@apple.com>
Unreviewed, rolling out r226401.
This caused timeouts on multiple platforms.
Reverted changeset:
"Implement Cache API partitioning based on ClientOrigin"
https://bugs.webkit.org/show_bug.cgi?id=181240
https://trac.webkit.org/changeset/226401
2018-01-05 Dan Bernstein <mitz@apple.com>
Fixed the build following AppKit API deprecations in a recent SDKs
* platform/mac/PasteboardMac.mm:
(WebCore::setDragImageImpl): Suppressed deprecation warnings.
* platform/mac/WidgetMac.mm:
(WebCore::Widget::paint): Ditto.
2018-01-05 Joseph Pecoraro <pecoraro@apple.com>
ServiceWorkers: Enable UserTiming / ResourceTiming
https://bugs.webkit.org/show_bug.cgi?id=181297
<rdar://problem/36307306>
Reviewed by Youenn Fablet.
Tests: http/tests/workers/service/service-worker-resource-timing.https.html
http/tests/workers/service/service-worker-user-timing.https.html
* loader/ResourceTiming.cpp:
(WebCore::ResourceTiming::ResourceTiming):
We used to clear extra NetworkLoadMetrics data early on. However,
for Workers we want to pass the complete NetworkLoadMetrics to
the Worker so that a Worker inspector has access to it.
* page/PerformanceResourceTiming.cpp:
(WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
Instead move the clearing of extra data to here, when the NetworkLoadMetrics
have finally settled into being used only for a performance entry.
2018-01-04 Philippe Normand <pnormand@igalia.com>
[EME][GStreamer] Fix wrong ifdef
https://bugs.webkit.org/show_bug.cgi?id=181289
Reviewed by Alex Christensen.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove the
ENCRYPTED_MEDIA ifdef from the VIDEO_TRACK ifdef block. Both have
nothing to do together.
2018-01-05 Fujii Hironori <Hironori.Fujii@sony.com>
[Cairo] Canvas: Path::clear should clear its transform
https://bugs.webkit.org/show_bug.cgi?id=181320
Reviewed by Carlos Garcia Campos.
Path of Cairo port has its cairo context. Path::clear() didn't
clear the transform matrix of the context.
Test: fast/canvas/reset-scaling-by-height-change.html
* platform/graphics/cairo/PathCairo.cpp:
(WebCore::Path::clear): Reset the transform matrix of Path.
2018-01-04 Devin Rousso <webkit@devinrousso.com>
Web Inspector: replace HTMLCanvasElement with CanvasRenderingContext for instrumentation logic
https://bugs.webkit.org/show_bug.cgi?id=180770
Reviewed by Joseph Pecoraro.
No change in functionality.
* html/HTMLCanvasElement.h:
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::createContext2d):
(WebCore::HTMLCanvasElement::createContextWebGL):
(WebCore::HTMLCanvasElement::createContextWebGPU):
(WebCore::HTMLCanvasElement::createContextBitmapRenderer):
(WebCore::HTMLCanvasElement::reset):
(WebCore::HTMLCanvasElement::paint):
(WebCore::HTMLCanvasElement::setImageBuffer const):
(WebCore::HTMLCanvasElement::addObserver): Deleted.
(WebCore::HTMLCanvasElement::removeObserver): Deleted.
(WebCore::HTMLCanvasElement::cssCanvasClients): Deleted.
(WebCore::HTMLCanvasElement::notifyObserversCanvasChanged): Deleted.
* html/OffscreenCanvas.h:
* html/canvas/CanvasRenderingContext.h:
* html/canvas/CanvasRenderingContext.cpp:
* html/canvas/CanvasRenderingContext2D.h:
* html/canvas/CanvasRenderingContext2D.cpp:
(WebCore::CanvasRenderingContext2D::create):
* html/canvas/CanvasRenderingContext2DBase.h:
* html/canvas/ImageBitmapRenderingContext.h:
* html/canvas/ImageBitmapRenderingContext.cpp:
(WebCore::ImageBitmapRenderingContext::create):
* html/canvas/WebGL2RenderingContext.h:
* html/canvas/WebGL2RenderingContext.cpp:
(WebCore::WebGL2RenderingContext::create):
* html/canvas/WebGLRenderingContext.h:
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::create):
* html/canvas/WebGLRenderingContextBase.h:
* html/canvas/WebGLRenderingContextBase.cpp:
(WebCore::WebGLRenderingContextBase::create):
* html/canvas/WebGPURenderingContext.cpp:
(WebCore::WebGPURenderingContext::create):
Instead of adding didCreateCanvasRenderingContext calls at the construction sites of each
context, we can make the constructors private and force the usage of static `create` functions.
This way, we have access to the fully constructed object and have a guaranteed path for creation.
* html/CanvasBase.h:
* html/CanvasBase.cpp:
(WebCore::CanvasBase::~CanvasBase):
(WebCore::CanvasBase::renderingContext const):
(WebCore::CanvasBase::addObserver):
(WebCore::CanvasBase::removeObserver):
(WebCore::CanvasBase::notifyObserversCanvasChanged):
(WebCore::CanvasBase::notifyObserversCanvasResized):
(WebCore::CanvasBase::notifyObserversCanvasDestroyed):
(WebCore::CanvasBase::cssCanvasClients const):
* Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
* Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasDestroyed):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
(WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
* css/CSSCanvasValue.h:
Move the CanvasObserver class to CanvasBase so that it can also be used for OffscreenCanvas.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodes):
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContext):
(WebCore::InspectorInstrumentation::didChangeCanvasMemory):
(WebCore::InspectorInstrumentation::recordCanvasAction):
(WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrame):
(WebCore::InspectorInstrumentation::didEnableExtension):
(WebCore::InspectorInstrumentation::didCreateProgram):
(WebCore::InspectorInstrumentation::willDeleteProgram):
(WebCore::InspectorInstrumentation::isShaderProgramDisabled):
(WebCore::InspectorInstrumentation::consoleStartRecordingCanvas):
(WebCore::InspectorInstrumentation::didCreateCSSCanvas): Deleted.
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::consoleStartRecordingCanvasImpl):
(WebCore::InspectorInstrumentation::didChangeCSSCanvasClientNodesImpl):
(WebCore::InspectorInstrumentation::didCreateCanvasRenderingContextImpl):
(WebCore::InspectorInstrumentation::didChangeCanvasMemoryImpl):
(WebCore::InspectorInstrumentation::didFinishRecordingCanvasFrameImpl):
(WebCore::InspectorInstrumentation::didEnableExtensionImpl):
(WebCore::InspectorInstrumentation::didCreateProgramImpl):
(WebCore::InspectorInstrumentation::didCreateCSSCanvasImpl): Deleted.
* inspector/agents/InspectorCanvasAgent.h:
* inspector/agents/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::enable):
(WebCore::InspectorCanvasAgent::requestNode):
(WebCore::InspectorCanvasAgent::requestContent):
(WebCore::InspectorCanvasAgent::requestCSSCanvasClientNodes):
(WebCore::contextAsScriptValue):
(WebCore::InspectorCanvasAgent::resolveCanvasContext):
(WebCore::InspectorCanvasAgent::startRecording):
(WebCore::InspectorCanvasAgent::stopRecording):
(WebCore::InspectorCanvasAgent::updateShader):
(WebCore::InspectorCanvasAgent::frameNavigated):
(WebCore::InspectorCanvasAgent::didChangeCSSCanvasClientNodes):
(WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext):
(WebCore::InspectorCanvasAgent::didChangeCanvasMemory):
(WebCore::InspectorCanvasAgent::recordCanvasAction):
(WebCore::InspectorCanvasAgent::canvasDestroyed):
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
(WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas):
(WebCore::InspectorCanvasAgent::didEnableExtension):
(WebCore::InspectorCanvasAgent::didCreateProgram):
(WebCore::InspectorCanvasAgent::canvasRecordingTimerFired):
(WebCore::InspectorCanvasAgent::clearCanvasData):
(WebCore::InspectorCanvasAgent::unbindCanvas):
(WebCore::InspectorCanvasAgent::findInspectorCanvas):
(WebCore::InspectorCanvasAgent::unbindProgram):
(WebCore::InspectorCanvasAgent::didCreateCSSCanvas): Deleted.
* inspector/InspectorCanvas.h:
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::create):
(WebCore::InspectorCanvas::InspectorCanvas):
(WebCore::InspectorCanvas::canvasElement):
(WebCore::InspectorCanvas::resetRecordingData):
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::buildObjectForCanvas):
(WebCore::InspectorCanvas::getCanvasContentAsDataURL):
(WebCore::InspectorCanvas::buildInitialState):
(WebCore::InspectorCanvas::~InspectorCanvas): Deleted.
* inspector/InspectorShaderProgram.h:
* inspector/InspectorShaderProgram.cpp:
(WebCore::InspectorShaderProgram::context const):
* page/PageConsoleClient.cpp:
(WebCore::PageConsoleClient::record):
(WebCore::PageConsoleClient::recordEnd):
* dom/Document.h:
* dom/Document.cpp:
(WebCore::Document::getCSSCanvasElement):
(WebCore::Document::nameForCSSCanvasElement const):
We have no reason to save the CSS canvas name for each InspectorCanvas object, so instead we
can just query for the name based on the CanvasRenderingContext's HTMLCanvasElement (assuming
it is not an OffscreenCanvas) when we need it.
2018-01-04 Chris Fleizach <cfleizach@apple.com>
AX: Implement updated CSS3 Speech for 'speak' and 'speak-as' properties
https://bugs.webkit.org/show_bug.cgi?id=180361
Reviewed by Zalan Bujtas.
Change speak -> speakAs, and allow a combination of properties.
Tests: Updated accessibility/mac/css-speech-speak.html
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilityObject::speakAsProperty const):
(WebCore::AccessibilityObject::speakProperty const): Deleted.
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::speakAsProperty const):
(WebCore::AccessibilityRenderObject::speakProperty const): Deleted.
* accessibility/AccessibilityRenderObject.h:
* accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
(-[WebAccessibilityObjectWrapper accessibilitySpeechHint]):
* accessibility/mac/WebAccessibilityObjectWrapperBase.h:
* accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
(-[WebAccessibilityObjectWrapperBase baseAccessibilitySpeechHint]):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::speakAsToCSSValue):
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator ESpeakAs const):
(WebCore::CSSPrimitiveValue::operator ESpeak const): Deleted.
* css/CSSProperties.json:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertSpeakAs):
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::CSSParserFastPaths::isKeywordPropertyID):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeSpeakAs):
(WebCore::CSSPropertyParser::parseSingleValue):
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::speakAs const):
(WebCore::RenderStyle::setSpeakAs):
(WebCore::RenderStyle::initialSpeakAs):
(WebCore::RenderStyle::speak const): Deleted.
(WebCore::RenderStyle::setSpeak): Deleted.
(WebCore::RenderStyle::initialSpeak): Deleted.
* rendering/style/RenderStyleConstants.h:
(WebCore::operator| ):
(WebCore::operator|= ):
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData):
(WebCore::StyleRareInheritedData::operator== const):
* rendering/style/StyleRareInheritedData.h:
2018-01-04 Brian Burg <bburg@apple.com>
Web Inspector: Capture Element Screenshot looks fuzzy
https://bugs.webkit.org/show_bug.cgi?id=175734
<rdar://problem/33803377>
Reviewed by Joseph Pecoraro and Simon Fraser.
Screenshots taken by Web Inspector were being downscaled from the
internal size to the logical size, causing them to be blurry when
later upscaled to the internal size.
Replace ScaleBehavior { Scaled, Unscaled } with PreserveResolution { No, Yes }.
This is a lot less confusing to read both inside ImageBuffer and at its use sites.
Remove unused CoordinateSystem argument for ImageBuffer::toDataURL,
and replace it with PreserveResolution. Plumb PreserveResolution into toCFData
so that PreserveResolution::Yes will preserve the internal size of
the image buffer, just as it does in other methods that take PreserveResolution.
At the use site in InspectorPageAgent, always request PreserveResolution::Yes snapshots
when taking an element screenshot. For now, keep using downscaled (smaller)
snapshots when capturing canvas previews, as the previews are not full-size.
Test: inspector/page/hidpi-snapshot-size.html
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::makePresentationCopy):
(WebCore::HTMLCanvasElement::copiedImage const):
* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::createPattern):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::snapshotNode):
(WebCore::InspectorPageAgent::snapshotRect):
* page/TextIndicator.cpp:
(WebCore::takeSnapshot):
* platform/DragImage.cpp:
(WebCore::createDragImageFromSnapshot):
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern):
* platform/graphics/ImageBuffer.h:
* platform/graphics/cairo/ImageBufferCairo.cpp:
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::toDataURL const):
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::createBitmapImageAfterScalingIfNeeded):
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::toDataURL const):
(WebCore::ImageBuffer::toData const):
(WebCore::ImageBuffer::toCFData const):
* platform/graphics/gtk/ImageBufferGtk.cpp:
(WebCore::ImageBuffer::toDataURL const):
* platform/graphics/win/ImageBufferDirect2D.cpp:
(WebCore::ImageBuffer::copyImage const):
(WebCore::ImageBuffer::sinkIntoImage):
(WebCore::ImageBuffer::toDataURL const):
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::drawPatternForContainer):
2018-01-04 John Wilander <wilander@apple.com>
Storage Access API: Turn feature on by default in Settings.yaml
https://bugs.webkit.org/show_bug.cgi?id=181298
<rdar://problem/36302506>
Reviewed by Brent Fulgham.
No new tests. This is just a feature settings change.
* page/Settings.yaml:
2018-01-04 Zalan Bujtas <zalan@apple.com>
WebContent process crashes while loading https://www.classicspecs.com
https://bugs.webkit.org/show_bug.cgi?id=181290
<rdar://problem/36225906>
Reviewed by Simon Fraser.
Floats can overhang multiple blocks (they are called intruding floats).
Each block keeps track of such intruding floats. When an overhanging float box is destroyed,
we need to deregister it from all those blocks. We do it by walking up the ancestor block chain
and check if the parent (grandparent etc) block still contains this float. Once we find the topmost block,
we start deregistering it by traversing back on the descendant blocks.
Normally we do it in RenderElement::takeChildInternal right before the box is getting detached.
However in certain cases (like when the float's parent happens to be an anonymous wrapper)
by the time we get to ::takeChildInternal the subtree is already detached and we can't access all the
ancestors.
This patch ensure that the floating box is still attached during de-registration.
Test: fast/block/float/crash-when-intruding-float-has-anonymous-parent-and-detach.html
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
2018-01-04 Eric Carlson <eric.carlson@apple.com>
[MediaStream] Add Mock screen capture source
https://bugs.webkit.org/show_bug.cgi?id=181291
<rdar://problem/36298164>
Reviewed by Dean Jackson.
Tests: http/tests/media/media-stream/get-display-media-prompt.html
GetDisplayMediaTest.BasicPrompt
GetDisplayMediaTest.Constraints
* Modules/mediastream/MediaDevices.cpp:
(WebCore::MediaDevices::MediaDevices): Add static_assert to ensure MediaDevices::DisplayCaptureSurfaceType
and RealtimeMediaSourceSettings::DisplaySurfaceType values are equivalent.
(WebCore::MediaDevices::getSupportedConstraints): Remove bogus code.
* Modules/mediastream/MediaDevices.h: Add DisplayCaptureSurfaceType.
* Modules/mediastream/MediaDevices.idl: Ditto.
* Modules/mediastream/MediaStreamTrack.cpp:
(WebCore::MediaStreamTrack::getSettings const): Add a FIXME.
* Modules/mediastream/MediaStreamTrack.h: Add displaySurface and logicalSurface.
* Modules/mediastream/MediaTrackSupportedConstraints.h: Remove displaySurface and logicalSurface.
* Modules/mediastream/MediaTrackSupportedConstraints.idl:
* SourcesCocoa.txt: Add DisplayCaptureManagerCocoa.cpp and DisplayCaptureSourceCocoa.cpp.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* platform/mediastream/CaptureDevice.h:
(WebCore::CaptureDevice::encode const): Add.
(WebCore::CaptureDevice::decode):
* platform/mediastream/RealtimeMediaSourceCenter.cpp:
(WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): Include display capture "devices".
(WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Deal with display capture devices.
(WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID): Ditto.
* platform/mediastream/RealtimeMediaSourceCenter.h:
* platform/mediastream/RealtimeMediaSourceSettings.h:
(WebCore::RealtimeMediaSourceSettings::displaySurface const): Return a DisplaySurfaceType.
(WebCore::RealtimeMediaSourceSettings::setDisplaySurface): Take a DisplaySurfaceType.
* platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
(WebCore::DisplayCaptureManagerCocoa::singleton):
(WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa):
(WebCore::DisplayCaptureManagerCocoa::captureDevices):
(WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
(WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID):
* platform/mediastream/mac/DisplayCaptureManagerCocoa.h:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: Added.
(WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa):
(WebCore::DisplayCaptureSourceCocoa::capabilities const):
(WebCore::DisplayCaptureSourceCocoa::settings const):
(WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::elapsedTime):
(WebCore::DisplayCaptureSourceCocoa::applyFrameRate):
(WebCore::DisplayCaptureSourceCocoa::emitFrame):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp:
(WebCore::RealtimeMediaSourceCenterMac::displayCaptureDeviceManager): New.
* platform/mediastream/mac/RealtimeMediaSourceCenterMac.h:
* platform/mock/MockRealtimeMediaSource.cpp:
(WebCore::deviceMap): Add screen capture "devices".
(WebCore::MockRealtimeMediaSource::displayDevices): New.
* platform/mock/MockRealtimeMediaSource.h:
* platform/mock/MockRealtimeMediaSourceCenter.cpp: Clean up includes.
* platform/mock/MockRealtimeMediaSourceCenter.h:
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Mock two screen devices.
(WebCore::MockRealtimeVideoSource::updateSettings): Deal with mock screens.
(WebCore::MockRealtimeVideoSource::initializeCapabilities): Ditto.
(WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Ditto.
(WebCore::MockRealtimeVideoSource::drawText): Ditto.
(WebCore::MockRealtimeVideoSource::generateFrame): Ditto.
* platform/mock/MockRealtimeVideoSource.h:
(WebCore::MockRealtimeVideoSource::mockCamera const):
(WebCore::MockRealtimeVideoSource::mockScreen const):
2018-01-04 Youenn Fablet <youenn@apple.com>
FetchResponse should set its internal response text encoding name
https://bugs.webkit.org/show_bug.cgi?id=181284
Reviewed by Alex Christensen.
Covered by rebased test.
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::create): Set response text encoding based on content type charset.
2018-01-04 John Wilander <wilander@apple.com>
Storage Access API: Remove JavaScript confirm() prompt from Document::requestStorageAccess()
https://bugs.webkit.org/show_bug.cgi?id=181276
<rdar://problem/36290463>
Reviewed by Alex Christensen.
No new tests. Existing test expectations updated.
* dom/Document.cpp:
(WebCore::Document::requestStorageAccess):
2018-01-04 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Issues with Ahem's ex / x-height
https://bugs.webkit.org/show_bug.cgi?id=180581
Reviewed by Michael Catanzaro.
Get the x-height value from the TT_OS2 table if available.
Fixes: fast/text/break-word-pre-wrap.html
imported/w3c/web-platform-tests/css/css-shapes-1/shape-outside/values/shape-outside-shape-arguments-000.html
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::platformInit):
2018-01-04 Philippe Normand <pnormand@igalia.com>
Unreviewed, GTK build fix attempt after r226357
* platform/graphics/gstreamer/GStreamerUtilities.h: The
GST_BUFFER_DTS_OR_PTS macro was added in GStreamer 1.8 but old
versions of Debian might not have this release yet.
2018-01-04 Youenn Fablet <youenn@apple.com>
Implement Cache API partitioning based on ClientOrigin
https://bugs.webkit.org/show_bug.cgi?id=181240
Reviewed by Alex Christensen.
Covered by updated tests.
Previously, cache storage was partitioned according the origin of the client, represented as a String.
We now partition according both client and top origins, represented as a ClientOrigin
Minor refactoring to use more makePendingActivity.
Added support for IPC serialization of ClientOrigin.
Added SecurityOriginData::toString which is used by WebKit2 Cache Storage implementation.
* Modules/cache/CacheStorageConnection.cpp:
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::retrieveCaches):
* Modules/cache/CacheStorageConnection.h:
(WebCore::CacheStorageConnection::clearMemoryRepresentation):
(WebCore::CacheStorageConnection::doOpen):
(WebCore::CacheStorageConnection::doRetrieveCaches):
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::origin const):
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::open):
(WebCore::DOMCacheStorage::remove):
* Modules/cache/DOMCacheStorage.h:
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::WorkerCacheStorageConnection::doOpen):
(WebCore::WorkerCacheStorageConnection::doRetrieveCaches):
* Modules/cache/WorkerCacheStorageConnection.h:
* page/ClientOrigin.h:
(WebCore::ClientOrigin::isolatedCopy const):
(WebCore::ClientOrigin::encode const):
(WebCore::ClientOrigin::decode):
* page/SecurityOriginData.cpp:
(WebCore::SecurityOriginData::toString const):
(WebCore::SecurityOriginData::debugString const): Deleted.
* page/SecurityOriginData.h:
(WebCore::SecurityOriginData::debugString const):
* testing/Internals.cpp:
(WebCore::Internals::clearCacheStorageMemoryRepresentation):
2018-01-04 Youenn Fablet <youenn@apple.com>
Service Worker should expose redirect mode for navigation loads as manual
https://bugs.webkit.org/show_bug.cgi?id=181067
Reviewed by Alex Christensen.
Covered by rebased tests.
* loader/CrossOriginAccessControl.cpp: Removing ContentType header only if affecting CORS checks.
This allows extending header filtering in service worker to all modes, including Navigate.
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent): Ideally, document loading code should set redirect to manual.
Since it is not the case yet and that would require changes to various places, manual is set before exposing the corresponding fetch event.
2018-01-04 Youenn Fablet <youenn@apple.com>
ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope should be a no-op if worker is being terminated
https://bugs.webkit.org/show_bug.cgi?id=181245
Reviewed by Alex Christensen.
Stop appending tasks to a terminating worker and returning false in that case.
This mirrors what is done for regular workers.
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::postTaskForModeToWorkerGlobalScope):
* workers/service/context/ServiceWorkerThreadProxy.h:
2018-01-04 Youenn Fablet <youenn@apple.com>
Cancel pending script loads when service worker is being terminated
https://bugs.webkit.org/show_bug.cgi?id=181250
Reviewed by Alex Christensen.
Covered by service worker tests no longer crashing in ASAN builds.
* workers/WorkerScriptLoader.cpp:
(WebCore::WorkerScriptLoader::notifyFinished): Clearing loader when finished.
(WebCore::WorkerScriptLoader::cancel): Implementing cancel of a script loader by cancelling the underlying threadable loader.
* workers/WorkerScriptLoader.h:
* workers/service/ServiceWorkerContainer.cpp: Canceling loads of all pending jobs.
(WebCore::ServiceWorkerContainer::stop):
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::cancelPendingLoad):
* workers/service/ServiceWorkerJob.h:
2018-01-04 Youenn Fablet <youenn@apple.com>
Implement https://fetch.spec.whatwg.org/#main-fetch default referrer policy setting
https://bugs.webkit.org/show_bug.cgi?id=181239
Reviewed by Alex Christensen.
Covered by updated and rebased test.
Setting the request referrer policy to the Document referrer policy if no one is set.
If Document has no referrer policy, use no-referrer-when-downgrade as per the spec.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::updateReferrerPolicy):
(WebCore::CachedResourceRequest::updateReferrerOriginAndUserAgentHeaders):
* loader/cache/CachedResourceRequest.h:
2018-01-03 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Create attachment elements when dropping files on iOS
https://bugs.webkit.org/show_bug.cgi?id=181192
<rdar://problem/36280945>
Reviewed by Tim Horton.
Implements support for dropping data as attachment elements on iOS. See comments below for more detail.
Tests: WKAttachmentTests.InsertDroppedRichAndPlainTextFilesAsAttachments
WKAttachmentTests.InsertDroppedZipArchiveAsAttachment
WKAttachmentTests.InsertDroppedItemProvidersInOrder
* WebCore.xcodeproj/project.pbxproj:
* editing/WebContentReader.cpp:
(WebCore::WebContentReader::ensureFragment):
Add a new helper to create the WebContentReader's fragment, if it hasn't already been created.
* editing/WebContentReader.h:
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readFilePaths):
Rename readFilenames to readFilePaths (which better reflects its parameters, which are file paths). Also, move
the implementation of readFilePaths to shared iOS/macOS code in WebContentReaderCocoa, and remove the stub
implementation on iOS.
There's a bit of code here that I kept macOS-only which deals with inserting file paths as plain text in
editable areas, but it's unclear to me why and if WebKit clients currently find this useful, so I left a FIXME
to investigate removing this altogether. Code for handling this plain text insertion of file paths on Mac was
introduced in r67403.
* editing/ios/WebContentReaderIOS.mm:
(WebCore::WebContentReader::readFilenames): Deleted.
* editing/mac/WebContentReaderMac.mm:
(WebCore::WebContentReader::readFilenames): Deleted.
* page/mac/DragControllerMac.mm:
(WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
Teach DragController to accept all types conforming to "public.item" and "public.content" on iOS, only when
attachment elements are enabled. This allows us to load content from item providers that we otherwise would not
have loaded, since we now have the ability to fall back to attachment element insertion if the type is not have
a default representation using standard web content.
* platform/Pasteboard.h:
* platform/PasteboardItemInfo.h: Added.
(WebCore::PasteboardItemInfo::encode const):
(WebCore::PasteboardItemInfo::decode):
Add PasteboardItemInfo, a struct that describes an item on the pasteboard. Also, implement encoding and decoding
support for PasteboardItemInfo. So far, the item info only describes file information about the pasteboard item,
and flags indicating whether the item prefers attachment or inline presentation.
* platform/PasteboardStrategy.h:
Replace getFilenamesForDataInteraction with informationForItemAtIndex. Instead of returning all of the file
paths associated with any item on the pasteboard, fetch a PasteboardItemInfo at a given item index, which
includes information about the file path as well as some other metadata we'll need when deciding how to read
pasteboard contents as a document fragment.
* platform/PlatformPasteboard.h:
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::Pasteboard::read):
* platform/ios/AbstractPasteboard.h:
* platform/ios/PasteboardIOS.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readRespectingUTIFidelities):
Teach the iOS Pasteboard to read web content using attachment elements, if enabled. There are two scenarios in
which we would want to insert an attachment element:
(1) The item provider uses a preferred presentation style of attachment, in which case we bail out of trying to
handle the drop using the default mechanisms, and simply insert it as an attachment. We need this to deal
with the case where we drop text or HTML files from the Files app, so that we don't try and insert the
contents of the text or HTML as inline web content.
(2) The item provider doesn't have a preferred attachment presentation style, but there's nothing WebKit would
otherwise do with the dropped content, so insert an attachment element as a fallback. Examples where this is
relevant are dropping a PDF or ZIP archive without attachment presentation style explicitly set.
We first check if we fall into case (1). If so, we can bail early by inserting an attachment; otherwise, we
proceed normally and see if we can read the contents of the drop as web content. If, at the end of default drop
handling, we don't still have a way to represent the dropped content, enter case (2).
(WebCore::Pasteboard::readFilePaths):
(WebCore::Pasteboard::readFilenames): Deleted.
Rename readFilenames to readFilePaths, and reimplement it using informationForItemAtIndex.
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::pasteboardItemPresentationStyle):
(WebCore::PlatformPasteboard::informationForItemAtIndex):
(WebCore::PlatformPasteboard::filenamesForDataInteraction): Deleted.
Implement informationForItemAtIndex and remove filenamesForDataInteraction. As before, we ask the pasteboard
(i.e. WebItemProviderPasteboard) for information about dropped file URLs. This time, we limit this to a single
file, so we don't end up creating multiple attachment elements for each representation of a single item
provider. See below for -preferredFileUploadURLAtIndex:fileType: for more detail.
* platform/ios/WebItemProviderPasteboard.h:
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderLoadResult initWithItemProvider:typesToLoad:]):
(-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]):
Remove this synthesized instance variable and instead just check the item provider's preferredPresentationStyle.
(-[WebItemProviderLoadResult description]):
Add a verbose -description to the load result object. Useful for debugging what was content was loaded from an
item provider on drop.
(-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]):
Return the highest fidelity loaded type identifier for a given item.
(-[WebItemProviderPasteboard allDroppedFileURLs]):
(-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
Prefer flat RTFD to RTFD. In the case where attachments are enabled and we're accepting all types of content
using attachment elements as a fallback representation, if the source writes attributed strings to the
pasteboard with com.apple.rtfd at a higher fidelity than com.apple.flat-rtfd, we'll end up loading only
com.apple.rtfd and dropping the text as an attachment element because we cannot convert the dropped content to
markup. Instead, if flat RTFD is present in the item provider, always prefer that over RTFD so that dropping as
regular web content isn't overridden when attachment elements are enabled.
(-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
(-[WebItemProviderPasteboard droppedFileURLs]): Deleted.
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsCompatibleContent const):
DragData::containsCompatibleContent should be true when attachment elements are enabled, and there are files we
can drop as attachment elements.
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readFilePaths):
(WebCore::Pasteboard::readFilenames): Deleted.
2018-01-03 Ting-Wei Lan <lantw44@gmail.com>
Replace hard-coded paths in shebangs with #!/usr/bin/env
https://bugs.webkit.org/show_bug.cgi?id=181040
Reviewed by Alex Christensen.
* bindings/scripts/InFilesCompiler.pm:
* bindings/scripts/InFilesParser.pm:
* bindings/scripts/generate-bindings-all.pl:
* bindings/scripts/generate-bindings.pl:
* bindings/scripts/preprocess-idls.pl:
* css/make-css-file-arrays.pl:
* css/makeprop.pl:
* css/makevalues.pl:
* dom/make_event_factory.pl:
* dom/make_names.pl:
* extract-localizable-strings.pl:
* make-hash-tools.pl:
2018-01-03 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Add plumbing for starting a drag with promised blob data
https://bugs.webkit.org/show_bug.cgi?id=181201
Reviewed by Tim Horton.
Adds logic to allow dragging an attachment element as a file by sending promised blob information to the UI
process. See comments below for more detail.
The only change in behavior is that dragging an attachment element will no longer write web content and injected
bundle data to the pasteboard if the attachment element's file attribute is nonnull. This will cause one
existing WK1 layout test to fail, but will otherwise not affect any attachment editing clients. On iOS,
attachment elements in the Mail viewer can be dragged, but each attachment's file is null, so we fall back to
current behavior; on macOS, Mail currently overrides the drag completely, beginning at -mouseDown:, so this
doesn't make a difference to macOS Mail either.
* editing/Editor.h:
* editing/cocoa/EditorCocoa.mm:
(WebCore::Editor::getPasteboardTypesAndDataForAttachment):
Add a helper method to retrieve an attachment element as web archive data, for moving attachments within the
same document. Also gives the injected editor bundle a chance to supply custom pasteboard types.
* loader/EmptyClients.cpp:
* page/DragClient.h:
(WebCore::DragClient::prepareToDragPromisedBlob):
Add new DragClient methods to send information about a promised blob to the UI process.
* page/DragController.cpp:
(WebCore::DragController::startDrag):
Call dragAttachmentElement when starting a drag on an attachment element.
(WebCore::DragController::dragAttachmentElement):
Try to begin dragging a given attachment element, propagating promised blob information to the client layers.
Returns true iff the attachment is backed by blob data (i.e. the file is nonnull).
* platform/PromisedBlobInfo.h:
Add a list of additional types and data to PromisedBlobInfo. In addition to the promised blob info, this would
allow injected bundle data and other private types alongside the main attachment data on the pasteboard.
2018-01-03 Simon Fraser <simon.fraser@apple.com>
Remove the 'resolutionScale' parameter from ImageBufferDataCG get/putBytes
https://bugs.webkit.org/show_bug.cgi?id=181268
Reviewed by Alex Christensen.
These functions were always called with resolutionScale=1.
* platform/graphics/cg/ImageBufferCG.cpp:
(WebCore::ImageBuffer::getUnmultipliedImageData const):
(WebCore::ImageBuffer::getPremultipliedImageData const):
(WebCore::ImageBuffer::putByteArray):
* platform/graphics/cg/ImageBufferDataCG.cpp:
(WebCore::ImageBufferData::getData const):
(WebCore::ImageBufferData::putData):
(WebCore::affineWarpBufferData): Deleted.
* platform/graphics/cg/ImageBufferDataCG.h:
2018-01-03 John Wilander <wilander@apple.com>
Storage Access API: Refactor XPC for access removal to go straight from the web process to the network process
https://bugs.webkit.org/show_bug.cgi?id=181270
<rdar://problem/36289544>
Reviewed by Alex Christensen.
No new tests. Existing test re-enabled.
This change refactors how the web process tells the network process
to remove storage access. Previously, this was done over the UI process
just like requests for storage access. But since no further reasoning
is needed, the message should go straight from the web process to the
network process for performance reasons and to minimize the risk of a
race.
As a consequence, the XPC code for storage access removal in the UI
process is deleted.
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::cookieStoragePartition const):
Removes the storageAccessAPIEnabled check since the flag
doesn't get propagated when the network process is created.
Figuring this out will take some work which is unnecessary
when we already gate access to the feature in Document.idl.
2018-01-03 James Craig <jcraig@apple.com>
AX: when invert colors is on, double-invert certain media elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=168447
<rdar://problem/30559874>
Reviewed by Simon Fraser.
Double-invert video when platform 'invert colors' setting is enabled. Behavior matches
current 'Smart Invert' feature of Safari Reader on macOS/iOS and other iOS native apps.
Tests: accessibility/smart-invert-reference.html
accessibility/smart-invert.html
* Modules/modern-media-controls/controls/media-controls.css:
(@media (inverted-colors)):
(:host):
(picture):
* css/html.css:
(@media (inverted-colors)):
(video):
2018-01-03 Youenn Fablet <youenn@apple.com>
LayoutTest http/tests/media/media-stream/disconnected-frame.html to consistently fail an assertion: !m_adoptionIsRequired
https://bugs.webkit.org/show_bug.cgi?id=181264
Reviewed by Eric Carlson.
Covered by http/tests/media/media-stream/disconnected-frame.html not crashing anymore in Debug builds.
Calling suspendIfNeeded in create method instead of constructor.
* Modules/mediastream/UserMediaRequest.cpp:
(WebCore::UserMediaRequest::create):
(WebCore::UserMediaRequest::UserMediaRequest):
2018-01-03 Antti Koivisto <antti@apple.com>
Remove DeprecatedCSSOMValue::equals
https://bugs.webkit.org/show_bug.cgi?id=181241
Reviewed by Zalan Bujtas.
This is dead code.
* css/DeprecatedCSSOMValue.cpp:
(WebCore::compareCSSOMValues): Deleted.
(WebCore::DeprecatedCSSOMValue::equals const): Deleted.
* css/DeprecatedCSSOMValue.h:
(WebCore::DeprecatedCSSOMValue::operator== const): Deleted.
(WebCore::DeprecatedCSSOMComplexValue::equals const): Deleted.
* css/DeprecatedCSSOMValueList.cpp:
(WebCore::DeprecatedCSSOMValueList::equals const): Deleted.
* css/DeprecatedCSSOMValueList.h:
2018-01-03 Simon Fraser <simon.fraser@apple.com>
feLighting is broken with primitiveUnits="objectBoundingBox"
https://bugs.webkit.org/show_bug.cgi?id=181197
Reviewed by Tim Horton.
With <filter primitiveUnits="objectBoundingBox"> we need to convert the coordinates
of fePointLights and feSpotLights into user space coordinates. Following
https://www.w3.org/TR/SVG/filters.html#FilterElementPrimitiveUnitsAttribute
this is done by treating them as fractions of the bounding box on the referencing
element, with treatment for z following https://www.w3.org/TR/SVG/coords.html#Units_viewport_percentage
To do this, store the bounds of the referencing elemenet on SVGFilterBuilder as
targetBoundingBox, and store the primitiveUnits type. Then do the conversion of lighting
coordinates in SVGFESpecularLightingElement::build() and SVGFEDiffuseLightingElement::build().
Remove SVGFELightElement::findLightSource(), since we need to be able to pass the SVGFilterBuilder
to the lightSource() function so hoist the code up.
Tests: svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
svg/filters/feDiffuseLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox-expected.svg
svg/filters/feDiffuseLighting-feSpotLight-primitiveUnits-objectBoundingBox.svg
svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox-expected.svg
svg/filters/feSpecularLighting-fePointLight-primitiveUnits-objectBoundingBox.svg
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* svg/SVGFEDiffuseLightingElement.cpp:
(WebCore::SVGFEDiffuseLightingElement::build):
* svg/SVGFEDistantLightElement.cpp:
(WebCore::SVGFEDistantLightElement::lightSource const):
* svg/SVGFEDistantLightElement.h:
* svg/SVGFELightElement.cpp:
(WebCore::SVGFELightElement::findLightSource): Deleted.
* svg/SVGFELightElement.h:
* svg/SVGFEPointLightElement.cpp:
(WebCore::SVGFEPointLightElement::lightSource const):
* svg/SVGFEPointLightElement.h:
* svg/SVGFESpecularLightingElement.cpp:
(WebCore::SVGFESpecularLightingElement::build):
* svg/SVGFESpotLightElement.cpp:
(WebCore::SVGFESpotLightElement::lightSource const):
* svg/SVGFESpotLightElement.h:
* svg/graphics/filters/SVGFilterBuilder.h:
(WebCore::SVGFilterBuilder::setTargetBoundingBox):
(WebCore::SVGFilterBuilder::targetBoundingBox const):
(WebCore::SVGFilterBuilder::primitiveUnits const):
(WebCore::SVGFilterBuilder::setPrimitiveUnits):
2018-01-03 Antti Koivisto <antti@apple.com>
Crash beneath CSSValue::equals @ csas.cz
https://bugs.webkit.org/show_bug.cgi?id=181243
<rdar://problem/35990826>
Reviewed by Alex Christensen.
Test: fast/text/oblique-degree-equals-crash.html
* css/CSSFontStyleValue.cpp:
(WebCore::CSSFontStyleValue::equals const):
Null check both oblique pointers.
2018-01-03 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
https://bugs.webkit.org/show_bug.cgi?id=180979
<rdar://problem/36146670>
Reviewed by Matt Baker.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(fontNameIsSystemFont):
(WebCore::FontCache::systemFontFamilies):
Switch to the original Mac algorithm before r180979 that uses
CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
available on iOS but now it is. This is a performance improvement on
both platforms, but significantly so on macOS. It also finds more,
valid, family names.
2018-01-03 Michael Catanzaro <mcatanzaro@igalia.com>
ASSERTION FAILED: !source || is<Target>(*source) in CoordinatedGraphicsLayer::removeFromParent
https://bugs.webkit.org/show_bug.cgi?id=166568
Reviewed by Simon Fraser.
When a GraphicsLayer has a mask layer, it fails to properly unparent the mask layer before
it is destroyed. This leaves the mask layer with a dangling parent pointer. Fix it, while
taking care not to introduce yet another virtual function call during the execution of the
destructor.
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::willBeDestroyed):
2018-01-03 Simon Fraser <simon.fraser@apple.com>
SVG lighting filter lights are in the wrong coordinate system
https://bugs.webkit.org/show_bug.cgi?id=181147
Reviewed by Zalan Bujtas.
Point and spot light coordinates weren't being converted into buffer-relative
coordinates before being fed into the lighting math, resulting in incorrect light
rendering on Retina devices, and when the filter primitive region was clipped.
Fix by storing absoluteUnclippedSubregion on FilterEffect, which allows us to map
lighting points from user space coordinates into the coordinates of the buffer being
used for rendering. Also scale the light z coordinate by doing a dummy point mapping in x.
Rename members of PointLightSource and SpotLightSource to make it clear which coordinate
system they are in.
Tests include HiDPI tests.
Tests: svg/filters/fePointLight-coordinates-expected.svg
svg/filters/fePointLight-coordinates.svg
svg/filters/feSpotLight-coordinates-expected.svg
svg/filters/feSpotLight-coordinates.svg
svg/filters/hidpi/fePointLight-coordinates-expected.svg
svg/filters/hidpi/fePointLight-coordinates.svg
svg/filters/hidpi/feSpotLight-coordinates-expected.svg
svg/filters/hidpi/feSpotLight-coordinates.svg
* platform/graphics/FloatPoint3D.h: Make it easy to get and set the X and Y coords as a FloatPoint.
(WebCore::FloatPoint3D::xy const):
(WebCore::FloatPoint3D::setXY):
* platform/graphics/GeometryUtilities.cpp:
(WebCore::mapPoint):
(WebCore::mapRect):
* platform/graphics/GeometryUtilities.h: Helper to make a point between rects.
* platform/graphics/filters/DistantLightSource.cpp:
(WebCore::DistantLightSource::initPaintingData):
* platform/graphics/filters/DistantLightSource.h:
* platform/graphics/filters/FELighting.cpp:
(WebCore::FELighting::drawLighting):
* platform/graphics/filters/FilterEffect.cpp:
(WebCore::FilterEffect::mapPointFromUserSpaceToBuffer const):
* platform/graphics/filters/FilterEffect.h:
(WebCore::FilterEffect::setUnclippedAbsoluteSubregion):
* platform/graphics/filters/LightSource.h:
* platform/graphics/filters/PointLightSource.cpp:
(WebCore::PointLightSource::initPaintingData):
(WebCore::PointLightSource::computePixelLightingData const):
(WebCore::PointLightSource::setX):
(WebCore::PointLightSource::setY):
(WebCore::PointLightSource::setZ):
* platform/graphics/filters/PointLightSource.h:
(WebCore::PointLightSource::position const):
(WebCore::PointLightSource::PointLightSource):
* platform/graphics/filters/SpotLightSource.cpp:
(WebCore::SpotLightSource::initPaintingData):
(WebCore::SpotLightSource::computePixelLightingData const):
(WebCore::SpotLightSource::setX):
(WebCore::SpotLightSource::setY):
(WebCore::SpotLightSource::setZ):
(WebCore::SpotLightSource::setPointsAtX):
(WebCore::SpotLightSource::setPointsAtY):
(WebCore::SpotLightSource::setPointsAtZ):
* platform/graphics/filters/SpotLightSource.h:
(WebCore::SpotLightSource::position const):
(WebCore::SpotLightSource::direction const):
(WebCore::SpotLightSource::SpotLightSource):
* rendering/svg/RenderSVGResourceFilter.cpp:
(WebCore::RenderSVGResourceFilter::buildPrimitives const):
* rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
(WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion):
2018-01-03 Youenn Fablet <youenn@apple.com>
Select service worker for documents with data/blob URLS
https://bugs.webkit.org/show_bug.cgi?id=181213
Reviewed by Alex Christensen.
Covered by updated test.
Reusing the service worker of the parent for blob/data URL documents.
* loader/DocumentLoader.cpp:
(WebCore::isLocalURL):
(WebCore::DocumentLoader::commitData):
2018-01-03 Ryan Haddad <ryanhaddad@apple.com>
Unreviewed, rolling out r226352.
Breaks Sierra and El Capitan builds.
Reverted changeset:
"Web Inspector: Slow open time enumerating system fonts
(FontCache::systemFontFamilies)"
https://bugs.webkit.org/show_bug.cgi?id=180979
https://trac.webkit.org/changeset/226352
2018-01-03 Philippe Normand <pnormand@igalia.com>
[GStreamer] The bus synchronous handler should be in the base player class
https://bugs.webkit.org/show_bug.cgi?id=181237
Reviewed by Carlos Garcia Campos.
Because this is where video rendering is handled.
No new tests, this is only a refactoring.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::setPipeline):
2018-01-03 Philippe Normand <pnormand@igalia.com>
[GStreamer] move MediaSample implementation out of mse/
https://bugs.webkit.org/show_bug.cgi?id=179165
Reviewed by Carlos Garcia Campos.
This module isn't specific to MSE and can potentially be reused
elsewhere, for WebRTC for instance. Additionally the
::platformSample() method was implemented and the code was cleaned up.
* platform/GStreamer.cmake:
* platform/MediaSample.h:
* platform/graphics/gstreamer/GStreamerMediaSample.cpp: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.cpp.
(WebCore::GStreamerMediaSample::platformSample):
* platform/graphics/gstreamer/GStreamerMediaSample.h: Renamed from Source/WebCore/platform/graphics/gstreamer/mse/GStreamerMediaSample.h.
* platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
(WebCore::PlaybackPipeline::enqueueSample):
2018-01-03 Carlos Garcia Campos <cgarcia@igalia.com>
Unreviewed. Fix resource load stats tests on GLib based ports after r226355.
The monitor can be created in the work queue thread too.
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
2018-01-03 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Crash destroying WebCore::FileMonitor
https://bugs.webkit.org/show_bug.cgi?id=181138
Reviewed by Michael Catanzaro.
Ensure that platform file monitor is always created and destroyed in the work queue thread synchronously.
* platform/FileMonitor.h:
* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
(WebCore::FileMonitor::~FileMonitor):
(WebCore::FileMonitor::didChange):
2018-01-02 Joseph Pecoraro <pecoraro@apple.com>
Web Inspector: Slow open time enumerating system fonts (FontCache::systemFontFamilies)
https://bugs.webkit.org/show_bug.cgi?id=180979
<rdar://problem/36146670>
Reviewed by Matt Baker.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::systemFontFamilies):
Switch to the original Mac algorithm before r180979 that uses
CTFontManagerCopyAvailableFontFamilyNames. Previously this wasn't
available on iOS but now it is. This is a performance improvement on
both platforms, but significantly so on macOS. It also finds more,
valid, family names.
2018-01-02 Yusuke Suzuki <utatane.tea@gmail.com>
Unreviewed, fix GCC warning by using #include
https://bugs.webkit.org/show_bug.cgi?id=181189
This file is included in C++ files. Use #include instead of #import to suppress warning in GCC.
* platform/PromisedBlobInfo.h:
2017-12-28 Yusuke Suzuki <utatane.tea@gmail.com>
Remove std::chrono completely
https://bugs.webkit.org/show_bug.cgi?id=181186
Reviewed by Alex Christensen.
Use MonotonicTime, WallTime, and Seconds instead.
Changes are mechanical ones. But persistent network cache data is changed.
So we bump the version number of the cache storage.
* Modules/indexeddb/server/IDBServer.cpp:
(WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::removeAllDatabasesForOriginPath):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesModifiedSince):
(WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
* Modules/indexeddb/server/IDBServer.h:
* Modules/webdatabase/DatabaseTracker.cpp:
(WebCore::DatabaseTracker::deleteDatabasesModifiedSince):
* Modules/webdatabase/DatabaseTracker.h:
* dom/Document.cpp:
(WebCore::Document::lastModified):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::clearMediaCache):
* html/HTMLMediaElement.h:
(WebCore::HTMLMediaElement::clearMediaCache):
* loader/CrossOriginPreflightResultCache.cpp:
(WebCore::parseAccessControlMaxAge):
(WebCore::CrossOriginPreflightResultCacheItem::parse):
(WebCore::CrossOriginPreflightResultCacheItem::allowsRequest const):
* loader/CrossOriginPreflightResultCache.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
(WebCore::CachedResource::freshnessLifetime const):
(WebCore::CachedResource::responseReceived):
(WebCore::CachedResource::updateResponseAfterRevalidation):
* loader/cache/CachedResource.h:
* platform/FileSystem.cpp:
(WebCore::FileSystem::getFileModificationTime):
* platform/FileSystem.h:
* platform/SearchPopupMenu.h:
* platform/cocoa/SearchPopupMenuCocoa.h:
* platform/cocoa/SearchPopupMenuCocoa.mm:
(WebCore::toSystemClockTime):
(WebCore::toNSDateFromSystemClock):
(WebCore::removeRecentlyModifiedRecentSearches):
* platform/graphics/MediaPlayer.cpp:
(WebCore::MediaPlayer::clearMediaCache):
* platform/graphics/MediaPlayer.h:
* platform/graphics/MediaPlayerPrivate.h:
(WebCore::MediaPlayerPrivateInterface::clearMediaCache):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::toSystemClockTime):
(WebCore::MediaPlayerPrivateAVFoundationObjC::clearMediaCache):
* platform/graphics/mac/MediaPlayerPrivateQTKit.h:
* platform/graphics/mac/MediaPlayerPrivateQTKit.mm:
(WebCore::MediaPlayerPrivateQTKit::clearMediaCache):
* platform/network/CacheValidation.cpp:
(WebCore::computeCurrentAge):
(WebCore::computeFreshnessLifetimeForHTTPFamily):
(WebCore::updateRedirectChainStatus):
(WebCore::redirectChainAllowsReuse):
(WebCore::parseCacheControlDirectives):
* platform/network/CacheValidation.h:
(WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
* platform/network/HTTPParsers.cpp:
(WebCore::parseHTTPDate):
* platform/network/HTTPParsers.h:
* platform/network/PlatformCookieJar.h:
* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::cacheControlMaxAge const):
(WebCore::parseDateValueInHeader):
(WebCore::ResourceResponseBase::date const):
(WebCore::ResourceResponseBase::age const):
(WebCore::ResourceResponseBase::expires const):
(WebCore::ResourceResponseBase::lastModified const):
* platform/network/ResourceResponseBase.h:
* platform/network/cf/CookieJarCFNet.cpp:
(WebCore::deleteAllCookiesModifiedSince):
* platform/network/curl/CookieJarCurl.cpp:
(WebCore::CookieJarCurlFileSystem::deleteAllCookiesModifiedSince):
(WebCore::deleteAllCookiesModifiedSince):
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CurlCacheEntry.cpp:
(WebCore::CurlCacheEntry::CurlCacheEntry):
(WebCore::CurlCacheEntry::isCached):
(WebCore::CurlCacheEntry::parseResponseHeaders):
* platform/network/curl/CurlCacheEntry.h:
* platform/network/mac/CookieJarMac.mm:
(WebCore::deleteAllCookiesModifiedSince):
* platform/network/soup/CookieJarSoup.cpp:
(WebCore::deleteAllCookiesModifiedSince):
* platform/win/SearchPopupMenuWin.cpp:
(WebCore::SearchPopupMenuWin::loadRecentSearches):
* rendering/RenderSearchField.cpp:
(WebCore::RenderSearchField::addSearchResult):
2018-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Introduce data structures and IPC support for writing promised blobs
https://bugs.webkit.org/show_bug.cgi?id=181189
Reviewed by Tim Horton.
Introduces a new header containing structs to be used for writing blob data when dragging. PromisedBlobInfo
represents information needed to declare data on the pasteboard that will eventually be provided via a Blob.
This includes the type and filename of the Blob-backed content. PromisedBlobData represents information needed
to actually deliver the Blob's content to the platform, and is sent some time after its corresponding
PromisedBlobInfo. The content may either be in the form of a file path (as is the case using the previous
declareAndWriteAttachment codepath) or a data buffer (which we would use if the Blob is not already backed by a
file on disk).
No new tests, since there is no observable change in functionality yet.
* WebCore.xcodeproj/project.pbxproj:
* platform/PromisedBlobInfo.h: Added.
(WebCore::PromisedBlobInfo::operator bool const):
(WebCore::PromisedBlobData::hasData const):
(WebCore::PromisedBlobData::hasFile const):
(WebCore::PromisedBlobData::operator bool const):
(WebCore::PromisedBlobData::fulfills const):
2018-01-02 Brady Eidson <beidson@apple.com>
Make MessagePortChannel::takeAllMessagesFromRemote asynchronous.
https://bugs.webkit.org/show_bug.cgi?id=181205
Reviewed by Alex Christensen.
No new tests (No behavior change)
This is needed for the ongoing WK2 MessagePort work.
For WK1 in-process MessagePorts it is still synchronous; no behavior change.
* dom/InProcessMessagePortChannel.cpp:
(WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
* dom/InProcessMessagePortChannel.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::dispatchMessages):
* dom/MessagePortChannel.h:
2018-01-02 Jiewen Tan <jiewen_tan@apple.com>
Add a WebAuthentication runtime feature flag
https://bugs.webkit.org/show_bug.cgi?id=181220
<rdar://problem/36055305>
Reviewed by Brent Fulgham.
This patch basically renames the CredentialManagement runtime feature flag into
WebAuthentication runtime feature flag.
No tests.
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/PublicKeyCredential.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setWebAuthenticationEnabled):
(WebCore::RuntimeEnabledFeatures::webAuthenticationEnabled const):
(WebCore::RuntimeEnabledFeatures::setCredentialManagementEnabled): Deleted.
(WebCore::RuntimeEnabledFeatures::credentialManagementEnabled const): Deleted.
2018-01-02 Wenson Hsieh <wenson_hsieh@apple.com>
[Attachment Support] Don't Blob-convert images and attachments with https:, http: or data: urls
https://bugs.webkit.org/show_bug.cgi?id=181143
<rdar://problem/36200381>
Reviewed by Tim Horton.
Clients such as Mail would expect pasting or dropping an image with src="https://..." to result in the source
URL being preserved (i.e. staying as remote images) instead of creating image attachments out of them. This
patch hooks into the shouldConvertToBlob() check added in r226272 so that it applies to attachment element
replacement as well.
Test: WKAttachmentTests.DoNotInsertDataURLImagesAsAttachments
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldConvertToBlob):
(WebCore::replaceRichContentWithAttachments):
2018-01-02 Brady Eidson <beidson@apple.com>
Identify MessagePorts by a globally unique MessagePortIdentifier.
https://bugs.webkit.org/show_bug.cgi?id=181172
Reviewed by Alex Christensen.
No new tests (Behavior change covered by all existing tests).
This cleans up the abstract MessagePortChannel interface to be in terms of identifiers
instead of actual MessagePort objects.
The identifiers are compounded with the current ProcessIdentifier meaning they are global
across all processes for the running UI process, enabling easy cross-process communication.
(Actual cross-process communication comes in a followup)
* WebCore.xcodeproj/project.pbxproj:
* dom/InProcessMessagePortChannel.cpp:
(WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
(WebCore::InProcessMessagePortChannel::isConnectedTo):
(WebCore::InProcessMessagePortChannel::entangleWithRemoteIfOpen):
(WebCore::InProcessMessagePortChannel::entangleIfOpen): Deleted.
* dom/InProcessMessagePortChannel.h:
* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
(WebCore::m_port2):
* dom/MessagePort.cpp:
(WebCore::allMessagePortsLock):
(WebCore::MessagePort::ref const):
(WebCore::MessagePort::deref const):
(WebCore::MessagePort::existingMessagePortForIdentifier):
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::entangleWithRemote):
(WebCore::MessagePort::entanglePorts):
(WebCore::MessagePort::entangle): Deleted.
* dom/MessagePort.h:
* dom/MessagePortChannel.h:
* dom/MessagePortIdentifier.h: Added.
(WebCore::operator==):
(WebCore::MessagePortIdentifier::encode const):
(WebCore::MessagePortIdentifier::decode):
(WebCore::MessagePortIdentifier::hash const):
(WTF::MessagePortIdentifierHash::hash):
(WTF::MessagePortIdentifierHash::equal):
(WTF::HashTraits<WebCore::MessagePortIdentifier>::emptyValue):
(WTF::HashTraits<WebCore::MessagePortIdentifier>::constructDeletedValue):
(WTF::HashTraits<WebCore::MessagePortIdentifier>::isDeletedValue):
2018-01-02 Youenn Fablet <youenn@apple.com>
Memory cache should not reuse resources with different credential fetch option
https://bugs.webkit.org/show_bug.cgi?id=181212
Reviewed by Alex Christensen.
Covered by rebased test.
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::determineRevalidationPolicy const):
2018-01-02 Jiewen Tan <jiewen_tan@apple.com>
Update Credential Management API for WebAuthentication
https://bugs.webkit.org/show_bug.cgi?id=181082
<rdar://problem/36055239>
Reviewed by Brent Fulgham.
Part 2/2
This patch implements Core API from Credential Management API: https://www.w3.org/TR/credential-management-1/#core.
which is required by WebAuthN. It also sets the CredentialManagement runtime flag to enable testing. Note that it
introduces a dummy PublicKeyCredential interface for testing functionalities of the Credential interface, which
cannot be instantiated.
Tests: http/wpt/credential-management/credentialscontainer-create-basics.https.html
http/wpt/credential-management/credentialscontainer-get-basics.https.html
http/wpt/credential-management/credentialscontainer-preventSilentAccess-basics.https.html
http/wpt/credential-management/idl.https.html
* CMakeLists.txt:
* DerivedSources.make:
* Modules/credentialmanagement/BasicCredential.cpp:
(WebCore::BasicCredential::BasicCredential):
(WebCore::BasicCredential::type const):
* Modules/credentialmanagement/BasicCredential.h:
(WebCore::BasicCredential::discovery const):
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
(WebCore::CredentialsContainer::CredentialsContainer):
(WebCore::CredentialsContainer::isSameOriginWithItsAncestors):
(WebCore::CredentialsContainer::dispatchTask):
(WebCore::CredentialsContainer::get):
(WebCore::CredentialsContainer::store):
(WebCore::CredentialsContainer::isCreate):
(WebCore::CredentialsContainer::preventSilentAccess):
* Modules/credentialmanagement/CredentialsContainer.h:
(WebCore::CredentialsContainer::create):
(WebCore::CredentialsContainer::CredentialsContainer): Deleted.
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
(WebCore::NavigatorCredentials::credentials):
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/PublicKeyCredential.cpp: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
(WebCore::PublicKeyCredential::PublicKeyCredential):
(WebCore::PublicKeyCredential::collectFromCredentialStore):
(WebCore::PublicKeyCredential::discoverFromExternalSource):
(WebCore::PublicKeyCredential::store):
(WebCore::PublicKeyCredential::create):
* Modules/webauthn/PublicKeyCredential.h: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.cpp.
* Modules/webauthn/PublicKeyCredential.idl: Copied from Source/WebCore/Modules/credentialmanagement/BasicCredential.idl.
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/WebCoreBuiltinNames.h:
* page/RuntimeEnabledFeatures.h:
2018-01-02 Oleksandr Skachkov <gskachkov@gmail.com>
WebAssembly: sending module to iframe fails
https://bugs.webkit.org/show_bug.cgi?id=179263
Reviewed by JF Bastien.
Allow use WebAssembly.Module as input parameters for postMessage
in window and iframe object. To prevent sending message to iframe
that is not ready, in iframe-* test we are waiting message from
iframe only after that we send message to it.
Tests: wasm/iframe-parent-postmessage.html
wasm/iframe-postmessage.html
wasm/window-postmessage.html
* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
* bindings/js/SerializedScriptValue.h:
* page/DOMWindow.cpp:
(WebCore::DOMWindow::postMessage):
== Rolled over to ChangeLog-2018-01-01 ==