2019-03-11 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r242770. rdar://problem/48795263 REGRESSION(r236281): YouTube Movies fail with "video format" error https://bugs.webkit.org/show_bug.cgi?id=195598 <rdar://problem/48782842> Reviewed by Jon Lee. Partially revert r236281 for YouTube.com. * page/Quirks.cpp: (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242770 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-03-11 Jer Noble <jer.noble@apple.com> REGRESSION(r236281): YouTube Movies fail with "video format" error https://bugs.webkit.org/show_bug.cgi?id=195598 <rdar://problem/48782842> Reviewed by Jon Lee. Partially revert r236281 for YouTube.com. * page/Quirks.cpp: (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): 2019-02-28 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r242204. rdar://problem/48483747 Locale names can be nullptr https://bugs.webkit.org/show_bug.cgi?id=195171 <rdar://problem/48262376> Reviewed by Dean Jackson. Nullptr can't be used in keys to HashMaps, so take an early out in this case. This is a partial revert of r241288. * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontDescription::platformResolveGenericFamily): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242204 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-28 Myles C. Maxfield <mmaxfield@apple.com> Locale names can be nullptr https://bugs.webkit.org/show_bug.cgi?id=195171 <rdar://problem/48262376> Reviewed by Dean Jackson. Nullptr can't be used in keys to HashMaps, so take an early out in this case. This is a partial revert of r241288. * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontDescription::platformResolveGenericFamily): 2019-02-28 Alan Coon <alancoon@apple.com> Apply patch. rdar://problem/48464969 2019-02-28 Timothy Hatcher <timothy@apple.com> REGRESSION: WebKit content crash in Base System (because NSAppearance is NULL). https://bugs.webkit.org/show_bug.cgi?id=195086 rdar://problem/48419124 Reviewed by Tim Horton. * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Always return a valid NSAppearance. 2019-02-24 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241986. rdar://problem/48350373 Crash in SWServerJobQueue::runNextJobSynchronously https://bugs.webkit.org/show_bug.cgi?id=194974 Reviewed by Geoffrey Garen. We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously or there is a timer heap corruption again :( Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen but convert an existing release assert to a debug assert since this appears to be hitting too frequently in wild. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::runNextJobSynchronously): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241986 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-22 Ryosuke Niwa <rniwa@webkit.org> Crash in SWServerJobQueue::runNextJobSynchronously https://bugs.webkit.org/show_bug.cgi?id=194974 Reviewed by Geoffrey Garen. We suspect the crash is happening due to m_jobQueue being empty in runNextJobSynchronously or there is a timer heap corruption again :( Exit early when m_jobQueue is empty. Also add a debug assert that this should never happen but convert an existing release assert to a debug assert since this appears to be hitting too frequently in wild. * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::runNextJobSynchronously): 2019-02-24 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241967. rdar://problem/48350358 Crash under IDBServer::IDBConnectionToClient::identifier() const https://bugs.webkit.org/show_bug.cgi?id=194843 <rdar://problem/48203102> Reviewed by Geoffrey Garen. UniqueIDBDatabase should ignore requests from connections that are already closed. Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore may start a version change transaction and ask for identifier from the connection that is already gone. * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed): * Modules/indexeddb/server/IDBConnectionToClient.h: (WebCore::IDBServer::IDBConnectionToClient::isClosed): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests): (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): * Modules/indexeddb/server/UniqueIDBDatabase.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241967 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-22 Sihui Liu <sihui_liu@apple.com> Crash under IDBServer::IDBConnectionToClient::identifier() const https://bugs.webkit.org/show_bug.cgi?id=194843 <rdar://problem/48203102> Reviewed by Geoffrey Garen. UniqueIDBDatabase should ignore requests from connections that are already closed. Tests are hard to create without some tricks on UniqueIDBDatabase so this fix is verified manually. One test is created by adding delay to UniqueIDBDatabase::openBackingStore on the background thread to make sure disconnection of web process happens before UniqueIDBDatabase::didOpenBackingStore, because didOpenBackingStore may start a version change transaction and ask for identifier from the connection that is already gone. * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::connectionToClientClosed): * Modules/indexeddb/server/IDBConnectionToClient.h: (WebCore::IDBServer::IDBConnectionToClient::isClosed): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::clearStalePendingOpenDBRequests): (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): (WebCore::IDBServer::UniqueIDBDatabase::operationAndTransactionTimerFired): * Modules/indexeddb/server/UniqueIDBDatabase.h: 2019-02-24 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241915. rdar://problem/48298733 Layout Test fast/text/international/khmer-selection.html is crashing https://bugs.webkit.org/show_bug.cgi?id=191368 Reviewed by Brent Fulgham. Source/WebCore: GlyphBuffer's offset array wasn't getting filled by UniscribeController. Our underlining code requires this array. Uniscribe gives us a character -> glyph mapping, so we just have to compute the inverse and give it to the GlyphBuffer. This patch is written by Myles C. Maxfield. Test: fast/text/international/khmer-selection.html. * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::add): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): * platform/graphics/win/UniscribeController.cpp: (WebCore::UniscribeController::advance): (WebCore::UniscribeController::itemizeShapeAndPlace): (WebCore::UniscribeController::shapeAndPlaceItem): * platform/graphics/win/UniscribeController.h: LayoutTests: * platform/win/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241915 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-21 Per Arne Vollan <pvollan@apple.com> Layout Test fast/text/international/khmer-selection.html is crashing https://bugs.webkit.org/show_bug.cgi?id=191368 Reviewed by Brent Fulgham. GlyphBuffer's offset array wasn't getting filled by UniscribeController. Our underlining code requires this array. Uniscribe gives us a character -> glyph mapping, so we just have to compute the inverse and give it to the GlyphBuffer. This patch is written by Myles C. Maxfield. Test: fast/text/international/khmer-selection.html. * platform/graphics/GlyphBuffer.h: (WebCore::GlyphBuffer::add): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawGlyphs::generateGlyphBuffer const): * platform/graphics/win/UniscribeController.cpp: (WebCore::UniscribeController::advance): (WebCore::UniscribeController::itemizeShapeAndPlace): (WebCore::UniscribeController::shapeAndPlaceItem): * platform/graphics/win/UniscribeController.h: 2019-02-24 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241830. rdar://problem/48248202 REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test https://bugs.webkit.org/show_bug.cgi?id=194866 Reviewed by Antti Koivisto. r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::recursiveRepaintLayer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241830 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-20 Simon Fraser <simon.fraser@apple.com> REGRESSION (r241788>): ASSERTION FAILED: !m_normalFlowListDirty in TestWebKitAPI.WebKit.ResizeReversePaginatedWebView test https://bugs.webkit.org/show_bug.cgi?id=194866 Reviewed by Antti Koivisto. r241788 removed some calls that updated layer lists (normal flow and z-order) during compositing updates, causing a later call to RenderLayerCompositor::recursiveRepaintLayer() to assert when the lists were dirty. Fix by updating the lists in RenderLayerCompositor::recursiveRepaintLayer(), as we do in various other places. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::recursiveRepaintLayer): 2019-02-21 Alan Coon <alancoon@apple.com> Apply patch. rdar://problem/48229545 2019-02-21 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r240909): Release assertion in FrameLoader::loadPostRequest when opening new window https://bugs.webkit.org/show_bug.cgi?id=194820 Reviewed by Geoffrey Garen and Brady Eidson. This release assertion was wrong. The invocation of PolicyChecker::checkNewWindowPolicy in FrameLoader doesn’t require PolicyChecker's load type to be set in PolicyChecker because FrameLoader's continueLoadAfterNewWindowPolicy invokes loadWithNavigationAction which sets the load type later, and we don't rely on PolicyChecker's load type until then. Fixed the crash by removing relese asserts before invoking checkNewWindowPolicy accordingly. This patch reverts r241015 since it too was asserting that PolicyChecker's load type is set before invoking checkNewWindowPolicy which is not the right assumption. Test: fast/loader/navigate-with-post-to-new-target-after-back-forward-navigation.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadPostRequest): 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241848. rdar://problem/48257838 Crash in DOMWindowExtension::suspendForPageCache https://bugs.webkit.org/show_bug.cgi?id=194871 Reviewed by Chris Dumez. This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache. We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's. Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache to avoid the crash. * page/DOMWindow.cpp: (WebCore::DOMWindow::willDestroyCachedFrame): (WebCore::DOMWindow::willDestroyDocumentInFrame): (WebCore::DOMWindow::willDetachDocumentFromFrame): (WebCore::DOMWindow::suspendForPageCache): (WebCore::DOMWindow::resumeFromPageCache): * page/DOMWindowExtension.cpp: (WebCore::DOMWindowExtension::suspendForPageCache): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241848 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-20 Ryosuke Niwa <rniwa@webkit.org> Crash in DOMWindowExtension::suspendForPageCache https://bugs.webkit.org/show_bug.cgi?id=194871 Reviewed by Chris Dumez. This is a speculative fix for a crash in DOMWindowExtension::suspendForPageCache. We think it's possible for DOMWindowExtension::suspendForPageCache notifying the clients via dispatchWillDisconnectDOMWindowExtensionFromGlobalObject to remove other DOMWindowExtension's. Check that each DOMWindowProperty is still in m_properties before invoking suspendForPageCache to avoid the crash. * page/DOMWindow.cpp: (WebCore::DOMWindow::willDestroyCachedFrame): (WebCore::DOMWindow::willDestroyDocumentInFrame): (WebCore::DOMWindow::willDetachDocumentFromFrame): (WebCore::DOMWindow::suspendForPageCache): (WebCore::DOMWindow::resumeFromPageCache): * page/DOMWindowExtension.cpp: (WebCore::DOMWindowExtension::suspendForPageCache): 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241788. rdar://problem/48248202 REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view https://bugs.webkit.org/show_bug.cgi?id=194827 rdar://problem/47620594 Reviewed by Antti Koivisto. Source/WebCore: Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating layer configurations, since a repaint implies that a layer gains painted content. This is done via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}. The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation for the root. The configuration state that matters here is whether the layer contains painted content, and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(), and feeds into GraphicsLayer::drawsContent(). However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading, then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing. Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer() to always return false for the RenderView's layer (the root). Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to respect it. Test: compositing/visibility/root-visibility-toggle.html * page/Frame.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): * testing/Internals.cpp: (WebCore::toLayerTreeFlags): * testing/Internals.h: * testing/Internals.idl: LayoutTests: Test dumps layer tree with RenderLayerBacking::shouldDumpPropertyForLayer to show that the root has (drawsContent 1) * compositing/visibility/root-visibility-toggle-expected.txt: Added. * compositing/visibility/root-visibility-toggle.html: Added. * platform/mac-wk1/compositing/visibility/root-visibility-toggle-expected.txt: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241788 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-19 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238090): Toggling visibility on the <html> element can result in a blank web view https://bugs.webkit.org/show_bug.cgi?id=194827 rdar://problem/47620594 Reviewed by Antti Koivisto. Incremental compositing updates, added in rr238090, use repaints as a trigger for re-evaluating layer configurations, since a repaint implies that a layer gains painted content. This is done via the call to setNeedsCompositingConfigurationUpdate() in RenderLayerBacking::setContentsNeedDisplay{InRect}. The RenderView's layer is opted out of this to avoid doing lots of redundant layer config recomputation for the root. The configuration state that matters here is whether the layer contains painted content, and therefore needs backing store; this is computed by RenderLayerBacking::isSimpleContainerCompositingLayer(), and feeds into GraphicsLayer::drawsContent(). However, if <html> starts as "visibility:hidden" or "opacity:0", as some sites do to hide incremental loading, then we'll fail to recompute 'drawsContent' for the root and leave the root with drawsContent=false, which causes RenderLayerBacking::setContentsNeedDisplay{InRect} to short-circuit, and then we paint nothing. Ironically, 'drawsContent' doesn't actually save any backing store for the root, since it has no affect on the root tile caches; we always make tiles. So the simple fix here is to change RenderLayerBacking::isSimpleContainerCompositingLayer() to always return false for the RenderView's layer (the root). Testing this was tricky; ref testing doesn't work because we force repaint, and we normally skip properties of the root in layer tree dumps to hide WK1/WK2 differences. Therefore I had to add LAYER_TREE_INCLUDES_ROOT_LAYER_PROPERTIES and fix RenderLayerBacking::shouldDumpPropertyForLayer to respect it. Test: compositing/visibility/root-visibility-toggle.html * page/Frame.h: * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::dumpProperties const): * platform/graphics/GraphicsLayerClient.h: (WebCore::GraphicsLayerClient::shouldDumpPropertyForLayer const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer const): (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerTreeAsText): * testing/Internals.cpp: (WebCore::toLayerTreeFlags): * testing/Internals.h: * testing/Internals.idl: 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241738. rdar://problem/48243338 Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus() https://bugs.webkit.org/show_bug.cgi?id=194786 Reviewed by Eric Carlson. Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:] in an exception handler. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241738 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-18 Jer Noble <jer.noble@apple.com> Uncaught Exception crash in MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus() https://bugs.webkit.org/show_bug.cgi?id=194786 Reviewed by Eric Carlson. Convert a runtime crash to a debug assert by wrapping the call to -[AVPlayer removeObserver:forKeyPath:] in an exception handler. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus): 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241721. rdar://problem/48243376 AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue. https://bugs.webkit.org/show_bug.cgi?id=194742 Reviewed by Chris Dumez. Source/WebCore: With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug). This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably receive notifications. It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful page load. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): Source/WebKit: Re-initialize the accessibility web process tokens when swapping processes. Send page load notifications from the UIProcess instead of the WebProcess to improve reliability. * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::didFinishLoadForMainFrame): (WebKit::PageClientImpl::didFailLoadForMainFrame): * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): * WebProcess/WebPage/WebPage.h: * WebProcess/WebPage/gtk/WebPageGtk.cpp: (WebKit::WebPage::platformReinitialize): (WebKit::WebPage::platformDetach): Deleted. (WebKit::WebPage::platformEditorState const): Deleted. (WebKit::WebPage::updateAccessibilityTree): Deleted. (WebKit::WebPage::performDefaultBehaviorForKeyEvent): Deleted. (WebKit::WebPage::platformCanHandleRequest): Deleted. (WebKit::WebPage::platformUserAgent const): Deleted. (WebKit::WebPage::getCenterForZoomGesture): Deleted. (WebKit::WebPage::setInputMethodState): Deleted. (WebKit::WebPage::collapseSelectionInFrame): Deleted. * WebProcess/WebPage/ios/WebPageIOS.mm: (WebKit::WebPage::platformReinitialize): * WebProcess/WebPage/mac/WebPageMac.mm: (WebKit::WebPage::platformReinitialize): * WebProcess/WebPage/win/WebPageWin.cpp: (WebKit::WebPage::platformReinitialize): * WebProcess/WebPage/wpe/WebPageWPE.cpp: (WebKit::WebPage::platformReinitialize): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241721 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-18 Chris Fleizach <cfleizach@apple.com> AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue. https://bugs.webkit.org/show_bug.cgi?id=194742 Reviewed by Chris Dumez. With the new process model, WebProcess hits a case where it tries to send the "page loaded" notification before VoiceOver had a chance to register for any notifications. This leads to those notifications being dropped (and thus this bug). This change instead asks the UIProcess to send the notification, which we know VoiceOver has registered for, and can reliably receive notifications. It also sends the notification for "load failures," which to the VO users' perspective amounts to the same thing as a successful page load. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241626. rdar://problem/48243415 Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured() https://bugs.webkit.org/show_bug.cgi?id=194691 Reviewed by Simon Fraser. Source/WebCore: The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document without updating the layout of ancestor documents (i.e. documents in which frame owner elements appear) even though it hit-tests against the top-level document's RenderView. Fixed the bug by updating the layout of the top-level document as needed. Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::isReplacementObscured): LayoutTests: Added a regression test. It hits the newly added debug assertion without the fix. * platform/mac-wk1/TestExpectations: Skip the test since DumpRenderTree doesn't support testRunner.setPluginSupportedMode. * plugins/unsupported-plugin-with-replacement-in-iframe-crash-expected.txt: Added. * plugins/unsupported-plugin-with-replacement-in-iframe-crash.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241626 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-15 Ryosuke Niwa <rniwa@webkit.org> Crash in the hit testing code via HTMLPlugInElement::isReplacementObscured() https://bugs.webkit.org/show_bug.cgi?id=194691 Reviewed by Simon Fraser. The crash was caused by HTMLPlugInElement::isReplacementObscured updating the document without updating the layout of ancestor documents (i.e. documents in which frame owner elements appear) even though it hit-tests against the top-level document's RenderView. Fixed the bug by updating the layout of the top-level document as needed. Test: plugins/unsupported-plugin-with-replacement-in-iframe-crash.html * html/HTMLPlugInElement.cpp: (WebCore::HTMLPlugInElement::isReplacementObscured): 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241567. rdar://problem/48243396 Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector https://bugs.webkit.org/show_bug.cgi?id=194671 <rdar://problem/47628191> Patch by Joseph Pecoraro <pecoraro@apple.com> on 2019-02-14 Reviewed by Devin Rousso. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::item): A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of sync with the m_contents list of rules. In particular if the wrappers vector is shorter than the rule list. We tried exercising code paths that modify these lists but were not able to reproduce the crash. To avoid a crash we can make this access safer and avoid the original overflow. At the same time we will keep and promote the assertion that would catch the lists getting out of sync in debug builds. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241567 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-14 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Occasional crash under WebCore::CSSStyleSheet::item called from Inspector https://bugs.webkit.org/show_bug.cgi?id=194671 <rdar://problem/47628191> Reviewed by Devin Rousso. * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::item): A crash may happen if the m_childRuleCSSOMWrappers Vector gets out of sync with the m_contents list of rules. In particular if the wrappers vector is shorter than the rule list. We tried exercising code paths that modify these lists but were not able to reproduce the crash. To avoid a crash we can make this access safer and avoid the original overflow. At the same time we will keep and promote the assertion that would catch the lists getting out of sync in debug builds. 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241547. rdar://problem/48220627 Web Inspector: don't include accessibility role in DOM.Node object payloads https://bugs.webkit.org/show_bug.cgi?id=194623 <rdar://problem/36384037> Reviewed by Devin Rousso. Source/JavaScriptCore: Remove property of DOM.Node that is no longer being sent. * inspector/protocol/DOM.json: Source/WebCore: Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately. Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the first place due to a DOM node tree update (i.e., NodeInserted). It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not necessary to collect this information in a problematic way when initially pushing the node, as it will be updated anyway. No new tests, no change in behavior. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForNode): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241547 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Brian Burg <bburg@apple.com> Web Inspector: don't include accessibility role in DOM.Node object payloads https://bugs.webkit.org/show_bug.cgi?id=194623 <rdar://problem/36384037> Reviewed by Devin Rousso. Accessibility properties are complicated to fetch at all the points where we want to build and push nodes immediately. Turning on AX often indirectly causes style recalc and layout. This is bad because we are often building nodes in the first place due to a DOM node tree update (i.e., NodeInserted). It turns out that DOM.getAccessibilityPropertiesForNode is called every time we display the computed role in the Elements Tab > Nodes Sidebar > Accessibility Section. So it is not necessary to collect this information in a problematic way when initially pushing the node, as it will be updated anyway. No new tests, no change in behavior. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::buildObjectForNode): 2019-02-20 Alan Coon <alancoon@apple.com> Cherry-pick r241492. rdar://problem/48243254 [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized. https://bugs.webkit.org/show_bug.cgi?id=194621 <rdar://problem/48002560> Reviewed by Eric Carlson. When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation change events in the media-controller.js on rAF(). * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype._returnMediaLayerToInlineIfNeeded): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241492 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Jer Noble <jer.noble@apple.com> [Mac] PiP window can get "stuck" if PiP is closed while Safari window is minimized. https://bugs.webkit.org/show_bug.cgi?id=194621 <rdar://problem/48002560> Reviewed by Eric Carlson. When Safari is minimized, no rAF() requests are executed. Don't gate responding to presentation change events in the media-controller.js on rAF(). * Modules/modern-media-controls/media/media-controller.js: (MediaController.prototype._returnMediaLayerToInlineIfNeeded): 2019-02-20 Alan Coon <alancoon@apple.com> Revert r237978. rdar://problem/48244945 2019-02-18 Babak Shafiei <bshafiei@apple.com> Apply patch. rdar://problem/48122553 Introduce a WebContent Process cache https://bugs.webkit.org/show_bug.cgi?id=194594 <rdar://problem/46793397> Reviewed by Geoff Garen. Source/WebCore: Update localizable strings. * en.lproj/Localizable.strings: Source/WebKit: Introduce a WebContent Process cache to reduce the number of process launches when process swap on navigation is enabled, and to reduce the power cost of the feature. If a WebProcess loaded pages from a single registrable domain then it is eligible for the cache. When process-swapping on navigation to a new registrable domain, we now attempt to retrieve a process from the cache for the domain in question instead of always launching a new one. The WebProcess cache currently has the following attributes: - It may contains 4 processes per GB of RAM the machine has, up to 30 processes. - WebProcesses automatically get evicted from the cache after 30 minutes. - If the application is no longer the active app, then the cache will get cleared after 5 minutes. - WebProcesses that are in the cache are reported as "(Cached)" in Activity Monitor. The WebProcess cache is currently disabled by default and can by enabled by the client via SPI. * Shared/WebBackForwardListItem.cpp: (WebKit::WebBackForwardListItem::WebBackForwardListItem): * Shared/WebBackForwardListItem.h: (WebKit::WebBackForwardListItem::lastProcessIdentifier const): (WebKit::WebBackForwardListItem::setLastProcessIdentifier): Add new lastProcessIdentifier data member that reflects which process this item was last loaded in. It is normally identical to the identifier of the process that created the item but it gets overriden in case of cross-site client-side redirect, since a new process takes over the item in this case. * Sources.txt: Add new source file. * UIProcess/API/APIProcessPoolConfiguration.cpp: (API::ProcessPoolConfiguration::copy): * UIProcess/API/APIProcessPoolConfiguration.h: * UIProcess/API/C/WKContextConfigurationRef.cpp: (WKContextConfigurationUsesWebProcessCache): (WKContextConfigurationSetUsesWebProcessCache): * UIProcess/API/C/WKContextConfigurationRef.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.h: * UIProcess/API/Cocoa/_WKProcessPoolConfiguration.mm: (-[_WKProcessPoolConfiguration setUsesWebProcessCache:]): (-[_WKProcessPoolConfiguration usesWebProcessCache]): Add new SPI to enable the WebProcess cache. * UIProcess/API/Cocoa/WKProcessPool.mm: (-[WKProcessPool _webProcessCountIgnoringPrewarmedAndCached]): * UIProcess/API/Cocoa/WKProcessPoolPrivate.h: Add new SPI for testing which returns the number of WebProcesses ignoring both prewarmed and cached ones. * UIProcess/Cocoa/WebProcessPoolCocoa.mm: (WebKit::WebProcessPool::registerNotificationObservers): (WebKit::WebProcessPool::unregisterNotificationObservers): Add application active state observers as the WebProcess cache gets cleared when the application resigns active state for more than 5 minutes. * UIProcess/ProvisionalPageProxy.cpp: (WebKit::ProvisionalPageProxy::loadRequest): When doing a load in a new process with the BackForwardList locked (i.e. client-side redirect), make sure we update the last process identifier for the BackForwardListItem. This is important because the logic in WebProcessPool::processForNavigation() relies on this identifier to select which process to do the history navigation into, and we want to do the load in the post-redirect process, not the pre-redirect one. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Tell the WebProcess whenever a main frame provisional load is started, providing the URL. * UIProcess/WebProcessCache.cpp: Added. (WebKit::WebProcessCache::WebProcessCache): (WebKit::WebProcessCache::addProcess): (WebKit::WebProcessCache::takeProcess): (WebKit::WebProcessCache::updateMaximumSize): (WebKit::WebProcessCache::clear): (WebKit::WebProcessCache::setApplicationIsActive): (WebKit::WebProcessCache::evictProcess): (WebKit::WebProcessCache::CachedProcess::CachedProcess): (WebKit::WebProcessCache::CachedProcess::~CachedProcess): (WebKit::WebProcessCache::CachedProcess::takeProcess): (WebKit::WebProcessCache::CachedProcess::evictionTimerFired): * UIProcess/WebProcessCache.h: Added. (WebKit::WebProcessCache::maximumSize): (WebKit::WebProcessCache::size const): (WebKit::WebProcessCache::CachedProcess::process): Add process cache implementation. * UIProcess/WebProcessPool.cpp: (WebKit::m_webProcessCache): WebProcessCache is stored on the WebProcessPool via m_webProcessCache data member. (WebKit::WebProcessPool::~WebProcessPool): Clear the WebProcess cache in the destructor. (WebKit::WebProcessPool::setApplicationIsActive): Notify the WebProcessCache whenever the application's active state changes. (WebKit::WebProcessPool::createWebPage): If the state of PSON changes via the experimental features menu, dynamically update the WebProcessCache's size. This is needed because the cache is disabled when PSON is disabled. (WebKit::WebProcessPool::handleMemoryPressureWarning): Clear the WebProcess cache on memory pressure. (WebKit::WebProcessPool::processForNavigationInternal): Query the WebProcessCache before attempting to create a new WebProcess for a cross-site navigation. (WebKit::WebProcessPool::findReusableSuspendedPageProcess): This logic was split out of processForNavigationInternal() to reduce the size of the method. * UIProcess/WebProcessPool.h: * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::setIsInProcessCache): Update the isInProcessCache flag on the WebProcessProxy and send an IPC to the WebContent process so that it can update its name in Activity Monitor. We also need to stop holding a strong reference to the WebProcessPool whenever the process is in the cache, similarly to what we do for pre-warmed processes, given that such processes should not keep the process pool alive. (WebKit::WebProcessProxy::addExistingWebPage): Assert that we never try to add a page to a cached process, it should be taken out of the cache before use. (WebKit::WebProcessProxy::hasProvisionalPageWithID const): (WebKit::WebProcessProxy::isAllowedToUpdateBackForwardItem const): (WebKit::WebProcessProxy::updateBackForwardItem): In case of client-side redirects, the previous process would sometimes send an IPC causing the UIProcess' backforward list item to get updated with the pre-redirect URL after we've already redirected. This previously would be unlikely to occur because we do not suspend client-redirect pages and their process would normally exit before getting a chance to send the IPC. However, with the process cache, the bug became obvious as the process would stay alive and send up the "bad" IPC. To address the issue, we now only let the IPC update the item if the item's page is (still) associated with the process. In the future, we may want to update the IPC so that it gets sent to the WebPageProxy instead of the WebProcessProxy. (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): If a cached WebProcess crashes, remove it from the cache so that we do not attempt to use it for a load later. (WebKit::WebProcessProxy::canBeAddedToWebProcessCache const): Only cache WebProcesses that have loaded a single registrable domain. Also prevent caching for service worker and inspector processes. (WebKit::WebProcessProxy::maybeShutDown): If the process is cacheable, add it to the cache instead of shutting it down right away. (WebKit::WebProcessProxy::canTerminateAuxiliaryProcess): Make sure we do not attempt to terminate a processes that is in the cache. (WebKit::WebProcessProxy::didStartProvisionalLoadForMainFrame): Whenever a main frame provisional load starts, make sure we update the process's associated registrable domain. nullopt indicates that there is no associated domain yet. Null string indicates that the process is associated with several registrable domain and is therefore not eligible for caching. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::registrableDomain const): (WebKit::WebProcessProxy::isInProcessCache const): (WebKit::WebProcessProxy::provisionalPageCount const): Add convenience getters. * WebKit.xcodeproj/project.pbxproj: Add new files to project. * WebProcess/WebProcess.cpp: (WebKit::WebProcess::setIsInProcessCache): * WebProcess/WebProcess.h: * WebProcess/WebProcess.messages.in: * WebProcess/cocoa/WebProcessCocoa.mm: (WebKit::WebProcess::updateProcessName): Update the WebProcess' name in Activity Monitor whenever it goes into or out of the WebProcess cache. Tools: Update API tests to turn on the WebContent Process cache. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@241556 268f45cc-cd09-0410-ab3c-d52691b4dbfc (cherry picked from commit dc197d35fd5d947ff4c81c2e0f5636b9cad36b3c) 2019-02-14 Chris Dumez <cdumez@apple.com> [PSON] Introduce a WebContent Process cache https://bugs.webkit.org/show_bug.cgi?id=194594 <rdar://problem/46793397> Reviewed by Geoff Garen. Update localizable strings. * en.lproj/Localizable.strings: 2019-02-13 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241499. rdar://problem/48065634 Crash in DOMTimer::fired https://bugs.webkit.org/show_bug.cgi?id=194638 Reviewed by Brent Fulgham. Source/WebCore: This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934. The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired). Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map we would not leak these DOM timers. We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier. Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code, and is no longer the preferred approach when dealing with these classes of bugs in WebKit. Test: fast/dom/timer-destruction-during-firing.html * page/DOMTimer.cpp: (WebCore::NestedTimersMap::add): (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): LayoutTests: Added a regression test. It needs debug assertions without the fix. * fast/dom/timer-destruction-during-firing-expected.txt: Added. * fast/dom/timer-destruction-during-firing.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241499 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Ryosuke Niwa <rniwa@webkit.org> Crash in DOMTimer::fired https://bugs.webkit.org/show_bug.cgi?id=194638 Reviewed by Brent Fulgham. This patch continues the saga of hunting down timer related crashes after r239814, r225985, r227934. The crash was caused by the bug that we don't remove a DOMTimer from NestedTimersMap if a DOMTimer is created & installed inside another DOMTimer's callback (via execute call in DOMTimer::fired). Fixed the crash by using a Ref in NestedTimersMap. This will keep the timer alive until we exit from DOMTimer::fired. Because DOMTimer::fired always calls stopTracking() which clears the map we would not leak these DOM timers. We could, alternatively, use WeakPtr in NestedTimersMap but that would unnecessarily increase the size of DOMTimer for a very marginal benefit of DOMTimer objcets being deleted slightly earlier. Deleting itself in DOMTimer's destructor involves more logic & house keeping in the timer code, and is no longer the preferred approach when dealing with these classes of bugs in WebKit. Test: fast/dom/timer-destruction-during-firing.html * page/DOMTimer.cpp: (WebCore::NestedTimersMap::add): (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): 2019-02-13 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241494. rdar://problem/48065624 AX: Crash in handleMenuOpen https://bugs.webkit.org/show_bug.cgi?id=194627 Reviewed by Zalan Bujtas. Tests run under libGuardMalloc will cause crashes. This list of objects is a Node list, not an Element list, so we were not removing some nodes when they were being deallocated. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241494 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Chris Fleizach <cfleizach@apple.com> AX: Crash in handleMenuOpen https://bugs.webkit.org/show_bug.cgi?id=194627 Reviewed by Zalan Bujtas. Tests run under libGuardMalloc will cause crashes. This list of objects is a Node list, not an Element list, so we were not removing some nodes when they were being deallocated. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): 2019-02-13 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241484. rdar://problem/48065620 Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root https://bugs.webkit.org/show_bug.cgi?id=194516 <rdar://problem/44678353> Reviewed by Antoine Quint. Source/WebCore: Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html When walking up the element ancestor chain, use parentElementInComposedTree() to walk past the shadow root boundary. * dom/Element.cpp: (WebCore::parentCrossingFrameBoundaries): LayoutTests: * fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor-expected.txt: Added. * fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html: Added. * platform/ios-wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241484 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Jer Noble <jer.noble@apple.com> Entering fullscreen inside a shadow root will not set fullscreen pseudoclasses outside of root https://bugs.webkit.org/show_bug.cgi?id=194516 <rdar://problem/44678353> Reviewed by Antoine Quint. Test: fast/shadow-dom/fullscreen-in-shadow-full-screen-ancestor.html When walking up the element ancestor chain, use parentElementInComposedTree() to walk past the shadow root boundary. * dom/Element.cpp: (WebCore::parentCrossingFrameBoundaries): 2019-02-13 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241480. rdar://problem/48065618 Further restricting webarchive loads https://bugs.webkit.org/show_bug.cgi?id=194567 <rdar://problem/47610130> Reviewed by Youenn Fablet. Source/WebCore: This patch futher restricts main frame webarchive loads to the followings: 1) loaded by clients; 2) loaded by drag; 3) reloaded from any of the previous two. It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document to FrameLoader such that the option is remembered during redirections. Covered by API tests. * dom/Document.h: (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted. (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::disallowWebArchive const): * loader/DocumentLoader.h: (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame): (WebCore::DocumentLoader::allowsWebArchiveForMainFrame): * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput): (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput): * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): (WebCore::FrameLoader::reload): * loader/FrameLoader.h: (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive): (WebCore::FrameLoader::alwaysAllowLocalWebarchive const): * page/DragController.cpp: (WebCore::DragController::performDragOperation): * testing/Internals.cpp: (WebCore::Internals::setAlwaysAllowLocalWebarchive const): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::loadRequest): Set a flag to indicate a load is started from clients. Tools: Besides adding API tests, this patch also enhances DragAndDropSimulator to allow navigations on drop. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/mac/LoadWebArchive.mm: Added. (-[TestLoadWebArchiveNavigationDelegate webView:didFinishNavigation:]): (-[TestLoadWebArchiveNavigationDelegate webView:didFailProvisionalNavigation:withError:]): (-[TestLoadWebArchiveNavigationDelegate webView:createWebViewWithConfiguration:forNavigationAction:windowFeatures:]): (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/mac/helloworld.webarchive: Added. * TestWebKitAPI/Tests/mac/load-web-archive-1.html: Added. * TestWebKitAPI/Tests/mac/load-web-archive-2.html: Added. * TestWebKitAPI/cocoa/DragAndDropSimulator.h: * TestWebKitAPI/mac/DragAndDropSimulatorMac.mm: (-[DragAndDropSimulator initWithWebViewFrame:configuration:]): (-[DragAndDropSimulator _webView:dragDestinationActionMaskForDraggingInfo:]): LayoutTests: * platform/mac/fast/loader/webarchive-encoding-respected.html: * webarchive/loading/cache-expired-subresource.html: * webarchive/loading/javascript-url-iframe-crash.html: * webarchive/loading/mainresource-null-mimetype-crash.html: * webarchive/loading/missing-data.html: * webarchive/loading/object.html: * webarchive/loading/test-loading-archive-subresource-null-mimetype.html: * webarchive/loading/test-loading-archive-subresource.html: * webarchive/loading/test-loading-archive.html: * webarchive/loading/test-loading-top-archive.html: * webarchive/loading/video-in-webarchive.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241480 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-12 Jiewen Tan <jiewen_tan@apple.com> Further restricting webarchive loads https://bugs.webkit.org/show_bug.cgi?id=194567 <rdar://problem/47610130> Reviewed by Youenn Fablet. This patch futher restricts main frame webarchive loads to the followings: 1) loaded by clients; 2) loaded by drag; 3) reloaded from any of the previous two. It moves setAlwaysAllowLocalWebarchive, which is used for testing only, from Document to FrameLoader such that the option is remembered during redirections. Covered by API tests. * dom/Document.h: (WebCore::Document::setAlwaysAllowLocalWebarchive): Deleted. (WebCore::Document::alwaysAllowLocalWebarchive const): Deleted. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::disallowWebArchive const): * loader/DocumentLoader.h: (WebCore::DocumentLoader::setAllowsWebArchiveForMainFrame): (WebCore::DocumentLoader::allowsWebArchiveForMainFrame): * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setIsRequestFromClientOrUserInput): (WebCore::FrameLoadRequest::isRequestFromClientOrUserInput): * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): (WebCore::FrameLoader::reload): * loader/FrameLoader.h: (WebCore::FrameLoader::setAlwaysAllowLocalWebarchive): (WebCore::FrameLoader::alwaysAllowLocalWebarchive const): * page/DragController.cpp: (WebCore::DragController::performDragOperation): * testing/Internals.cpp: (WebCore::Internals::setAlwaysAllowLocalWebarchive const): * testing/Internals.h: * testing/Internals.idl: 2019-02-13 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241479. rdar://problem/48065642 Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged() https://bugs.webkit.org/show_bug.cgi?id=194613 <rdar://problem/48023912> Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241479 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Jer Noble <jer.noble@apple.com> Null-deref crash at SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged() https://bugs.webkit.org/show_bug.cgi?id=194613 <rdar://problem/48023912> Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): 2019-02-13 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241437. rdar://problem/48065626 [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size. https://bugs.webkit.org/show_bug.cgi?id=194580 <rdar://problem/42727739> Reviewed by Eric Carlson. * platform/cocoa/CoreVideoSoftLink.cpp: * platform/cocoa/CoreVideoSoftLink.h: * platform/graphics/cv/PixelBufferConformerCV.cpp: (WebCore::CVPixelBufferGetBytePointerCallback): (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241437 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Jer Noble <jer.noble@apple.com> [Cocoa] Switch to CVPixelBufferGetBytesPerRow() for calculating CVPixelBuffer base address size. https://bugs.webkit.org/show_bug.cgi?id=194580 <rdar://problem/42727739> Reviewed by Eric Carlson. * platform/cocoa/CoreVideoSoftLink.cpp: * platform/cocoa/CoreVideoSoftLink.h: * platform/graphics/cv/PixelBufferConformerCV.cpp: (WebCore::CVPixelBufferGetBytePointerCallback): (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer): 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241319. rdar://problem/48015672 Source/WebCore: Remove setDefersLoading infrastructure from WebKit2 https://bugs.webkit.org/show_bug.cgi?id=194506 Patch by Alex Christensen <achristensen@webkit.org> on 2019-02-12 Reviewed by Brady Eidson. setDefersLoading is inherently racy from WebCore to the NetworkProcess, it adds unwanted complexity to the initialization and use of network objects, and it has led to many unrecoverable hang bugs over the years. We needed to force it into WebKit2 to transition some existing clients who relied on it, but we have recently finished transitioning those clients to other solutions, mostly completion handlers. * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::setJavaScriptPaused): LayoutTests: BitmapRenderer should handle existing ImageBuffers https://bugs.webkit.org/show_bug.cgi?id=194555 <rdar://problem/47857150> Reviewed by Tim Horton. Test that creates a canvas, triggers an ImageBuffer to be created, then creates the bitmaprenderer context. * fast/canvas/bitmaprenderer-created-after-toBlob-expected.txt: Added. * fast/canvas/bitmaprenderer-created-after-toBlob.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241319 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-12 Dean Jackson <dino@apple.com> BitmapRenderer should handle existing ImageBuffers https://bugs.webkit.org/show_bug.cgi?id=194555 <rdar://problem/47857150> Reviewed by Tim Horton. Our logic in ImageBitmapRenderingContext assumed that it had always created the ImageBuffer being used. However, it's valid to call something like toBlob() or toDataURL() before creating a context, so we need to handle the case where an ImageBuffer already exists. Test: fast/canvas/bitmaprenderer-created-after-toBlob.html * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::createImageBuffer const): Move some logic into setImageBuffer. (WebCore::HTMLCanvasElement::setImageBuffer const): Make sure to clear the state saver. 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241300. rdar://problem/48016008 Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions. https://bugs.webkit.org/show_bug.cgi?id=194530 <rdar://problem/47973274> Reviewed by Chris Dumez. This is needed to fix a null pointer dereference that arises from the following scenario: 1. a Document detaches from its StyleSheetList. 2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet to be scanned and collected by the GC. 3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and discovers a null owner pointer. This patch fixes this issue by applying the following null checks: 1. Add a null check in JSNodeCustom.h's root(). root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm. isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result to root(). However, depending on which class the ownerNode() method belongs to, it can either return a pointer or a reference. The null check only makes sense in the pointer case. To accommodate the 2 forms, root() itself is has an overload that takes a reference instead of a pointer. Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode() returns, it can't discern when the result is a pointer and apply the null check. Instead, we just add the null check to the version of root() that takes a pointer. If the node pointer is null, we'll return a null opaque root. 2. Fix CodeGeneratorJS.pm to null check the opaque root before using it. * bindings/js/JSNodeCustom.h: (WebCore::root): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241300 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-12 Mark Lam <mark.lam@apple.com> Add some null checks in JSNodeCustom.h's root() and generated isReachableFromOpaqueRoots() functions. https://bugs.webkit.org/show_bug.cgi?id=194530 <rdar://problem/47973274> Reviewed by Chris Dumez. This is needed to fix a null pointer dereference that arises from the following scenario: 1. a Document detaches from its StyleSheetList. 2. the JSStyleSheetList that is associated with the detached StyleSheetList has yet to be scanned and collected by the GC. 3. the GC eventually looks for the opaque root of the StyleSheetList's owner, and discovers a null owner pointer. This patch fixes this issue by applying the following null checks: 1. Add a null check in JSNodeCustom.h's root(). root() is called from a isReachableFromOpaqueRoots() generated by CodeGeneratorJS.pm. isReachableFromOpaqueRoots() calls a ownerNode() method and passes its result to root(). However, depending on which class the ownerNode() method belongs to, it can either return a pointer or a reference. The null check only makes sense in the pointer case. To accommodate the 2 forms, root() itself is has an overload that takes a reference instead of a pointer. Since CodeGeneratorJS.pm can't tell what the generated class' ownerNode() returns, it can't discern when the result is a pointer and apply the null check. Instead, we just add the null check to the version of root() that takes a pointer. If the node pointer is null, we'll return a null opaque root. 2. Fix CodeGeneratorJS.pm to null check the opaque root before using it. * bindings/js/JSNodeCustom.h: (WebCore::root): * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots): 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241296. rdar://problem/48015654 Crash in WebCore::ScrollingTree::updateTreeFromStateNode https://bugs.webkit.org/show_bug.cgi?id=194538 <rdar://problem/47841926> Reviewed by Zalan Bujtas. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::updateTreeFromStateNode): Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241296 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-12 Antti Koivisto <antti@apple.com> Crash in WebCore::ScrollingTree::updateTreeFromStateNode https://bugs.webkit.org/show_bug.cgi?id=194538 <rdar://problem/47841926> Reviewed by Zalan Bujtas. * page/scrolling/ScrollingTree.cpp: (WebCore::ScrollingTree::updateTreeFromStateNode): Make sure we don't leave node entry behind in m_nodeMap in case we failed to add it to the parent. 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241289. rdar://problem/48015662 AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc https://bugs.webkit.org/show_bug.cgi?id=182280 <rdar://problem/37018386> Reviewed by Alan Bujtas. Source/WebCore: Remove the possibility that changing children calls back into updating layout by handling children changes in a deferred manner. This follows the same architecture as many other deferred changes, but also requires us to check deferred changes in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children. A few tests had to be modified to no longer change the tree and then check the children immediately. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateBackingStore): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (convertToNSArray): (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): LayoutTests: * accessibility/aria-hidden-update.html: * accessibility/aria-hidden-updates-alldescendants.html: * accessibility/image-load-on-delay.html: * accessibility/mac/aria-hidden-changes-for-non-ignored-elements.html: * accessibility/removed-anonymous-block-child-causes-crash.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241289 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-08 Chris Fleizach <cfleizach@apple.com> AXObjectCache::childrenChanged shouldn't update layout or style during another style recalc https://bugs.webkit.org/show_bug.cgi?id=182280 <rdar://problem/37018386> Reviewed by Alan Bujtas. Remove the possibility that changing children calls back into updating layout by handling children changes in a deferred manner. This follows the same architecture as many other deferred changes, but also requires us to check deferred changes in updateBackingStore, because things like aria-hidden changes won't trigger a layout, but will require us to update children. A few tests had to be modified to no longer change the tree and then check the children immediately. * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::remove): (WebCore::AXObjectCache::childrenChanged): (WebCore::AXObjectCache::prepareForDocumentDestruction): (WebCore::AXObjectCache::performDeferredCacheUpdate): * accessibility/AXObjectCache.h: * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::updateBackingStore): * accessibility/mac/WebAccessibilityObjectWrapperBase.mm: (convertToNSArray): (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]): 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241288. rdar://problem/47992210 [Cocoa] Ask platform for generic font family mappings https://bugs.webkit.org/show_bug.cgi?id=187723 <rdar://problem/41892438> Reviewed by Brent Fulgham. Source/WebCore: WebKit API allows setting the generic font families for the USCRIPT_COMMON script. When trying to style a character with a generic font family, we first look to see if we have a mapping for the particular script the character is rendered with, and if we don't find a match, we then check USCRIPT_COMMON. In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka the only scripts which won't use the API families) is in SettingsBase::initializeDefaultFontFamilies(). That function only sets the families for the CJK scripts. The mappings inside SettingsBase are incorrect and conflict with our policy regarding user-installed fonts. Instead, we should be consulting with the platform for some of these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit API still has to work to set the mappings for untagged content. Therefore, we use the system mappings for language-tagged content, and the API mappings for non-language-tagged content. This is a good balance that makes sure we always have a good mapping for every language, but API clients can still set the mappings, too. Test: fast/text/ja-sans-serif.html * css/CSSComputedStyleDeclaration.cpp: * css/CSSFontSelector.cpp: (WebCore::resolveGenericFamily): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontFamily): * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::initializeDefaultFontFamilies): (WebCore::osakaMonoIsInstalled): Deleted. * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::platformResolveGenericFamily): * platform/graphics/FontDescription.h: * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::computeSpecializedChineseLocale): (WebCore::cachedSpecializedChineseLocale): (WebCore::languageChanged): (WebCore::FontDescription::platformResolveGenericFamily): * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::clear): (WebCore::genericFamily): (WebCore::SystemFontDatabaseCoreText::serifFamily): (WebCore::SystemFontDatabaseCoreText::sansSerifFamily): (WebCore::SystemFontDatabaseCoreText::cursiveFamily): (WebCore::SystemFontDatabaseCoreText::fantasyFamily): (WebCore::SystemFontDatabaseCoreText::monospaceFamily): * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Source/WebCore/PAL: * pal/spi/cocoa/CoreTextSPI.h: Source/WTF: Add an ENABLE in Platform. * wtf/Platform.h: Tools: Allow testing infrastructure to use fonts that are returned from CTFontDescriptorCreateForCSSFamily(). * DumpRenderTree/mac/DumpRenderTree.mm: (allowedFontFamilySet): * WebKitTestRunner/mac/TestControllerMac.mm: (WTR::allowedFontFamilySet): LayoutTests: Update the tests to work with this new model. * fast/text/international/font-fallback-to-common-script-expected.html: Removed. * fast/text/international/font-fallback-to-common-script.html: Removed. * fast/text/international/lang-sensitive-fonts-expected.html: * fast/text/international/lang-sensitive-fonts-xml-expected.html: * fast/text/international/lang-sensitive-fonts-xml.xhtml: * fast/text/international/lang-sensitive-fonts.html: * fast/text/international/locale-sensitive-fonts-expected.html: * fast/text/international/locale-sensitive-fonts.html: * fast/text/ja-sans-serif-expected-mismatch.html: Added. * fast/text/ja-sans-serif.html: Added. * platform/ios/fast/block/float/016-expected.txt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241288 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-11 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] Ask platform for generic font family mappings https://bugs.webkit.org/show_bug.cgi?id=187723 <rdar://problem/41892438> Reviewed by Brent Fulgham. WebKit API allows setting the generic font families for the USCRIPT_COMMON script. When trying to style a character with a generic font family, we first look to see if we have a mapping for the particular script the character is rendered with, and if we don't find a match, we then check USCRIPT_COMMON. In the Cocoa ports, the only way families get set for non-USCRIPT_COMMON scripts (aka the only scripts which won't use the API families) is in SettingsBase::initializeDefaultFontFamilies(). That function only sets the families for the CJK scripts. The mappings inside SettingsBase are incorrect and conflict with our policy regarding user-installed fonts. Instead, we should be consulting with the platform for some of these mappings, by calling CTFontDescriptorCreateForCSSFamily(). However, the WebKit API still has to work to set the mappings for untagged content. Therefore, we use the system mappings for language-tagged content, and the API mappings for non-language-tagged content. This is a good balance that makes sure we always have a good mapping for every language, but API clients can still set the mappings, too. Test: fast/text/ja-sans-serif.html * css/CSSComputedStyleDeclaration.cpp: * css/CSSFontSelector.cpp: (WebCore::resolveGenericFamily): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeFontFamily): * page/cocoa/SettingsBaseCocoa.mm: (WebCore::SettingsBase::initializeDefaultFontFamilies): (WebCore::osakaMonoIsInstalled): Deleted. * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::platformResolveGenericFamily): * platform/graphics/FontDescription.h: * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::computeSpecializedChineseLocale): (WebCore::cachedSpecializedChineseLocale): (WebCore::languageChanged): (WebCore::FontDescription::platformResolveGenericFamily): * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::clear): (WebCore::genericFamily): (WebCore::SystemFontDatabaseCoreText::serifFamily): (WebCore::SystemFontDatabaseCoreText::sansSerifFamily): (WebCore::SystemFontDatabaseCoreText::cursiveFamily): (WebCore::SystemFontDatabaseCoreText::fantasyFamily): (WebCore::SystemFontDatabaseCoreText::monospaceFamily): * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241231. rdar://problem/47971603 [Cocoa] CTLineGetGlyphRuns() might return nullptr https://bugs.webkit.org/show_bug.cgi?id=194467 <rdar://problem/42423999> Reviewed by Simon Fraser. Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future. Covered by find/text/find-backwards.html * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241231 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-08 Myles C. Maxfield <mmaxfield@apple.com> [Cocoa] CTLineGetGlyphRuns() might return nullptr https://bugs.webkit.org/show_bug.cgi?id=194467 <rdar://problem/42423999> Reviewed by Simon Fraser. Be somewhat defensive to try to make sure this sort of thing doesn't happen in the future. Covered by find/text/find-backwards.html * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241203. rdar://problem/47971610 [WebVTT] Inline WebVTT styles should start with '::cue' https://bugs.webkit.org/show_bug.cgi?id=194227 <rdar://problem/47791087> Reviewed by Eric Carlson. Source/WebCore: Check that the CSS string starts with '::cue' and is successfully parsed before adding it to the CSS stylesheet list. Also, the caption preferences CSS string should start with '::cue', since it is added inside the video shadow root element. Test: media/track/track-cue-css.html * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::checkAndStoreStyleSheet): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const): LayoutTests: * media/track/captions-webvtt/css-styling.vtt: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241203 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-08 Per Arne Vollan <pvollan@apple.com> [WebVTT] Inline WebVTT styles should start with '::cue' https://bugs.webkit.org/show_bug.cgi?id=194227 <rdar://problem/47791087> Reviewed by Eric Carlson. Check that the CSS string starts with '::cue' and is successfully parsed before adding it to the CSS stylesheet list. Also, the caption preferences CSS string should start with '::cue', since it is added inside the video shadow root element. Test: media/track/track-cue-css.html * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::checkAndStoreStyleSheet): * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::CaptionUserPreferencesMediaAF::captionsStyleSheetOverride const): 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241200. rdar://problem/47971541 Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8 https://bugs.webkit.org/show_bug.cgi?id=194380 <rdar://problem/47916514> Reviewed by Eric Carlson. Source/WebCore: Set whether VP8 is supported at creation of the page. This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration. Add internal API to enable resetting the factory to enable proper testing. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/Page.cpp: (WebCore::m_applicationManifest): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * testing/Internals.cpp: (WebCore::Internals::clearPeerConnectionFactory): * testing/Internals.h: * testing/Internals.idl: LayoutTests: * webrtc/video-mute-vp8-expected.txt: * webrtc/video-mute-vp8.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241200 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-08 Youenn Fablet <youenn@apple.com> Running RTCRtpSender.getCapabilities("video") before initial offer breaks VP8 https://bugs.webkit.org/show_bug.cgi?id=194380 <rdar://problem/47916514> Reviewed by Eric Carlson. Set whether VP8 is supported at creation of the page. This ensures that any call creating a peer connection factory will end up supporting the runtime flag configuration. Add internal API to enable resetting the factory to enable proper testing. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/Page.cpp: (WebCore::m_applicationManifest): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * testing/Internals.cpp: (WebCore::Internals::clearPeerConnectionFactory): * testing/Internals.h: * testing/Internals.idl: 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241198. rdar://problem/47971587 [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces https://bugs.webkit.org/show_bug.cgi?id=190997 <rdar://problem/35983035> Reviewed by Brent Fulgham. Source/WebCore: Support serializing sequences and FrozenArrays of types that aren't interfaces. This is needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings. We should support serializing sequences of interfaces too, but that's slightly more complicated since it involves iterating the sequence and serializing each of its items. I left that as a follow-up task, since I don't see any IDLs that currently need this. We also don't support serializing sequences with the CachedAttribute or CustomGetter extended attributes, because WebIDL specifies that a new array should be created when converting an IDL sequence into an ECMAScript value. Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html. * bindings/scripts/CodeGenerator.pm: (GetInterfaceForType): Renamed from GetInterfaceForAttribute. (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types. (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an attribute has the CachedAttribute or CustomGetter extended attributes. (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter extended attributes before calling IsSerializableType. (GetInterfaceForAttribute): Renamed to GetInterfaceForType. * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/TestSerialization.idl: LayoutTests: * http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241198 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-08 Andy Estes <aestes@apple.com> [WebIDL] Support serializing sequences and FrozenArrays of non-interfaces https://bugs.webkit.org/show_bug.cgi?id=190997 <rdar://problem/35983035> Reviewed by Brent Fulgham. Support serializing sequences and FrozenArrays of types that aren't interfaces. This is needed to properly serialize PaymentAddress, which has a FrozenArray of DOMStrings. We should support serializing sequences of interfaces too, but that's slightly more complicated since it involves iterating the sequence and serializing each of its items. I left that as a follow-up task, since I don't see any IDLs that currently need this. We also don't support serializing sequences with the CachedAttribute or CustomGetter extended attributes, because WebIDL specifies that a new array should be created when converting an IDL sequence into an ECMAScript value. Added bindings test cases to TestSerialization.idl and PaymentAddress test cases to http/tests/paymentrequest/payment-address-attributes-and-toJSON-method.https.html. * bindings/scripts/CodeGenerator.pm: (GetInterfaceForType): Renamed from GetInterfaceForAttribute. (IsSerializableType): Modified to allow sequences and FrozenArrays of non-interface types. (hasCachedAttributeOrCustomGetterExtendedAttribute): Added a helper to determine if an attribute has the CachedAttribute or CustomGetter extended attributes. (IsSerializableAttribute): Checked for sequences with the CachedAttribute or CustomGetter extended attributes before calling IsSerializableType. (GetInterfaceForAttribute): Renamed to GetInterfaceForType. * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/TestSerialization.idl: 2019-02-13 Alan Coon <alancoon@apple.com> Cherry-pick r241352. rdar://problem/48038900 Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction https://bugs.webkit.org/show_bug.cgi?id=194582 Reviewed by Antti Koivisto. Source/WebCore: Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong from the non-generated identifier being sent to us as it was the case in this failure. * loader/PolicyChecker.cpp: (WebCore::PolicyCheckIdentifier::isValidFor): Source/WebKit: The bug was caused by WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction invoking the callback with responseIdentifier even when we had failed to send the policy check IPC. Clearly, responseIdentifier is invalid in that case, and we should be using requestIdentifier instead. Unfortunately no new tests since I'm not aware of a way to make sendSync fail in this case. * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241352 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-13 Ryosuke Niwa <rniwa@webkit.org> Release assert in PolicyCheckIdentifier::isValidFor via WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction https://bugs.webkit.org/show_bug.cgi?id=194582 Reviewed by Antti Koivisto. Check the zero-ness of m_policyCheck first so that we can differentiate process ID being wrong from the non-generated identifier being sent to us as it was the case in this failure. * loader/PolicyChecker.cpp: (WebCore::PolicyCheckIdentifier::isValidFor): 2019-02-07 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241170. rdar://problem/47909341 REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&) https://bugs.webkit.org/show_bug.cgi?id=194402 <rdar://problem/47858241> Reviewed by Geoffrey Garen. r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it is valid during access. * Modules/indexeddb/server/ServerOpenDBRequest.cpp: (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked): (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase): * Modules/indexeddb/server/ServerOpenDBRequest.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241170 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-07 Sihui Liu <sihui_liu@apple.com> REGRESSION(r239887): Crash under IDBConnectionToClient::didDeleteDatabase(WebCore::IDBResultData const&) https://bugs.webkit.org/show_bug.cgi?id=194402 <rdar://problem/47858241> Reviewed by Geoffrey Garen. r239887 removed a reference cycle of IDBConnectionToClient so that IDBConnectionToClient would no longer be around forever. Therefore, ServerOpenRequest should keep a reference to IDBConnectionToClient to make sure it is valid during access. * Modules/indexeddb/server/ServerOpenDBRequest.cpp: (WebCore::IDBServer::ServerOpenDBRequest::maybeNotifyRequestBlocked): (WebCore::IDBServer::ServerOpenDBRequest::notifyDidDeleteDatabase): * Modules/indexeddb/server/ServerOpenDBRequest.h: 2019-02-07 Babak Shafiei <bshafiei@apple.com> Cherry-pick r241150. rdar://problem/47908154 Overflow element scrollbar is light for dark mode content. https://bugs.webkit.org/show_bug.cgi?id=194407 rdar://problem/45991585 Reviewed by Beth Dakin. Source/WebCore: Tested by css-dark-mode/supported-color-schemes-scrollbar.html. * page/ChromeClient.h: (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1, that do not implement preferredScrollbarOverlayStyle(). * page/FrameView.cpp: (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case to auto detect overlay style when page() is null. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::useDarkAppearance const): Added. * rendering/RenderLayer.h: * testing/Internals.cpp: (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument. (WebCore::Internals::scrollbarUsingDarkAppearance const): Added. * testing/Internals.h: * testing/Internals.idl: LayoutTests: Updated tests to look at overflow elements and if dark apearance is used by the scrollbar directly. * css-dark-mode/supported-color-schemes-scrollbar-expected.txt: * css-dark-mode/supported-color-schemes-scrollbar.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241150 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-07 Timothy Hatcher <timothy@apple.com> Overflow element scrollbar is light for dark mode content. https://bugs.webkit.org/show_bug.cgi?id=194407 rdar://problem/45991585 Reviewed by Beth Dakin. Tested by css-dark-mode/supported-color-schemes-scrollbar.html. * page/ChromeClient.h: (WebCore::FrameView::preferredScrollbarOverlayStyle): Return WTF::nullopt by default to avoid short-circuiting auto detection in recalculateScrollbarOverlayStyle() for clients, like WK1, that do not implement preferredScrollbarOverlayStyle(). * page/FrameView.cpp: (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use WTF::nullopt in the false case to auto detect overlay style when page() is null. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::useDarkAppearance const): Added. * rendering/RenderLayer.h: * testing/Internals.cpp: (WebCore::Internals::scrollbarOverlayStyle const): Added Node argument. (WebCore::Internals::scrollbarUsingDarkAppearance const): Added. * testing/Internals.h: * testing/Internals.idl: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r240710. rdar://problem/47776353 AX: Support color well on iOS https://bugs.webkit.org/show_bug.cgi?id=194010 Reviewed by Joanmarie Diggs. Source/WebCore: Test: accessibility/ios-simulator/color-well.html Add support for color well on iOS. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]): (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]): * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::AXColorWellText): * platform/LocalizedStrings.h: Tools: * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm: (WTR::AccessibilityUIElement::stringAttributeValue): LayoutTests: * accessibility/ios-simulator/color-well-expected.txt: Added. * accessibility/ios-simulator/color-well.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240710 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-30 Chris Fleizach <cfleizach@apple.com> AX: Support color well on iOS https://bugs.webkit.org/show_bug.cgi?id=194010 Reviewed by Joanmarie Diggs. Test: accessibility/ios-simulator/color-well.html Add support for color well on iOS. * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityCanFuzzyHitTest]): (-[WebAccessibilityObjectWrapper determineIsAccessibilityElement]): (-[WebAccessibilityObjectWrapper accessibilityRoleDescription]): (-[WebAccessibilityObjectWrapper accessibilityColorStringValue]): * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::AXColorWellText): * platform/LocalizedStrings.h: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241137. rdar://problem/47893603 Unable to sign in leetcode. https://bugs.webkit.org/show_bug.cgi?id=194366 rdar://problem/47259025. Reviewed by Chris Dumez. Source/WebCore: In case a signal is passed as part of a FetchRequestInit, the IDL binding code is throwing an exception in case signal is not an AbortSignal object. This breaks an AbortSignal shim used in some web sites. Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest. Test: http/wpt/fetch/request-abort.html Also covered by manually signing in to leetcode. * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeWith): * Modules/fetch/FetchRequestInit.h: (WebCore::FetchRequestInit::hasMembers const): * Modules/fetch/FetchRequestInit.idl: LayoutTests: * http/wpt/fetch/request-abort-expected.txt: Added. * http/wpt/fetch/request-abort.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241137 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-07 Youenn Fablet <youenn@apple.com> Unable to sign in leetcode. https://bugs.webkit.org/show_bug.cgi?id=194366 rdar://problem/47259025. Reviewed by Chris Dumez. In case a signal is passed as part of a FetchRequestInit, the IDL binding code is throwing an exception in case signal is not an AbortSignal object. This breaks an AbortSignal shim used in some web sites. Relaxed the IDL binding rule by marking signal as any and doing the conversion in FetchRequest. Test: http/wpt/fetch/request-abort.html Also covered by manually signing in to leetcode. * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeWith): * Modules/fetch/FetchRequestInit.h: (WebCore::FetchRequestInit::hasMembers const): * Modules/fetch/FetchRequestInit.idl: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241130. rdar://problem/47893594 HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class https://bugs.webkit.org/show_bug.cgi?id=194360 HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement, make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases. Reviewed by Geoffrey Garen. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::ApplePaySession): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::UserMediaRequest): * Modules/notifications/Notification.cpp: (WebCore::Notification::Notification): * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::PaymentRequest): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): * animation/WebAnimation.cpp: (WebCore::WebAnimation::WebAnimation): * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::ActiveDOMObject): * dom/ActiveDOMObject.h: * dom/Document.h: (WebCore::ActiveDOMObject::ActiveDOMObject): * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::HTMLMarqueeElement): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::HTMLSourceElement): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::IntersectionObserver): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241130 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-07 Jer Noble <jer.noble@apple.com> HTMLMediaElement registers wrong ScriptExecutionContext with its ActiveDOMObject parent class https://bugs.webkit.org/show_bug.cgi?id=194360 HTMLMediaElement registers the Document used to create it with ActiveDOMObject, when it should really use that Document's contextDocument(). Rather than just fix this in HTMLMediaElement, make sure that the correct document is used everywhere by adding a new ActiveDOMObject constructor taking a Document&, and making an explicitly deleted Document* constructor to catch any new cases. Reviewed by Geoffrey Garen. * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::ApplePaySession): * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::MediaDevices): * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::UserMediaRequest): * Modules/notifications/Notification.cpp: (WebCore::Notification::Notification): * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::PaymentRequest): * Modules/webaudio/AudioContext.cpp: (WebCore::AudioContext::AudioContext): * animation/WebAnimation.cpp: (WebCore::WebAnimation::WebAnimation): * css/FontFaceSet.cpp: (WebCore::FontFaceSet::FontFaceSet): * dom/ActiveDOMObject.cpp: (WebCore::ActiveDOMObject::ActiveDOMObject): * dom/ActiveDOMObject.h: * dom/Document.h: (WebCore::ActiveDOMObject::ActiveDOMObject): * html/HTMLMarqueeElement.cpp: (WebCore::HTMLMarqueeElement::HTMLMarqueeElement): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): * html/HTMLSourceElement.cpp: (WebCore::HTMLSourceElement::HTMLSourceElement): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::IntersectionObserver): 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241121. rdar://problem/47893559 Infinite recursion via CachedResource::~CachedResource https://bugs.webkit.org/show_bug.cgi?id=194378 <rdar://problem/42023295> Reviewed by Daniel Bates. I don't know the exact steps to trigger this but the mechanism seems clear. 1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map. 2) This decrements the handle count of resource and causes it be deleted. 3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled). 4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created. This increments the handle count of the resource from 0 back to 1. 5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3). The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource. It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles. Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything other than bail out is going to crash. CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to support this erranous call so they are removed as well. * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::~CachedResource): This is the substantive change. The rest just removes now-dead code. * loader/cache/CachedResource.h: (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::loadResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): (WebCore::CachedResourceLoader::removeCachedResource): Deleted. * loader/cache/CachedResourceLoader.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241121 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-07 Antti Koivisto <antti@apple.com> Infinite recursion via CachedResource::~CachedResource https://bugs.webkit.org/show_bug.cgi?id=194378 <rdar://problem/42023295> Reviewed by Daniel Bates. I don't know the exact steps to trigger this but the mechanism seems clear. 1) An existing resource is removed from or replaced in CachedResourceLoader::m_documentResources map. 2) This decrements the handle count of resource and causes it be deleted. 3) CachedResource::~CachedResource calls m_owningCachedResourceLoader->removeCachedResource(*this). This only happens with resources that are "owned" by CachedResourceLoader which is a rare special case (used by image document and if memory cache is disabled). 4) CachedResourceLoader::removeCachedResource looks up the resource from the map which causes a temporary CachedResourceHandle to be created. This increments the handle count of the resource from 0 back to 1. 5) When the temporary dies, CachedResource::~CachedResource is called again and we cycle back to 3). The fix here is simply to remove CachedResourceLoader::removeCachedResource call from ~CachedResource. It is a leftover from when the map contained raw pointers instead of owning CachedResourceHandles. Since m_documentResources map has a handle to the resource, the only way we are in the destructor is that the resource has been removed from the map already (or is in process of being removed like in this crash). Any call that does anything other than bail out is going to crash. CachedResource::n_owningCachedResourceLoader member and CachedResourceLoader::removeCachedResource function only exist to support this erranous call so they are removed as well. * loader/ImageLoader.cpp: (WebCore::ImageLoader::updateFromElement): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::~CachedResource): This is the substantive change. The rest just removes now-dead code. * loader/cache/CachedResource.h: (WebCore::CachedResource::setOwningCachedResourceLoader): Deleted. * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::~CachedResourceLoader): (WebCore::CachedResourceLoader::requestUserCSSStyleSheet): (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::loadResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): (WebCore::CachedResourceLoader::removeCachedResource): Deleted. * loader/cache/CachedResourceLoader.h: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241105. rdar://problem/47893571 [Payment Request] It should be possible to require a phonetic name for shipping contacts https://bugs.webkit.org/show_bug.cgi?id=194311 <rdar://46733045> Reviewed by Alex Christensen. Source/WebCore: It should be possible to require that a shipping contact has a phonetic name in Payment Request. To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data. Since required shipping contact fields can now be specified both in requiredShippingContactFields and PaymentOptions, we merge the required fields from these two sources such that, e.g., email is required if it is specified in either place. So that clients can detect this new feature, the API version number is bumped from 5 to 6. Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html. * DerivedSources.make: * 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/PaymentCoordinatorClient.cpp: Added. (WebCore::PaymentCoordinatorClient::supportsVersion): * Modules/applepay/PaymentCoordinatorClient.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::mergePaymentOptions): (WebCore::ApplePayPaymentHandler::show): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: * testing/MockPaymentContactFields.h: Added. (WebCore::MockPaymentContactFields::MockPaymentContactFields): * testing/MockPaymentContactFields.idl: Added. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::supportsVersion): Deleted. * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: Source/WebKit: * WebProcess/ApplePay/WebPaymentCoordinator.cpp: (WebKit::WebPaymentCoordinator::supportsVersion): Deleted. * WebProcess/ApplePay/WebPaymentCoordinator.h: Source/WebKitLegacy/mac: * WebCoreSupport/WebPaymentCoordinatorClient.h: * WebCoreSupport/WebPaymentCoordinatorClient.mm: (WebPaymentCoordinatorClient::supportsVersion): Deleted. LayoutTests: * http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt: * http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html: * http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt: * http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html: * http/tests/ssl/applepay/PaymentRequest.https-expected.txt: * http/tests/ssl/applepay/PaymentRequest.https.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241105 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-06 Andy Estes <aestes@apple.com> [Payment Request] It should be possible to require a phonetic name for shipping contacts https://bugs.webkit.org/show_bug.cgi?id=194311 <rdar://46733045> Reviewed by Alex Christensen. It should be possible to require that a shipping contact has a phonetic name in Payment Request. To accomplish this, move requiredShippingContactFields from ApplePayPaymentRequest to ApplePayRequestBase so that it can be used as part of an Apple Pay payment method data. Since required shipping contact fields can now be specified both in requiredShippingContactFields and PaymentOptions, we merge the required fields from these two sources such that, e.g., email is required if it is specified in either place. So that clients can detect this new feature, the API version number is bumped from 5 to 6. Added test cases to ApplePayRequestShippingContact.https.html and ApplePayRequestShippingContactV3.https.html. * DerivedSources.make: * 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/PaymentCoordinatorClient.cpp: Added. (WebCore::PaymentCoordinatorClient::supportsVersion): * Modules/applepay/PaymentCoordinatorClient.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::mergePaymentOptions): (WebCore::ApplePayPaymentHandler::show): * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: * testing/MockPaymentContactFields.h: Added. (WebCore::MockPaymentContactFields::MockPaymentContactFields): * testing/MockPaymentContactFields.idl: Added. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::supportsVersion): Deleted. * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241022. rdar://problem/47893580 CoreAudioCaptureSource should not configure its audio unit until it starts producing data https://bugs.webkit.org/show_bug.cgi?id=194310 Reviewed by Eric Carlson. Delay the configuration of the audio unit until the source is instructed to start producing data. This allows the UIProcess to not start changing the audio unit when checking for constraints during getUserMedia call before the prompt. Covered by manual testing. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::initializeToStartProducingData): (WebCore::CoreAudioCaptureSource::startProducingData): * platform/mediastream/mac/CoreAudioCaptureSource.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241022 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-06 Youenn Fablet <youenn@apple.com> CoreAudioCaptureSource should not configure its audio unit until it starts producing data https://bugs.webkit.org/show_bug.cgi?id=194310 Reviewed by Eric Carlson. Delay the configuration of the audio unit until the source is instructed to start producing data. This allows the UIProcess to not start changing the audio unit when checking for constraints during getUserMedia call before the prompt. Covered by manual testing. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::initializeToStartProducingData): (WebCore::CoreAudioCaptureSource::startProducingData): * platform/mediastream/mac/CoreAudioCaptureSource.h: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241021. rdar://problem/47893607 Disable audio ducking at Audio Unit setup time https://bugs.webkit.org/show_bug.cgi?id=194303 Reviewed by Eric Carlson. When creating a CoreAudioCaptureSource, the audio unit might be reconfigured if a past audio capture was done. This might trigger audio ducking which is undone in startInternal. In some cases, startInternal will never call start. In that case, the audio unit will continue ducking the other processing. To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal. In addition to that, once a shared unit is created, it stays alive until the UIProcess exits. This might affect all applications. Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened. This has noticeable effects in the quality of audio being played on bluetooth devices. Covered by manual tests. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::setupAudioUnit): (WebCore::CoreAudioSharedUnit::unduck): (WebCore::CoreAudioSharedUnit::startInternal): (WebCore::CoreAudioSharedUnit::captureFailed): (WebCore::CoreAudioSharedUnit::stopProducingData): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241021 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-06 Youenn Fablet <youenn@apple.com> Disable audio ducking at Audio Unit setup time https://bugs.webkit.org/show_bug.cgi?id=194303 Reviewed by Eric Carlson. When creating a CoreAudioCaptureSource, the audio unit might be reconfigured if a past audio capture was done. This might trigger audio ducking which is undone in startInternal. In some cases, startInternal will never call start. In that case, the audio unit will continue ducking the other processing. To ensure ducking is disabled, unduck in setupAudioUnit as well as startInternal. In addition to that, once a shared unit is created, it stays alive until the UIProcess exits. This might affect all applications. Instead, whenever the shared unit is stopped, clean it so as to restore the state as if no capture ever happened. This has noticeable effects in the quality of audio being played on bluetooth devices. Covered by manual tests. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::setupAudioUnit): (WebCore::CoreAudioSharedUnit::unduck): (WebCore::CoreAudioSharedUnit::startInternal): (WebCore::CoreAudioSharedUnit::captureFailed): (WebCore::CoreAudioSharedUnit::stopProducingData): 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r241018. rdar://problem/47893623 RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver https://bugs.webkit.org/show_bug.cgi?id=194333 <rdar://problem/47822929> Reviewed by Zalan Bujtas. Source/WebCore: Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of the legacy animation code triggering a resource load. Test: http/tests/contentextensions/css-display-none-keyframe.html * style/StyleScope.cpp: (WebCore::Style::Scope::scheduleUpdate): Avoid clearing the style resolver if we are in the middle of a style resolution. A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335. LayoutTests: * http/tests/contentextensions/css-display-none-keyframe-expected.txt: Added. * http/tests/contentextensions/css-display-none-keyframe.html: Added. * http/tests/contentextensions/css-display-none-keyframe.html.json: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241018 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-06 Antti Koivisto <antti@apple.com> RELEASE_ASSERT(!m_document.isResolvingTreeStyle()) in com.apple.WebKit.WebContent at WebCore: WebCore::StyleResolver::~StyleResolver https://bugs.webkit.org/show_bug.cgi?id=194333 <rdar://problem/47822929> Reviewed by Zalan Bujtas. Content extensions may mutate the extension stylesheet in the middle of a style resolution as a result of the legacy animation code triggering a resource load. Test: http/tests/contentextensions/css-display-none-keyframe.html * style/StyleScope.cpp: (WebCore::Style::Scope::scheduleUpdate): Avoid clearing the style resolver if we are in the middle of a style resolution. A better fix that avoid doing this in the first place is tracked by https://bugs.webkit.org/show_bug.cgi?id=194335. 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r240808. rdar://problem/47774548 Revert r238819 which is unneeded and caused a performance regression. https://bugs.webkit.org/show_bug.cgi?id=192272 <rdar://problem/46664625> Source/WebCore: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::prepareForLoadStart): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::loadProvisionalItemFromCachedPage): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: Source/WebKit: * WebProcess/InjectedBundle/API/APIInjectedBundlePageLoaderClient.h: (API::InjectedBundle::PageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInLoadDelegate.h: * WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp: * WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm: (PageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.cpp: (WebKit::InjectedBundlePageLoaderClient::didStartProvisionalLoadForFrame): * WebProcess/InjectedBundle/InjectedBundlePageLoaderClient.h: * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp: (WebKit::WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebProcess/WebCoreSupport/WebFrameLoaderClient.h: Source/WebKitLegacy/mac: * WebCoreSupport/WebFrameLoaderClient.h: * WebCoreSupport/WebFrameLoaderClient.mm: (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): Source/WebKitLegacy/win: * WebCoreSupport/WebFrameLoaderClient.cpp: (WebFrameLoaderClient::dispatchDidStartProvisionalLoad): * WebCoreSupport/WebFrameLoaderClient.h: Tools: * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenPlugIn.mm: (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didCommitLoadForFrame:]): (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:willStartProvisionalLoadForFrame:completionHandler:]): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240808 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-31 Alex Christensen <achristensen@webkit.org> Revert r238819 which is unneeded and caused a performance regression. https://bugs.webkit.org/show_bug.cgi?id=192272 <rdar://problem/46664625> * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::prepareForLoadStart): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::loadProvisionalItemFromCachedPage): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: 2019-02-07 Alan Coon <alancoon@apple.com> Cherry-pick r239831. rdar://problem/47776468 [css-grid] Let abspos items reference implicit grid lines https://bugs.webkit.org/show_bug.cgi?id=193313 Patch by Oriol Brufau <obrufau@igalia.com> on 2019-01-10 Reviewed by Manuel Rego Casasnovas. LayoutTests/imported/w3c: Import test changes from WPT. * web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html: * web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html: Source/WebCore: While they can't create new implicit grid lines, abspos items can reference existing ones as clarified in https://github.com/w3c/csswg-drafts/commit/511bb63 This patch makes WebKit match Blink, Firefox and Edge. Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild): Don't treat implicit grid lines as 'auto'. * rendering/RenderGrid.h: Remove unused gridPositionIsAutoForOutOfFlow. * rendering/style/GridPositionsResolver.cpp: (WebCore::adjustGridPositionsFromStyle): Don't treat implicit grid lines as 'auto'. Remove unused gridContainerStyle parameter. (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem): Remove argument from adjustGridPositionsFromStyle call. Remove unused gridContainerStyle parameter. (WebCore::resolveGridPositionFromStyle): Remove unnecessary assert that uses isValidNamedLineOrArea. (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle): Remove argument from adjustGridPositionsFromStyle call. * rendering/style/GridPositionsResolver.h: Remove unused isValidNamedLineOrArea. Remove unused parameter from spanSizeForAutoPlacedItem. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239831 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-10 Oriol Brufau <obrufau@igalia.com> [css-grid] Let abspos items reference implicit grid lines https://bugs.webkit.org/show_bug.cgi?id=193313 Reviewed by Manuel Rego Casasnovas. While they can't create new implicit grid lines, abspos items can reference existing ones as clarified in https://github.com/w3c/csswg-drafts/commit/511bb63 This patch makes WebKit match Blink, Firefox and Edge. Tests: web-platform-tests/css/css-grid/abspos/grid-positioned-items-padding-001.html web-platform-tests/css/css-grid/abspos/grid-positioned-items-unknown-named-grid-line-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateExplicitGridAndOrderIterator const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::createEmptyGridAreaAtSpecifiedPositionsOutsideGrid const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::placeSpecifiedMajorAxisItemsOnGrid const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::placeAutoMajorAxisItemOnGrid const): Remove argument from spanSizeForAutoPlacedItem call. (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild): Don't treat implicit grid lines as 'auto'. * rendering/RenderGrid.h: Remove unused gridPositionIsAutoForOutOfFlow. * rendering/style/GridPositionsResolver.cpp: (WebCore::adjustGridPositionsFromStyle): Don't treat implicit grid lines as 'auto'. Remove unused gridContainerStyle parameter. (WebCore::GridPositionsResolver::spanSizeForAutoPlacedItem): Remove argument from adjustGridPositionsFromStyle call. Remove unused gridContainerStyle parameter. (WebCore::resolveGridPositionFromStyle): Remove unnecessary assert that uses isValidNamedLineOrArea. (WebCore::GridPositionsResolver::resolveGridPositionsFromStyle): Remove argument from adjustGridPositionsFromStyle call. * rendering/style/GridPositionsResolver.h: Remove unused isValidNamedLineOrArea. Remove unused parameter from spanSizeForAutoPlacedItem. 2019-02-06 Alan Coon <alancoon@apple.com> Cherry-pick r241015. rdar://problem/47866495 REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name https://bugs.webkit.org/show_bug.cgi?id=194329 Reviewed by Geoffrey Garen. Source/WebCore: The bug was caused by the code path for when navigating with a specific target frame name that does not exist never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous navigation, resulting in this release assertion. Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix. Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): LayoutTests: Added a regression test. * fast/loader/navigate-with-new-target-after-back-forward-navigation-expected.txt: Added. * fast/loader/navigate-with-new-target-after-back-forward-navigation.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241015 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-05 Ryosuke Niwa <rniwa@webkit.org> REGRESSION (r240909): Release assert in FrameLoader::loadURL when navigating with a non-existent target name https://bugs.webkit.org/show_bug.cgi?id=194329 Reviewed by Geoffrey Garen. The bug was caused by the code path for when navigating with a specific target frame name that does not exist never setting the load type of PolicyChecker. As a result, we would use whatever load type used in the previous navigation, resulting in this release assertion. Updating the load type here should in theory fix the underlying bug r240909 was meant to catch & fix. Test: fast/loader/navigate-with-new-target-after-back-forward-navigation.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): 2019-02-06 Alan Coon <alancoon@apple.com> Apply patch. rdar://problem/47822019 2019-02-06 Ryosuke Niwa <rniwa@webkit.org> Validate navigation policy decisions to avoid crashes in continueLoadAfterNavigationPolicy https://bugs.webkit.org/show_bug.cgi?id=194189 Reviewed by Geoffrey Garen. Introduced PolicyCheckIdentifier to pair each navigation policy check request with a decision, and deployed it in PolicyChecker. The identifier is passed from WebContent process to UI process in WebKit2, and passed it back with the policy decision. Because PolicyCheckIdentifier embeds the process identifier from which a navigation policy is checked, we would be able to detect when UI process had sent the decision to a wrong WebContent process. This patch also adds release assertions to make sure history().provisionalItem() is set whenever we're requesting a navigation policy check. These code changes should either: 1. Fix crashes in FrameLoader::continueLoadAfterNavigationPolicy where isBackForwardLoadType would return true yet history().provisionalItem() is null. 2. Detect a bug that UI process can send a navigation policy decision to a wrong WebContent process. 3. Rule out the possibility that (2) exists. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::responseReceived): * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNewWindowAction): (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkContentPolicy): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadPostRequest): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/FrameLoaderTypes.h: (WebCore::PolicyCheckIdentifier): Added. (WebCore::PolicyCheckIdentifier::operator== const): Added. (WebCore::PolicyCheckIdentifier::PolicyCheckIdentifier): Added. (WebCore::PolicyCheckIdentifier::encode const): Added. (WebCore::PolicyCheckIdentifier::decode): Added. * loader/PolicyChecker.cpp: (WebCore::PolicyCheckIdentifier::generate): (WebCore::PolicyCheckIdentifier::isValidFor): Returns true if the identifer matches. Also release asserts that the process ID is same, and that m_check is always not zero (meaning it's a generated value). The failure of these release assertions would indicate that there is a bug in UI process, which results in a policy decision response being sent to a wrong Web process. (WebCore::PolicyChecker::checkNavigationPolicy): Exit early if isValidFor fails. (WebCore::PolicyChecker::checkNewWindowPolicy): 2019-02-06 Alan Coon <alancoon@apple.com> Cherry-pick r240804. rdar://problem/47774520 [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME https://bugs.webkit.org/show_bug.cgi?id=193988 Reviewed by Jon Lee. Modern EME is writing SecureStop data as a file at the same path as the directory used by Legacy EME; meaning, when Modern EME attempts to write to that file, it will fail because a directory exists at the same path. Add a migration step to take care of those instances where Modern EME Secure Stop data was already written to disk, and move that previously written data to the correct file path. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240804 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-31 Jer Noble <jer.noble@apple.com> [Cocoa][EME] Modern EME uses a different path for SecureStop data than Legacy EME https://bugs.webkit.org/show_bug.cgi?id=193988 Reviewed by Jon Lee. Modern EME is writing SecureStop data as a file at the same path as the directory used by Legacy EME; meaning, when Modern EME attempts to write to that file, it will fail because a directory exists at the same path. Add a migration step to take care of those instances where Modern EME Secure Stop data was already written to disk, and move that previously written data to the correct file path. * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setStorageDirectory): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession): 2019-02-06 Alan Coon <alancoon@apple.com> Cherry-pick r240746. rdar://problem/47774550 [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove() https://bugs.webkit.org/show_bug.cgi?id=193984 Reviewed by Eric Carlson. MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:] completion handler is called. Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::sessionIdChanged): * Modules/encryptedmedia/MediaKeySession.h: * platform/encryptedmedia/CDMInstanceSession.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240746 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-30 Jer Noble <jer.noble@apple.com> [Cocoa][EME] persistent-usage-record data not issued after MediaKeySession.remove() https://bugs.webkit.org/show_bug.cgi?id=193984 Reviewed by Eric Carlson. MediaKeySession.sessionId is empty during the CDMInstance->requestLicense success callback handler. The KVO notification that AVContentKeySession.contentProtectionSessionIdentifier changed isn't called until after the -[AVContentKeyRequest makeStreamingContentKeyRequestDataForApp:contentIdentifier:options:completionHandler:] completion handler is called. Explicitly ask for the -contentProtectionSessionIdentifier inside that handler, and just in case the sessionID changes after that, add a new client callback method to notify the MediaKeySession that the ID has changed. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::sessionIdChanged): * Modules/encryptedmedia/MediaKeySession.h: * platform/encryptedmedia/CDMInstanceSession.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r239752. rdar://problem/47776478 [WebAuthN] Support U2F HID Authenticators on macOS https://bugs.webkit.org/show_bug.cgi?id=191535 <rdar://problem/47102027> Reviewed by Brent Fulgham. Source/WebCore: This patch changes U2fCommandConstructor to produce register commands with enforcing test of user presence. Otherwise, authenticators would silently generate credentials. It also renames readFromU2fSignResponse to readU2fSignResponse. Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html http/wpt/webauthn/public-key-credential-create-success-u2f.https.html http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html http/wpt/webauthn/public-key-credential-get-success-u2f.https.html * Modules/webauthn/fido/U2fCommandConstructor.cpp: (fido::WebCore::constructU2fRegisterCommand): * Modules/webauthn/fido/U2fResponseConverter.cpp: (fido::readU2fSignResponse): (fido::readFromU2fSignResponse): Deleted. * Modules/webauthn/fido/U2fResponseConverter.h: Source/WebKit: This patch implements the support for U2F authenticators, and enables it for hid devices. It follows the CTAP spec to map WebAuthN requests to U2F commands and return the responses: https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability Most of the parts are done before this patch, this patch focues on: 7.2.2 and 7.3.2. Besides implementing the U2fHidAuthenticator, this patch also adds support in the mocking environment for U2F authenticators. It is done by extending the stages in MockHidConnection from 4 to indefinite as multi-round communications are expected to map WebAuthN requests to U2F requests. * Sources.txt: * UIProcess/API/C/WKWebsiteDataStoreRef.cpp: (WKWebsiteDataStoreSetWebAuthenticationMockConfiguration): * UIProcess/WebAuthentication/Cocoa/HidService.mm: (WebKit::HidService::continueAddDeviceAfterGetInfo): * UIProcess/WebAuthentication/fido/CtapHidDriver.cpp: (WebKit::CtapHidDriver::continueAfterChannelAllocated): * UIProcess/WebAuthentication/fido/CtapHidDriver.h: (WebKit::CtapHidDriver::setProtocol): * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.cpp: Added. (WebKit::U2fHidAuthenticator::U2fHidAuthenticator): (WebKit::U2fHidAuthenticator::makeCredential): (WebKit::U2fHidAuthenticator::checkExcludeList): (WebKit::U2fHidAuthenticator::issueRegisterCommand): (WebKit::U2fHidAuthenticator::getAssertion): (WebKit::U2fHidAuthenticator::issueSignCommand): (WebKit::U2fHidAuthenticator::issueNewCommand): (WebKit::U2fHidAuthenticator::issueCommand): (WebKit::U2fHidAuthenticator::responseReceived): (WebKit::U2fHidAuthenticator::continueRegisterCommandAfterResponseReceived): (WebKit::U2fHidAuthenticator::continueCheckOnlyCommandAfterResponseReceived): (WebKit::U2fHidAuthenticator::continueBogusCommandAfterResponseReceived): (WebKit::U2fHidAuthenticator::continueSignCommandAfterResponseReceived): * UIProcess/WebAuthentication/fido/U2fHidAuthenticator.h: Added. * UIProcess/WebAuthentication/Mock/MockHidConnection.cpp: (WebKit::MockHidConnection::parseRequest): (WebKit::MockHidConnection::feedReports): * UIProcess/WebAuthentication/Mock/MockHidConnection.h: * UIProcess/WebAuthentication/Mock/MockWebAuthenticationConfiguration.h: * WebKit.xcodeproj/project.pbxproj: Tools: This patch: 1) adds support for U2F mocking mechanism; 2) updates tests to reflect U2fCommandConstructor changes. * TestWebKitAPI/Tests/WebCore/CtapResponseTest.cpp: (TestWebKitAPI::TEST): * TestWebKitAPI/Tests/WebCore/FidoTestData.h: * WebKitTestRunner/InjectedBundle/TestRunner.cpp: (WTR::TestRunner::setWebAuthenticationMockConfiguration): LayoutTests: Besiding adding tests for U2F authenticators, it also changes payloadBase64 from a string to a vector of strings. New tests are skipped for iOS. * http/wpt/webauthn/ctap-hid-failure.https.html: * http/wpt/webauthn/ctap-hid-success.https.html: * http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html: * http/wpt/webauthn/public-key-credential-create-failure-hid.https.html: * http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https-expected.txt: Added. * http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html: Added. * http/wpt/webauthn/public-key-credential-create-failure-u2f.https-expected.txt: Added. * http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html: Added. * http/wpt/webauthn/public-key-credential-create-success-hid.https.html: * http/wpt/webauthn/public-key-credential-create-success-u2f.https-expected.txt: Added. * http/wpt/webauthn/public-key-credential-create-success-u2f.https.html: Copied from LayoutTests/http/wpt/webauthn/public-key-credential-create-success-hid.https.html. * http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html: * http/wpt/webauthn/public-key-credential-get-failure-hid.https.html: * http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https-expected.txt: Added. * http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html: Added. * http/wpt/webauthn/public-key-credential-get-failure-u2f.https-expected.txt: Added. * http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html: Added. * http/wpt/webauthn/public-key-credential-get-success-hid.https.html: * http/wpt/webauthn/public-key-credential-get-success-u2f.https-expected.txt: Added. * http/wpt/webauthn/public-key-credential-get-success-u2f.https.html: Added. * http/wpt/webauthn/resources/util.js: * platform/ios-wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239752 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-08 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Support U2F HID Authenticators on macOS https://bugs.webkit.org/show_bug.cgi?id=191535 <rdar://problem/47102027> Reviewed by Brent Fulgham. This patch changes U2fCommandConstructor to produce register commands with enforcing test of user presence. Otherwise, authenticators would silently generate credentials. It also renames readFromU2fSignResponse to readU2fSignResponse. Tests: http/wpt/webauthn/public-key-credential-create-failure-u2f-silent.https.html http/wpt/webauthn/public-key-credential-create-failure-u2f.https.html http/wpt/webauthn/public-key-credential-create-success-u2f.https.html http/wpt/webauthn/public-key-credential-get-failure-u2f-silent.https.html http/wpt/webauthn/public-key-credential-get-failure-u2f.https.html http/wpt/webauthn/public-key-credential-get-success-u2f.https.html * Modules/webauthn/fido/U2fCommandConstructor.cpp: (fido::WebCore::constructU2fRegisterCommand): * Modules/webauthn/fido/U2fResponseConverter.cpp: (fido::readU2fSignResponse): (fido::readFromU2fSignResponse): Deleted. * Modules/webauthn/fido/U2fResponseConverter.h: 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240930. rdar://problem/47810469 Make sure to remove the device observer in AVVideoCaptureSource https://bugs.webkit.org/show_bug.cgi?id=194181 <rdar://problem/47739247> Reviewed by Eric Carlson. Make sure to remove the device observer when the observer is destroyed. To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor. Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource. Covered by manual test. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::initializeSession): (WebCore::AVVideoCaptureSource::clearSession): (WebCore::AVVideoCaptureSource::stopProducingData): (WebCore::AVVideoCaptureSource::setupSession): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240930 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-04 Youenn Fablet <youenn@apple.com> Make sure to remove the device observer in AVVideoCaptureSource https://bugs.webkit.org/show_bug.cgi?id=194181 <rdar://problem/47739247> Reviewed by Eric Carlson. Make sure to remove the device observer when the observer is destroyed. To simplify things, add the observer in AVVideoCaptureSource constructor and remove it in the destructor. Make also sure the session observer is also removed whenever the session is released by AVVideoCaptureSource. Covered by manual test. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::initializeSession): (WebCore::AVVideoCaptureSource::clearSession): (WebCore::AVVideoCaptureSource::stopProducingData): (WebCore::AVVideoCaptureSource::setupSession): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240880. rdar://problem/47774545 REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html https://bugs.webkit.org/show_bug.cgi?id=193740 <rdar://problem/47527267> Reviewed by Alex Christensen. Source/WebCore: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): * loader/FrameLoader.h: * loader/FrameLoaderTypes.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): (WebCore::PolicyChecker::checkNewWindowPolicy): * loader/PolicyChecker.h: Source/WebKit: The issue was happening when the page is triggering a cross-site navigation while in the middle of parsing. This would cause us to start a new provisional load in a new process before the previous process sends the DidFinishLoadForFrame() IPC to the UIProcess. Getting such IPC after a provisional load has started would mess up our state machine and trip assertions. This patch restores non-PSON behavior which is that the previous load in the old process now gets stopped so that no DidFinishLoadForFrame() / DidFailLoadForFrame() gets sent. To achieve this behavior, I introduced a new "StopAllLoads" PolicyAction that we now send the old process when the load is continuing in a new process, instead of sending it "Ignore". * NetworkProcess/NetworkDataTaskBlob.cpp: (WebKit::NetworkDataTaskBlob::dispatchDidReceiveResponse): * NetworkProcess/cocoa/NetworkSessionCocoa.mm: (toNSURLSessionResponseDisposition): * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::receivedNavigationPolicyDecision): Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240880 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-02-01 Chris Dumez <cdumez@apple.com> REGRESSION: Flaky ASSERTION FAILED: m_uncommittedState.state == State::Committed on http/tests/cookies/same-site/fetch-after-top-level-navigation-initiated-from-iframe-in-cross-origin-page.html https://bugs.webkit.org/show_bug.cgi?id=193740 <rdar://problem/47527267> Reviewed by Alex Christensen. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): * loader/FrameLoader.h: * loader/FrameLoaderTypes.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): (WebCore::PolicyChecker::checkNewWindowPolicy): * loader/PolicyChecker.h: 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240833. rdar://problem/47774523 [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt https://bugs.webkit.org/show_bug.cgi?id=194114 Reviewed by Eric Carlson. The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key requests to the AVContentKeySession. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240833 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-31 Jer Noble <jer.noble@apple.com> [Cocoa][EME] AirPlaying a FairPlay-protected HLS stream fails to decrypt https://bugs.webkit.org/show_bug.cgi?id=194114 Reviewed by Eric Carlson. The AVAssetResourceLoaderDelegate must explicitly... delegate responsibility for FairPlay key requests to the AVContentKeySession. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240822. rdar://problem/47774539 [Mac] Requesting PiP from two different WebViews gets PiP window "stuck" https://bugs.webkit.org/show_bug.cgi?id=194099 <rdar://problem/47271323> Reviewed by Eric Carlson. When a different client requests the PiP window, the PiP framework will call -pipDidClose: without first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two WebViews will constantly try to steal PiP from one another, ad infinitum. When receiving a notification that the PiP window closed when our internal state tells us that the close was not requested, notify the client that PiP mode was exited, allowing them to set their expected state to a correct and sane value. * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240822 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-31 Jer Noble <jer.noble@apple.com> [Mac] Requesting PiP from two different WebViews gets PiP window "stuck" https://bugs.webkit.org/show_bug.cgi?id=194099 <rdar://problem/47271323> Reviewed by Eric Carlson. When a different client requests the PiP window, the PiP framework will call -pipDidClose: without first calling -pipActionStop:. This leaves the internal fullscreen state in a confused state where the WebView will attempt to re-enter PiP once it gets focus, and can lead to a state where the two WebViews will constantly try to steal PiP from one another, ad infinitum. When receiving a notification that the PiP window closed when our internal state tells us that the close was not requested, notify the client that PiP mode was exited, allowing them to set their expected state to a correct and sane value. * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240773. rdar://problem/47774755 ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification https://bugs.webkit.org/show_bug.cgi?id=189094 <rdar://problem/43853526> Reviewed by Zalan Bujtas. Source/WebCore: Protect against access to objects and cache's that can be removed while an object is still in memory. Unskipped flaky tests on mac-wk2. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextStateChangePlatformNotification): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (textMarkerForVisiblePosition): (textMarkerRangeFromVisiblePositions): LayoutTests: Unskip flaky test with crash resolved. * platform/mac-wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240773 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-31 Chris Fleizach <cfleizach@apple.com> ASSERTION FAILED: cache under WebCore::AXObjectCache::postTextStateChangePlatformNotification https://bugs.webkit.org/show_bug.cgi?id=189094 <rdar://problem/43853526> Reviewed by Zalan Bujtas. Protect against access to objects and cache's that can be removed while an object is still in memory. Unskipped flaky tests on mac-wk2. * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postTextStateChangePlatformNotification): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (textMarkerForVisiblePosition): (textMarkerRangeFromVisiblePositions): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240750. rdar://problem/47774507 Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error https://bugs.webkit.org/show_bug.cgi?id=194023 <rdar://problem/47417981> Reviewed by Geoffrey Garen. Source/WebCore: The issue was caused by the 'isTopSite' flag not getting properly set on the network request in case of a cross-site history navigation (with process-swap). As a result, twitter.com was not getting its same-site lax cookies. The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were bypassing this method entirely when continuing a load in a new process after a swap. This was intentional as the network request is normally already fully populated by the previous process and we do not want the new process to modify the request in any way (e.g. we would not want to add a Origin header back after it was removed by the previous process). However, in case of a History navigation, we do not actually pass a request along from one process to another. Instead, we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process. In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though we are technically continuing a load in a new process. We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're continuing a load with a request and not when we're continuing a load with a HistoryItem. Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/FrameLoader.h: (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const): LayoutTests: Add layout test coverage. * http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load-expected.txt: Added. * http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php: Added. * http/tests/cookies/same-site/resources/navigate-back.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240750 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-30 Chris Dumez <cdumez@apple.com> Regression(PSON) History navigations to twitter.com lead to a 403 HTTP error https://bugs.webkit.org/show_bug.cgi?id=194023 <rdar://problem/47417981> Reviewed by Geoffrey Garen. The issue was caused by the 'isTopSite' flag not getting properly set on the network request in case of a cross-site history navigation (with process-swap). As a result, twitter.com was not getting its same-site lax cookies. The 'isTopSite' flag normally gets set by FrameLoader::addExtraFieldsToRequest(), but we were bypassing this method entirely when continuing a load in a new process after a swap. This was intentional as the network request is normally already fully populated by the previous process and we do not want the new process to modify the request in any way (e.g. we would not want to add a Origin header back after it was removed by the previous process). However, in case of a History navigation, we do not actually pass a request along from one process to another. Instead, we pass a HistoryItem and then build a fresh new request from the HistoryItem in the new process. In this case, we *want* addExtraFieldsToRequest() to be called on the new request, even though we are technically continuing a load in a new process. We thus address the issue by bypassing FrameLoader::addExtraFieldsToRequest() only if we're continuing a load with a request and not when we're continuing a load with a HistoryItem. Test: http/tests/cookies/same-site/lax-samesite-cookie-after-cross-site-history-load.php * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::addExtraFieldsToRequest): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/FrameLoader.h: (WebCore::FrameLoader::shouldTreatCurrentLoadAsContinuingLoad const): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240727. rdar://problem/47776358 LayoutTests/imported/w3c: ServiceWorkerJob should notify its client in case its job is cancelled https://bugs.webkit.org/show_bug.cgi?id=193747 <rdar://problem/47498196> Reviewed by Chris Dumez. * web-platform-tests/service-workers/service-worker/registration-security-error.https-expected.txt: Source/WebCore: Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe https://bugs.webkit.org/show_bug.cgi?id=193747 <rdar://problem/47498196> Reviewed by Chris Dumez. Make ServiceWorkerJob be no longer ref counted. Instead its lifetime is fully controlled by ServiceWorkerContainer. Make sure that a failing load will remove the job from ServiceWorkerContainer job map. This allows to ensure that these jobs do not stay forever. Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful. Before the patch, unsetPendingActivity was only called for successful jobs finishing. In case of failing loads, ServiceWorkerContainer would leak. Make sure that setPendingActivity/unsetPendingActivity is balanced by storing a pending activity in the job map next to the job. When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess. This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone. Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not. Update type of exception to be SecurityError when load fails due to AccessControl. Covered by existing tests. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::updateRegistration): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::stop): (WebCore::ServiceWorkerContainer::job): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): (WebCore::ServiceWorkerJob::cancelPendingLoad): * workers/service/ServiceWorkerJob.h: (WebCore::ServiceWorkerJob::hasPromise const): (WebCore::ServiceWorkerJob::takePromise): * workers/service/ServiceWorkerJobClient.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240727 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-30 Youenn Fablet <youenn@apple.com> Refactor ServiceWorkerJob management by ServiceWorkerContainer to make it more memory safe https://bugs.webkit.org/show_bug.cgi?id=193747 <rdar://problem/47498196> Reviewed by Chris Dumez. Make ServiceWorkerJob be no longer ref counted. Instead its lifetime is fully controlled by ServiceWorkerContainer. Make sure that a failing load will remove the job from ServiceWorkerContainer job map. This allows to ensure that these jobs do not stay forever. Before the patch, the jobs map was never cleared, which is creating a ref cycle whenever a job is not succesful. Before the patch, unsetPendingActivity was only called for successful jobs finishing. In case of failing loads, ServiceWorkerContainer would leak. Make sure that setPendingActivity/unsetPendingActivity is balanced by storing a pending activity in the job map next to the job. When ServiceWorkerContainer is stopped, notify that all jobs are cancelled to NetworkProcess. This makes these jobs in NetworkProcess-side to not stay until the corresponding WebProcess is gone. Simplify ServiceWorkerJob promise rejection handling so that it is clear when promise is rejected and when it is not. Update type of exception to be SecurityError when load fails due to AccessControl. Covered by existing tests. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::addRegistration): (WebCore::ServiceWorkerContainer::removeRegistration): (WebCore::ServiceWorkerContainer::updateRegistration): (WebCore::ServiceWorkerContainer::scheduleJob): (WebCore::ServiceWorkerContainer::jobFailedWithException): (WebCore::ServiceWorkerContainer::jobResolvedWithRegistration): (WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult): (WebCore::ServiceWorkerContainer::jobFailedLoadingScript): (WebCore::ServiceWorkerContainer::jobDidFinish): (WebCore::ServiceWorkerContainer::stop): (WebCore::ServiceWorkerContainer::job): * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::failedWithException): (WebCore::ServiceWorkerJob::resolvedWithRegistration): (WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult): (WebCore::ServiceWorkerJob::startScriptFetch): (WebCore::ServiceWorkerJob::didReceiveResponse): (WebCore::ServiceWorkerJob::notifyFinished): (WebCore::ServiceWorkerJob::cancelPendingLoad): * workers/service/ServiceWorkerJob.h: (WebCore::ServiceWorkerJob::hasPromise const): (WebCore::ServiceWorkerJob::takePromise): * workers/service/ServiceWorkerJobClient.h: * workers/service/server/SWServerJobQueue.cpp: (WebCore::SWServerJobQueue::scriptFetchFinished): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240709. rdar://problem/47776349 AX: Role=switch not returning correct accessibilityValue https://bugs.webkit.org/show_bug.cgi?id=194006 Reviewed by Joanmarie Diggs. Source/WebCore: Return the toggle state of a role=switch element. Test: accessibility/ios-simulator/role-switch.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityValue]): LayoutTests: * accessibility/ios-simulator/role-switch-expected.txt: Added. * accessibility/ios-simulator/role-switch.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240709 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-30 Chris Fleizach <cfleizach@apple.com> AX: Role=switch not returning correct accessibilityValue https://bugs.webkit.org/show_bug.cgi?id=194006 Reviewed by Joanmarie Diggs. Return the toggle state of a role=switch element. Test: accessibility/ios-simulator/role-switch.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityValue]): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240697. rdar://problem/47774541 Make sure we have a frame before trying to access its loader https://bugs.webkit.org/show_bug.cgi?id=193985 <rdar://problem/47618239> Reviewed by Ryosuke Niwa. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240697 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-29 Brent Fulgham <bfulgham@apple.com> Make sure we have a frame before trying to access its loader https://bugs.webkit.org/show_bug.cgi?id=193985 <rdar://problem/47618239> Reviewed by Ryosuke Niwa. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240643. rdar://problem/47774515 webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic. https://bugs.webkit.org/show_bug.cgi?id=193923 <rdar://problem/45956595> Reviewed by Eric Carlson. The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget): (WebCore::HTMLMediaElement::dispatchEvent): * html/HTMLMediaElement.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240643 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-28 Jer Noble <jer.noble@apple.com> webkitcurrentplaybacktargetiswirelesschanged and webkitCurrentPlaybackIsWireless are non-deterministic. https://bugs.webkit.org/show_bug.cgi?id=193923 <rdar://problem/45956595> Reviewed by Eric Carlson. The value of webkitCurrentPlaybackTargetIsWireless can change in between when the event is scheduled and when it's actually dispatched. To make this more deterministic, use a GenericTaskQueue to enqueue setting m_isPlayingToWirelessTarget and dispatch the changed event in the same run-loop. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebCore::HTMLMediaElement::setIsPlayingToWirelessTarget): (WebCore::HTMLMediaElement::dispatchEvent): * html/HTMLMediaElement.h: 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r240537. rdar://problem/47774500 <video> elements not in the DOM should be allowed to AirPlay https://bugs.webkit.org/show_bug.cgi?id=193837 Source/WebCore: <rdar://42559491> Reviewed by Eric Carlson. Test: media/airplay-allows-buffering.html Some websites will switch between <video> elements backed by MSE to one backed by a media file in order to implement an AirPlay control. But when a <video> element is removed from the DOM and paused, further buffering is blocked. For some ports (namely Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for elements who have been asked to play wirelessly, but whose wireless playback has not started yet. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::dataBufferingPermitted const): (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget): LayoutTests: Reviewed by Eric Carlson. * media/airplay-allows-buffering-expected.txt: Added. * media/airplay-allows-buffering.html: Added. * platform/ios/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240537 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-25 Jer Noble <jer.noble@apple.com> <video> elements not in the DOM should be allowed to AirPlay https://bugs.webkit.org/show_bug.cgi?id=193837 <rdar://42559491> Reviewed by Eric Carlson. Test: media/airplay-allows-buffering.html Some websites will switch between <video> elements backed by MSE to one backed by a media file in order to implement an AirPlay control. But when a <video> element is removed from the DOM and paused, further buffering is blocked. For some ports (namely Cocoa ones), this keeps AirPlay from engaging. Relax this buffering restriction for elements who have been asked to play wirelessly, but whose wireless playback has not started yet. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::dataBufferingPermitted const): (WebCore::MediaElementSession::setShouldPlayToPlaybackTarget): 2019-02-05 Alan Coon <alancoon@apple.com> Cherry-pick r239881. rdar://problem/47776480 [iOS] Precision drop state thrashes when dragging near the top edge of an editable element https://bugs.webkit.org/show_bug.cgi?id=193364 <rdar://problem/47214117> Reviewed by Tim Horton. Source/WebCore: Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop caret position. This is either the enclosing form control (in the case of text fields and text areas), or the highest editable root. See WebKit ChangeLog for more details. Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea * editing/FrameSelection.cpp: (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const): * editing/FrameSelection.h: Source/WebKit: On iOS, marking a UIDropProposal as precise offsets the hit-testing location of the drop by a small distance either upwards or downwards from the actual location of the user's finger. When dragging over an editable element, WebKit currently marks the drop proposal as precise; however, when dragging over the top edge of an editable element, what happens is that the hit-testing location is offset to a location outside of the editable element, which causes us to turn off precision drop mode; subsequently, turning off precision drop mode removes the offset, which causes us to hit-test within the editable element once again and re-enable precision mode, and the cycle continues. In order to mitigate this, bail out of precision drop mode when dragging near the top or bottom edges of the highest editable root that contains the current drop caret position (or, if the drop caret is inside of a text form control, use the form control as the editable element instead). * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::didPerformDragControllerAction): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::currentDragCaretEditableElementRect const): * UIProcess/WebPageProxy.messages.in: * UIProcess/ios/WKContentViewInteraction.mm: (-[WKContentView dropInteraction:sessionDidUpdate:]): Avoid precise mode when we're less than 25pt away from the top and bottom edge of the editable element rect. Since the drag location offset amount is a fixed offset in window coordinates, we first convert this minimum distance to the content view's coordinate space by dividing by the content scale factor. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::performDragControllerAction): Tools: Add a test to verify that dragging near the top of a textarea element does not flag the drop proposal as precise, whereas dragging near the middle of the textarea does. * TestWebKitAPI/Tests/ios/DragAndDropTestsIOS.mm: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239881 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-11 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Precision drop state thrashes when dragging near the top edge of an editable element https://bugs.webkit.org/show_bug.cgi?id=193364 <rdar://problem/47214117> Reviewed by Tim Horton. Add a new helper method on DragCaretController to compute the bounds of the editable element around the drop caret position. This is either the enclosing form control (in the case of text fields and text areas), or the highest editable root. See WebKit ChangeLog for more details. Test: DragAndDropTests.AvoidPreciseDropNearTopOfTextArea * editing/FrameSelection.cpp: (WebCore::DragCaretController::editableElementRectInRootViewCoordinates const): * editing/FrameSelection.h: 2019-01-30 Babak Shafiei <bshafiei@apple.com> Cherry-pick r240633. rdar://problem/47682687 [watchOS] Enable Parental Controls content filtering https://bugs.webkit.org/show_bug.cgi?id=193939 <rdar://problem/46641912> Reviewed by Ryosuke Niwa. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Source/WebCore: * Configurations/FeatureDefines.xcconfig: Source/WebCore/PAL: * Configurations/FeatureDefines.xcconfig: Source/WebKit: * Configurations/FeatureDefines.xcconfig: Source/WebKitLegacy/mac: * Configurations/FeatureDefines.xcconfig: Source/WTF: * wtf/Platform.h: Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240633 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-28 Andy Estes <aestes@apple.com> [watchOS] Enable Parental Controls content filtering https://bugs.webkit.org/show_bug.cgi?id=193939 <rdar://problem/46641912> Reviewed by Ryosuke Niwa. * Configurations/FeatureDefines.xcconfig: 2019-01-28 Babak Shafiei <bshafiei@apple.com> Cherry-pick r240451. rdar://problem/47586844 Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object. https://bugs.webkit.org/show_bug.cgi?id=193778 Reviewed by Jon Lee. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240451 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-24 Jer Noble <jer.noble@apple.com> Fix leak of AVSampleBufferRenderSynchronizer boundaryObserver object. https://bugs.webkit.org/show_bug.cgi?id=193778 Reviewed by Jon Lee. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime): 2019-01-28 Babak Shafiei <bshafiei@apple.com> Cherry-pick r240450. rdar://problem/47586830 DidFirstVisuallyNonEmptyLayout milestone should always fire at some point. https://bugs.webkit.org/show_bug.cgi?id=193741 <rdar://problem/47135030> Reviewed by Antti Koivisto and Simon Fraser. Source/WebCore: fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when 1. the received data is not "contentful" yet 2. and we are expecting some more (loading is not complete yet) 3. but no layout is initiated anymore nothing triggers the milestone firing. This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did. * page/FrameView.cpp: (WebCore::FrameView::FrameView): (WebCore::FrameView::loadProgressingStatusChanged): Tools: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp: (TestWebKitAPI::TEST): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240450 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-24 Zalan Bujtas <zalan@apple.com> DidFirstVisuallyNonEmptyLayout milestone should always fire at some point. https://bugs.webkit.org/show_bug.cgi?id=193741 <rdar://problem/47135030> Reviewed by Antti Koivisto and Simon Fraser. fireLayoutRelatedMilestonesIfNeeded() is part of the post-layout tasks. In certain cases when 1. the received data is not "contentful" yet 2. and we are expecting some more (loading is not complete yet) 3. but no layout is initiated anymore nothing triggers the milestone firing. This patch ensures that we fire the DidFirstVisuallyNonEmptyLayout when the frame load is complete unless we already did. * page/FrameView.cpp: (WebCore::FrameView::FrameView): (WebCore::FrameView::loadProgressingStatusChanged): 2019-01-19 Youenn Fablet <youenn@apple.com> Cherry-pick r240206. rdar://problem/47357218 getUserMedia with a deviceId exact constraint with an empty string value should succeed https://bugs.webkit.org/show_bug.cgi?id=193541 <rdar://problem/47357218> Reviewed by Eric Carlson. If there is a deviceId constraint, remove any empty string from ideal/exact string list. This will make the device selection be solely based on other constraints. An improvement might be for 'exact' constraint to pick the default device. There is currently no such notion of a default device. Picking the best fitting device seems a good tradeoff. Covered by updated test. * platform/mediastream/MediaConstraints.cpp: (WebCore::MediaTrackConstraintSetMap::set): * platform/mediastream/MediaConstraints.h: (WebCore::StringConstraint::removeEmptyStringConstraint): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r239965. rdar://problem/47295360 Animation and other code is too aggressive about invalidating layer composition https://bugs.webkit.org/show_bug.cgi?id=193343 Reviewed by Antoine Quint. Source/WebCore: We used to have the concept of a "SyntheticStyleChange", which was used to trigger style updates for animation, and also to get compositing updated. That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work, and dirties DOM touch event regions (which can be expensive to update). However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger compositing, and doing so from animations caused excessive touch event regions on yahoo.com, which has several visibility:hidden elements with background-position animation. So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead call just invalidateStyle(). Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to do so, because fireAnimationEventsIfNeeded() can run the state machine and change state. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::setNeedsStyleRecalc): * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::updateAnimations): (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle): (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime): (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime): (WebCore::CSSAnimationController::cancelAnimations): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::animate): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::clientStyleChanged): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * svg/SVGAnimateElementBase.cpp: (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): LayoutTests: This test was clobbering the 'box' class on the animating element and therefore making it disappear. * legacy-animation-engine/compositing/animation/animation-compositing.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239965 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-14 Simon Fraser <simon.fraser@apple.com> Animation and other code is too aggressive about invalidating layer composition https://bugs.webkit.org/show_bug.cgi?id=193343 Reviewed by Antoine Quint. We used to have the concept of a "SyntheticStyleChange", which was used to trigger style updates for animation, and also to get compositing updated. That morphed into a call to Element::invalidateStyleAndLayerComposition(), which causes a style update to result in a "RecompositeLayer" diff, which in turn triggers compositing work, and dirties DOM touch event regions (which can be expensive to update). However, not all the callers of Element::invalidateStyleAndLayerComposition() need to trigger compositing, and doing so from animations caused excessive touch event regions on yahoo.com, which has several visibility:hidden elements with background-position animation. So fix callers of invalidateStyleAndLayerComposition() which don't care about compositing to instead call just invalidateStyle(). Also fix KeyframeAnimation::animate to correctly return true when animation state changes—it failed to do so, because fireAnimationEventsIfNeeded() can run the state machine and change state. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::setNeedsStyleRecalc): * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::updateAnimations): (WebCore::CSSAnimationControllerPrivate::fireEventsAndUpdateStyle): (WebCore::CSSAnimationControllerPrivate::pauseAnimationAtTime): (WebCore::CSSAnimationControllerPrivate::pauseTransitionAtTime): (WebCore::CSSAnimationController::cancelAnimations): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::animate): * rendering/RenderImage.cpp: (WebCore::RenderImage::imageChanged): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): * rendering/svg/SVGResourcesCache.cpp: (WebCore::SVGResourcesCache::clientStyleChanged): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::createAnimatedElementUpdate): * svg/SVGAnimateElementBase.cpp: (WebCore::applyCSSPropertyToTarget): (WebCore::removeCSSPropertyFromTarget): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r239947. rdar://problem/47295371 Re-enable ability to build --cloop builds. https://bugs.webkit.org/show_bug.cgi?id=192955 Source/JavaScriptCore: <rdar://problem/46882363> Reviewed by Saam barati and Keith Miller. * Configurations/FeatureDefines.xcconfig: Source/WebCore: Reviewed by Saam barati and Keith Miller. * Configurations/FeatureDefines.xcconfig: Source/WebCore/PAL: <rdar://problem/46882363> Reviewed by Saam barati and Keith Miller. * Configurations/FeatureDefines.xcconfig: Source/WebKit: <rdar://problem/46882363> Reviewed by Saam barati and Keith Miller. * Configurations/FeatureDefines.xcconfig: Source/WebKitLegacy/mac: <rdar://problem/46882363> Reviewed by Saam barati and Keith Miller. * Configurations/FeatureDefines.xcconfig: Tools: <rdar://problem/46882363> Reviewed by Saam barati and Keith Miller. The --cloop build option was being ignored this whole time since r236381. This patch makes it possible to build CLoop builds again. * Scripts/build-jsc: * Scripts/webkitperl/FeatureList.pm: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239947 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-14 Mark Lam <mark.lam@apple.com> Re-enable ability to build --cloop builds. https://bugs.webkit.org/show_bug.cgi?id=192955 Reviewed by Saam barati and Keith Miller. * Configurations/FeatureDefines.xcconfig: 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r239946. rdar://problem/47295375 https://bugs.webkit.org/show_bug.cgi?id=193403 <rdar://problem/46750743> Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC. Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239946 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-14 Jer Noble <jer.noble@apple.com> https://bugs.webkit.org/show_bug.cgi?id=193403 <rdar://problem/46750743> Continue fix in r239711 by using WeakPtr in SourceBufferPrivateAVFObjC. Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r239927. rdar://problem/47295363 DOMCacheStorage: use-after-move in doSequentialMatch() https://bugs.webkit.org/show_bug.cgi?id=193396 Reviewed by Youenn Fablet. Depending on the platform- and compiler-specific calling conventions, the doSequentialMatch() code can move out the Vector<Ref<DOMCache>> object into the callback lambda before the DOMCache object at the specified index is retrieved for the DOMCache::doMatch() invocation. This problem is now avoided by retrieving reference to the target DOMCache object in an earlier expression. * Modules/cache/DOMCacheStorage.cpp: (WebCore::doSequentialMatch): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239927 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-14 Zan Dobersek <zdobersek@igalia.com> DOMCacheStorage: use-after-move in doSequentialMatch() https://bugs.webkit.org/show_bug.cgi?id=193396 Reviewed by Youenn Fablet. Depending on the platform- and compiler-specific calling conventions, the doSequentialMatch() code can move out the Vector<Ref<DOMCache>> object into the callback lambda before the DOMCache object at the specified index is retrieved for the DOMCache::doMatch() invocation. This problem is now avoided by retrieving reference to the target DOMCache object in an earlier expression. * Modules/cache/DOMCacheStorage.cpp: (WebCore::doSequentialMatch): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r239905. rdar://problem/47494732 Release assert with <img usemap> in shadow tree https://bugs.webkit.org/show_bug.cgi?id=193378 Reviewed by Ryosuke Niwa. Source/WebCore: When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try to remove the map from the scope of the host. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::removedFromAncestor): Tree scope changes are relevant, not the connection to the document. LayoutTests: * fast/shadow-dom/image-map-tree-scope.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239905 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-13 Antti Koivisto <antti@apple.com> Release assert with <img usemap> in shadow tree https://bugs.webkit.org/show_bug.cgi?id=193378 Reviewed by Ryosuke Niwa. When a shadow host that has <img usemap> in the shadow tree is removed from the document, we try to remove the map from the scope of the host. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::removedFromAncestor): Tree scope changes are relevant, not the connection to the document. 2019-01-23 Kocsen Chung <kocsen_chung@apple.com> Revert r238815. rdar://problem/47457960 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240158. rdar://problem/47458281 FetchResponse::url should return the empty string for tainted responses https://bugs.webkit.org/show_bug.cgi?id=193553 Reviewed by Youenn Fablet. LayoutTests/imported/w3c: * web-platform-tests/fetch/api/basic/mode-no-cors.sub.any.js: (fetchNoCors): Source/WebCore: Check whether the response is tainted in FetchResponse::url, to match the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::url const): LayoutTests: * http/wpt/fetch/response-opaque-clone.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240158 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-18 Ali Juma <ajuma@chromium.org> FetchResponse::url should return the empty string for tainted responses https://bugs.webkit.org/show_bug.cgi?id=193553 Reviewed by Youenn Fablet. Check whether the response is tainted in FetchResponse::url, to match the behavior described in https://fetch.spec.whatwg.org/#concept-filtered-response-opaque. * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::url const): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240152. rdar://problem/47458242 A track source should be unmuted whenever reenabled after setDirection changes https://bugs.webkit.org/show_bug.cgi?id=193554 <rdar://problem/47366196> Reviewed by Eric Carlson. Source/WebCore: Ensure that track gets unmuted after being fired as part of track event. Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC. Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track, some enqueued samples might not be from the right active video track or there might be no active video track. Test: webrtc/video-setDirection.html * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): LayoutTests: * webrtc/video-setDirection-expected.txt: Added. * webrtc/video-setDirection.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240152 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-18 Youenn Fablet <youenn@apple.com> A track source should be unmuted whenever reenabled after setDirection changes https://bugs.webkit.org/show_bug.cgi?id=193554 <rdar://problem/47366196> Reviewed by Eric Carlson. Ensure that track gets unmuted after being fired as part of track event. Test is triggering some existing issues with MediaPlayerPrivateMediaStreamAVFObjC. Given the enqueuing of samples happens in a different frame than the thread used to update media stream and the active video track, some enqueued samples might not be from the right active video track or there might be no active video track. Test: webrtc/video-setDirection.html * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::fireTrackEvent): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240122. rdar://problem/47458135 [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable https://bugs.webkit.org/show_bug.cgi?id=193478 <rdar://problem/34368591> Reviewed by Brent Fulgham. By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only website that assumes submit buttons are focusable, and will prohibit users from completing immigration forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable. This quirk is for ceac.state.gov specifically, and therefore no tests. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isMouseFocusable const): (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const): * html/HTMLFormControlElement.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240122 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-17 Jiewen Tan <jiewen_tan@apple.com> [Mac] Add a new quirk to HTMLFormControlElement::isMouseFocusable https://bugs.webkit.org/show_bug.cgi?id=193478 <rdar://problem/34368591> Reviewed by Brent Fulgham. By default in macOS, submit buttons (controls) are not focusable. WebKit follows this system convention as suggested by the spec: https://html.spec.whatwg.org/multipage/interaction.html#focusable-area. This is also the convention Firefox respects. However, Chrome doesn't. ceac.state.gov is by far the only website that assumes submit buttons are focusable, and will prohibit users from completing immigration forms, such as DS160 if buttons are not. To help immigrations, we decide to add a new quirk to HTMLFormControlElement::isMouseFocusable such that submit buttons are mouse focusable. This quirk is for ceac.state.gov specifically, and therefore no tests. * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::isMouseFocusable const): (WebCore::HTMLFormControlElement::needsSiteSpecificQuirks const): * html/HTMLFormControlElement.h: 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240112. rdar://problem/47458291 [EME] Remove Amazon Prime Video from quirks list https://bugs.webkit.org/show_bug.cgi?id=193514 rdar://problem/47295330 Reviewed by Jer Noble. * page/Quirks.cpp: (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240112 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-17 Jon Lee <jonlee@apple.com> [EME] Remove Amazon Prime Video from quirks list https://bugs.webkit.org/show_bug.cgi?id=193514 rdar://problem/47295330 Reviewed by Jer Noble. * page/Quirks.cpp: (WebCore::Quirks::hasBrokenEncryptedMediaAPISupportQuirk const): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240049. rdar://problem/47458184 ServiceWorkerContainer is leaking due to a ref cycle https://bugs.webkit.org/show_bug.cgi?id=193462 <rdar://problem/47026303> Reviewed by Brady Eidson. ServiceWorkerContainer keeps a reference to its ready promise. The ready promise keeps a ref to its value which is a ServiceWorkerRegistration. ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer. To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped. Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::stop): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240049 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-16 Youenn Fablet <youenn@apple.com> ServiceWorkerContainer is leaking due to a ref cycle https://bugs.webkit.org/show_bug.cgi?id=193462 <rdar://problem/47026303> Reviewed by Brady Eidson. ServiceWorkerContainer keeps a reference to its ready promise. The ready promise keeps a ref to its value which is a ServiceWorkerRegistration. ServiceWorkerRegistration keeps a ref to ServiceWorkerContainer. To break the reference cycle, set the ready promise to zero when ServiceWorkerContainer is stopped. Covered by imported/w3c/web-platform-tests/service-workers/service-worker/ready.https.html no longer leaking. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::stop): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240037. rdar://problem/47458128 Add more assertions to find root cause for release assert hit in StyleResolver https://bugs.webkit.org/show_bug.cgi?id=193488 <rdar://problem/30983040> Reviewed by Zalan Bujtas. * css/StyleResolver.cpp: (WebCore::StyleResolver::~StyleResolver): Release assert we are not resolving tree style. * dom/Document.cpp: (WebCore::Document::setIsResolvingTreeStyle): * dom/Document.h: (WebCore::Document::isResolvingTreeStyle const): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Scope::Scope): (WebCore::Style::TreeResolver::Scope::~Scope): Set isResolvingTreeStyle bit when we have a tree resolver scope. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240037 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-16 Antti Koivisto <antti@apple.com> Add more assertions to find root cause for release assert hit in StyleResolver https://bugs.webkit.org/show_bug.cgi?id=193488 <rdar://problem/30983040> Reviewed by Zalan Bujtas. * css/StyleResolver.cpp: (WebCore::StyleResolver::~StyleResolver): Release assert we are not resolving tree style. * dom/Document.cpp: (WebCore::Document::setIsResolvingTreeStyle): * dom/Document.h: (WebCore::Document::isResolvingTreeStyle const): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::Scope::Scope): (WebCore::Style::TreeResolver::Scope::~Scope): Set isResolvingTreeStyle bit when we have a tree resolver scope. 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r240000. rdar://problem/47457985 Correctly handle rotation for local video playback https://bugs.webkit.org/show_bug.cgi?id=193412 Reviewed by Eric Carlson. Update AVVideoCaptureSource to compute the size given to settings after rotating the sample. This ensures computing the size of video elements appropriately. Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size. Covered by manual testing as we do not have yet emulation of local capture with rotation. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setIntrinsicSize): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::settings): (WebCore::AVVideoCaptureSource::computeSampleRotation): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240000 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-15 Youenn Fablet <youenn@apple.com> Correctly handle rotation for local video playback https://bugs.webkit.org/show_bug.cgi?id=193412 Reviewed by Eric Carlson. Update AVVideoCaptureSource to compute the size given to settings after rotating the sample. This ensures computing the size of video elements appropriately. Also makes sure to notify observers of size change whenever rotation happens as settings() call will provide a different size. Covered by manual testing as we do not have yet emulation of local capture with rotation. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setIntrinsicSize): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::settings): (WebCore::AVVideoCaptureSource::computeSampleRotation): 2019-01-23 Alan Coon <alancoon@apple.com> Cherry-pick r239971. rdar://problem/47458229 Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections https://bugs.webkit.org/show_bug.cgi?id=193416 Reviewed by Wenson Hsieh. The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and it shows up on Speedometer profiles so optimize to only run this code if we have a selection range. * editing/FrameSelection.cpp: (WebCore::FrameSelection::respondToNodeModification): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239971 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-14 Simon Fraser <simon.fraser@apple.com> Only run the node comparison code in FrameSelection::respondToNodeModification() for range selections https://bugs.webkit.org/show_bug.cgi?id=193416 Reviewed by Wenson Hsieh. The code inside the m_selection.firstRange() clause needs to only run for non-collapsed selections, and it shows up on Speedometer profiles so optimize to only run this code if we have a selection range. * editing/FrameSelection.cpp: (WebCore::FrameSelection::respondToNodeModification): 2019-01-22 Alan Coon <alancoon@apple.com> Cherry-pick r240046. rdar://problem/47099573 Regression(PSON) View becomes blank after click a cross-site download link https://bugs.webkit.org/show_bug.cgi?id=193361 <rdar://problem/47099573> Reviewed by Geoffrey Garen. Source/WebCore: * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When restoring from PageCache, make sure we notify the client that the load was committed *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy logic in the UIProcess. Source/WebKit: The issue tracked by rdar://problem/47099573 is that a provisional load may get canceled (or converted into a download) *after* we've decided to process-swap. In such cases, the view should keep displaying the current site and it should still be interactive. However, with the previous PSON model, the view (pageProxy) would have already swapped to the new process and would end up displaying the initially empty document. To address the issue, this patch introduces the concept of a provisional load in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the provisional page until after the load was committed in the new process. This means that the view / WebPageProxy keeps using the old process and displays the current content until a load has committed in the provisional page. If no load commits in the provisional process (e.g. because the load is cancelled or converted into a download), then we merely destroy the ProvisionalPageProxy and terminate its process, without impacting the WebPageProxy. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to delay attaching the drawing area in case of a process-swap, no matter what now that the previous process is kept alive until the provisional load is committed in the new process. * Shared/WebPolicyAction.h: Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of process-swap, we now tell the previous process to simply ignore the load, while we create a ProvisionalPageProxy to do the new load in a new process. Suspension of the previous page in the old process, happens later, when a load is actually committed in the new process. * Sources.txt: Add new ProvisionalPageProxy file. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcessAndResetState]): When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current process and the provisional one, to maintain previous behavior in our API tests. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy): (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState): (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing): (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing): * UIProcess/AcceleratedDrawingAreaProxy.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::createDrawingAreaProxy): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::DrawingAreaProxy): (WebKit::DrawingAreaProxy::~DrawingAreaProxy): (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::process): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): (WebKit::DrawingAreaProxyImpl::update): * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/PageClient.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange): (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry): (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart): (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _createDrawingAreaProxy:]): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy): (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry): (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom): (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom): (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/mac/WebPageProxyMac.mm: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/win/PageClientImpl.h: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/win/PageClientImpl.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): Pass the drawing area's associated process when constructing it and store it as a member in addition to the page. This is necessary now that a page can be associated with 2 WebProcesses at a time, each having its own drawing area. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Pass the process. * UIProcess/ProvisionalPageProxy.cpp: Added. (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::processDidTerminate): (WebKit::ProvisionalPageProxy::takeDrawingArea): (WebKit::ProvisionalPageProxy::cancel): (WebKit::ProvisionalPageProxy::processDidFinishLaunching): (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): (WebKit::ProvisionalPageProxy::initializeWebPage): (WebKit::ProvisionalPageProxy::loadData): (WebKit::ProvisionalPageProxy::loadRequest): (WebKit::ProvisionalPageProxy::goToBackForwardItem): (WebKit::ProvisionalPageProxy::didCreateMainFrame): (WebKit::ProvisionalPageProxy::didPerformClientRedirect): (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData): (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame): (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync): (WebKit::ProvisionalPageProxy::decidePolicyForResponse): (WebKit::ProvisionalPageProxy::startURLSchemeTask): (WebKit::ProvisionalPageProxy::backForwardGoToItem): (WebKit::ProvisionalPageProxy::didReceiveMessage): (WebKit::ProvisionalPageProxy::didReceiveSyncMessage): * UIProcess/ProvisionalPageProxy.h: Added. (WebKit::ProvisionalPageProxy::page): (WebKit::ProvisionalPageProxy::mainFrame const): (WebKit::ProvisionalPageProxy::process): (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const): (WebKit::ProvisionalPageProxy::navigationID const): (WebKit::ProvisionalPageProxy::drawingArea const): New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from the provisional process. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::unsuspend): (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy which tries to register itself as an IPC message receiver for the same pageID when a process-swap occurs and we're switching to a suspended page. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::isMainFrame const): WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame. Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's m_mainFrame to maintain previous behavior. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::provisionalDrawingArea const): Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot. (WebKit::WebPageProxy::swapToWebProcess): swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess() later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs to initialize some data members such as the drawing area and the main frame as it is transferring them over from the ProvisionalPageProxy which started the provisional load. (WebKit::WebPageProxy::finishAttachingToWebProcess): We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been committed in the provisional process. (WebKit::WebPageProxy::setDrawingArea): (WebKit::WebPageProxy::initializeWebPage): - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been committed in the provisional process. - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess(). (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadRequestWithNavigationShared): Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not Yes. This avoids hitting some assertions as this was already called during the first API call if needed. (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadDataWithNavigationShared): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::findPlugin): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): In case of process swap, tell the previous process to ignore the load instead of suspending it right away. Suspension now happens later, only if we end up committing the provisional load in the new process. Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used to happen a bit later but it is clearer if we do this as early as possible I think. (WebKit::WebPageProxy::commitProvisionalPage): When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of: - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess(). - Suspending the current page. - Letting the client know the load is comitted - Destroy the ProvisionalPageProxy. This work used to happen earlier in continueNavigationInNewProcess(). (WebKit::WebPageProxy::continueNavigationInNewProcess): Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy, without actually having the WebPageProxy switch to the new process yet. (WebKit::WebPageProxy::didCreateMainFrame): (WebKit::WebPageProxy::didCreateSubframe): (WebKit::WebPageProxy::didCreateWindow): Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this. (WebKit::WebPageProxy::didDestroyNavigation): On process-swap, when telling the previous process to ignore the load and starting the new load in a new ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore the call since the navigation is merely taken over by the ProvisionalPageProxy. (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Moved some PSON logic to the ProvisionalPageProxy instead. (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared): (WebKit::WebPageProxy::willPerformClientRedirectForFrame): (WebKit::WebPageProxy::didCancelClientRedirectForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared): (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it. (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): (WebKit::WebPageProxy::didReceiveTitleForFrame): (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame): (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): (WebKit::WebPageProxy::didRunInsecureContentForFrame): (WebKit::WebPageProxy::frameDidBecomeFrameSet): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseShared): (WebKit::WebPageProxy::unableToImplementPolicy): (WebKit::WebPageProxy::willSubmitForm): (WebKit::WebPageProxy::didNavigateWithNavigationData): (WebKit::WebPageProxy::didNavigateWithNavigationDataShared): (WebKit::WebPageProxy::didPerformClientRedirect): (WebKit::WebPageProxy::didPerformClientRedirectShared): (WebKit::WebPageProxy::didPerformServerRedirect): (WebKit::WebPageProxy::didUpdateHistoryTitle): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::unavailablePluginButtonClicked): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): (WebKit::WebPageProxy::printFrame): (WebKit::WebPageProxy::backForwardGoToItem): (WebKit::WebPageProxy::backForwardGoToItemShared): (WebKit::WebPageProxy::learnWord): (WebKit::WebPageProxy::ignoreWord): (WebKit::WebPageProxy::didReceiveEvent): (WebKit::WebPageProxy::editingRangeCallback): (WebKit::WebPageProxy::rectForCharacterRangeCallback): (WebKit::WebPageProxy::focusedFrameChanged): (WebKit::WebPageProxy::frameSetLargestFrameChanged): (WebKit::WebPageProxy::provisionalProcessDidTerminate): Cancel the provisiona load and destroy the ProvisionalPageProxy if the provisional process crashes. (WebKit::WebPageProxy::resetState): Drop some code that is no longer needed. (WebKit::WebPageProxy::creationParameters): - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have more than one call site. This was just some bad factoring. - Take the process in parameter now that we page can be associated with several processes at a time. (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::startURLSchemeTaskShared): (WebKit::WebPageProxy::stopURLSchemeTask): (WebKit::WebPageProxy::loadSynchronousURLSchemeTask): (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess): (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::visitedLinkStore): (WebKit::WebPageProxy::provisionalPageProxy const): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::hasProvisionalPageWithID const): (WebKit::WebProcessProxy::updateBackForwardItem): (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): (WebKit::WebProcessProxy::didFinishLaunching): (WebKit::WebProcessProxy::canTerminateChildProcess): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::addProvisionalPageProxy): (WebKit::WebProcessProxy::removeProvisionalPageProxy): Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID associated with this process yet, because it is still a ProvisionalPageProxy. * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): (WebKit::WebURLSchemeTask::didPerformRedirection): (WebKit::WebURLSchemeTask::didReceiveResponse): (WebKit::WebURLSchemeTask::didReceiveData): (WebKit::WebURLSchemeTask::didComplete): (WebKit::WebURLSchemeTask::pageDestroyed): * UIProcess/WebURLSchemeTask.h: Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::endSwipeGesture): Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently associated with the page in case of process swap. * WebKit.xcodeproj/project.pbxproj: Add ProvisionalPageProxy class. * WebProcess/WebPage/WebFrame.cpp: (WebKit::toPolicyAction): (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldAttachDrawingAreaOnPageTransition): (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::didReceivePolicyDecision): Stop dealing with WebPolicyAction::Suspend as it no longer exists. (WebKit::WebPage::didCompletePageTransition): (WebKit::WebPage::setIsSuspended): Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend. setIsSuspended(true) IPC is sent when we actually commit the provisional page. * WebProcess/WebPage/WebPage.h: Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: (-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): LayoutTests: Skip test testing the cross-process DOMWindow API as I broke it with this patch. The feature is far from ready and off by default anyway. I will add support back in a follow-up. * platform/wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240046 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-16 Chris Dumez <cdumez@apple.com> Regression(PSON) View becomes blank after click a cross-site download link https://bugs.webkit.org/show_bug.cgi?id=193361 <rdar://problem/47099573> Reviewed by Geoffrey Garen. * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When restoring from PageCache, make sure we notify the client that the load was committed *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy logic in the UIProcess. 2019-01-22 Alan Coon <alancoon@apple.com> Revert r240258. rdar://problem/47099573 2019-01-22 Alan Coon <alancoon@apple.com> Revert r240262. rdar://problem/47099573 2019-01-22 Alan Coon <alancoon@apple.com> Revert r240263. rdar://problem/47099573 2019-01-22 Alan Coon <alancoon@apple.com> Cherry-pick r240046. rdar://problem/47099573 Regression(PSON) View becomes blank after click a cross-site download link https://bugs.webkit.org/show_bug.cgi?id=193361 <rdar://problem/47099573> Reviewed by Geoffrey Garen. Source/WebCore: * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When restoring from PageCache, make sure we notify the client that the load was committed *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy logic in the UIProcess. Source/WebKit: The issue tracked by rdar://problem/47099573 is that a provisional load may get canceled (or converted into a download) *after* we've decided to process-swap. In such cases, the view should keep displaying the current site and it should still be interactive. However, with the previous PSON model, the view (pageProxy) would have already swapped to the new process and would end up displaying the initially empty document. To address the issue, this patch introduces the concept of a provisional load in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the provisional page until after the load was committed in the new process. This means that the view / WebPageProxy keeps using the old process and displays the current content until a load has committed in the provisional page. If no load commits in the provisional process (e.g. because the load is cancelled or converted into a download), then we merely destroy the ProvisionalPageProxy and terminate its process, without impacting the WebPageProxy. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to delay attaching the drawing area in case of a process-swap, no matter what now that the previous process is kept alive until the provisional load is committed in the new process. * Shared/WebPolicyAction.h: Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of process-swap, we now tell the previous process to simply ignore the load, while we create a ProvisionalPageProxy to do the new load in a new process. Suspension of the previous page in the old process, happens later, when a load is actually committed in the new process. * Sources.txt: Add new ProvisionalPageProxy file. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcessAndResetState]): When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current process and the provisional one, to maintain previous behavior in our API tests. * UIProcess/API/gtk/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/API/gtk/PageClientImpl.h: * UIProcess/API/wpe/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/API/wpe/PageClientImpl.h: * UIProcess/AcceleratedDrawingAreaProxy.cpp: (WebKit::AcceleratedDrawingAreaProxy::AcceleratedDrawingAreaProxy): (WebKit::AcceleratedDrawingAreaProxy::didUpdateBackingStoreState): (WebKit::AcceleratedDrawingAreaProxy::sendUpdateBackingStoreState): (WebKit::AcceleratedDrawingAreaProxy::waitForAndDispatchDidUpdateBackingStoreState): (WebKit::AcceleratedDrawingAreaProxy::setNativeSurfaceHandleForCompositing): (WebKit::AcceleratedDrawingAreaProxy::destroyNativeSurfaceHandleForCompositing): * UIProcess/AcceleratedDrawingAreaProxy.h: * UIProcess/Cocoa/WebViewImpl.h: * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::createDrawingAreaProxy): * UIProcess/DrawingAreaProxy.cpp: (WebKit::DrawingAreaProxy::DrawingAreaProxy): (WebKit::DrawingAreaProxy::~DrawingAreaProxy): (WebKit::DrawingAreaProxy::viewExposedRectChangedTimerFired): * UIProcess/DrawingAreaProxy.h: (WebKit::DrawingAreaProxy::process): * UIProcess/DrawingAreaProxyImpl.cpp: (WebKit::DrawingAreaProxyImpl::DrawingAreaProxyImpl): (WebKit::DrawingAreaProxyImpl::update): * UIProcess/DrawingAreaProxyImpl.h: * UIProcess/PageClient.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h: * UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm: (WebKit::RemoteLayerTreeDrawingAreaProxy::RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::~RemoteLayerTreeDrawingAreaProxy): (WebKit::RemoteLayerTreeDrawingAreaProxy::deviceScaleFactorDidChange): (WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry): (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart): (WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidEnd): (WebKit::RemoteLayerTreeDrawingAreaProxy::didRefreshDisplay): (WebKit::RemoteLayerTreeDrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::RemoteLayerTreeDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/ios/PageClientImplIOS.h: * UIProcess/ios/PageClientImplIOS.mm: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/ios/WKContentView.h: * UIProcess/ios/WKContentView.mm: (-[WKContentView _createDrawingAreaProxy:]): * UIProcess/mac/PageClientImplMac.h: * UIProcess/mac/PageClientImplMac.mm: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h: * UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm: (WebKit::TiledCoreAnimationDrawingAreaProxy::TiledCoreAnimationDrawingAreaProxy): (WebKit::TiledCoreAnimationDrawingAreaProxy::deviceScaleFactorDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::colorSpaceDidChange): (WebKit::TiledCoreAnimationDrawingAreaProxy::waitForDidUpdateActivityState): (WebKit::TiledCoreAnimationDrawingAreaProxy::createFence): (WebKit::TiledCoreAnimationDrawingAreaProxy::sendUpdateGeometry): (WebKit::TiledCoreAnimationDrawingAreaProxy::adjustTransientZoom): (WebKit::TiledCoreAnimationDrawingAreaProxy::commitTransientZoom): (WebKit::TiledCoreAnimationDrawingAreaProxy::dispatchAfterEnsuringDrawing): * UIProcess/mac/WebPageProxyMac.mm: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/win/PageClientImpl.h: * UIProcess/win/PageClientImpl.cpp: (WebKit::PageClientImpl::createDrawingAreaProxy): * UIProcess/win/PageClientImpl.h: * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): Pass the drawing area's associated process when constructing it and store it as a member in addition to the page. This is necessary now that a page can be associated with 2 WebProcesses at a time, each having its own drawing area. * UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Pass the process. * UIProcess/ProvisionalPageProxy.cpp: Added. (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::processDidTerminate): (WebKit::ProvisionalPageProxy::takeDrawingArea): (WebKit::ProvisionalPageProxy::cancel): (WebKit::ProvisionalPageProxy::processDidFinishLaunching): (WebKit::ProvisionalPageProxy::finishInitializingWebPageAfterProcessLaunch): (WebKit::ProvisionalPageProxy::initializeWebPage): (WebKit::ProvisionalPageProxy::loadData): (WebKit::ProvisionalPageProxy::loadRequest): (WebKit::ProvisionalPageProxy::goToBackForwardItem): (WebKit::ProvisionalPageProxy::didCreateMainFrame): (WebKit::ProvisionalPageProxy::didPerformClientRedirect): (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): (WebKit::ProvisionalPageProxy::didNavigateWithNavigationData): (WebKit::ProvisionalPageProxy::didChangeProvisionalURLForFrame): (WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionAsync): (WebKit::ProvisionalPageProxy::decidePolicyForResponse): (WebKit::ProvisionalPageProxy::startURLSchemeTask): (WebKit::ProvisionalPageProxy::backForwardGoToItem): (WebKit::ProvisionalPageProxy::didReceiveMessage): (WebKit::ProvisionalPageProxy::didReceiveSyncMessage): * UIProcess/ProvisionalPageProxy.h: Added. (WebKit::ProvisionalPageProxy::page): (WebKit::ProvisionalPageProxy::mainFrame const): (WebKit::ProvisionalPageProxy::process): (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const): (WebKit::ProvisionalPageProxy::navigationID const): (WebKit::ProvisionalPageProxy::drawingArea const): New WebPageProxy-like class which is owned by the WebPageProxy and proxies IPC from the provisional process. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::unsuspend): (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy which tries to register itself as an IPC message receiver for the same pageID when a process-swap occurs and we're switching to a suspended page. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::isMainFrame const): WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame. Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's m_mainFrame to maintain previous behavior. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::provisionalDrawingArea const): Add getter for the provisional drawing area. We normally only deal with the page's current drawing area, but the ViewGestureController needs access to the provisional once to display the swipe gesture snapshot. (WebKit::WebPageProxy::swapToWebProcess): swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess() later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs to initialize some data members such as the drawing area and the main frame as it is transferring them over from the ProvisionalPageProxy which started the provisional load. (WebKit::WebPageProxy::finishAttachingToWebProcess): We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been committed in the provisional process. (WebKit::WebPageProxy::setDrawingArea): (WebKit::WebPageProxy::initializeWebPage): - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been committed in the provisional process. - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess(). (WebKit::WebPageProxy::maybeInitializeSandboxExtensionHandle): (WebKit::WebPageProxy::loadRequest): (WebKit::WebPageProxy::loadRequestWithNavigationShared): Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not Yes. This avoids hitting some assertions as this was already called during the first API call if needed. (WebKit::WebPageProxy::loadData): (WebKit::WebPageProxy::loadDataWithNavigationShared): (WebKit::WebPageProxy::stopLoading): (WebKit::WebPageProxy::reload): (WebKit::WebPageProxy::didPerformDragControllerAction): (WebKit::WebPageProxy::findPlugin): (WebKit::WebPageProxy::receivedNavigationPolicyDecision): In case of process swap, tell the previous process to ignore the load instead of suspending it right away. Suspension now happens later, only if we end up committing the provisional load in the new process. Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used to happen a bit later but it is clearer if we do this as early as possible I think. (WebKit::WebPageProxy::commitProvisionalPage): When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of: - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess(). - Suspending the current page. - Letting the client know the load is comitted - Destroy the ProvisionalPageProxy. This work used to happen earlier in continueNavigationInNewProcess(). (WebKit::WebPageProxy::continueNavigationInNewProcess): Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy, without actually having the WebPageProxy switch to the new process yet. (WebKit::WebPageProxy::didCreateMainFrame): (WebKit::WebPageProxy::didCreateSubframe): (WebKit::WebPageProxy::didCreateWindow): Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this. (WebKit::WebPageProxy::didDestroyNavigation): On process-swap, when telling the previous process to ignore the load and starting the new load in a new ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore the call since the navigation is merely taken over by the ProvisionalPageProxy. (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): (WebKit::WebPageProxy::didStartProvisionalLoadForFrameShared): Moved some PSON logic to the ProvisionalPageProxy instead. (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame): (WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrameShared): (WebKit::WebPageProxy::willPerformClientRedirectForFrame): (WebKit::WebPageProxy::didCancelClientRedirectForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrame): (WebKit::WebPageProxy::didChangeProvisionalURLForFrameShared): (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): (WebKit::WebPageProxy::didFailProvisionalLoadForFrameShared): When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it. (WebKit::WebPageProxy::didCommitLoadForFrame): (WebKit::WebPageProxy::didFinishDocumentLoadForFrame): (WebKit::WebPageProxy::didFinishLoadForFrame): (WebKit::WebPageProxy::didFailLoadForFrame): (WebKit::WebPageProxy::didSameDocumentNavigationForFrame): (WebKit::WebPageProxy::didReceiveTitleForFrame): (WebKit::WebPageProxy::didFirstVisuallyNonEmptyLayoutForFrame): (WebKit::WebPageProxy::didDisplayInsecureContentForFrame): (WebKit::WebPageProxy::didRunInsecureContentForFrame): (WebKit::WebPageProxy::frameDidBecomeFrameSet): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync): (WebKit::WebPageProxy::decidePolicyForNavigationActionAsyncShared): (WebKit::WebPageProxy::decidePolicyForNavigationAction): (WebKit::WebPageProxy::decidePolicyForNavigationActionSync): (WebKit::WebPageProxy::decidePolicyForNewWindowAction): (WebKit::WebPageProxy::decidePolicyForResponse): (WebKit::WebPageProxy::decidePolicyForResponseShared): (WebKit::WebPageProxy::unableToImplementPolicy): (WebKit::WebPageProxy::willSubmitForm): (WebKit::WebPageProxy::didNavigateWithNavigationData): (WebKit::WebPageProxy::didNavigateWithNavigationDataShared): (WebKit::WebPageProxy::didPerformClientRedirect): (WebKit::WebPageProxy::didPerformClientRedirectShared): (WebKit::WebPageProxy::didPerformServerRedirect): (WebKit::WebPageProxy::didUpdateHistoryTitle): (WebKit::WebPageProxy::createNewPage): (WebKit::WebPageProxy::runJavaScriptAlert): (WebKit::WebPageProxy::runJavaScriptConfirm): (WebKit::WebPageProxy::runJavaScriptPrompt): (WebKit::WebPageProxy::unavailablePluginButtonClicked): (WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): (WebKit::WebPageProxy::runOpenPanel): (WebKit::WebPageProxy::printFrame): (WebKit::WebPageProxy::backForwardGoToItem): (WebKit::WebPageProxy::backForwardGoToItemShared): (WebKit::WebPageProxy::learnWord): (WebKit::WebPageProxy::ignoreWord): (WebKit::WebPageProxy::didReceiveEvent): (WebKit::WebPageProxy::editingRangeCallback): (WebKit::WebPageProxy::rectForCharacterRangeCallback): (WebKit::WebPageProxy::focusedFrameChanged): (WebKit::WebPageProxy::frameSetLargestFrameChanged): (WebKit::WebPageProxy::provisionalProcessDidTerminate): Cancel the provisiona load and destroy the ProvisionalPageProxy if the provisional process crashes. (WebKit::WebPageProxy::resetState): Drop some code that is no longer needed. (WebKit::WebPageProxy::creationParameters): - Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have more than one call site. This was just some bad factoring. - Take the process in parameter now that we page can be associated with several processes at a time. (WebKit::WebPageProxy::exceededDatabaseQuota): (WebKit::WebPageProxy::requestGeolocationPermissionForFrame): (WebKit::WebPageProxy::requestUserMediaPermissionForFrame): (WebKit::WebPageProxy::enumerateMediaDevicesForFrame): (WebKit::WebPageProxy::startURLSchemeTask): (WebKit::WebPageProxy::startURLSchemeTaskShared): (WebKit::WebPageProxy::stopURLSchemeTask): (WebKit::WebPageProxy::loadSynchronousURLSchemeTask): (WebKit::WebPageProxy::checkURLReceivedFromCurrentOrPreviousWebProcess): (WebKit::WebPageProxy::willAcquireUniversalFileReadSandboxExtension): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::visitedLinkStore): (WebKit::WebPageProxy::provisionalPageProxy const): * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::hasProvisionalPageWithID const): (WebKit::WebProcessProxy::updateBackForwardItem): (WebKit::WebProcessProxy::processDidTerminateOrFailedToLaunch): (WebKit::WebProcessProxy::didFinishLaunching): (WebKit::WebProcessProxy::canTerminateChildProcess): * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::addProvisionalPageProxy): (WebKit::WebProcessProxy::removeProvisionalPageProxy): Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID associated with this process yet, because it is still a ProvisionalPageProxy. * UIProcess/WebURLSchemeHandler.cpp: (WebKit::WebURLSchemeHandler::startTask): * UIProcess/WebURLSchemeHandler.h: * UIProcess/WebURLSchemeTask.cpp: (WebKit::WebURLSchemeTask::create): (WebKit::WebURLSchemeTask::WebURLSchemeTask): (WebKit::WebURLSchemeTask::didPerformRedirection): (WebKit::WebURLSchemeTask::didReceiveResponse): (WebKit::WebURLSchemeTask::didReceiveData): (WebKit::WebURLSchemeTask::didComplete): (WebKit::WebURLSchemeTask::pageDestroyed): * UIProcess/WebURLSchemeTask.h: Pass the process when constructing a WebURLSchemeTask and store it as a data member in addition to the page. This is necessary now that a WebPageProxy can be associated with several WebProcesses. * UIProcess/ios/ViewGestureControllerIOS.mm: (WebKit::ViewGestureController::endSwipeGesture): Use the provisional drawing area to display the swipe snapshot as it may differ from the one currently associated with the page in case of process swap. * WebKit.xcodeproj/project.pbxproj: Add ProvisionalPageProxy class. * WebProcess/WebPage/WebFrame.cpp: (WebKit::toPolicyAction): (WebKit::WebFrame::didReceivePolicyDecision): * WebProcess/WebPage/WebPage.cpp: (WebKit::m_shouldAttachDrawingAreaOnPageTransition): (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::didReceivePolicyDecision): Stop dealing with WebPolicyAction::Suspend as it no longer exists. (WebKit::WebPage::didCompletePageTransition): (WebKit::WebPage::setIsSuspended): Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend. setIsSuspended(true) IPC is sent when we actually commit the provisional page. * WebProcess/WebPage/WebPage.h: Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: (-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): LayoutTests: Skip test testing the cross-process DOMWindow API as I broke it with this patch. The feature is far from ready and off by default anyway. I will add support back in a follow-up. * platform/wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240046 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-16 Chris Dumez <cdumez@apple.com> Regression(PSON) View becomes blank after click a cross-site download link https://bugs.webkit.org/show_bug.cgi?id=193361 <rdar://problem/47099573> Reviewed by Geoffrey Garen. * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When restoring from PageCache, make sure we notify the client that the load was committed *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy logic in the UIProcess. 2019-01-22 Alan Coon <alancoon@apple.com> Cherry-pick r240015. rdar://problem/47099573 Unreviewed, rolling out r239993, r239995, r239997, and r239999. Caused assertions under ViewGestureController::disconnectFromProcess() Reverted changesets: "Regression(PSON) View becomes blank after click a cross-site download link" https://bugs.webkit.org/show_bug.cgi?id=193361 https://trac.webkit.org/changeset/239993 "Unreviewed iOS build fix after r239993." https://trac.webkit.org/changeset/239995 "Fix iOS build after r239993" https://bugs.webkit.org/show_bug.cgi?id=193361 https://trac.webkit.org/changeset/239997 "Unreviewed, revert part of r239997 as it is not needed to fix the build." https://trac.webkit.org/changeset/239999 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240015 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-15 Chris Dumez <cdumez@apple.com> Unreviewed, rolling out r239993, r239995, r239997, and r239999. Caused assertions under ViewGestureController::disconnectFromProcess() Reverted changesets: "Regression(PSON) View becomes blank after click a cross-site download link" https://bugs.webkit.org/show_bug.cgi?id=193361 https://trac.webkit.org/changeset/239993 "Unreviewed iOS build fix after r239993." https://trac.webkit.org/changeset/239995 "Fix iOS build after r239993" https://bugs.webkit.org/show_bug.cgi?id=193361 https://trac.webkit.org/changeset/239997 "Unreviewed, revert part of r239997 as it is not needed to fix the build." https://trac.webkit.org/changeset/239999 2019-01-22 Alan Coon <alancoon@apple.com> Cherry-pick r239993. rdar://problem/47099573 Regression(PSON) View becomes blank after click a cross-site download link https://bugs.webkit.org/show_bug.cgi?id=193361 <rdar://problem/47099573> Reviewed by Geoff Garen. Source/WebCore: * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When restoring from PageCache, make sure we notify the client that the load was committed *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy logic in the UIProcess. Source/WebKit: The issue tracked by rdar://problem/47099573 is that a provisional load may get canceled (or converted into a download) *after* we've decided to process-swap. In such cases, the view should keep displaying the current site and it should still be interactive. However, with the previous PSON model, the view (pageProxy) would have already swapped to the new process and would end up displaying the initially empty document. To address the issue, this patch introduces the concept of a provisional load in the UIProcess, handled by a ProvisionalPageProxy which has its own privisional process. The WebPageProxy owns the ProvisionalPageProxy but we do not commit the provisional page until after the load was committed in the new process. This means that the view / WebPageProxy keeps using the old process and displays the current content until a load has committed in the provisional page. If no load commits in the provisional process (e.g. because the load is cancelled or converted into a download), then we merely destroy the ProvisionalPageProxy and terminate its process, without impacting the WebPageProxy. * Shared/WebPageCreationParameters.cpp: (WebKit::WebPageCreationParameters::encode const): (WebKit::WebPageCreationParameters::decode): * Shared/WebPageCreationParameters.h: Rename isSwapFromSuspended to isProcessSwap for clarity as we always want to delay attaching the drawing area in case of a process-swap, no matter what now that the previous process is kept alive until the provisional load is committed in the new process. * Shared/WebPolicyAction.h: Drop Suspend policy action. At decidePolicyForNavigationAction time, in case of process-swap, we now tell the previous process to simply ignore the load, while we create a ProvisionalPageProxy to do the new load in a new process. Suspension of the previous page in the old process, happens later, when a load is actually committed in the new process. * Sources.txt: Add new ProvisionalPageProxy file. * UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView _killWebContentProcessAndResetState]): When calling _killWebContentProcessAndResetState on a WKWebView, kill both the current process and the provisional one, to maintain previous behavior in our API tests. * UIProcess/PageClient.h: Tiny build fix. * UIProcess/ProvisionalPageProxy.cpp: Added. (WebKit::ProvisionalPageProxy::ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::~ProvisionalPageProxy): (WebKit::ProvisionalPageProxy::takeDrawingArea): (WebKit::ProvisionalPageProxy::cancel): (WebKit::ProvisionalPageProxy::initializeWebPage): (WebKit::ProvisionalPageProxy::loadDataWithNavigation): (WebKit::ProvisionalPageProxy::loadRequestWithNavigation): (WebKit::ProvisionalPageProxy::goToBackForwardItem): (WebKit::ProvisionalPageProxy::didCreateMainFrame): (WebKit::ProvisionalPageProxy::didStartProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didFailProvisionalLoadForFrame): (WebKit::ProvisionalPageProxy::didCommitLoadForFrame): (WebKit::ProvisionalPageProxy::didReceiveMessage): (WebKit::ProvisionalPageProxy::didReceiveSyncMessage): * UIProcess/ProvisionalPageProxy.h: Added. (WebKit::ProvisionalPageProxy::page): (WebKit::ProvisionalPageProxy::mainFrame const): (WebKit::ProvisionalPageProxy::process): (WebKit::ProvisionalPageProxy::processSwapRequestedByClient const): (WebKit::ProvisionalPageProxy::navigationID const): Add new ProvisionalPageProxy class to wrap the provisional load in the new process after a swap. The provisional page is owned by the WebPageProxy and we only commit the provisional page when the load is committed. Until then, the WebPageProxy keeps using the old process and displaying the current content. * UIProcess/SuspendedPageProxy.cpp: (WebKit::SuspendedPageProxy::~SuspendedPageProxy): (WebKit::SuspendedPageProxy::unsuspend): (WebKit::SuspendedPageProxy::didProcessRequestToSuspend): Unregister the SuspendedPageProxy as an IPC message receiver a little bit earlier when we're going to unsuspend it. This avoids conflicting with the ProvisionalPageProxy which tries to register itself as an IPC message receiver for the same pageID when a process-swap occurs and we're switching to a suspended page. * UIProcess/WebFrameProxy.cpp: (WebKit::WebFrameProxy::isMainFrame const): WebFrameProxy::isMainFrame() relies on checking that the frame is the WebPageProxy's m_mainFrame. Now that the WebPageProxy can have a ProvisionalPageProxy, also check if it is the ProvisionalPageProxy's m_mainFrame to maintain previous behavior. * UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::swapToWebProcess): swapToWebProcess() no longer takes care of unsuspending the SuspendedPage because we now call swapToWebProcess() later, when a load is actually committed in the provisional page / process. swapToWebProcess() now also needs to initialize some data members such as the drawing area and the main frame as it is transferring them over from the ProvisionalPageProxy which started the provisional load. (WebKit::WebPageProxy::finishAttachingToWebProcess): We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been committed in the provisional process. (WebKit::WebPageProxy::initializeWebPage): - We no longer need IsSwapFromSuspended parameter as this is called later now, after a load has actually been committed in the provisional process. - Factor some code out to WebPageProxy::setDrawingArea() so that it can be shared with swapToWebProcess(). (WebKit::WebPageProxy::loadRequestWithNavigation): Only call setPendingAPIRequestURL() in loadRequestWithNavigation() only if ShouldTreatAsContinuingLoad is not Yes. This avoids hitting some assertions as this was already called during the first API call if needed. (WebKit::WebPageProxy::receivedNavigationPolicyDecision): In case of process swap, tell the previous process to ignore the load instead of suspending it right away. Suspension now happens later, only if we end up committing the provisional load in the new process. Also discard the SuspendedPage if it failed to suspend (we only reuse its process in this case). This used to happen a bit later but it is clearer if we do this as early as possible I think. (WebKit::WebPageProxy::commitProvisionalPage): When the load is committed in the new process, we call WebPageProxy::commitProvisionalPage(). It takes care of: - Actually swapping the WebPageProxy to the new process by calling processDidTerminate() / swapToWebProcess(). - Suspending the current page. - Letting the client know the load is comitted - Destroy the ProvisionalPageProxy. This work used to happen earlier in continueNavigationInNewProcess(). (WebKit::WebPageProxy::continueNavigationInNewProcess): Moved some of the logic to commitProvisionalPage(). We now merely start the load in a new ProvisionalPageProxy, without actually having the WebPageProxy switch to the new process yet. (WebKit::WebPageProxy::didCreateMainFrame): (WebKit::WebPageProxy::didCreateWindow): Drop some code that is no longer needed, now that the ProvisionalPageProxy takes care of this. (WebKit::WebPageProxy::didDestroyNavigation): On process-swap, when telling the previous process to ignore the load and starting the new load in a new ProvisionalPageProxy, the previous WebPage attempts to destroy the navigation. In this case, we ignore the call since the navigation is merely taken over by the ProvisionalPageProxy. (WebKit::WebPageProxy::didStartProvisionalLoadForFrame): Moved some PSON logic to the ProvisionalPageProxy instead. (WebKit::WebPageProxy::didFailProvisionalLoadForFrame): When didFailProvisionalLoadForFrame() is called for a ProvisionalPageProxy, destroy it. (WebKit::WebPageProxy::decidePolicyForNavigationActionAsync): (WebKit::WebPageProxy::decidePolicyForResponse): Capture the process in the lambda, to make sure we send the policy decision to the same process that asked for it, so as to not get confused by process swaps. (WebKit::WebPageProxy::resetState): Drop some code that is no longer needed. (WebKit::WebPageProxy::creationParameters): Move the hasRegisteredServiceWorkers flag initialization from the call site to here now that we have more than one call site. This was just some bad factoring. (WebKit::WebPageProxy::PageProcessOverride::PageProcessOverride): (WebKit::WebPageProxy::PageProcessOverride::~PageProcessOverride): * UIProcess/WebPageProxy.h: (WebKit::WebPageProxy::temporarilyOverrideProcess): Add utility class to temporarily override the WebPageProxy's m_process with the provisional one when the ProvisionalPageProxy interacts with the WebPageProxy. * UIProcess/WebProcessProxy.cpp: (WebKit::WebProcessProxy::hasProvisionalPageWithID const): (WebKit::WebProcessProxy::updateBackForwardItem): Before updating a BackForwardListItem, we normally make sure the process has a WebPageProxy with the item's pageID. We have to tweak the logic because there may now be no WebPageProxy with this pageID associated with this process yet, because it is still a ProvisionalPageProxy. (WebKit::WebProcessProxy::canTerminateChildProcess): Do not terminate the WebProcess if there are ProvisionalPageProxy objects using it. * UIProcess/WebProcessProxy.h: (WebKit::WebProcessProxy::addProvisionalPageProxy): (WebKit::WebProcessProxy::removeProvisionalPageProxy): * WebKit.xcodeproj/project.pbxproj: * WebProcess/WebPage/WebFrame.cpp: (WebKit::toPolicyAction): (WebKit::WebFrame::didReceivePolicyDecision): Stop dealing with WebPolicyAction::Suspend as it no longer exists. * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::reinitializeWebPage): (WebKit::WebPage::didReceivePolicyDecision): (WebKit::WebPage::setIsSuspended): Suspend the Page when setIsSuspended(true) is called, now that there is no longer a WebPolicyAction::Suspend. setIsSuspended(true) IPC is sent when we actually commit the provisional page. * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm: (WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea): Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: (-[PSONNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]): LayoutTests: Skip test testing the cross-process DOMWindow API as I broke it with this patch. The feature is far from ready and off by default anyway. I will add support back in a follow-up. * platform/wk2/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239993 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-15 Chris Dumez <cdumez@apple.com> Regression(PSON) View becomes blank after click a cross-site download link https://bugs.webkit.org/show_bug.cgi?id=193361 <rdar://problem/47099573> Reviewed by Geoff Garen. * loader/FrameLoader.cpp: (WebCore::FrameLoader::commitProvisionalLoad): When restoring from PageCache, make sure we notify the client that the load was committed *before* we tell it that the navigation is complete. This would confuse the ProvisionalPageProxy logic in the UIProcess. 2019-01-16 Alan Coon <alancoon@apple.com> Apply patch. rdar://problem/47260377 Cherry-pick r240039. rdar://problem/47260377 IndexedDB: leak WebIDBConnectionToClient for retain cycle https://bugs.webkit.org/show_bug.cgi?id=193097 <rdar://problem/46899601> Reviewed by David Kilzer. Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself. * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: git-svn-id: http://svn.webkit.org/repository/webkit/trunk@240039 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-16 David Kilzer <ddkilzer@apple.com> Cherry-pick r240039. rdar://problem/47260377 2019-01-16 Sihui Liu <sihui_liu@apple.com> IndexedDB: leak WebIDBConnectionToClient for retain cycle https://bugs.webkit.org/show_bug.cgi?id=193097 <rdar://problem/46899601> Reviewed by David Kilzer. Fix API test failure after r239887. After removing the retain cycle, IDBConnectionToClient will no longer live forever so make sure it is not destructed before UniqueIDBDatabaseConnection unregisters itself. * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection): (WebCore::IDBServer::UniqueIDBDatabaseConnection::fireVersionChangeEvent): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCommitTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didClearObjectStore): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didCreateIndex): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didDeleteIndex): (WebCore::IDBServer::UniqueIDBDatabaseConnection::didRenameIndex): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: 2019-01-16 Alan Coon <alancoon@apple.com> Apply patch. rdar://problem/47260377 Cherry-pick r239887. rdar://problem/47260377 IndexedDB: leak WebIDBConnectionToClient for retain cycle https://bugs.webkit.org/show_bug.cgi?id=193097 <rdar://problem/46899601> Reviewed by Brady Eidson. Source/WebCore: Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate. * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient): (WebCore::IDBServer::IDBConnectionToClient::identifier const): (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase): (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase): (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction): (WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex): (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex): (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex): (WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd): (WebCore::IDBServer::IDBConnectionToClient::didGetRecord): (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords): (WebCore::IDBServer::IDBConnectionToClient::didGetCount): (WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord): (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor): (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor): (WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction): (WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent): (WebCore::IDBServer::IDBConnectionToClient::didStartTransaction): (WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer): (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked): (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames): * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: Source/WebKit: Let WebIDBConnectionToClient hold reference to IPC::Connection instead of NetworkConnectionToWebProcess to break the cycle. * NetworkProcess/IndexedDB/WebIDBConnectionToClient.cpp: (WebKit::WebIDBConnectionToClient::create): (WebKit::WebIDBConnectionToClient::WebIDBConnectionToClient): (WebKit::WebIDBConnectionToClient::messageSenderConnection): * NetworkProcess/IndexedDB/WebIDBConnectionToClient.h: * NetworkProcess/NetworkConnectionToWebProcess.cpp: (WebKit::NetworkConnectionToWebProcess::establishIDBConnectionToServer): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@239887 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-16 David Kilzer <ddkilzer@apple.com> Cherry-pick r239887. rdar://problem/47260377 2019-01-11 Sihui Liu <sihui_liu@apple.com> IndexedDB: leak WebIDBConnectionToClient for retain cycle https://bugs.webkit.org/show_bug.cgi?id=193097 <rdar://problem/46899601> Reviewed by Brady Eidson. Let IDBConnectionToClient hold a WeakPtr of IDBConnectionToClientDelegate. * Modules/indexeddb/server/IDBConnectionToClient.cpp: (WebCore::IDBServer::IDBConnectionToClient::IDBConnectionToClient): (WebCore::IDBServer::IDBConnectionToClient::identifier const): (WebCore::IDBServer::IDBConnectionToClient::didDeleteDatabase): (WebCore::IDBServer::IDBConnectionToClient::didOpenDatabase): (WebCore::IDBServer::IDBConnectionToClient::didAbortTransaction): (WebCore::IDBServer::IDBConnectionToClient::didCreateObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didDeleteObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didRenameObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didClearObjectStore): (WebCore::IDBServer::IDBConnectionToClient::didCreateIndex): (WebCore::IDBServer::IDBConnectionToClient::didDeleteIndex): (WebCore::IDBServer::IDBConnectionToClient::didRenameIndex): (WebCore::IDBServer::IDBConnectionToClient::didPutOrAdd): (WebCore::IDBServer::IDBConnectionToClient::didGetRecord): (WebCore::IDBServer::IDBConnectionToClient::didGetAllRecords): (WebCore::IDBServer::IDBConnectionToClient::didGetCount): (WebCore::IDBServer::IDBConnectionToClient::didDeleteRecord): (WebCore::IDBServer::IDBConnectionToClient::didOpenCursor): (WebCore::IDBServer::IDBConnectionToClient::didIterateCursor): (WebCore::IDBServer::IDBConnectionToClient::didCommitTransaction): (WebCore::IDBServer::IDBConnectionToClient::fireVersionChangeEvent): (WebCore::IDBServer::IDBConnectionToClient::didStartTransaction): (WebCore::IDBServer::IDBConnectionToClient::didCloseFromServer): (WebCore::IDBServer::IDBConnectionToClient::notifyOpenDBRequestBlocked): (WebCore::IDBServer::IDBConnectionToClient::didGetAllDatabaseNames): * Modules/indexeddb/server/IDBConnectionToClient.h: * Modules/indexeddb/server/IDBConnectionToClientDelegate.h: 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239904. rdar://problem/4726030 Have prefers-color-scheme: light always match on macOS versions before Mojave. https://bugs.webkit.org/show_bug.cgi?id=191655 rdar://problem/46074680 Reviewed by Megan Gardner. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions. Source/WebCore: Tests: css-dark-mode/older-systems/prefers-color-scheme.html css-dark-mode/older-systems/supported-color-schemes-css.html css-dark-mode/older-systems/supported-color-schemes.html Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code. Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems. * Configurations/FeatureDefines.xcconfig: * dom/Document.cpp: (WebCore::Document::useDarkAppearance const): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::enable): * page/Page.cpp: (WebCore::Page::setUseDarkAppearance): (WebCore::Page::useDarkAppearance const): (WebCore::Page::setUseDarkAppearanceOverride): * platform/mac/LocalDefaultSystemAppearance.h: (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): * platform/mac/LocalDefaultSystemAppearance.mm: (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): * platform/mac/ScrollAnimatorMac.mm: * rendering/RenderThemeMac.mm: (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]): (-[WebListButtonCell drawWithFrame:inView:]): (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): (WebCore::RenderThemeMac::systemColor const): Source/WebCore/PAL: * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions. Source/WebKit: * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions. * UIProcess/Cocoa/WebViewImpl.mm: (WebKit::WebViewImpl::effectiveAppearanceIsDark): * UIProcess/RemoteLayerTree/mac/ScrollerMac.mm: Source/WebKitLegacy/mac: * Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions. * WebView/WebView.mm: (-[WebView _effectiveAppearanceIsDark]): Source/WTF: * wtf/Platform.h: Define HAVE_OS_DARK_MODE_SUPPORT on macOS 10.14. Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: ENABLE_DARK_MODE_CSS_macosx for all OS versions. * TestWebKitAPI/Tests/WebKit/mac/ForceLightAppearanceInBundle.mm: LayoutTests: * css-dark-mode/older-systems/prefers-color-scheme-expected.txt: Added. * css-dark-mode/older-systems/prefers-color-scheme.html: Added. * css-dark-mode/older-systems/supported-color-schemes-css-expected.txt: Added. * css-dark-mode/older-systems/supported-color-schemes-css.html: Added. * css-dark-mode/older-systems/supported-color-schemes-expected.txt: Added. * css-dark-mode/older-systems/supported-color-schemes.html: Added. * platform/mac/TestExpectations: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239904 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-12 Timothy Hatcher <timothy@apple.com> Have prefers-color-scheme: light always match on macOS versions before Mojave. https://bugs.webkit.org/show_bug.cgi?id=191655 rdar://problem/46074680 Reviewed by Megan Gardner. Tests: css-dark-mode/older-systems/prefers-color-scheme.html css-dark-mode/older-systems/supported-color-schemes-css.html css-dark-mode/older-systems/supported-color-schemes.html Use new HAVE(OS_DARK_MODE_SUPPORT) to make it easier to find code. Added HAVE(OS_DARK_MODE_SUPPORT) around more bits to make it work on older systems. * Configurations/FeatureDefines.xcconfig: * dom/Document.cpp: (WebCore::Document::useDarkAppearance const): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::enable): * page/Page.cpp: (WebCore::Page::setUseDarkAppearance): (WebCore::Page::useDarkAppearance const): (WebCore::Page::setUseDarkAppearanceOverride): * platform/mac/LocalDefaultSystemAppearance.h: (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): * platform/mac/LocalDefaultSystemAppearance.mm: (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): * platform/mac/ScrollAnimatorMac.mm: * rendering/RenderThemeMac.mm: (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]): (-[WebListButtonCell drawWithFrame:inView:]): (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): (WebCore::RenderThemeMac::systemColor const): 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239889. rdar://problem/47260233 REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC() https://bugs.webkit.org/show_bug.cgi?id=193342 <rdar://problem/47119836> Reviewed by Eric Carlson. Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted. * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::initCallback): (WebCore::AudioSourceProviderAVFObjC::finalizeCallback): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239889 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-11 Jer Noble <jer.noble@apple.com> REGRESSION(r239419): Crash in AudioSourceProviderAVFObjC::~AudioSourceProviderAVFObjC() https://bugs.webkit.org/show_bug.cgi?id=193342 <rdar://problem/47119836> Reviewed by Eric Carlson. Make the TapStorage used by AudioSourceProviderAVFObjC thread-safe RefCounted. * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.h: * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::initCallback): (WebCore::AudioSourceProviderAVFObjC::finalizeCallback): 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239888. rdar://problem/47260286 Compile out Web API Statistics Collection https://bugs.webkit.org/show_bug.cgi?id=193370 <rdar://problem/45388584> Reviewed by Brent Fulgham. Source/JavaScriptCore: * Configurations/FeatureDefines.xcconfig: Defined ENABLE_WEB_API_STATISTICS, off by default. Source/WebCore: No new tests. This patch disables functionality. The associated tests are skipped. These functions are now no-ops unless web API statistics is enabled. * Configurations/FeatureDefines.xcconfig: * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logFontLoad): (WebCore::ResourceLoadObserver::logCanvasRead): (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure): (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed): (WebCore::ResourceLoadObserver::logScreenAPIAccessed): * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::encode const): (WebCore::ResourceLoadStatistics::decode): (WebCore::ResourceLoadStatistics::toString const): (WebCore::ResourceLoadStatistics::merge): * loader/ResourceLoadStatistics.h: The associated struct members are skipped unless web API statistics is enabled. Source/WebCore/PAL: * Configurations/FeatureDefines.xcconfig: Defined ENABLE_WEB_API_STATISTICS, off by default. Source/WebKit: * Configurations/FeatureDefines.xcconfig: Defined ENABLE_WEB_API_STATISTICS, off by default. * Shared/WebCoreArgumentCoders.cpp: (IPC::ArgumentCoder<ResourceLoadStatistics>::encode): Skipped encoding of web API statistics. (IPC::ArgumentCoder<ResourceLoadStatistics>::decode): Skipped decoding of web API statistics. Source/WebKitLegacy/mac: * Configurations/FeatureDefines.xcconfig: Defined ENABLE_WEB_API_STATISTICS, off by default. Tools: * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Defined ENABLE_WEB_API_STATISTICS, off by default. LayoutTests: * platform/ios-wk2/TestExpectations: http/tests/webAPIStatistics skipped. * platform/mac-wk2/TestExpectations: http/tests/webAPIStatistics skipped. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239888 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-11 John Wilander <wilander@apple.com> Compile out Web API Statistics Collection https://bugs.webkit.org/show_bug.cgi?id=193370 <rdar://problem/45388584> Reviewed by Brent Fulgham. No new tests. This patch disables functionality. The associated tests are skipped. These functions are now no-ops unless web API statistics is enabled. * Configurations/FeatureDefines.xcconfig: * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logFontLoad): (WebCore::ResourceLoadObserver::logCanvasRead): (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure): (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed): (WebCore::ResourceLoadObserver::logScreenAPIAccessed): * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::encode const): (WebCore::ResourceLoadStatistics::decode): (WebCore::ResourceLoadStatistics::toString const): (WebCore::ResourceLoadStatistics::merge): * loader/ResourceLoadStatistics.h: The associated struct members are skipped unless web API statistics is enabled. 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239880. rdar://problem/47260310 REGRESSION (PSON): Firefox app lacks Open in New Tab in menu https://bugs.webkit.org/show_bug.cgi?id=193366 <rdar://problem/46097212> Reviewed by Simon Fraser. Source/WebCore: * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isFirefox): Add a Firefox Mobile bundle check. Source/WebKit: A pair of unrelated changes broke Firefox's use of WKWebView internals to override the long-press menu. Maintain binary compatibility by introducing linked-on-or-after checks. * UIProcess/Cocoa/VersionChecks.h: * UIProcess/WebProcessPool.cpp: (WebKit::WebProcessPool::createWebPage): Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default. Because gestures are very stateful, we always swap them out when swapping processes (changing that behavior is fairly risky). Also, we don't always inform the client when we swap processes (only when the process actually crashes), so they currently don't re-adjust the gesture recognizers when a PSON swap occurs. * UIProcess/ios/WKContentView.mm: (-[WKContentView _commonInitializationWithProcessPool:configuration:]): Synchronously install gesture recognizers under -init when linked against an SDK before the version that introduces lazy gesture recognizer installation. r237331 is an optimization that made us lazily install gestures when the view is parented, but Firefox (and potentially other clients) depend on them being installed synchronously in order to find and override them. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239880 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-11 Tim Horton <timothy_horton@apple.com> REGRESSION (PSON): Firefox app lacks Open in New Tab in menu https://bugs.webkit.org/show_bug.cgi?id=193366 <rdar://problem/46097212> Reviewed by Simon Fraser. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isFirefox): Add a Firefox Mobile bundle check. 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239877. rdar://problem/47260302 Release assert when removing element with a map element in the shadow tree https://bugs.webkit.org/show_bug.cgi?id=193351 <rdar://problem/47208807> Reviewed by Ryosuke Niwa. Source/WebCore: When a shadow host that has a map element in the shadow tree is removed from the document, we try to remove the map from the scope of the host. Test: fast/shadow-dom/image-map-tree-scope.html * html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::insertedIntoAncestor): (WebCore::HTMLMapElement::removedFromAncestor): Add and remove image maps when the scope changes, not when the document changes. This matches how id/name/etc updates work in the HTMLElement. LayoutTests: * fast/shadow-dom/image-map-tree-scope-expected.txt: Added. * fast/shadow-dom/image-map-tree-scope.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239877 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-11 Antti Koivisto <antti@apple.com> Release assert when removing element with a map element in the shadow tree https://bugs.webkit.org/show_bug.cgi?id=193351 <rdar://problem/47208807> Reviewed by Ryosuke Niwa. When a shadow host that has a map element in the shadow tree is removed from the document, we try to remove the map from the scope of the host. Test: fast/shadow-dom/image-map-tree-scope.html * html/HTMLMapElement.cpp: (WebCore::HTMLMapElement::insertedIntoAncestor): (WebCore::HTMLMapElement::removedFromAncestor): Add and remove image maps when the scope changes, not when the document changes. This matches how id/name/etc updates work in the HTMLElement. 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239865. rdar://problem/47260332 IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests https://bugs.webkit.org/show_bug.cgi?id=193167 <rdar://problem/46891688> Reviewed by Geoffrey Garen. Do some cleanup to break retain cycle when context is stopped. * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::cancelForStop): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::removeRequest): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::doComplete): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239865 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-11 Sihui Liu <sihui_liu@apple.com> IndexedDB: leak IDBTransaction, TransactionOperation and IDBRequest in layout tests https://bugs.webkit.org/show_bug.cgi?id=193167 <rdar://problem/46891688> Reviewed by Geoffrey Garen. Do some cleanup to break retain cycle when context is stopped. * Modules/indexeddb/IDBOpenDBRequest.cpp: (WebCore::IDBOpenDBRequest::cancelForStop): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::abortOnServerAndCancelRequests): (WebCore::IDBTransaction::stop): (WebCore::IDBTransaction::removeRequest): * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::TransactionOperation::doComplete): 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239857. rdar://problem/47260358 <video> elements do not enter 'paused' state when playing to end over AirPlay https://bugs.webkit.org/show_bug.cgi?id=193295 <rdar://problem/46708670> Reviewed by Eric Carlson. Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting for more data before playing. AirPlay devices report this state back from the remote device, and this allows the MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling. Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the readyState > HAVE_ENOUGH as an intentional pause. Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay() until the first frame became available. But this code was entirely undermined by the previous behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was actually requested started making this code work for the first time, and broke some API tests. Thus, we're removing this previously dead code. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::play): (WebCore::MediaPlayerPrivateAVFoundation::pause): (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239857 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-10 Jer Noble <jer.noble@apple.com> <video> elements do not enter 'paused' state when playing to end over AirPlay https://bugs.webkit.org/show_bug.cgi?id=193295 <rdar://problem/46708670> Reviewed by Eric Carlson. Adopt the -[AVPlayer timeControlStatus] API, which reports whether the AVPlayer is paused, playing, or blocked waiting for more data before playing. AirPlay devices report this state back from the remote device, and this allows the MediaPlayerPrivateAVFoundationObjC to differentiate between user-generated pauses and simple stalling. Adopting this API allows us to remove the heuristic from rateChanged() which inteprets a rate change when the readyState > HAVE_ENOUGH as an intentional pause. Drive-by fix: MediaPlayerPrivateAVFoundation had some code to delay calling platformPlay() until the first frame became available. But this code was entirely undermined by the previous behavior of setRate(). Fixing setRate()/setRateDouble() to only start playback if playback was actually requested started making this code work for the first time, and broke some API tests. Thus, we're removing this previously dead code. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::MediaPlayerPrivateAVFoundation): (WebCore::MediaPlayerPrivateAVFoundation::play): (WebCore::MediaPlayerPrivateAVFoundation::pause): (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): (WebCore::MediaPlayerPrivateAVFoundation::updateStates): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::cancelLoad): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::didEnd): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPlay): (WebCore::MediaPlayerPrivateAVFoundationObjC::platformPause): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime): (WebCore::MediaPlayerPrivateAVFoundationObjC::setRateDouble): (WebCore::MediaPlayerPrivateAVFoundationObjC::setPlayerRate): (WebCore::MediaPlayerPrivateAVFoundationObjC::timeControlStatusDidChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldObserveTimeControlStatus): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239847. rdar://problem/47260246 Fix rare crash under ScrollbarThemeMac::paintScrollCorner() https://bugs.webkit.org/show_bug.cgi?id=193337 rdar://problem/47179993 Reviewed by Zalan Bujtas. Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint, which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars() which tried to get at the platform context, and then crashed. So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified that other scrollbar-related painting code paths were already protected. Hard to test because it depends on async image decoding timing. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::paint): (WebCore::ScrollbarThemeMac::paintScrollCorner): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239847 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-10 Simon Fraser <simon.fraser@apple.com> Fix rare crash under ScrollbarThemeMac::paintScrollCorner() https://bugs.webkit.org/show_bug.cgi?id=193337 rdar://problem/47179993 Reviewed by Zalan Bujtas. Async image decoding can trigger a FrameView::traverseForPaintInvalidation() fake paint, which creates a GraphicsContext with no platform context. However, we could hit ScrollView::paintScrollbars() which tried to get at the platform context, and then crashed. So protect two functions in ScrollbarThemeMac with if (context.paintingDisabled()) checks. I verified that other scrollbar-related painting code paths were already protected. Hard to test because it depends on async image decoding timing. * platform/mac/ScrollbarThemeMac.mm: (WebCore::ScrollbarThemeMac::paint): (WebCore::ScrollbarThemeMac::paintScrollCorner): 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239833. rdar://problem/47260274 Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters https://bugs.webkit.org/show_bug.cgi?id=193309 <rdar://problem/45279224> Reviewed by Antoine Quint. A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters. The crash log indicates we crash in a Checked<> class that is not recording overflow i.e. it is crashing due to an overflow. The only place in this function where that could happen is when we convert the FloatRect for the backdrop region into a Checked<unsigned> for width and height. This suggests that either the width or height are negative, or the float values are too large for integers, or the product of the two overflows. Avoid this by using RecordOverflow, but also changing the code a little to bail if the rectangle is incorrect. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateBackdropFilters): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239833 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-09 Dean Jackson <dino@apple.com> Safari Crashing in Version 12.0.1 (14606.2.104.1.1) WebCore::GraphicsLayerCA::updateBackdropFilters https://bugs.webkit.org/show_bug.cgi?id=193309 <rdar://problem/45279224> Reviewed by Antoine Quint. A speculative fix for a CheckedArithmetic crash triggered in updateBackdropFilters. The crash log indicates we crash in a Checked<> class that is not recording overflow i.e. it is crashing due to an overflow. The only place in this function where that could happen is when we convert the FloatRect for the backdrop region into a Checked<unsigned> for width and height. This suggests that either the width or height are negative, or the float values are too large for integers, or the product of the two overflows. Avoid this by using RecordOverflow, but also changing the code a little to bail if the rectangle is incorrect. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateBackdropFilters): 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239814. rdar://problem/47260367 ThreadTimers should not store a raw pointer in its heap https://bugs.webkit.org/show_bug.cgi?id=192975 <rdar://problem/46893946> Reviewed by Geoffrey Garen. Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code, this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears the raw pointer back to TimerBase*. This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this hardening is to make it work even in the precense of such a bug). This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton. The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that layout tests run successfully without hitting any debug assertions. No new tests since there should be no observable behavior difference. * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h * platform/ThreadTimers.cpp: (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap, which should never happen. (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer from the heap since setNextFireTime does the removal already. * platform/ThreadTimers.h: Outdented the whole file. (WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~> doesn't have a copy constructor which is used by std::push_heap. (WebCore::ThreadTimerHeapItem): Added. (WebCore::ThreadTimerHeapItem::hasTimer const): Added. (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which signifies the item not being in the heap instead of all negative values as in the old code in TimerBase. (WebCore::ThreadTimerHeapItem::isInHeap const): Added. (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added. (WebCore::ThreadTimerHeapItem::timer): Added. (WebCore::ThreadTimerHeapItem::clearTimer): Added. (WebCore::ThreadTimerHeapItem::heapIndex const): Added. (WebCore::ThreadTimerHeapItem::setHeapIndex): Added. (WebCore::ThreadTimerHeapItem::timerHeap const): Added. * platform/Timer.cpp: (WebCore::threadGlobalTimerHeap): This function is now only used in assertions. (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added. (WebCore::ThreadTimerHeapItem::create): Added. (WebCore::TimerHeapPointer::TimerHeapPointer): (WebCore::TimerHeapPointer::operator-> const): (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor. (WebCore::TimerHeapReference::copyRef const): Added. (WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const): (WebCore::TimerHeapPointer::operator* const): (WebCore::TimerHeapReference::operator=): Use move assignment operator. (WebCore::TimerHeapReference::swapWith): (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=. (WebCore::swap): (WebCore::TimerHeapIterator::TimerHeapIterator): (WebCore::TimerHeapIterator::operator-> const): (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>. (WebCore::TimerHeapLessThanFunction::operator() const): (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem. (WebCore::TimerBase::stop): (WebCore::TimerBase::nextFireInterval const): (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap. (WebCore::TimerBase::checkConsistency const): (WebCore::TimerBase::heapDecreaseKey): (WebCore::TimerBase::heapDelete): (WebCore::TimerBase::heapDeleteMin): (WebCore::TimerBase::heapIncreaseKey): (WebCore::TimerBase::heapInsert): (WebCore::TimerBase::heapPop): (WebCore::TimerBase::heapPopMin): (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase. (WebCore::parentHeapPropertyHolds): (WebCore::childHeapPropertyHolds): (WebCore::TimerBase::hasValidHeapPosition const): (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called on an item with an invalid (-1) heap index. (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase is deleted. (WebCore::TimerHeapReference::operator TimerBase* const): Deleted. * platform/Timer.h: (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap by m_heapItem, RefPtr to an ThreadTimerHeapItem. (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::inHeap const): (WebCore::TimerBase::nextFireTime const): (WebCore::TimerBase::isActive const): (WebCore::TimerBase:: const): Deleted. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239814 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-09 Ryosuke Niwa <rniwa@webkit.org> ThreadTimers should not store a raw pointer in its heap https://bugs.webkit.org/show_bug.cgi?id=192975 <rdar://problem/46893946> Reviewed by Geoffrey Garen. Right now, ThreadTimers's heap data structure stores a raw pointer to TimerBase. In order to harden the timer code, this patch replaces it with ThreadTimerHeapItem, a newly introduced struct, which effectively acks like WeakReference<TimerBase*> as the timer heap and TimerBase both store RefPtr to it, and TimerBase's destructor clears the raw pointer back to TimerBase*. This approach was taken instead of an out-right adoptation of WeakPtr since the heap data structure requires each node in the heap to have a fixed "priority" yet WeakPtr with no valid pointer back to TimerBase would effectively lose its "priority" thereby corrupting the heap data structure. That is, each item in the heap must remember its fire time and insertion order even when the underlying TimerBase had gone away (this should never happen but the whole point of this hardening is to make it work even in the precense of such a bug). This patch also moves the heap index in TimerBase to ThreadTimerHeapItem, and replaces the pointer to the heap vector in TimerBase by a reference to ThreadTimers in ThreadTimerHeapItem. Note that ThreadTimers is a per-thread singleton. The correctness of this hardening was tested by commenting out the call to stop() and !isInHeap() assertion in TimerBase::~TimerBase() as well as the !isInHeap() assertion in ThreadTimerHeapItem::clearTimer() and observing that layout tests run successfully without hitting any debug assertions. No new tests since there should be no observable behavior difference. * WebCore.xcodeproj/project.pbxproj: Export ThreadTimers.h as a private header since it's now included in Timer.h * platform/ThreadTimers.cpp: (WebCore::ThreadTimers::updateSharedTimer): Delete ThreadTimerHeapItem's with nullptr TimerBase* (TimerBase had already been deleted). This should only happen when TimerBase's destructor failed to remove itself from the timer heap, which should never happen. (WebCore::ThreadTimers::sharedTimerFiredInternal): Ditto. Also removed the redundant code which had removed the timer from the heap since setNextFireTime does the removal already. * platform/ThreadTimers.h: Outdented the whole file. (WebCore::ThreadTimers::timerHeap): We use Vector<RefPtr<ThreadTimerHeapItem>> instead of Vector<Ref<~>> since Ref<~> doesn't have a copy constructor which is used by std::push_heap. (WebCore::ThreadTimerHeapItem): Added. (WebCore::ThreadTimerHeapItem::hasTimer const): Added. (WebCore::ThreadTimerHeapItem::setNotInHeap): Added. ThreadTimerHeapItem uses unsigned -1 as the single value which signifies the item not being in the heap instead of all negative values as in the old code in TimerBase. (WebCore::ThreadTimerHeapItem::isInHeap const): Added. (WebCore::ThreadTimerHeapItem::isFirstInHeap const): Added. (WebCore::ThreadTimerHeapItem::timer): Added. (WebCore::ThreadTimerHeapItem::clearTimer): Added. (WebCore::ThreadTimerHeapItem::heapIndex const): Added. (WebCore::ThreadTimerHeapItem::setHeapIndex): Added. (WebCore::ThreadTimerHeapItem::timerHeap const): Added. * platform/Timer.cpp: (WebCore::threadGlobalTimerHeap): This function is now only used in assertions. (WebCore::ThreadTimerHeapItem::ThreadTimerHeapItem): Added. (WebCore::ThreadTimerHeapItem::create): Added. (WebCore::TimerHeapPointer::TimerHeapPointer): (WebCore::TimerHeapPointer::operator-> const): (WebCore::TimerHeapReference::TimerHeapReference): Added a copy constructor. (WebCore::TimerHeapReference::copyRef const): Added. (WebCore::TimerHeapReference::operator RefPtr<ThreadTimerHeapItem>& const): (WebCore::TimerHeapPointer::operator* const): (WebCore::TimerHeapReference::operator=): Use move assignment operator. (WebCore::TimerHeapReference::swapWith): (WebCore::TimerHeapReference::updateHeapIndex): Extracted to share code between two verions of operator=. (WebCore::swap): (WebCore::TimerHeapIterator::TimerHeapIterator): (WebCore::TimerHeapIterator::operator-> const): (WebCore::TimerHeapLessThanFunction::compare): Added variants which take RefPtr<ThreadTimerHeapItem>. (WebCore::TimerHeapLessThanFunction::operator() const): (WebCore::TimerBase::TimerBase): (WebCore::TimerBase::~TimerBase):Clear the raw pointer in ThreadTimerHeapItem. (WebCore::TimerBase::stop): (WebCore::TimerBase::nextFireInterval const): (WebCore::TimerBase::checkHeapIndex const): Added the consistency check for other items in the heap. (WebCore::TimerBase::checkConsistency const): (WebCore::TimerBase::heapDecreaseKey): (WebCore::TimerBase::heapDelete): (WebCore::TimerBase::heapDeleteMin): (WebCore::TimerBase::heapIncreaseKey): (WebCore::TimerBase::heapInsert): (WebCore::TimerBase::heapPop): (WebCore::TimerBase::heapPopMin): (WebCore::TimerBase::heapDeleteNullMin): Added. Used to delete ThreadTimerHeapItem which no longer has a valid TimerBase. (WebCore::parentHeapPropertyHolds): (WebCore::childHeapPropertyHolds): (WebCore::TimerBase::hasValidHeapPosition const): (WebCore::TimerBase::updateHeapIfNeeded): Tweaked the heap index assertion as heapIndex() itself would assert when called on an item with an invalid (-1) heap index. (WebCore::TimerBase::setNextFireTime): Create ThreadTimerHeapItem. Note m_heapItem is never cleared until this TimerBase is deleted. (WebCore::TimerHeapReference::operator TimerBase* const): Deleted. * platform/Timer.h: (WebCore::TimerBase): Replaced m_nextFireTime, m_heapIndex, m_heapInsertionOrder, and m_cachedThreadGlobalTimerHeap by m_heapItem, RefPtr to an ThreadTimerHeapItem. (WebCore::TimerBase::augmentFireInterval): (WebCore::TimerBase::inHeap const): (WebCore::TimerBase::nextFireTime const): (WebCore::TimerBase::isActive const): (WebCore::TimerBase:: const): Deleted. 2019-01-15 Alan Coon <alancoon@apple.com> Cherry-pick r239786. rdar://problem/47260219 [Datalist] Crash when input with datalist is dynamically added. https://bugs.webkit.org/show_bug.cgi?id=193012 <rdar://problem/45923457> Reviewed by Brent Fulgham. Source/WebCore: In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree to see whether the input needs datalist related items. The list attribute is simply not set yet. This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032). Test: fast/forms/datalist/datalist-crash-when-dynamic.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::attributeChanged): (WebCore::TextFieldInputType::createDataListDropdownIndicator): * html/TextFieldInputType.h: LayoutTests: * fast/forms/datalist/datalist-crash-when-dynamic-expected.txt: Added. * fast/forms/datalist/datalist-crash-when-dynamic.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239786 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-09 Zalan Bujtas <zalan@apple.com> [Datalist] Crash when input with datalist is dynamically added. https://bugs.webkit.org/show_bug.cgi?id=193012 <rdar://problem/45923457> Reviewed by Brent Fulgham. In certain cases (cloning, setAttribute), it's too early to check for the list attribute in createShadowSubtree to see whether the input needs datalist related items. The list attribute is simply not set yet. This patch only addresses the obvious crash. m_dataListDropdownIndicator clearly lacks proper lifecycle management (see webkit.org/b/193032). Test: fast/forms/datalist/datalist-crash-when-dynamic.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::createShadowSubtree): (WebCore::TextFieldInputType::attributeChanged): (WebCore::TextFieldInputType::createDataListDropdownIndicator): * html/TextFieldInputType.h: 2019-01-09 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r239758. rdar://problem/47158613 Blob references for System Previews don't get a correct file extension https://bugs.webkit.org/show_bug.cgi?id=193268 <rdar://problem/47133037> Reviewed by Tim Horton. Source/WebCore: Apple platforms don't yet have a mapping from the USD MIME type to file extensions (and we support some non-standard MIME types), which means that downloads from Blob references don't get correctly named. Fix this by adding an explicit mapping between System Preview types and ".usdz". WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since this applies to macOS and iOS now. * platform/MIMETypeRegistry.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping for USDZ. Tools: New test that a Blob download of a USDZ file gets named correctly. * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WebKitCocoa/Download.mm: (-[BlobWithUSDZExtensionDownloadDelegate _download:decideDestinationWithSuggestedFilename:completionHandler:]): (-[BlobWithUSDZExtensionDownloadDelegate _downloadDidFinish:]): (TEST): * TestWebKitAPI/Tests/WebKitCocoa/SystemPreviewBlobNaming.html: Added. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239758 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-08 Dean Jackson <dino@apple.com> Blob references for System Previews don't get a correct file extension https://bugs.webkit.org/show_bug.cgi?id=193268 <rdar://problem/47133037> Reviewed by Tim Horton. Apple platforms don't yet have a mapping from the USD MIME type to file extensions (and we support some non-standard MIME types), which means that downloads from Blob references don't get correctly named. Fix this by adding an explicit mapping between System Preview types and ".usdz". WebKit API test: _WKDownload.SystemPreviewUSDZBlobNaming * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): Remove USE(SYSTEM_PREVIEW) since this applies to macOS and iOS now. * platform/MIMETypeRegistry.h: * platform/cocoa/MIMETypeRegistryCocoa.mm: (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): Add a mapping for USDZ. 2019-01-09 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r239746. rdar://problem/47158728 IDB storage of Crypto keys does not work in private browsing mode https://bugs.webkit.org/show_bug.cgi?id=193219 Reviewed by Brady Eidson. Source/WebCore: https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization. This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object. To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject. If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject. Covered by updated test. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM): (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState): * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWrapper.cpp: (WebCore::JSDOMObject::JSDOMObject): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpArrayBufferView): (WebCore::CloneSerializer::toJSArrayBuffer): LayoutTests: Activate private browsing mode for these two tests. * crypto/subtle/rsa-indexeddb-non-exportable-private.html: * crypto/subtle/rsa-indexeddb-private.html: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239746 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-08 Youenn Fablet <youenn@apple.com> IDB storage of Crypto keys does not work in private browsing mode https://bugs.webkit.org/show_bug.cgi?id=193219 Reviewed by Brady Eidson. https://trac.webkit.org/changeset/238677 moved from using a JSGlobalObject to a JSDOMGlobalObject for serialization/deserialization. This does not work for crypto keys as they require not only a JSDOMGlobalObject but either a window or worker global object. To fix the issue, revert 238677, and fix it by checking whether the dumping of an ArrayBuffer happens for a JSDOMGlobalObject or a JSGlobalObject. If it is the latter, use JSC routines instead of toJS() which requires a JSDOMGlobalObject. Covered by updated test. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM): (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState): * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWrapper.cpp: (WebCore::JSDOMObject::JSDOMObject): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpArrayBufferView): (WebCore::CloneSerializer::toJSArrayBuffer): 2019-01-09 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r239715. rdar://problem/47158638 Crash in SWServer::Connection::resolveRegistrationReadyRequests https://bugs.webkit.org/show_bug.cgi?id=193217 Reviewed by Chris Dumez. As can be seen from the traces, SWServer might clear its connections HashMap in its destructor. This might then trigger calling SWServer::resolveRegistrationReadyRequests. This method is iterating on the connections HashMap which is being cleared. To remove this problem, move the HashMap in a temporary variable and clear the temporary variable. * workers/service/server/SWServer.cpp: (WebCore::SWServer::~SWServer): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239715 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-07 Youenn Fablet <youenn@apple.com> Crash in SWServer::Connection::resolveRegistrationReadyRequests https://bugs.webkit.org/show_bug.cgi?id=193217 Reviewed by Chris Dumez. As can be seen from the traces, SWServer might clear its connections HashMap in its destructor. This might then trigger calling SWServer::resolveRegistrationReadyRequests. This method is iterating on the connections HashMap which is being cleared. To remove this problem, move the HashMap in a temporary variable and clear the temporary variable. * workers/service/server/SWServer.cpp: (WebCore::SWServer::~SWServer): 2019-01-09 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r239711. rdar://problem/47158701 REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53 https://bugs.webkit.org/show_bug.cgi?id=193211 <rdar://problem/46937412> Reviewed by Eric Carlson. Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in std::unique_ptrs, and not in Ref or RefPtr. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239711 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-07 Jer Noble <jer.noble@apple.com> REGRESSION (r239519): ASSERTION FAILED: !m_adoptionIsRequired in com.apple.WebCore: void WTF::refIfNotNull<WebCore::CDMSessionMediaSourceAVFObjC> + 53 https://bugs.webkit.org/show_bug.cgi?id=193211 <rdar://problem/46937412> Reviewed by Eric Carlson. Make CDMSessionMediaSourceAVFObjC a CanMakeWeakPtr rather than RefCounted, as CDMSessions are stored in std::unique_ptrs, and not in Ref or RefPtr. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): 2019-01-09 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r239702. rdar://problem/47158664 Cleanup AudioTrackPrivateMediaStreamCocoa https://bugs.webkit.org/show_bug.cgi?id=193208 <rdar://problem/42225870> Reviewed by Youenn Fablet. * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and output format descriptions after stopping the audio unit. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239702 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-07 Eric Carlson <eric.carlson@apple.com> Cleanup AudioTrackPrivateMediaStreamCocoa https://bugs.webkit.org/show_bug.cgi?id=193208 <rdar://problem/42225870> Reviewed by Youenn Fablet. * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable): Clear input and output format descriptions after stopping the audio unit. 2019-01-09 Kocsen Chung <kocsen_chung@apple.com> Cherry-pick r239694. rdar://problem/47158722 Deactivate audio session whenever possible https://bugs.webkit.org/show_bug.cgi?id=193188 <rdar://problem/42678977> Reviewed by Jer Noble. Source/WebCore: Test: media/deactivate-audio-session.html * platform/audio/AudioSession.cpp: (WebCore::AudioSession::tryToSetActive): (WebCore::AudioSession::tryToSetActiveInternal): * platform/audio/AudioSession.h: (WebCore::AudioSession::isActive const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::removeSession): (WebCore::deactivateAudioSession): (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession): (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession): * platform/audio/PlatformMediaSessionManager.h: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::tryToSetActiveInternal): (WebCore::AudioSession::tryToSetActive): Deleted. * platform/audio/mac/AudioSessionMac.cpp: (WebCore::AudioSession::tryToSetActiveInternal): (WebCore::AudioSession::tryToSetActive): Deleted. * testing/Internals.cpp: (WebCore::Internals::audioSessionActive const): * testing/Internals.h: * testing/Internals.idl: Source/WebKit: * WebProcess/WebPage/WebPage.cpp: (WebKit::WebPage::WebPage): LayoutTests: * TestExpectations: Skip the new test. * media/deactivate-audio-session-expected.txt: Added. * media/deactivate-audio-session.html: Added. * platform/ios/TestExpectations: Run the new test. * platform/mac-wk2/TestExpectations: Ditto. git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239694 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-07 Eric Carlson <eric.carlson@apple.com> Deactivate audio session whenever possible https://bugs.webkit.org/show_bug.cgi?id=193188 <rdar://problem/42678977> Reviewed by Jer Noble. Test: media/deactivate-audio-session.html * platform/audio/AudioSession.cpp: (WebCore::AudioSession::tryToSetActive): (WebCore::AudioSession::tryToSetActiveInternal): * platform/audio/AudioSession.h: (WebCore::AudioSession::isActive const): * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::removeSession): (WebCore::deactivateAudioSession): (WebCore::PlatformMediaSessionManager::shouldDeactivateAudioSession): (WebCore::PlatformMediaSessionManager::setShouldDeactivateAudioSession): * platform/audio/PlatformMediaSessionManager.h: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::tryToSetActiveInternal): (WebCore::AudioSession::tryToSetActive): Deleted. * platform/audio/mac/AudioSessionMac.cpp: (WebCore::AudioSession::tryToSetActiveInternal): (WebCore::AudioSession::tryToSetActive): Deleted. * testing/Internals.cpp: (WebCore::Internals::audioSessionActive const): * testing/Internals.h: * testing/Internals.idl: 2019-01-08 Alan Coon <alancoon@apple.com> Cherry-pick r239726. rdar://problem/47097726 Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow https://bugs.webkit.org/show_bug.cgi?id=193224 <rdar://problem/47097726> Reviewed by Alex Christensen. Source/WebCore: Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation. When we return to a suspended page, we load the current history item again and it normally properly restores the page from PageCache, even though we load the same history item and the current one and even though the page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache). The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would return true because both the source and destination URLs (which are the same) contains a fragment. To address the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is suspended. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldPerformFragmentNavigation): Tools: Add API test coverage. * TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239726 268f45cc-cd09-0410-ab3c-d52691b4dbfc 2019-01-08 Chris Dumez <cdumez@apple.com> Regression(PSON-r239182): Blank view when navigating back and forth between google.com and stack overflow https://bugs.webkit.org/show_bug.cgi?id=193224 <rdar://problem/47097726> Reviewed by Alex Christensen. Since r239182, pages get suspended in-place when we suspend the old process after a process-swap on navigation. When we return to a suspended page, we load the current history item again and it normally properly restores the page from PageCache, even though we load the same history item and the current one and even though the page is suspended in-place (i.e. we did not navigate away, which is the usual case for page cache). The issue is that if the page URL contains a fragment, FrameLoader::shouldPerformFragmentNavigation() would return true because both the source and destination URLs (which are the same) contains a fragment. To address the issue, update FrameLoader::shouldPerformFragmentNavigation() to return false if the current page is suspended. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldPerformFragmentNavigation): 2019-01-07 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Margin collapsing should not be limited to in-flow non-replaced boxes. https://bugs.webkit.org/show_bug.cgi?id=193183 Reviewed by Antti Koivisto. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): * layout/LayoutUnits.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): 2019-01-07 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Move MarginCollapse from BlockFormattingContext::Geometry to BlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=193181 Reviewed by Antti Koivisto. This is in preparation to share margin collapsing across all boxes in block formatting context. * layout/blockformatting/BlockFormattingContext.h: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBeforeFromFirstChild): (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginAfterFromLastChild): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfterCollapsesWithNextSibling): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginsCollapseThrough): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBefore): (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): Deleted. 2019-01-07 Zan Dobersek <zdobersek@igalia.com> [WPE] Use Widget bounds for PlatformScreen rectangle information https://bugs.webkit.org/show_bug.cgi?id=193190 Reviewed by Philippe Normand. Provide a better screen area estimate in screenRect() and screenAvailableRect() return values than the current 1240x640 value by using the Widget's bounds rectangle. This approach is only factually correct when the Widget-associated view is displayed in fullscreen, but it provides a better estimate even when displayed in any other case as well. WPE doesn't provide specific API that could enable the embedding environment to provide this information. * platform/wpe/PlatformScreenWPE.cpp: (WebCore::screenRect): Return bounds of the Widget object. (WebCore::screenAvailableRect): Relay the call to screenRect(). 2019-01-07 Zan Dobersek <zdobersek@igalia.com> Make Gradient::gradientSpaceTransform(), Pattern::patternSpaceTransform() methods const https://bugs.webkit.org/show_bug.cgi?id=193189 Reviewed by Philippe Normand. The transform getter methods on the Gradient and Pattern classes both return const references to the transform objects, and don't modify any internal state. They should be marked const accordingly, allowing invocations of these two methods through const references to Gradient and Pattern objects. * platform/graphics/Gradient.h: (WebCore::Gradient::gradientSpaceTransform): Now const. * platform/graphics/Pattern.h: (WebCore::Pattern::patternSpaceTransform): Now const. 2019-01-07 Zan Dobersek <zdobersek@igalia.com> REGRESSION(r239636): ImageDecoder::setEncodedDataStatusChangeCallback() can be called on a null decoder https://bugs.webkit.org/show_bug.cgi?id=193187 Reviewed by Philippe Normand. * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::ensureDecoderAvailable): Bail before calling the setEncodedDataStatusChangeCallback() method when the returned ImageDecoder object is null. 2019-01-06 Zan Dobersek <zdobersek@igalia.com> [Nicosia] Take over CoordinatedGraphics-named implementation of async scrolling classes https://bugs.webkit.org/show_bug.cgi?id=193133 Reviewed by Michael Catanzaro. Move the CoordinatedGraphics-specific files under page/scrolling/coordinatedgraphics/ to page/scrolling/nicosia/, along with renaming the files and classes accordingly. Implementation will only depend on the Nicosia-specific layer structure and is not specific to the CoordinatedGraphics system. * PlatformPlayStation.cmake: * SourcesGTK.txt: * SourcesWPE.txt: * page/scrolling/nicosia/ScrollingCoordinatorNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp. * page/scrolling/nicosia/ScrollingCoordinatorNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.h. * page/scrolling/nicosia/ScrollingStateNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp. * page/scrolling/nicosia/ScrollingTreeFixedNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp. * page/scrolling/nicosia/ScrollingTreeFixedNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.h. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.cpp. * page/scrolling/nicosia/ScrollingTreeFrameScrollingNodeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeFrameScrollingNodeCoordinatedGraphics.h. * page/scrolling/nicosia/ScrollingTreeNicosia.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.cpp. * page/scrolling/nicosia/ScrollingTreeNicosia.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeCoordinatedGraphics.h. * page/scrolling/nicosia/ScrollingTreeStickyNode.cpp: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp. * page/scrolling/nicosia/ScrollingTreeStickyNode.h: Renamed from Source/WebCore/page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.h. * platform/TextureMapper.cmake: 2019-01-06 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Import U2F command/response converters from Chromium https://bugs.webkit.org/show_bug.cgi?id=193150 <rdar://problem/47054028> Reviewed by Brent Fulgham. This patch imports Chromium's U2F command/response converters: https://fidoalliance.org/specs/fido-v2.0-id-20180227/fido-client-to-authenticator-protocol-v2.0-id-20180227.html#u2f-interoperability 1. It directly imports the following files and suit them to WebKit's coding style: https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.cc?l=1&rcl=db624110317d01efa78cd32e7be1524190e1beb0 https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor.h?rcl=db624110317d01efa78cd32e7be1524190e1beb0 https://cs.chromium.org/chromium/src/device/fido/u2f_command_constructor_unittest.cc?rcl=db624110317d01efa78cd32e7be1524190e1beb0 2. It gathers the following methods into U2fResponseConverter: AuthenticatorMakeCredentialResponse::CreateFromU2fRegisterResponse() AuthenticatorGetAssertionResponse::CreateFromU2fSignResponse() 3. It also updates FidoConstants.h, FidoTestData.h and CtapResponseTest.cpp accordingly. Besides importing stuff from Chroimum, it also gathers a bunch of constants and helper functions into WebAuthenticationConstants.h and WebAuthenticationUtils.h. It also fixes Bug 183534: 2) and 7). Covered by API tests. * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash): * Modules/webauthn/WebAuthenticationConstants.h: Copied from Source/WebCore/Modules/webauthn/COSEConstants.h. * Modules/webauthn/WebAuthenticationUtils.cpp: Added. (WebCore::convertBytesToVector): (WebCore::produceRpIdHash): (WebCore::encodeES256PublicKeyAsCBOR): (WebCore::buildAttestedCredentialData): (WebCore::buildAuthData): (WebCore::buildAttestationObject): * Modules/webauthn/WebAuthenticationUtils.h: Renamed from Source/WebCore/Modules/webauthn/COSEConstants.h. * Modules/webauthn/fido/DeviceResponseConverter.cpp: (fido::getCredentialId): (fido::readCTAPGetInfoResponse): * Modules/webauthn/fido/FidoConstants.h: * Modules/webauthn/fido/U2fCommandConstructor.cpp: Added. (fido::WebCore::constructU2fRegisterCommand): (fido::WebCore::constructU2fSignCommand): (fido::isConvertibleToU2fRegisterCommand): (fido::isConvertibleToU2fSignCommand): (fido::convertToU2fRegisterCommand): (fido::convertToU2fCheckOnlySignCommand): (fido::convertToU2fSignCommand): (fido::constructBogusU2fRegistrationCommand): * Modules/webauthn/fido/U2fCommandConstructor.h: Added. * Modules/webauthn/fido/U2fResponseConverter.cpp: Added. (fido::WebCore::extractECPublicKeyFromU2fRegistrationResponse): (fido::WebCore::extractCredentialIdFromU2fRegistrationResponse): (fido::WebCore::createAttestedCredentialDataFromU2fRegisterResponse): (fido::WebCore::parseX509Length): (fido::WebCore::createFidoAttestationStatementFromU2fRegisterResponse): (fido::readU2fRegisterResponse): (fido::readFromU2fSignResponse): * Modules/webauthn/fido/U2fResponseConverter.h: Added. * Modules/webgpu/WebGPUCommandBuffer.cpp: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2019-01-06 David Kilzer <ddkilzer@apple.com> Leak of WTF::Function objects in WebCore::CryptoKeyRSA::generatePair() (64-80 bytes each) in com.apple.WebKit.WebContent running WebKit layout tests <https://webkit.org/b/193177> <rdar://problem/47072196> Reviewed by Saam Barati. * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::generatePair): Fix the leak by changing raw pointers to heap-allocated __block variables to hold the WTF::Function objects until they are consumed within the block passed to dispatch_async(). The __block variables act like captured variables in a C++ lambda and have the same lifetime as the block that they are captured in. Note that we would have to convert the source file from C++ to Objective-C++ to use a C++ lambda functor with dispatch_async(), which creates its own issue because the comipiler requires a copy constructor to convert the C++ lambda to a block functor, but the copy constructor for the C++ lambda is implicitly deleted because the WTF::Function copy constructor is explicitly deleted. Whew! 2019-01-06 Pablo Saavedra <psaavedra@igalia.com> [WPE][GTK] Building with ENABLE_VIDEO=OFF fails trying to use Document MediaPlayback functions. https://bugs.webkit.org/show_bug.cgi?id=193174 Reviewed by Michael Catanzaro. * page/Page.cpp: (WebCore::Page::stopAllMediaPlayback): (WebCore::Page::suspendAllMediaPlayback): (WebCore::Page::resumeAllMediaPlayback): 2019-01-05 David Kilzer <ddkilzer@apple.com> Leak of two CCRSACryptorRef (4.0 Kbytes/1 page each) in com.apple.WebKit.WebContent running WebKit layout tests <https://webkit.org/b/193154> <rdar://problem/47052993> Reviewed by Brent Fulgham. Broadly: - Fix leaks by switching from using raw pointers to using std::unique_ptr<>. - Introduce PlatformRSAKeyContainer type to handle different std::unique_ptr<> on each platform. - Get rid of custom CryptoKeyRSA destructors since the std::unique_ptr<> handles that with a Deleter. - Initialize stack variables to nullptr. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::CryptoKeyRSA): (WebCore::CryptoKeyRSA::keySizeInBits const): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): (WebCore::CryptoKeyRSA::exportSpki const): (WebCore::CryptoKeyRSA::exportPkcs8 const): (WebCore::CryptoKeyRSA::algorithm const): (WebCore::CryptoKeyRSA::exportData const): (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted. * crypto/keys/CryptoKeyRSA.h: (WebCore::CCRSACryptorRefDeleter::operator() const): * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::getPublicKeyComponents): (WebCore::getPrivateKeyComponents): (WebCore::CryptoKeyRSA::CryptoKeyRSA): (WebCore::CryptoKeyRSA::create): (WebCore::CryptoKeyRSA::exportData const): (WebCore::CryptoKeyRSA::generatePair): (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): (WebCore::CryptoKeyRSA::~CryptoKeyRSA): Deleted. 2019-01-05 Zalan Bujtas <zalan@apple.com> Incorrect clipping across compositing boundary. https://bugs.webkit.org/show_bug.cgi?id=193172 <rdar://problem/44693008> Reviewed by Simon Fraser. Use temporary cliprect type when crossing compositing boundary to prevent cliprect caching. The issue here is that RenderLayer::backgroundClipRect() could cross compositing boundary by calling parentClipRects() which triggers clip rect update using the wrong painting root. This happens when the layer hierarchy and the compositing context do not match. For clip rect computation, we need to climb up on the layer hierarchy (calling parent layer's cliprect functions) but we also need to make sure that the computed cliprects on any given layer are cached only when the painting root is correct. It ensures that when we paint a layer (with the painting root as entry point), the cached cliprects are always based on its onw painting root. Test: compositing/clipping/cached-cliprect-with-compositing-boundary.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): 2019-01-05 Youenn Fablet <youenn@apple.com> Service Worker fetch should obey its referrer policy https://bugs.webkit.org/show_bug.cgi?id=193152 Reviewed by Chris Dumez. Pass referrer policy retrieved when fetching the service worker script to the SWServer. The SWServer then stores it persistently and sends it to the manager creating service workers. This manager will then set the referrer policy on the dummy Document of the corresponding service worker. Covered by rebased test. * workers/WorkerScriptLoader.cpp: (WebCore::WorkerScriptLoader::didReceiveResponse): * workers/WorkerScriptLoader.h: (WebCore::WorkerScriptLoader::referrerPolicy const): * workers/service/SWClientConnection.cpp: (WebCore::SWClientConnection::failedFetchingScript): * workers/service/ServiceWorkerContainer.cpp: (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/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::notifyFinished): * workers/service/ServiceWorkerJobClient.h: * workers/service/context/ServiceWorkerThreadProxy.cpp: (WebCore::createPageForServiceWorker): * workers/service/server/RegistrationDatabase.cpp: (WebCore::recordsTableSchema): (WebCore::RegistrationDatabase::doPushChanges): (WebCore::RegistrationDatabase::importRecords): * workers/service/server/SWServer.cpp: (WebCore::SWServer::addRegistrationFromStore): (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::SWServerWorker::contextData const): * workers/service/server/SWServerWorker.h: 2019-01-04 Simon Fraser <simon.fraser@apple.com> Factor legacy WK1 code for fixed and scrolling layers into their own helper class https://bugs.webkit.org/show_bug.cgi?id=193165 Reviewed by Frédéric Wang. RenderLayerCompositor has some code to handle registration of viewport-constrained and scrolling layers which is specific to iOS WK1. To reduce pollution, move this into its own helper class called LegacyWebKitScrollingLayerCoordinator, which is only allocated for iOS WK1. iOS WK1 never has a ScrollingCoordinator, so rather than the check for scrollingCoordinator(), we know that we only made a LegacyWebKitScrollingLayerCoordinator when there's a platform widget (i.e. WK1). * page/ChromeClient.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::RenderLayerCompositor): (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): (WebCore::RenderLayerCompositor::didFlushChangesForLayer): (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): No longer check the page cache state; now we destroy the render tree of pages in the page cache, so we should never hit this code path. (WebCore::RenderLayerCompositor::didAddScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllViewportConstrainedLayers): (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllViewportConstrainedLayers): (WebCore::scrollbarHasDisplayNone): (WebCore::LegacyWebKitScrollingLayerCoordinator::updateScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::registerAllScrollingLayers): (WebCore::LegacyWebKitScrollingLayerCoordinator::registerScrollingLayersNeedingUpdate): (WebCore::LegacyWebKitScrollingLayerCoordinator::unregisterAllScrollingLayers): (WebCore::LegacyWebKitScrollingLayerCoordinator::addScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::removeScrollingLayer): (WebCore::LegacyWebKitScrollingLayerCoordinator::didFlushChangesForLayer): (WebCore::updateScrollingLayerWithClient): Deleted. (WebCore::RenderLayerCompositor::registerAllViewportConstrainedLayers): Deleted. (WebCore::RenderLayerCompositor::unregisterAllViewportConstrainedLayers): Deleted. (WebCore::RenderLayerCompositor::registerAllScrollingLayers): Deleted. (WebCore::RenderLayerCompositor::unregisterAllScrollingLayers): Deleted. * rendering/RenderLayerCompositor.h: (WebCore::LegacyWebKitScrollingLayerCoordinator::LegacyWebKitScrollingLayerCoordinator): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::~ServiceWorkerContainer): 2019-01-05 Zalan Bujtas <zalan@apple.com> [LFC] VerticalMargin should only have the used values. https://bugs.webkit.org/show_bug.cgi?id=193168 Reviewed by Antti Koivisto. Split VerticalMargin into ComputedVerticalMargin and UsedVerticalMargin. ComputedVerticalMargin holds the computed (optional) values while UsedVerticalMargin holds both the collapsed (optional) and the non-collapsed values. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedVerticalMargin): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): Deleted. * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/LayoutUnits.h: * layout/MarginTypes.h: (WebCore::Layout::UsedVerticalMargin::before const): (WebCore::Layout::UsedVerticalMargin::after const): (WebCore::Layout::UsedVerticalMargin::nonCollapsedValues const): (WebCore::Layout::UsedVerticalMargin::collapsedValues const): (WebCore::Layout::UsedVerticalMargin::hasCollapsedValues const): (WebCore::Layout::UsedVerticalMargin::setCollapsedValues): (WebCore::Layout::UsedVerticalMargin::UsedVerticalMargin): (WebCore::Layout::VerticalMargin::nonCollapsedValues const): Deleted. (WebCore::Layout::VerticalMargin::collapsedValues const): Deleted. (WebCore::Layout::VerticalMargin::setCollapsedValues): Deleted. (WebCore::Layout::VerticalMargin::VerticalMargin): Deleted. (WebCore::Layout::VerticalMargin::usedValues const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::verticalMargin const): (WebCore::Display::Box::marginBefore const): (WebCore::Display::Box::marginAfter const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): 2019-01-04 Daniel Bates <dabates@apple.com> REGRESSION (r238522): Erratic scrolling on Google flights search result page and vrbo.com https://bugs.webkit.org/show_bug.cgi?id=192996 <rdar://problem/46573552> Reviewed by Simon Fraser. Only scroll a text field if its inner text size changes and it is the currently active and focused element on the page. Test: fast/scrolling/page-should-not-scroll-on-unfocused-text-field-layout.html * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): 2019-01-04 Alex Christensen <achristensen@webkit.org> Progress towards fixing Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=193105 Reviewed by Don Olmstead. * PlatformMac.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPURenderPassEncoder.h: 2019-01-04 Zalan Bujtas <zalan@apple.com> [iOS] ERROR: post-layout: dirty renderer(s) in WebCore::RenderTreeNeedsLayoutChecker::~RenderTreeNeedsLayoutChecker() https://bugs.webkit.org/show_bug.cgi?id=189608 <rdar://problem/44473299> Reviewed by Simon Fraser. When a frameset/iframe is hidden and we skip layout, clear the dirty flag on its subtree as well. Covered by fast/frames/invalid-frameset.html. * rendering/RenderFrameSet.cpp: (WebCore::clearSiblingSubtrees): (WebCore::RenderFrameSet::positionFrames): (WebCore::RenderFrameSet::positionFramesWithFlattening): 2019-01-04 Youenn Fablet <youenn@apple.com> [Fetch API] Implement abortable fetch https://bugs.webkit.org/show_bug.cgi?id=174980 <rdar://problem/46861402> Reviewed by Chris Dumez. Add an AbortSignal to FetchRequest. Add support for AbortSignal algorithm. The fetch request signal is added an algorithm to abort the fetch. Update clone algorithm to let signal of the cloned request be following the origin request. Update ReadableStream error handling to return an exception instead of a string. This allows passing an AbortError instead of a TypeError as previously done. Update FetchBodyOwner to store a loading error either as an exception or as a resource error. The latter is used for passing the error from service worker back to the page. The former is used to pass it to ReadableStream or body accessors. Covered by enabled tests. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::put): * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::consumeAsStream): (WebCore::FetchBody::loadingFailed): * Modules/fetch/FetchBody.h: * Modules/fetch/FetchBodyConsumer.cpp: (WebCore::FetchBodyConsumer::loadingFailed): * Modules/fetch/FetchBodyConsumer.h: * Modules/fetch/FetchBodyOwner.cpp: (WebCore::FetchBodyOwner::arrayBuffer): (WebCore::FetchBodyOwner::blob): (WebCore::FetchBodyOwner::cloneBody): (WebCore::FetchBodyOwner::formData): (WebCore::FetchBodyOwner::json): (WebCore::FetchBodyOwner::text): (WebCore::FetchBodyOwner::loadBlob): (WebCore::FetchBodyOwner::blobLoadingFailed): (WebCore::FetchBodyOwner::consumeBodyAsStream): (WebCore::FetchBodyOwner::setLoadingError): * Modules/fetch/FetchBodyOwner.h: (WebCore::FetchBodyOwner::loadingError const): (WebCore::FetchBodyOwner::loadingException const): * Modules/fetch/FetchBodySource.cpp: (WebCore::FetchBodySource::error): * Modules/fetch/FetchBodySource.h: * Modules/fetch/FetchRequest.cpp: (WebCore::FetchRequest::initializeWith): (WebCore::FetchRequest::clone): * Modules/fetch/FetchRequest.h: (WebCore::FetchRequest::FetchRequest): * Modules/fetch/FetchRequest.idl: * Modules/fetch/FetchRequestInit.h: (WebCore::FetchRequestInit::hasMembers const): * Modules/fetch/FetchRequestInit.idl: * Modules/fetch/FetchResponse.cpp: (WebCore::FetchResponse::clone): (WebCore::FetchResponse::fetch): (WebCore::FetchResponse::BodyLoader::didFail): * Modules/fetch/FetchResponse.h: * bindings/js/ReadableStreamDefaultController.h: (WebCore::ReadableStreamDefaultController::error): * dom/AbortSignal.cpp: (WebCore::AbortSignal::abort): (WebCore::AbortSignal::follow): * dom/AbortSignal.h: 2019-01-04 Brent Fulgham <bfulgham@apple.com> Parsed protocol of javascript URLs with embedded newlines and carriage returns do not match parsed protocol in Chrome and Firefox https://bugs.webkit.org/show_bug.cgi?id=193155 <rdar://problem/40230982> Reviewed by Chris Dumez. Test: fast/loader/comment-only-javascript-url.html Make a special case for URLs beginning with 'javascript:'. We should always treat these as JS URLs, even if the content contained within the URL string might match other parts of the URL parsing spec. * html/URLUtils.h: (WebCore::URLUtils<T>::protocol const): 2019-01-04 Jer Noble <jer.noble@apple.com> [WebKitLegacy] Media playback pauses on scroll https://bugs.webkit.org/show_bug.cgi?id=192829 Reviewed by Eric Carlson. New API tests: WebKitLegacy.ScrollingDoesNotPauseMedia WKWebView.StopAllMediaPlayback WKWebView.SuspendResumeAllMediaPlayback Do not use suspendActiveDOMObjects(ReasonForSuspension::PageWillBeSuspended) to pause video. Roll back the changes to HTMLMediaElement, and introduce a new set of Page calls suspendAllMediaPlayback() & resumeAllMediaPlayback() which replaces the removed bahavior. * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::stopAllMediaPlayback): (WebCore::Document::suspendAllMediaPlayback): (WebCore::Document::resumeAllMediaPlayback): * dom/Document.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::parseAttribute): (WebCore::HTMLMediaElement::didFinishInsertingNode): (WebCore::HTMLMediaElement::setSrcObject): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): (WebCore::HTMLMediaElement::suspend): (WebCore::HTMLMediaElement::resume): (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted. * html/MediaElementSession.cpp: (WebCore::MediaElementSession::playbackPermitted const): * page/Page.cpp: (WebCore::Page::stopAllMediaPlayback): (WebCore::Page::suspendAllMediaPlayback): (WebCore::Page::resumeAllMediaPlayback): * page/Page.h: (WebCore::Page::mediaPlaybackIsSuspended): * platform/audio/PlatformMediaSession.h: * platform/audio/PlatformMediaSessionManager.cpp: (WebCore::PlatformMediaSessionManager::suspendAllMediaPlaybackForDocument): (WebCore::PlatformMediaSessionManager::resumeAllMediaPlaybackForDocument): * platform/audio/PlatformMediaSessionManager.h: 2019-01-04 Chris Dumez <cdumez@apple.com> Add support for toggling device orientation API support per site https://bugs.webkit.org/show_bug.cgi?id=193143 <rdar://problem/46605724> Reviewed by Alex Christensen. Add support for toggling device orientation API support per site via _WKWebsitePolicies. * dom/Document.cpp: (WebCore::Document::simulateDeviceOrientationChange): * dom/Document.h: * loader/DocumentLoader.h: (WebCore::DocumentLoader::deviceOrientationEventEnabled const): (WebCore::DocumentLoader::setDeviceOrientationEventEnabled): * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): 2019-01-04 Jer Noble <jer.noble@apple.com> Web Content process main thread blocked beneath ImageDecoderAVFObjC::readSamples for many seconds on imgur.com https://bugs.webkit.org/show_bug.cgi?id=191806 <rdar://problem/46151477> Reviewed by Dean Jackson. Test: http/tests/images/mp4-partial-load.html Rather than use an AVAssetReaderTrackOutput, which will load both sample metadata and sample data synchronously when a sample is requested, use AVAssetReaderSampleReferenceOutput, which only loads sample metadata, including the byte offset and byte length of the sample data. By waiting until the AVAsset signals that it's own metadata is loaded, we can safely parse all the sample metadata without blocking on network loads. Once enough data is loaded, we can replace the byte reference and offset attachements in the sample with actual data, and mark the sample as "complete". Because the existing ImageSource assumes that image data parsing will occur synchronously, and that synchronous parsing could cause a hang if the metadata is not loaded, add a new callback method which allows the ImageSource to be notified when the encodedDataStatus changes. The ImageSource notifies the CacheImage, which notifies the RenderImage, and thus the asynchronous parsing will kick off the renderer's animation loop. * loader/cache/CachedImage.cpp: (WebCore::CachedImage::CachedImageObserver::encodedDataStatusChanged): (WebCore::CachedImage::encodedDataStatusChanged): * loader/cache/CachedImage.h: * platform/graphics/ImageDecoder.h: (WebCore::ImageDecoder::setEncodedDataStatusChangeCallback): * platform/graphics/ImageObserver.h: (WebCore::ImageObserver::encodedDataStatusChanged): * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::ensureDecoderAvailable): (WebCore::ImageSource::encodedDataStatusChanged): (WebCore::ImageSource::frameDecodingStatusAtIndex): * platform/graphics/ImageSource.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h: * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (-[WebCoreSharedBufferResourceLoaderDelegate data]): (WebCore::ImageDecoderAVFObjCSample::byteRange const): (WebCore::ImageDecoderAVFObjC::readSamples): (WebCore::ImageDecoderAVFObjC::setEncodedDataStatusChangeCallback): (WebCore::ImageDecoderAVFObjC::encodedDataStatus const): (WebCore::ImageDecoderAVFObjC::frameIsCompleteAtIndex const): (WebCore::ImageDecoderAVFObjC::createFrameImageAtIndex): (WebCore::ImageDecoderAVFObjC::sampleIsComplete const): 2019-01-04 Youenn Fablet <youenn@apple.com> CSP violation reports should bypass CSP checks https://bugs.webkit.org/show_bug.cgi?id=192857 <rdar://problem/46887236> Reviewed by Chris Dumez. For ping loads, pass the option to do CSP checks from PingLoader to LoaderStrategy. This new option is unused by WebKit Legacy. It is used by WebKit loader strategy to only send any CSP response header to network process in case CSP checks should be done. This option is used to disable CSP checks for Ping Loads that report CSP violations. Test: http/wpt/fetch/csp-reports-bypass-csp-checks.html * loader/LoaderStrategy.h: * loader/PingLoader.cpp: (WebCore::PingLoader::loadImage): (WebCore::PingLoader::sendPing): (WebCore::PingLoader::sendViolationReport): (WebCore::PingLoader::startPingLoad): * loader/PingLoader.h: * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): 2019-01-04 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] Merge WebEditCommandProxy::nameForEditAction and undoNameForEditAction into a single function https://bugs.webkit.org/show_bug.cgi?id=193129 Reviewed by Tim Horton. Adds a new helper function that returns the undo/redo name for a given EditAction. No change in behavior. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * editing/EditAction.cpp: Copied from Source/WebKit/UIProcess/WebEditCommandProxy.cpp. (WebCore::nameForUndoRedo): * editing/EditAction.h: * editing/Editor.cpp: 2019-01-03 Matt Rajca <mrajca@apple.com> Make DidPlayMediaPreventedFromPlaying autoplay event more generic. https://bugs.webkit.org/show_bug.cgi?id=193128 rdar://34554231 Reviewed by Jer Noble. Today, the "DidPlayMediaPreventedFromPlaying" autoplay event is only sent for media prevented from autoplaying. It could be generalized to a "DidPlayMediaWithUserGesture" event along with a flag that indicates whether or not autoplay was actually prevented. Moreover, we can include a flag that indicates whether the media element in question is main content. Clients will then know in more cases when media was played with a user gesture, whether or not it has audio, as well as its main content status. While the main content heuristics may not be perfect, they covered the top 20 video-centric websites that this was tested with and are meant to be used by clients for data evaluation purposes. As part of this, the PlaybackWithoutUserGesture enum was renamed to AutoplayEventPlaybackState since it now also applies to cases where there is a user gesture. The `m_playbackWithoutUserGestureStartedTime` member variable was also removed in favor of `playbackStartedTime` which also covers all the cases we care about. Tests: existing API tests were updated to reflect the new names. New API tests were added for the new case in which the "DidPlayMediaWithUserGesture" event is sent. * html/HTMLMediaElement.cpp: (WebCore::convertEnumerationToString): Update to new enum cases. (WebCore::HTMLMediaElement::setReadyState): Ditto. (WebCore::HTMLMediaElement::play): Ditto. (WebCore::HTMLMediaElement::playInternal): Also cover the case where playback was not prevented but there was a user gesture. (WebCore::HTMLMediaElement::pauseInternal): Use new name. (WebCore::HTMLMediaElement::setVolume): Use new name. (WebCore::HTMLMediaElement::playbackProgressTimerFired): Dispatch the DidPlayMediaWithUserGesture event when playback was started with a user gesture as well. (WebCore::HTMLMediaElement::mediaPlayerDidAddAudioTrack): Use new name. (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): Ditto. (WebCore::HTMLMediaElement::mediaPlayerCharacteristicChanged): Ditto. (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. (WebCore::HTMLMediaElement::handleAutoplayEvent): Pass along new media state. (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Use new name. (WebCore::HTMLMediaElement::setAutoplayEventPlaybackState): Stop setting m_playbackWithoutUserGestureStartedTime in favor of using playbackStartedTime. (WebCore::HTMLMediaElement::updateShouldPlay): Use new name. (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Renamed. * html/HTMLMediaElement.h: (WTF::LogArgument<WebCore::HTMLMediaElement::AutoplayEventPlaybackState>::toString): Renamed from... (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::isMainContentForPurposesOfAutoplayEvents const): Don't do the hit testing check for the purposes of autoplay events. It seems to fail on the basic Vimeo player due to overlapping divs. (WebCore::isElementMainContentForPurposesOfAutoplay): (WebCore::MediaElementSession::updateIsMainContent const): Keep the existing behavior here of hit testing. (WebCore::isMainContentForPurposesOfAutoplay): Renamed. * html/MediaElementSession.h: * page/AutoplayEvent.h: 2019-01-04 Youenn Fablet <youenn@apple.com> Crash in WebCore::ServiceWorkerGlobalScope https://bugs.webkit.org/show_bug.cgi?id=192513 <rdar://problem/46563880> Reviewed by Alex Christensen. Store the identifier in its own variable to make sure we do not use workerThread after being moved. * workers/service/ServiceWorkerGlobalScope.cpp: (WebCore::ServiceWorkerGlobalScope::skipWaiting): 2019-01-04 Chris Fleizach <cfleizach@apple.com> AX: String check: "Rule" does not reflect the meaning of the <hr> html tag https://bugs.webkit.org/show_bug.cgi?id=193041 <rdar://problem/46954090> Reviewed by Zalan Bujtas. * en.lproj/Localizable.strings: * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::AXHorizontalRuleDescriptionText): 2019-01-04 Zalan Bujtas <zalan@apple.com> [LFC] ComputedHorizontalMargin should have optional members https://bugs.webkit.org/show_bug.cgi?id=193131 Reviewed by Antti Koivisto. Split HorizontalMargin into UsedHorizontalMargin and ComputedHorizontalMargin. ComputedHorizontalMargin's members are optional. (see computed vs used values) * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedHorizontalMargin): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): Deleted. * layout/LayoutUnits.h: * layout/MarginTypes.h: * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::computedMarginStart const): (WebCore::Display::Box::computedMarginEnd const): * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::marginStart const): (WebCore::Layout::FloatAvoider::marginEnd const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): 2019-01-04 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Use computedValue and usedValue consistently https://bugs.webkit.org/show_bug.cgi?id=193059 Reviewed by Antti Koivisto. https://www.w3.org/TR/CSS22/cascade.html#value-stages 6.1.2 Computed values Specified values are resolved to computed values during the cascade; for example URIs are made absolute and 'em' and 'ex' units are computed to pixel or absolute lengths. Computing a value never requires the user agent to render the document... 6.1.3 Used values Computed values are processed as far as possible without formatting the document. Some values, however, can only be determined when the document is being laid out. For example, if the width of an element is set to be a certain percentage of its containing block, the width cannot be determined until the width of the containing block has been determined. The used value is the result of taking the computed value and resolving any remaining dependencies into an absolute value. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::LayoutState): * layout/LayoutUnits.h: * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHasValidHorizontalComputedMargin): (WebCore::Display::Box::setHorizontalComputedMargin): (WebCore::Display::Box::computedMarginStart const): (WebCore::Display::Box::computedMarginEnd const): (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin): Deleted. (WebCore::Display::Box::setHorizontalNonComputedMargin): Deleted. (WebCore::Display::Box::nonComputedMarginStart const): Deleted. (WebCore::Display::Box::nonComputedMarginEnd const): Deleted. * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::marginStart const): (WebCore::Layout::FloatAvoider::marginEnd const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const): 2019-01-03 Zalan Bujtas <zalan@apple.com> REGRESSION: -webkit-appearance test case crashes https://bugs.webkit.org/show_bug.cgi?id=189302 <rdar://problem/44143049> Reviewed by Wenson Hsieh. The painting and the layout positions of the cancel button need to match in order to be able to interact with it. This patch removes the previous position inlining attempts. Test: fast/forms/webkit-appearance-searchfield-cancel-button-crash.html * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::paintSearchFieldCancelButton): 2019-01-03 David Kilzer <ddkilzer@apple.com> Leak of WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback (48 bytes) in com.apple.WebKit.WebContent running WebKit layout tests <https://webkit.org/b/193122> <rdar://problem/47022987> Reviewed by Youenn Fablet. * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::AddRef const): (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::Release const): - Remove `final` keyword so that `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()` can be called. (WebCore::LibWebRTCCertificateGenerator::generateCertificate): - To fix the leak call `new rtc::RefCountedObject<RTCCertificateGeneratorCallback>()` to create the object. 2019-01-03 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238090): After showing the Find banner or tab bar, hit tests are vertically offset (or painting is not offset) https://bugs.webkit.org/show_bug.cgi?id=193124 rdar://problem/46755409 Reviewed by Tim Horton. Top content inset feeds into scrolling tree geometry, so when it changes we need to trigger an update of the root scrolling node, which happens via RenderLayerBacking::updateGeometry(). So set a dirty bit on the root layer in frameViewDidChangeSize(), which is called from the code path that runs when top content inset changes. Find banner behavior is not easily testable. platform/mac/fast/events/content-inset-hit-testing.html did not detect the regression. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::frameViewDidChangeSize): 2019-01-03 Chris Dumez <cdumez@apple.com> Potential infinite recursion in isFrameFamiliarWith(Frame&, Frame&) https://bugs.webkit.org/show_bug.cgi?id=192997 <rdar://problem/46217271> Reviewed by Antti Koivisto. isFrameFamiliarWith(Frame&, Frame&) was called recursively using the passed frames' openers. The issue is that a Frame can be its opener. There could also be a cycle in the opener chain. To address the issue, simplify isFrameFamiliarWith() so that it is no longer recursive. We now only check if the frames belong to the same pages or if their openers do. We no longer check openers' opener and up. Note that this function is used to check if a frame is allowed to target another. In practice, it is unlikely to be useful to navigate an opener's opener and an openee's openee. Tests: fast/dom/Window/window-open-opener-cycle.html fast/dom/Window/window-open-self-as-opener.html * page/FrameTree.cpp: (WebCore::isFrameFamiliarWith): 2019-01-02 Simon Fraser <simon.fraser@apple.com> REGRESSION (r239306): Don't disable font smoothing in transparent layers on macOS Mojave and later https://bugs.webkit.org/show_bug.cgi?id=193095 <rdar://problem/47014944> Reviewed by Zalan Bujtas. In r239306 we stopped making CALayers for font-smoothed text when not necessary on macOS Mojave and later. However, we still turned off smoothing for non-opaque layers (setShouldSmoothFonts(false)), which continues to affect the appearance of text. Fix by only calling setShouldSmoothFonts(false) when the OS supports font smoothing. Test: compositing/contents-format/subpixel-antialiased-text.html * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayer::drawLayerContents): 2019-01-02 David Kilzer <ddkilzer@apple.com> Leak of CMSampleBuffer (752 bytes) in com.apple.WebKit.WebContent running WebKit layout tests <https://webkit.org/b/193016> <rdar://problem/46925703> Reviewed by Simon Fraser. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::copySampleBufferWithCurrentTimeStamp): - Change to return RetainPtr<CMSampleBufferRef>. - Check return value of CMSampleBufferCreateCopyWithNewTiming(). (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): - Check return value of copySampleBufferWithCurrentTimeStamp(). - Fix leak by using RetainPtr<CMSampleBufferRef> returned from copySampleBufferWithCurrentTimeStamp() instead of leaking `bufferWithCurrentTime` by using retainPtr(). (WebCore::createAudioFormatDescription): - Extract method from appendAudioSampleBuffer() to return RetainPtr<CMFormatDescriptionRef> after calling CMAudioFormatDescriptionCreate(). - Check return value of CMAudioFormatDescriptionCreate(). (WebCore::createAudioSampleBufferWithPacketDescriptions): - Extract method from appendAudioSampleBuffer() to return RetainPtr<CMSampleBufferRef> after calling CMAudioSampleBufferCreateWithPacketDescriptions(). (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): - Check return values of createAudioFormatDescription() and createAudioSampleBufferWithPacketDescriptions(). - Fix leaks by extracting code into helper methods that return RetainPtr<> objects instead of leaking CMFormatDescriptionRef directly or leaking `sampleBuffer` by using retainPtr(). 2019-01-02 Wenson Hsieh <wenson_hsieh@apple.com> Add support for using the current text selection as the find string on iOS https://bugs.webkit.org/show_bug.cgi?id=193034 <rdar://problem/45138739> Reviewed by Tim Horton. Add support for "TakeFindStringFromSelection" on iOS. Unlike macOS, iOS does not have a notion of a "find pasteboard" like macOS; instead, we handle this editing command by sending the selection string to the UI process, where it is exposed via WebKit SPI so that clients that present find-in-page UI (i.e. MobileSafari) are able to trigger find-in-page with this string. Test: WebKit.UseSelectionAsFindString * editing/Editor.cpp: (WebCore::Editor::canCopyExcludingStandaloneImages const): Make this helper function cross-platform. * editing/Editor.h: * editing/EditorCommand.cpp: (WebCore::createCommandMap): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::takeFindStringFromSelection): Move this from EditorMac to EditorCocoa, and implement it on iOS by calling into the editor client to update the find string (see WebKit/ChangeLog for more details). * editing/mac/EditorMac.mm: (WebCore::Editor::canCopyExcludingStandaloneImages): Deleted. (WebCore::Editor::takeFindStringFromSelection): Deleted. * loader/EmptyClients.cpp: * page/EditorClient.h: Add a new editor client method to send the string for find-in-page to the UI process. 2019-01-02 Devin Rousso <webkit@devinrousso.com> Web Inspector: Implement `queryObjects` Command Line API https://bugs.webkit.org/show_bug.cgi?id=176766 <rdar://problem/34890689> Reviewed by Joseph Pecoraro. Test: inspector/console/queryObjects.html * inspector/CommandLineAPIModuleSource.js: (CommandLineAPI): (CommandLineAPIImpl.prototype.queryObjects): Added. 2019-01-02 Charles Vazac <cvazac@gmail.com> Fix resourcetimingbufferfull bubbles attribute https://bugs.webkit.org/show_bug.cgi?id=193087 Reviewed by Chris Dumez. This change is covered by web-platform-tests [1]. [1] https://github.com/web-platform-tests/wpt/blob/master/resource-timing/buffer-full-when-populate-entries.html#L20 * page/Performance.cpp: (WebCore::Performance::resourceTimingBufferFullTimerFired): 2019-01-02 Simon Fraser <simon.fraser@apple.com> Rename LayerScrollCoordinationRole to ScrollCoordinationRole and make an enum class https://bugs.webkit.org/show_bug.cgi?id=193010 Reviewed by Zalan Bujtas. Move the enum LayerScrollCoordinationRole from RenderLayer.h to RenderLayerCompositor.h, and make it an enum class. * page/FrameView.cpp: (WebCore::FrameView::scrollLayerID const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::~RenderLayerBacking): (WebCore::RenderLayerBacking::detachFromScrollingCoordinator): (WebCore::operator<<): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): (WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers): (WebCore::scrollCoordinationRoleForNodeType): (WebCore::RenderLayerCompositor::attachScrollingNode): (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): * rendering/RenderLayerCompositor.h: 2019-01-02 Simon Fraser <simon.fraser@apple.com> Don't spin up a CalcParser if the current token is not a function token https://bugs.webkit.org/show_bug.cgi?id=193067 Reviewed by Zalan Bujtas. Various functions in CSSPropertyParserHelpers fall back to trying to parse a calc expression if the normal parsing fails. Don't do this unless the current token is a function token, which should be slightly more efficient. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeInteger): (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw): (WebCore::CSSPropertyParserHelpers::consumeNumberRaw): (WebCore::CSSPropertyParserHelpers::consumeNumber): (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber): (WebCore::CSSPropertyParserHelpers::consumeLength): (WebCore::CSSPropertyParserHelpers::consumePercent): (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent): (WebCore::CSSPropertyParserHelpers::consumeAngle): (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent): (WebCore::CSSPropertyParserHelpers::consumeTime): 2019-01-02 Simon Fraser <simon.fraser@apple.com> Support css-color-4 rgb functions https://bugs.webkit.org/show_bug.cgi?id=192321 Reviewed by Zalan Bujtas. Support the new rgb()/rgba() syntax described in https://drafts.csswg.org/css-color/#rgb-functions. The differences are: 1. There is a new comma-free syntax, where the optional alpha is separated by a slash: rgb(128 34 56) rgb(128 34 56 / 50%) 2. Floating point values are allowed, and rounded: rgb(128.5 34.2 56.5) becomes rgb(129 34 57) 3. rgba() is a pure alias for rgb(), so these are equivalent: rgb(128 34 56 / 50%) rgba(128 34 56 / 50%) hsl()/hsla() parsing was already updated to this new syntax in r230861. Tested by tests in imported/w3c/web-platform-tests/css/css-color/ * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::clampRGBComponent): (WebCore::CSSPropertyParserHelpers::parseRGBParameters): (WebCore::CSSPropertyParserHelpers::parseColorFunction): 2019-01-02 Simon Fraser <simon.fraser@apple.com> Handle calc() expressions in gradient color stops https://bugs.webkit.org/show_bug.cgi?id=193066 rdar://problem/46961985 Reviewed by Sam Weinig. Fix two issues that prevented calc() expressions from working in conic-gradient color stops, for the angle or percent value. First, consumeAngleOrPercent() needs to look for CalculationCategory::Percent calc values as well as angle ones. Second, CSSPrimitiveValue::isAngle() needs to use primitiveType() (which takes calc into account), just as isPx() etc do. Test: fast/gradients/conic-calc-stop-position.html * css/CSSPrimitiveValue.h: (WebCore::CSSPrimitiveValue::isAngle const): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent): (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops): 2018-12-31 Keith Miller <keith_miller@apple.com> SourceProviders should use an actual URL instead of a string https://bugs.webkit.org/show_bug.cgi?id=192734 Reviewed by Yusuke Suzuki. Remove ScriptSourceCode's URL member and make the url() method reference the URL on the SourceProvider. Also, avoid some ref count churn. Additionally, this patch fixes an existing bug in WorkletGlobalScope() that would use a ScriptSourceCode after WTFMoving it. * bindings/js/CachedScriptSourceProvider.h: (WebCore::CachedScriptSourceProvider::CachedScriptSourceProvider): * bindings/js/ScheduledAction.cpp: (WebCore::ScheduledAction::execute): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeScriptInWorld): (WebCore::ScriptController::executeScript): * bindings/js/ScriptSourceCode.h: (WebCore::ScriptSourceCode::ScriptSourceCode): (WebCore::ScriptSourceCode::m_code): (WebCore::ScriptSourceCode::url const): (WebCore::ScriptSourceCode::m_url): Deleted. * dom/ScriptElement.cpp: (WebCore::ScriptElement::prepareScript): (WebCore::ScriptElement::requestModuleScript): (WebCore::ScriptElement::executePendingScript): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): * page/Frame.cpp: (WebCore::Frame::injectUserScriptImmediately): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::importScripts): * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): * xml/parser/XMLDocumentParserLibxml2.cpp: (WebCore::XMLDocumentParser::endElementNs): 2019-01-01 Jeff Miller <jeffm@apple.com> Update user-visible copyright strings to include 2019 https://bugs.webkit.org/show_bug.cgi?id=192811 Reviewed by Mark Lam. * Info.plist: 2018-12-30 David Kilzer <ddkilzer@apple.com> clang-tidy: Save 8 padding bytes on WebCore::BorderEdge <https://webkit.org/b/193058> <rdar://problem/46979275> Reviewed by Yusuke Suzuki. * rendering/BorderEdge.cpp: (WebCore::BorderEdge::BorderEdge): Reorder initialization to match new instance variable order. * rendering/BorderEdge.h: Reorder instance variables to save 8 padding bytes. 2018-12-28 Yusuke Suzuki <yusukesuzuki@slowstart.org> [JSC] Remove one indirection in JSObject::toStringName https://bugs.webkit.org/show_bug.cgi?id=193037 Reviewed by Keith Miller. Use old JSObject::toStringName function here. * bindings/js/JSDOMConstructorBase.cpp: (WebCore::JSDOMConstructorBase::className): (WebCore::JSDOMConstructorBase::toStringName): * bindings/js/JSDOMConstructorBase.h: (WebCore::JSDOMConstructorBase::className): Deleted. 2018-12-27 Alex Christensen <achristensen@webkit.org> Resurrect Mac CMake build https://bugs.webkit.org/show_bug.cgi?id=192658 Reviewed by Yusuke Suzuki. This makes it so JSC and most of WebCore builds. WebCore's use of ARC seems inconsistent, so I'll fix that later. * PlatformMac.cmake: * config.h: 2018-12-26 Jim Mason <jmason@ibinx.com> [FreeType] Restore conditional compilation logic for recent HarfBuzz refactoring https://bugs.webkit.org/show_bug.cgi?id=193036 Reviewed by Michael Catanzaro. * platform/graphics/FontPlatformData.h: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: 2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com> Remove "using namespace std;" https://bugs.webkit.org/show_bug.cgi?id=192973 <rdar://problem/46937309> Unreviewed Windows port Debug builds fix. No new tests since no behavior changes. * accessibility/win/AXObjectCacheWin.cpp: (WebCore::AXObjectCache::postPlatformNotification): Add "std::" prefix to numeric_limits in ASSERT macro. 2018-12-24 Fujii Hironori <Hironori.Fujii@sony.com> Remove "using namespace std;" https://bugs.webkit.org/show_bug.cgi?id=192973 Reviewed by Alex Christensen. Removed "using namespace std" statement, and use std:: prefix. No new tests since no behavior changes. * accessibility/win/AXObjectCacheWin.cpp: * platform/graphics/GraphicsContext3DPrivate.cpp: * platform/graphics/cairo/ImageBufferCairo.cpp: * platform/graphics/win/FontPlatformDataCairoWin.cpp: * platform/graphics/win/FontWin.cpp: (WebCore::FontCascade::floatWidthForComplexText const): * platform/graphics/win/GraphicsContextCGWin.cpp: * platform/graphics/win/GraphicsContextCairoWin.cpp: * platform/graphics/win/GraphicsContextDirect2D.cpp: * platform/graphics/win/GraphicsContextWin.cpp: * platform/graphics/win/SimpleFontDataCGWin.cpp: * platform/graphics/win/UniscribeController.cpp: (WebCore::UniscribeController::UniscribeController): (WebCore::UniscribeController::shapeAndPlaceItem): * platform/image-decoders/ScalableImageDecoder.cpp: * platform/text/LocaleICU.cpp: * platform/text/win/LocaleWin.cpp: * platform/win/ScrollbarThemeWin.cpp: * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutBlock): * rendering/RenderThemeWin.cpp: (WebCore::RenderThemeWin::adjustMenuListButtonStyle const): (WebCore::RenderThemeWin::paintSearchFieldCancelButton): (WebCore::RenderThemeWin::adjustSearchFieldCancelButtonStyle const): (WebCore::RenderThemeWin::adjustSearchFieldResultsDecorationPartStyle const): (WebCore::RenderThemeWin::paintSearchFieldResultsDecorationPart): (WebCore::RenderThemeWin::adjustSearchFieldResultsButtonStyle const): (WebCore::RenderThemeWin::paintSearchFieldResultsButton): 2018-12-24 Simon Fraser <simon.fraser@apple.com> Change ScrollingNodeType to an enum class https://bugs.webkit.org/show_bug.cgi?id=193009 Reviewed by Zalan Bujtas. Change the ScrollingNodeType enum to an enum class. No behavior change. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/ScrollingCoordinator.cpp: (WebCore::operator<<): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateFixedNode.cpp: (WebCore::ScrollingStateFixedNode::ScrollingStateFixedNode): * page/scrolling/ScrollingStateNode.h: (WebCore::ScrollingStateNode::isFixedNode const): (WebCore::ScrollingStateNode::isStickyNode const): (WebCore::ScrollingStateNode::isFrameScrollingNode const): (WebCore::ScrollingStateNode::isOverflowScrollingNode const): * page/scrolling/ScrollingStateOverflowScrollingNode.cpp: (WebCore::ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode): * page/scrolling/ScrollingStateStickyNode.cpp: (WebCore::ScrollingStateStickyNode::ScrollingStateStickyNode): * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::createNode): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingTreeNode.h: (WebCore::ScrollingTreeNode::isFixedNode const): (WebCore::ScrollingTreeNode::isStickyNode const): (WebCore::ScrollingTreeNode::isFrameScrollingNode const): (WebCore::ScrollingTreeNode::isOverflowScrollingNode const): * page/scrolling/ScrollingTreeOverflowScrollingNode.cpp: (WebCore::ScrollingTreeOverflowScrollingNode::ScrollingTreeOverflowScrollingNode): * page/scrolling/ios/ScrollingTreeIOS.cpp: (WebCore::ScrollingTreeIOS::createScrollingTreeNode): * page/scrolling/mac/ScrollingTreeFixedNode.mm: (WebCore::ScrollingTreeFixedNode::ScrollingTreeFixedNode): * page/scrolling/mac/ScrollingTreeMac.cpp: (ScrollingTreeMac::createScrollingTreeNode): * page/scrolling/mac/ScrollingTreeStickyNode.mm: (WebCore::ScrollingTreeStickyNode::ScrollingTreeStickyNode): * platform/graphics/GraphicsLayerClient.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): (WebCore::scrollCoordinationRoleForNodeType): (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2018-12-22 Carlos Garcia Campos <cgarcia@igalia.com> [HarfBuzz] Width not correctly reported as 0 for zero font size https://bugs.webkit.org/show_bug.cgi?id=192986 Reviewed by Michael Catanzaro. Fixes test fast/text/font-size-zero.html * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Use empty advances for glyphs when the font size is zero. 2018-12-20 Yusuke Suzuki <yusukesuzuki@slowstart.org> Use Ref<> as much as possible https://bugs.webkit.org/show_bug.cgi?id=192808 Reviewed by Alex Christensen. * Modules/encryptedmedia/NavigatorEME.cpp: (WebCore::NavigatorEME::requestMediaKeySystemAccess): * Modules/fetch/FetchBody.cpp: (WebCore::FetchBody::bodyAsFormData const): * Modules/geolocation/Geolocation.cpp: (WebCore::Geolocation::getCurrentPosition): (WebCore::Geolocation::watchPosition): * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::objectStoreNames const): * Modules/indexeddb/IDBDatabase.h: * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::indexNames const): * Modules/indexeddb/IDBObjectStore.h: * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::scheduleOperation): * Modules/indexeddb/IDBTransaction.h: * Modules/indexeddb/client/TransactionOperation.h: (WebCore::IDBClient::createTransactionOperation): * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::getUserMedia const): (WebCore::MediaDevices::getDisplayMedia const): * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::create): * Modules/mediastream/UserMediaRequest.h: * Modules/webaudio/AudioParam.cpp: (WebCore::AudioParam::calculateFinalValues): * Modules/webaudio/ScriptProcessorNode.cpp: (WebCore::ScriptProcessorNode::initialize): * Modules/webdatabase/SQLStatement.cpp: (WebCore::SQLStatement::execute): * Modules/webgpu/WebGPU.cpp: (WebCore::WebGPU::requestAdapter const): * Modules/webgpu/WebGPUAdapter.cpp: (WebCore::WebGPUAdapter::create): * Modules/webgpu/WebGPUAdapter.h: * Modules/webgpu/WebGPUBuffer.cpp: (WebCore::WebGPUBuffer::create): * Modules/webgpu/WebGPUBuffer.h: * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::beginRenderPass): * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::create): (WebCore::WebGPUDevice::createBuffer const): (WebCore::WebGPUDevice::createShaderModule const): (WebCore::WebGPUDevice::createRenderPipeline const): (WebCore::WebGPUDevice::createCommandBuffer const): * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::create): * Modules/webgpu/WebGPURenderPassEncoder.h: * Modules/webgpu/WebGPURenderPipeline.cpp: (WebCore::WebGPURenderPipeline::create): * Modules/webgpu/WebGPURenderPipeline.h: * Modules/webgpu/WebGPUShaderModule.cpp: (WebCore::WebGPUShaderModule::create): * Modules/webgpu/WebGPUShaderModule.h: * Modules/webgpu/WebGPUTexture.cpp: (WebCore::WebGPUTexture::createDefaultTextureView): * Modules/webgpu/WebGPUTextureView.cpp: (WebCore::WebGPUTextureView::create): * Modules/webgpu/WebGPUTextureView.h: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::rangeMatchesTextNearRange): * accessibility/atk/AXObjectCacheAtk.cpp: (WebCore::AXObjectCache::nodeTextChangePlatformNotification): * accessibility/atk/WebKitAccessibleHyperlink.cpp: (webkitAccessibleHyperlinkGetStartIndex): (webkitAccessibleHyperlinkGetEndIndex): * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (getSelectionOffsetsForObject): * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper _convertToNSRange:]): * bindings/js/JSDOMGlobalObjectTask.cpp: * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::queueTaskToEventLoop): * bindings/js/JSWorkerGlobalScopeBase.cpp: (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop): * bindings/js/ScriptControllerMac.mm: (WebCore::ScriptController::createScriptInstanceForWidget): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): (WebCore::SerializedScriptValue::create): * bridge/objc/objc_instance.h: * bridge/objc/objc_instance.mm: (ObjcInstance::create): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::currentColorOrValidColor const): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForShorthandProperties): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesForGridShorthand): (WebCore::ComputedStyleExtractor::getBackgroundShorthandValue): * css/CSSComputedStyleDeclaration.h: * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::load): * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::rules): * css/FontFace.cpp: (WebCore::FontFace::unicodeRange const): (WebCore::FontFace::featureSettings const): * css/InspectorCSSOMWrappers.cpp: (WebCore::InspectorCSSOMWrappers::collectFromStyleSheetContents): * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::strokeDashArrayToCSSValueList): (WebCore::ComputedStyleExtractor::adjustSVGPaintForCurrentColor const): * css/StyleResolver.cpp: (WebCore::StyleResolver::createFilterOperations): * css/StyleRule.cpp: (WebCore::StyleRuleBase::createCSSOMWrapper const): * css/StyleRule.h: * dom/ChildListMutationScope.cpp: (WebCore::ChildListMutationAccumulator::getOrCreate): * dom/ChildListMutationScope.h: * dom/DocumentMarkerController.cpp: (WebCore::updateRenderedRectsForMarker): * dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): * dom/PointerEvent.h: * dom/UserGestureIndicator.h: (WebCore::UserGestureToken::create): * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::applyAlternativeTextToRange): (WebCore::AlternativeTextController::respondToUnappliedSpellCorrection): (WebCore::AlternativeTextController::respondToUnappliedEditing): (WebCore::AlternativeTextController::markPrecedingWhitespaceForDeletedAutocorrectionAfterCommand): (WebCore::AlternativeTextController::respondToMarkerAtEndOfWord): * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::applyBlockStyle): (WebCore::ApplyStyleCommand::pushDownInlineStyleAroundNode): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::targetRanges const): (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): (WebCore::CompositeEditCommand::moveParagraphs): * editing/DeleteSelectionCommand.cpp: (WebCore::DeleteSelectionCommand::mergeParagraphs): * editing/Editing.cpp: (WebCore::visiblePositionForIndexUsingCharacterIterator): * editing/EditingStyle.cpp: (WebCore::EditingStyle::removeStyleConflictingWithStyleOfNode): (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const): (WebCore::EditingStyle::prepareToApplyAt): (WebCore::EditingStyle::mergeInlineAndImplicitStyleOfElement): (WebCore::EditingStyle::mergeStyleFromRulesForSerialization): (WebCore::EditingStyle::removeStyleFromRulesAndContext): (WebCore::extractPropertiesNotIn): * editing/Editor.cpp: (WebCore::Editor::setBaseWritingDirection): (WebCore::Editor::setComposition): * editing/EditorCommand.cpp: (WebCore::executeApplyParagraphStyle): (WebCore::executeMakeTextWritingDirectionLeftToRight): (WebCore::executeMakeTextWritingDirectionNatural): (WebCore::executeMakeTextWritingDirectionRightToLeft): * editing/FormatBlockCommand.cpp: (WebCore::FormatBlockCommand::formatRange): * editing/RemoveFormatCommand.cpp: (WebCore::RemoveFormatCommand::doApply): * editing/ReplaceRangeWithTextCommand.cpp: (WebCore::ReplaceRangeWithTextCommand::targetRanges const): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline): (WebCore::handleStyleSpansBeforeInsertion): (WebCore::ReplaceSelectionCommand::handleStyleSpans): * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::targetRanges const): * editing/TextCheckingHelper.cpp: (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar): * editing/TypingCommand.cpp: (WebCore::TypingCommand::insertText): (WebCore::TypingCommand::willAddTypingToOpenCommand): * editing/VisibleUnits.cpp: (WebCore::distanceBetweenPositions): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::selectionInWebArchiveFormat): * editing/ios/DictationCommandIOS.cpp: (WebCore::DictationCommandIOS::doApply): * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection): (WebCore::Editor::removeUnchangeableStyles): (WebCore::Editor::writeImageToPasteboard): * editing/mac/EditorMac.mm: (WebCore::Editor::replaceNodeFromPasteboard): (WebCore::Editor::imageInWebArchiveFormat): * editing/markup.cpp: (WebCore::styleFromMatchedRulesAndInlineDecl): (WebCore::createFragmentForTransformToFragment): * fileapi/FileReaderLoader.cpp: (WebCore::FileReaderLoader::didFinishLoading): * html/FTPDirectoryDocument.cpp: (WebCore::createTemplateDocumentData): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::scheduleEvent): (WebCore::HTMLMediaElement::createMediaControls): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::createSharedCellStyle): * html/HTMLTableElement.h: * html/URLUtils.h: (WebCore::URLUtils<T>::origin const): * html/parser/HTMLConstructionSite.cpp: (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): * html/shadow/TextControlInnerElements.cpp: (WebCore::TextControlInnerElement::resolveCustomStyle): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::createNewCue): * inspector/DOMPatchSupport.cpp: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::openInNewTab): * inspector/InspectorStyleSheet.cpp: (WebCore::asCSSRuleList): (WebCore::InspectorStyle::styleWithProperties const): (WebCore::InspectorStyleSheet::ensureSourceData): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext): * inspector/agents/InspectorIndexedDBAgent.cpp: (WebCore::Inspector::keyPathFromIDBKeyPath): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::archive): * loader/EmptyClients.cpp: (WebCore::EmptyStorageNamespaceProvider::createSessionStorageNamespace): (WebCore::EmptyStorageNamespaceProvider::createLocalStorageNamespace): (WebCore::EmptyStorageNamespaceProvider::createEphemeralLocalStorageNamespace): (WebCore::EmptyStorageNamespaceProvider::createTransientLocalStorageNamespace): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::shouldInterruptLoadForXFrameOptions): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/WorkerThreadableLoader.cpp: (WebCore::WorkerThreadableLoader::loadResourceSynchronously): * loader/archive/mhtml/MHTMLParser.cpp: (WebCore::MHTMLParser::addResourceToArchive): (WebCore::MHTMLParser::parseNextPart): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::addImageToCache): (WebCore::MemoryCache::removeResourcesWithOrigin): * page/DOMWindow.cpp: (WebCore::DOMWindow::getMatchedCSSRules const): (WebCore::DOMWindow::createWindow): * page/EventHandler.cpp: (WebCore::textDistance): * page/Page.cpp: (WebCore::Page::userStyleSheet const): * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFilterOperations): * page/ios/FrameIOS.mm: (WebCore::Frame::initWithSimpleHTMLDocument): (WebCore::Frame::interpretationsForCurrentRoot const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::fadeIn): (WebCore::ServicesOverlayController::Highlight::fadeOut): * platform/SharedBuffer.cpp: (WebCore::SharedBuffer::tryCreateArrayBuffer const): * platform/audio/HRTFElevation.cpp: (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation): * platform/audio/SincResampler.cpp: (WebCore::SincResampler::consumeSource): * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp: (WebCore::AudioFileReader::createBus): * platform/audio/mac/AudioFileReaderMac.cpp: (WebCore::AudioFileReader::createBus): * platform/graphics/Icon.h: (WebCore::Icon::create): * platform/graphics/InbandTextTrackPrivate.h: (WebCore::InbandTextTrackPrivate::create): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::shouldWaitForLoadingOfResource): * platform/graphics/avfoundation/objc/AudioTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::fulfillRequestWithKeyData): (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::create): (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::create): (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset): * platform/graphics/avfoundation/objc/VideoTrackPrivateMediaSourceAVFObjC.h: * platform/graphics/ca/TileController.cpp: (WebCore::TileController::createTileLayer): * platform/graphics/ca/TileController.h: * platform/graphics/ca/win/CACFLayerTreeHost.cpp: (WebCore::CACFLayerTreeHost::acceleratedCompositingAvailable): (WebCore::CACFLayerTreeHost::create): * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: (WebCore::GPUBuffer::create): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::updateTracks): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::processMpegTsSection): (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::paint): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsinkNewSample): * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp: (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): * platform/graphics/iso/ISOTrackEncryptionBox.cpp: (WebCore::ISOTrackEncryptionBox::parse): * platform/graphics/texmap/TextureMapperAnimation.cpp: (WebCore::applyFilterAnimation): * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp: (WebCore::TextureMapperPlatformLayerBuffer::clone): * platform/graphics/transforms/TransformOperations.cpp: (WebCore::TransformOperations::blendByMatchingOperations const): * platform/image-decoders/ico/ICOImageDecoder.cpp: (WebCore::ICOImageDecoder::setDataForPNGDecoderAtIndex): * platform/mock/mediasource/MockBox.cpp: (WebCore::MockInitializationBox::MockInitializationBox): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::create): (WebCore::MockSourceBufferPrivate::append): * platform/mock/mediasource/MockSourceBufferPrivate.h: * platform/mock/mediasource/MockTracks.h: (WebCore::MockTextTrackPrivate::create): (WebCore::MockVideoTrackPrivate::create): * platform/network/FormData.h: (WebCore::FormData::decode): * platform/network/cocoa/CookieStorageObserver.h: * platform/network/cocoa/CookieStorageObserver.mm: (WebCore::CookieStorageObserver::create): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::appendEncodedBlobItemToSoupMessageBody): (WebCore::ResourceRequest::updateSoupMessageBody const): * platform/text/hyphen/HyphenationLibHyphen.cpp: (WebCore::HyphenationDictionary::createNull): (WebCore::HyphenationDictionary::create): * platform/win/SearchPopupMenuWin.cpp: (WebCore::SearchPopupMenuWin::SearchPopupMenuWin): (WebCore::SearchPopupMenuWin::popupMenu): * platform/win/SearchPopupMenuWin.h: * rendering/RenderThemeIOS.mm: (WebCore::applyCommonButtonPaddingToStyle): (WebCore::RenderThemeIOS::paintProgressBar): (WebCore::RenderThemeIOS::adjustButtonStyle const): (WebCore::paintAttachmentIcon): * rendering/svg/SVGRenderTreeAsText.cpp: (WebCore::writeSVGResourceContainer): * storage/Storage.cpp: (WebCore::Storage::create): (WebCore::Storage::Storage): * storage/Storage.h: (WebCore::Storage::area const): * storage/StorageNamespace.h: * storage/StorageNamespaceProvider.cpp: (WebCore::StorageNamespaceProvider::localStorageArea): * storage/StorageNamespaceProvider.h: * svg/SVGElement.cpp: (WebCore::SVGElement::getPresentationAttribute): * svg/SVGFEBlendElement.cpp: (WebCore::SVGFEBlendElement::build): * svg/SVGFEColorMatrixElement.cpp: (WebCore::SVGFEColorMatrixElement::build): * svg/SVGFEComponentTransferElement.cpp: (WebCore::SVGFEComponentTransferElement::build): * svg/SVGFECompositeElement.cpp: (WebCore::SVGFECompositeElement::build): * svg/SVGFEDiffuseLightingElement.cpp: (WebCore::SVGFEDiffuseLightingElement::build): * svg/SVGFEDisplacementMapElement.cpp: (WebCore::SVGFEDisplacementMapElement::build): * svg/SVGFEDropShadowElement.cpp: (WebCore::SVGFEDropShadowElement::build): * svg/SVGFEGaussianBlurElement.cpp: (WebCore::SVGFEGaussianBlurElement::build): * svg/SVGFEMergeElement.cpp: (WebCore::SVGFEMergeElement::build): * svg/SVGFEMorphologyElement.cpp: (WebCore::SVGFEMorphologyElement::build): * svg/SVGFEOffsetElement.cpp: (WebCore::SVGFEOffsetElement::build): * svg/SVGFESpecularLightingElement.cpp: (WebCore::SVGFESpecularLightingElement::build): * svg/SVGFETileElement.cpp: (WebCore::SVGFETileElement::build): * testing/GCObservation.h: * xml/XSLTProcessor.cpp: (WebCore::XSLTProcessor::createDocumentFromSource): * xml/parser/XMLDocumentParser.cpp: (WebCore::XMLDocumentParser::parseDocumentFragment): 2018-12-21 Chris Dumez <cdumez@apple.com> navigator.userAgent in service workers does not reflect customUserAgent set by client https://bugs.webkit.org/show_bug.cgi?id=192951 Reviewed by Youenn Fablet. Whenever a service worker client registers itself, also pass its effective user agent. In the network process, for each origin, we store the latest client's user agent and use it when starting the service worker. * dom/Document.cpp: (WebCore::Document::setServiceWorkerConnection): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient): * workers/service/SWClientConnection.h: * workers/service/server/SWServer.cpp: (WebCore::SWServer::serviceWorkerClientUserAgent const): (WebCore::SWServer::installContextData): (WebCore::SWServer::runServiceWorker): (WebCore::SWServer::registerServiceWorkerClient): * workers/service/server/SWServer.h: * workers/service/server/SWServerToContextConnection.h: * workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::userAgent const): * workers/service/server/SWServerWorker.h: 2018-12-21 Youenn Fablet <youenn@apple.com> RTCRtpSender.setParameters() does set active parameter https://bugs.webkit.org/show_bug.cgi?id=192848 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::updateRTCRtpSendParameters): The routine was updating the local value, not the out parameter. 2018-12-21 Eric Carlson <eric.carlson@apple.com> 'ended' Event doesn't fire on MediaStreamTrack when a USB camera is unplugged https://bugs.webkit.org/show_bug.cgi?id=187896 <rdar://problem/42681445> Reviewed by Jer Noble. No new tests, tested manually. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::deviceDisconnected): (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver deviceConnectedDidChange:]): * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp: (WebCore::deviceHasInputStreams): (WebCore::isValidCaptureDevice): (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Deleted. * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::setCaptureDevice): (WebCore::CoreAudioSharedUnit::devicesChanged): (WebCore::CoreAudioSharedUnit::startProducingData): (WebCore::CoreAudioSharedUnit::startInternal): (WebCore::CoreAudioSharedUnit::verifyIsCapturing): (WebCore::CoreAudioSharedUnit::captureFailed): (WebCore::CoreAudioCaptureSourceFactory::devicesChanged): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioSharedUnit::setCaptureDeviceID): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: 2018-12-20 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r239353): iOS WK1 Assertion failure in notifyChildNodeRemoved while running TestWebKitAPI.QuickLook.LegacyQuickLookContent https://bugs.webkit.org/show_bug.cgi?id=192859 <rdar://problem/46887237> Reviewed by Antti Koivisto. After r239353, ScriptDisallowedScope::InMainThread::isScriptAllowed() may return false when the web thread is inside a delegate callback even when there is a ScriptDisallowedScope defined. Replace the existign debug assertions which assert !ScriptDisallowedScope::InMainThread::isScriptAllowed() by a newly added ScriptDisallowedScope::InMainThread::hasDisallowedScope to avoid hitting this assertion. Tests: TestWebKitAPI.QuickLook.LegacyQuickLookContent * dom/ContainerNodeAlgorithms.cpp: (WebCore::notifyChildNodeInserted): (WebCore::notifyChildNodeRemoved): * dom/Document.cpp: (WebCore::Document::nodeChildrenWillBeRemoved): (WebCore::Document::nodeWillBeRemoved): * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::hasDisallowedScope): * html/HTMLFormElement.cpp: (WebCore:: const): 2018-12-21 Joseph Pecoraro <pecoraro@apple.com> Update status of some WebCore features in features.json https://bugs.webkit.org/show_bug.cgi?id=192998 Reviewed by Tim Horton. * features.json: - Variation Fonts: Supported - Conic Gradients: Supported in Preview - Web Share: Supported in Preview - <datalist>: Supported in Preview - Intersection Observers: Supported in Preview 2018-12-21 Zalan Bujtas <zalan@apple.com> [iOS] Using file upload can trigger a crash under RenderThemeIOS::paintFileUploadIconDecorations() https://bugs.webkit.org/show_bug.cgi?id=192357 <rdar://problem/42852260> Reviewed by Simon Fraser. Do not try to paint the file picker when painting is disabled. * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): 2018-12-21 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] userPresence should always be true https://bugs.webkit.org/show_bug.cgi?id=192835 <rdar://problem/46538788> Reviewed by Brent Fulgham. In the current spec as of 7 August 2018, userPresence is suggested to set to the inverse of userVerification. This doesn't comply with the CTAP spec. Details in: https://github.com/w3c/webauthn/issues/1123. After discussing with other members of the working group, we decided to make userPresence always default to true. Covered by exisiting tests. * Modules/webauthn/fido/DeviceRequestConverter.cpp: (fido::encodeGetAssertionRequestAsCBOR): 2018-12-21 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Import an APDU coder from Chromium https://bugs.webkit.org/show_bug.cgi?id=192949 <rdar://problem/46879933> Reviewed by Brent Fulgham. This patch imports an APDU coder from Chromium. Here is the documentation: https://fidoalliance.org/specs/fido-u2f-v1.2-ps-20170411/fido-u2f-raw-message-formats-v1.2-ps-20170411.html#u2f-message-framing APDU is a binary format to frame any U2F requests/responses into binaries. It is equivalent to CBOR in CTAP2. Here is a list of files that are imported from Chromium: https://cs.chromium.org/chromium/src/components/apdu/apdu_command.cc?rcl=a2f290c10d132f53518e7f99d5635ee814ff8090 https://cs.chromium.org/chromium/src/components/apdu/apdu_command.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6 https://cs.chromium.org/chromium/src/components/apdu/apdu_response.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6 https://cs.chromium.org/chromium/src/components/apdu/apdu_response.h?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6 https://cs.chromium.org/chromium/src/components/apdu/apdu_unittest.cc?rcl=867b103481f6f4ccc79a69bba16c11eefac3cdb6 Covered by API tests. * Modules/webauthn/apdu/ApduCommand.cpp: Added. (apdu::ApduCommand::createFromMessage): (apdu::ApduCommand::ApduCommand): (apdu::ApduCommand::getEncodedCommand const): * Modules/webauthn/apdu/ApduCommand.h: Added. * Modules/webauthn/apdu/ApduResponse.cpp: Added. (apdu::ApduResponse::createFromMessage): (apdu::ApduResponse::ApduResponse): (apdu::ApduResponse::getEncodedResponse const): * Modules/webauthn/apdu/ApduResponse.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-12-21 Jer Noble <jer.noble@apple.com> Convert raw CDMSessionMediaSourceAVFObjC pointer in MediaPlayerPrivateMediaSourceAVFObjC https://bugs.webkit.org/show_bug.cgi?id=192985 <rdar://problem/46750743> Reviewed by Eric Carlson. Make m_session a RefPtr; drive-by fix: make m_mediaElement in WebKitMediaKeys a WeakPtr. * Modules/encryptedmedia/legacy/WebKitMediaKeys.cpp: (WebCore::WebKitMediaKeys::setMediaElement): * Modules/encryptedmedia/legacy/WebKitMediaKeys.h: * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::MediaPlayerPrivateMediaSourceAVFObjC): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setCDMSession): 2018-12-21 Justin Michaud <justin_michaud@apple.com> CSS variables don't work for colors in "border" property https://bugs.webkit.org/show_bug.cgi?id=192922 Reviewed by Simon Fraser. ParseColorFunction no longer consumes anything if the color was not valid. Test: css-custom-properties-api/border-variable-parsing.html * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseColorFunction): 2018-12-21 Justin Fan <justin_fan@apple.com> [WebGPU] GPUBindGroupLayout refactoring: no HashMap, and failure logging https://bugs.webkit.org/show_bug.cgi?id=192990 Reviewed by Myles C. Maxfield. Refactor away the unnecessary HashMaps when creating MTLArgumentEncoders in GPUBindGroupLayout creation. Also update GPUBindGroupLayout::create -> tryCreate, in order to better handle Objective-C exceptions. No new tests; no change in behavior. * Modules/webgpu/WebGPUBindGroupLayout.cpp: (WebCore::WebGPUBindGroupLayout::create): (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout): * Modules/webgpu/WebGPUBindGroupLayout.h: (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createBindGroupLayout const): * platform/graphics/gpu/GPUBindGroupLayout.h: * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::tryCreateBindGroupLayout const): Renamed from ::create*. Now returning a RefPtr. (WebCore::GPUDevice::createBindGroupLayout const): Deleted. * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: (WebCore::appendArgumentToArray): (WebCore::newEncoder): (WebCore::GPUBindGroupLayout::tryCreate): Renamed from ::create. Now returning a RefPtr. (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): (WebCore::appendArgumentToArrayInMap): Deleted. (WebCore::GPUBindGroupLayout::create): Deleted. Deleted unneeded GPUBindGroupLayout.cpp: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUBindGroupLayout.cpp: Removed. 2018-12-21 Alejandro G. Castro <alex@igalia.com> [GTK][WPE] Add DeviceIdHashSaltStorage disk persistence https://bugs.webkit.org/show_bug.cgi?id=190466 Reviewed by Youenn Fablet. Added persistency to the DeviceIdHashSaltStorage. * platform/glib/FileSystemGlib.cpp: (WebCore::FileSystem::getFileSize): Implemented this function to allow sharing code with the statistics storage class. * platform/glib/KeyedDecoderGlib.cpp: (WebCore::KeyedDecoderGlib::dictionaryFromGVariant): Added a condition to control situations where the key is empty, it can happen if the user modifies the file in the disk. * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: Add include to make work compilation with debug, unified builds. 2018-12-21 Zalan Bujtas <zalan@apple.com> Synchronous media query evaluation could destroy current Frame/FrameView. https://bugs.webkit.org/show_bug.cgi?id=192781 <rdar://problem/34416793> Reviewed by Chris Dumez. Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid. Test: printing/print-with-media-query-destory.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::finishedLoading): * page/Frame.cpp: (WebCore::Frame::setPrinting): * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): * page/PrintContext.cpp: (WebCore::PrintContext::PrintContext): (WebCore::PrintContext::computePageRects): (WebCore::PrintContext::computePageRectsWithPageSizeInternal): (WebCore::PrintContext::begin): (WebCore::PrintContext::computeAutomaticScaleFactor): (WebCore::PrintContext::spoolPage): (WebCore::PrintContext::spoolRect): (WebCore::PrintContext::end): * page/PrintContext.h: (WebCore::PrintContext::frame const): Deleted. 2018-12-21 Wenson Hsieh <wenson_hsieh@apple.com> Setting the file wrapper and content type of an attachment to a PDF should update its image https://bugs.webkit.org/show_bug.cgi?id=192984 <rdar://problem/46798028> Reviewed by Tim Horton. Allow PDF data to be used to update enclosing image elements when setting the file wrapper for an attachment. Covered by a new API test: WKAttachmentTests.SetFileWrapperForPDFImageAttachment. * html/HTMLAttachmentElement.cpp: (WebCore::mimeTypeIsSuitableForInlineImageAttachment): (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData): 2018-12-21 Justin Michaud <justin_michaud@apple.com> Repeated background images with zero size should display the background color https://bugs.webkit.org/show_bug.cgi?id=192962 Reviewed by Antti Koivisto. Test: fast/backgrounds/background-repeat-with-zero-size.html * platform/LengthSize.h: (WebCore::LengthSize::isEmpty const): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::paintFillLayerExtended): * rendering/style/FillLayer.h: (WebCore::FillLayer::isEmpty const): 2018-12-21 Manuel Rego Casasnovas <rego@igalia.com> [css-grid] Fix percentages in relative offsets for grid items https://bugs.webkit.org/show_bug.cgi?id=190492 Reviewed by Sergio Villar Senin. The method RenderBoxModelObject::relativePositionOffset() was not considering the case of grid items, where the containing block is the grid area. The patch modifies the method so the new code uses overrideContainingBlockContentWidth|Height when required. Test: imported/w3c/web-platform-tests/css/css-grid/grid-items/grid-items-relative-offsets-002.html * rendering/RenderBox.cpp: Implement the physical versions of the already existent methods. (WebCore::RenderBox::overrideContainingBlockContentWidth const): (WebCore::RenderBox::overrideContainingBlockContentHeight const): (WebCore::RenderBox::hasOverrideContainingBlockContentWidth const): (WebCore::RenderBox::hasOverrideContainingBlockContentHeight const): * rendering/RenderBox.h: * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::relativePositionOffset const): Modified method to take into account overrideContainingBlockContentWidth|Height for grid items. * rendering/RenderBoxModelObject.h: Added new headers for physical virtual methods that will be overridden in RenderBox. (WebCore::RenderBoxModelObject::overrideContainingBlockContentWidth const): (WebCore::RenderBoxModelObject::overrideContainingBlockContentHeight const): (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentWidth const): (WebCore::RenderBoxModelObject::hasOverrideContainingBlockContentHeight const): 2018-12-20 Justin Fan <justin_fan@apple.com> [WebGPU] Convert WebGPUBindGroups into MTLArgumentEncoders https://bugs.webkit.org/show_bug.cgi?id=192956 Reviewed by Myles Maxfield. No testable behavior change. Existing tests cover possible crashing. Add GPUBindGroupLayoutMetal.mm: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Flesh out GPUBindGroupLayout::create: * platform/graphics/gpu/GPUBindGroupLayout.cpp: * platform/graphics/gpu/GPUBindGroupLayout.h: * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::createBindGroupLayout const): * platform/graphics/gpu/cocoa/GPUBindGroupLayoutMetal.mm: Added. (WebCore::appendArgumentToArrayInMap): Added. (WebCore::GPUBindGroupLayout::create): (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): (WebCore::MTLDataTypeForBindingType): Added. 2018-12-20 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, remove stray #pragma once added to .cpp file * svg/properties/SVGAttributeOwnerProxy.cpp: 2018-12-20 Justin Michaud <justin_michaud@apple.com> Adding runtime-enabled attribute to Element prevents inlining property access https://bugs.webkit.org/show_bug.cgi?id=192901 Add a call to flattenDictionaryObject after disabling runtime-enabled attributes. Reviewed by Ryosuke Niwa. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: (WebCore::JSTestEnabledBySettingPrototype::finishCreation): * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: (WebCore::JSTestGenerateIsReachablePrototype::finishCreation): * bindings/scripts/test/JS/JSTestNode.cpp: (WebCore::JSTestNodePrototype::finishCreation): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjPrototype::finishCreation): 2018-12-20 Chris Dumez <cdumez@apple.com> Use Optional::hasValue() instead of Optional::has_value() https://bugs.webkit.org/show_bug.cgi?id=192948 Reviewed by Tim Horton. * bindings/js/DOMPromiseProxy.h: (WebCore::DOMPromiseProxy<IDLType>::isFulfilled const): (WebCore::DOMPromiseProxy<IDLVoid>::isFulfilled const): (WebCore::DOMPromiseProxyWithResolveCallback<IDLType>::isFulfilled const): * dom/DataTransferItemList.h: (WebCore::DataTransferItemList::hasItems const): * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::captionDisplayMode): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::wouldTaintOrigin const): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::parseDemuxerSrcPadCaps): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcUpdatePresentationSize): * platform/mac/NSScrollerImpDetails.mm: (WebCore::ScrollerStyle::recommendedScrollerStyle): * rendering/RenderListItem.cpp: (WebCore::RenderListItem::setExplicitValue): 2018-12-20 Chris Dumez <cdumez@apple.com> Move HTTPS_UPGRADE code behind a runtime flag, off by default https://bugs.webkit.org/show_bug.cgi?id=192937 Reviewed by Youenn Fablet. Move HTTPS_UPGRADE code behind a runtime flag, off by default and drop the build time flag. * page/Settings.yaml: 2018-12-20 Youenn Fablet <youenn@apple.com> Remove custom constructors of ReadableStreamDefaultReader and ReadableStreamBYOBReader https://bugs.webkit.org/show_bug.cgi?id=192838 Reviewed by Chris Dumez. Generate constructor code in case of a Private but not Public constructor. Make sure this is correctly exposed in global objects. Add JS built-in constructor implementations for those two objects. Also add JS built-in constructors for controller and byob request. To keep existing behavior, JS built-ins calling these constructors need to pass an additional parameter that allows making the difference between a JS builtin caller or a JS caller. In the latter case, the constructor will throw. Covered by existing tests, no observable change of behavior. * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableByteStreamController.js: (initializeReadableByteStreamController): (getter.byobRequest): * Modules/streams/ReadableByteStreamInternals.js: (privateInitializeReadableByteStreamController): Deleted. (privateInitializeReadableStreamBYOBRequest): Deleted. * Modules/streams/ReadableStream.js: (initializeReadableStream): * Modules/streams/ReadableStreamBYOBReader.js: (initializeReadableStreamBYOBReader): * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamBYOBRequest.js: (initializeReadableStreamBYOBRequest): * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultController.js: (initializeReadableStreamDefaultController): (enqueue): * Modules/streams/ReadableStreamDefaultReader.js: (initializeReadableStreamDefaultReader): * Modules/streams/ReadableStreamInternals.js: (readableStreamDefaultControllerError): Deleted. * Sources.txt: * UnifiedSources-input.xcfilelist: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMBuiltinConstructor.h: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::addBuiltinGlobals): * bindings/js/JSReadableStreamPrivateConstructors.cpp: Removed. * bindings/js/JSReadableStreamPrivateConstructors.h: Removed. * bindings/scripts/CodeGeneratorJS.pm: (GeneratePropertiesHashTable): * bindings/scripts/preprocess-idls.pl: (shouldExposeInterface): 2018-12-20 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Remove hash from Client Data https://bugs.webkit.org/show_bug.cgi?id=192727 <rdar://problem/46746673> Reviewed by Brent Fulgham. The hash algorithm for hashing the client data is enforced to SHA_256 in the latest spec: https://www.w3.org/TR/webauthn/#sec-client-data. Therefore, we should remove it. Covered by existing tests. * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson): 2018-12-20 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Add a runtime flag for local authenticator https://bugs.webkit.org/show_bug.cgi?id=192792 <rdar://problem/46798738> Reviewed by Brent Fulgham. No tests. This patch adds a runtime flag for local authenticator and removes ways to set the runtime flag for web authentication in LegacyWebKit. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebAuthenticationLocalAuthenticatorEnabled): (WebCore::RuntimeEnabledFeatures::webAuthenticationLocalAuthenticatorEnabled const): 2018-12-20 Jeremy Jones <jeremyj@apple.com> Pointer lock causes abandoned documents https://bugs.webkit.org/show_bug.cgi?id=188727 rdar://problem/44248197 Reviewed by Simon Fraser. Fixes --world-leaks in these tests: pointer-lock/locked-element-removed-from-dom.html pointer-lock/mouse-event-delivery.html fast/shadow-dom/pointerlockelement-in-slot.html PointerLockController now uses WeakPtr instead of RefPtr because it has no need to extend the lifetime of a document. * page/PointerLockController.cpp: (WebCore::PointerLockController::elementRemoved): (WebCore::PointerLockController::documentDetached): (WebCore::PointerLockController::didAcquirePointerLock): * page/PointerLockController.h: 2018-12-20 Chris Dumez <cdumez@apple.com> Use Optional::valueOr() instead of Optional::value_or() https://bugs.webkit.org/show_bug.cgi?id=192933 Reviewed by Geoffrey Garen. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::convert): (WebCore::ApplePayPaymentHandler::didAuthorizePayment): * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::load): * Modules/indexeddb/IDBDatabaseIdentifier.h: (WebCore::IDBDatabaseIdentifier::hash const): * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::open): * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::applyConstraints): * Modules/mediastream/RTCDTMFSender.cpp: (WebCore::RTCDTMFSender::insertDTMF): * Modules/webdatabase/SQLTransaction.cpp: (WebCore::SQLTransaction::executeSql): * Modules/webvr/VRFrameData.cpp: (WebCore::VRFrameData::update): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSTransitionsForElement): * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::cancel): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/KeyframeEffect.cpp: (WebCore::computeMissingKeyframeOffsets): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): * animation/WebAnimation.cpp: (WebCore::WebAnimation::runPendingPlayTask): (WebCore::WebAnimation::runPendingPauseTask): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::write): * crypto/algorithms/CryptoAlgorithmHMAC.cpp: (WebCore::CryptoAlgorithmHMAC::generateKey): (WebCore::CryptoAlgorithmHMAC::importKey): * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt): (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt): * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): * crypto/keys/CryptoKeyRSA.cpp: (WebCore::CryptoKeyRSA::importJwk): * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt): (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt): * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::importSpki): (WebCore::CryptoKeyRSA::importPkcs8): * css/CSSComputedStyleDeclaration.cpp: (WebCore::counterToCSSValue): * css/CSSFontFace.cpp: (WebCore::calculateItalicRange): * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::doubleValue const): * css/CSSStyleSheet.cpp: (WebCore::CSSStyleSheet::addRule): * css/DOMMatrix.cpp: (WebCore::DOMMatrix::rotateSelf): * css/DOMMatrixReadOnly.cpp: (WebCore::DOMMatrixReadOnly::validateAndFixup): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueCounter): * css/parser/MediaQueryParser.cpp: (WebCore::MediaQueryParser::commitMediaQuery): * dom/Document.h: (WebCore::Document::referrerPolicy const): * dom/Element.cpp: (WebCore::toScrollAlignment): * dom/EventTarget.cpp: (WebCore::EventTarget::addEventListener): * dom/MutationObserver.cpp: (WebCore::MutationObserver::observe): * editing/cocoa/FontAttributeChangesCocoa.mm: (WebCore::FontChanges::platformFontFamilyNameForCSS const): * fileapi/File.cpp: (WebCore::File::File): * html/DOMTokenList.cpp: (WebCore::DOMTokenList::toggle): * html/HTMLOListElement.h: * html/ImageBitmap.cpp: (WebCore::croppedSourceRectangleWithFormatting): * html/canvas/CanvasPattern.cpp: (WebCore::CanvasPattern::setTransform): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::setTransform): (WebCore::CanvasRenderingContext2DBase::isPointInPathInternal): (WebCore::CanvasRenderingContext2DBase::isPointInStrokeInternal): * html/canvas/Path2D.cpp: (WebCore::Path2D::addPath): * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildAction): * inspector/InspectorFrontendHost.cpp: (WebCore::populateContextMenu): * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/MarginTypes.h: (WebCore::Layout::VerticalMargin::usedValues const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::width const): (WebCore::Display::Box::height const): (WebCore::Display::Box::contentBoxTop const): (WebCore::Display::Box::contentBoxLeft const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::Iterator::set): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::urlSelected): * loader/NavigationAction.cpp: * page/FrameView.cpp: (WebCore::FrameView::setLayoutViewportOverrideRect): (WebCore::FrameView::documentToAbsoluteScaleFactor const): (WebCore::FrameView::viewportSizeForCSSViewportUnits const): * page/Page.cpp: (WebCore::Page::setLowPowerModeEnabledOverrideForTesting): * page/SecurityOriginData.cpp: (WebCore::SecurityOriginData::databaseIdentifier const): * page/SecurityOriginData.h: (WebCore::SecurityOriginDataHash::hash): * page/SecurityOriginHash.h: (WebCore::SecurityOriginHash::hash): * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::setViewLayoutSize): * page/WindowFeatures.cpp: (WebCore::parseDialogFeatures): * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::updateStateMachine): (WebCore::AnimationBase::fireAnimationEventsIfNeeded): (WebCore::AnimationBase::getTimeToNextEvent const): (WebCore::AnimationBase::freezeAtTime): (WebCore::AnimationBase::getElapsedTime const): * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::updateAnimationTimer): * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::ResourceUsageThread::platformThreadBody): * page/linux/ResourceUsageThreadLinux.cpp: (WebCore::ResourceUsageThread::platformThreadBody): * platform/graphics/ComplexTextController.cpp: (WebCore::ComplexTextController::offsetForPosition): * platform/graphics/FontCache.h: (WebCore::FontDescriptionKey::computeHash const): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::drawText const): (WebCore::FontCascade::drawEmphasisMarks const): (WebCore::FontCascade::displayListForTextRun const): (WebCore::FontCascade::adjustSelectionRectForText const): (WebCore::FontCascade::codePath const): * platform/graphics/FontSelectionAlgorithm.cpp: (WebCore::FontSelectionAlgorithm::styleDistance const): * platform/graphics/FontSelectionAlgorithm.h: (WebCore::operator<<): (WebCore::FontSelectionSpecifiedCapabilities::computeWeight const): (WebCore::FontSelectionSpecifiedCapabilities::computeWidth const): (WebCore::FontSelectionSpecifiedCapabilities::computeSlope const): * platform/graphics/ShadowBlur.cpp: (WebCore::ShadowBlur::calculateLayerBoundingRect): * platform/graphics/avfoundation/cf/WebCoreAVCFResourceLoader.cpp: (WebCore::WebCoreAVCFResourceLoader::startLoading): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::paintWithVideoOutput): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::naturalSize): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setVisibleAndCoverageRects): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::preparePlatformFont): * platform/graphics/filters/FETurbulence.cpp: (WebCore::FETurbulence::fillRegion const): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamer): * platform/graphics/texmap/TextureMapperLayer.cpp: (WebCore::TextureMapperLayer::paintSelfAndChildrenWithReplica): (WebCore::TextureMapperLayer::replicaTransform): (WebCore::TextureMapperLayer::syncAnimations): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::transformedVisibleRect): (WebCore::CoordinatedGraphicsLayer::computeTransformedVisibleRect): * platform/graphics/transforms/TransformState.cpp: (WebCore::TransformState::mappedPoint const): (WebCore::TransformState::mapQuad const): (WebCore::TransformState::flattenWithTransform): * platform/network/CacheValidation.cpp: (WebCore::computeCurrentAge): (WebCore::computeFreshnessLifetimeForHTTPFamily): * platform/network/NetworkStateNotifier.cpp: (WebCore::NetworkStateNotifier::onLine): * rendering/FloatingObjects.cpp: (WebCore::FindNextFloatLogicalBottomAdapter::nextLogicalBottom const): (WebCore::FindNextFloatLogicalBottomAdapter::nextShapeLogicalBottom const): * rendering/GridBaselineAlignment.cpp: (WebCore::GridBaselineAlignment::ascentForChild const): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrack::setGrowthLimit): (WebCore::GridTrackSizingAlgorithm::initialBaseSize const): (WebCore::GridTrackSizingAlgorithm::initialGrowthLimit const): (WebCore::GridTrackSizingAlgorithm::sizeTrackToFitNonSpanningItem): (WebCore::sortByGridTrackGrowthPotential): (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes): * rendering/PaintInfo.h: (WebCore::PaintInfo::applyTransform): * rendering/RenderBox.cpp: (WebCore::RenderBox::computeLogicalHeight const): * rendering/RenderCounter.cpp: (WebCore::planCounter): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): * rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::baselinePosition const): (WebCore::RenderFlexibleBox::marginBoxAscentForChild): (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::gridGap const): (WebCore::RenderGrid::baselinePosition const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintLayerByApplyingTransform): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItem): (WebCore::RenderListBox::listIndexIsVisible): * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::calculateMaxColumnHeight const): * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalHeightToComputedHeight): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::cellBaselinePosition const): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::firstLineBaseline const): * rendering/RenderText.cpp: (WebCore::RenderText::computePreferredLogicalWidths): (WebCore::RenderText::previousOffset const): (WebCore::RenderText::previousOffsetForBackwardDeletion const): (WebCore::RenderText::nextOffset const): (WebCore::RenderText::stringView const): * rendering/RenderView.cpp: (WebCore::RenderView::layout): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::baselinePosition const): * rendering/mathml/RenderMathMLBlock.h: (WebCore::RenderMathMLBlock::ascentForChild): * rendering/style/GridPosition.cpp: (WebCore::GridPosition::max): * rendering/style/TextUnderlineOffset.h: (WebCore::TextUnderlineOffset::lengthOr const): * rendering/svg/RenderSVGContainer.cpp: (WebCore::RenderSVGContainer::nodeAtFloatPoint): * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::nodeAtFloatPoint): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::nodeAtFloatPoint): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::hitTestClipContent): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::postApplyResource): * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::nodeAtPoint): * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::nodeAtFloatPoint): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::nodeAtFloatPoint): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::clipToImageBuffer): * svg/SVGToOTFFontConversion.cpp: (WebCore::SVGToOTFFontConverter::processGlyphElement): (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter): 2018-12-20 Jer Noble <jer.noble@apple.com> REGRESSION (r239419): heap-use-after-free in AudioSourceProviderAVFObjC::finalizeCallback() https://bugs.webkit.org/show_bug.cgi?id=192941 <rdar://problem/46874096> Reviewed by Brent Fulgham. Don't delete the locked lock before unlocking the lock. * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::finalizeCallback): 2018-12-20 Keith Rollin <krollin@apple.com> Improve release-level page-load logging https://bugs.webkit.org/show_bug.cgi?id=192872 <rdar://problem/46850309> Reviewed by Chris Dumez. There are a number of reported bugs that are difficult or impossible to track down with our current level of logging. Additionally, some software groups lower in the page-loading stack have requested logging sufficient for tracking a user-visible error message down to the requested resource that caused the message. Add more-comprehensive logging to address these issues/requests. No new tests -- no changed functionality. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::setMainDocumentError): (WebCore::DocumentLoader::mainReceivedError): (WebCore::DocumentLoader::stopLoading): (WebCore::DocumentLoader::notifyFinished): (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::DocumentLoader::startLoadingMainResource): (WebCore::DocumentLoader::loadMainResource): (WebCore::DocumentLoader::cancelMainResourceLoad): * loader/FrameLoader.cpp: (WebCore::FrameLoader::urlSelected): (WebCore::FrameLoader::loadURLIntoChildFrame): (WebCore::FrameLoader::loadArchive): (WebCore::FrameLoader::loadInSameDocument): (WebCore::FrameLoader::loadFrameRequest): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::reloadWithOverrideEncoding): (WebCore::FrameLoader::reload): (WebCore::FrameLoader::setState): (WebCore::FrameLoader::checkLoadCompleteForThisFrame): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::loadDifferentDocumentItem): * loader/ProgressTracker.cpp: (WebCore::ProgressItem::ProgressItem): (WebCore::ProgressTracker::reset): (WebCore::ProgressTracker::progressStarted): (WebCore::ProgressTracker::progressCompleted): (WebCore::ProgressTracker::finalProgressComplete): (WebCore::ProgressTracker::incrementProgress): (WebCore::ProgressTracker::completeProgress): (WebCore::ProgressTracker::isAlwaysOnLoggingAllowed const): * loader/ProgressTracker.h: * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::loadDataURL): (WebCore::ResourceLoader::willSendRequestInternal): (WebCore::ResourceLoader::didFinishLoading): (WebCore::ResourceLoader::didFail): (WebCore::ResourceLoader::willSendRequestAsync): (WebCore::ResourceLoader::wasBlocked): (WebCore::ResourceLoader::cannotShowURL): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::willSendRequestInternal): (WebCore::=): (WebCore::SubresourceLoader::didReceiveResponse): (WebCore::SubresourceLoader::didFinishLoading): (WebCore::SubresourceLoader::didFail): (WebCore::SubresourceLoader::willCancel): * loader/cache/CachedResource.cpp: (WebCore::CachedResource::load): 2018-12-20 Jeremy Jones <jeremyj@apple.com> Switch tabs before retuning PiP video to inline. https://bugs.webkit.org/show_bug.cgi?id=192767 rdar://problem/46006046 Reviewed by Jer Noble. No new tests because this code path only happens with a user action on system UI. When exiting PiP, notify the fullscreen change observer so it can restore client UI state before exiting. * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): 2018-12-19 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, fix GTK build after r239410 It added a new file to the build, breaking the unified sources magic that obscured a bug in URLSoup.h. It forward-declares URL, but this never worked unless the URL.h header was included via another source file in the unified source bundle. * platform/network/soup/URLSoup.h: 2018-12-19 Chris Dumez <cdumez@apple.com> wtf/Optional.h: move-constructor and move-assignment operator should disengage the value being moved from https://bugs.webkit.org/show_bug.cgi?id=192728 <rdar://problem/46746779> Reviewed by Geoff Garen. * Modules/*: * animation/*: * bindings/*: * crypto/*: * css/*: * dom/*: * editing/*: * fileapi/*: * html/*: * inspector/*: * layout/*: * loader/*: * mathml/*: * page/*: * platform/*: * plugins/*: * rendering/*: * testing/*: * workers/*: * xml/*: 2018-12-19 Jer Noble <jer.noble@apple.com> Leak of MTAudioProcessingTap (304 bytes) in com.apple.WebKit.WebContent running WebKit layout tests https://bugs.webkit.org/show_bug.cgi?id=192896 <rdar://46732186> Reviewed by Eric Carlson. * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: (WebCore::AudioSourceProviderAVFObjC::initCallback): 2018-12-19 Timothy Hatcher <timothy@apple.com> REGRESSION (r232991): Switching to dark mode in Mail does not update the message view to be transparent https://bugs.webkit.org/show_bug.cgi?id=188891 rdar://problem/42344352 Reviewed by Simon Fraser. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): Don't return early when m_layerForOverhangAreas is null to avoid skipping setRootLayerConfigurationNeedsUpdate() and scheduleCompositingLayerUpdate(). 2018-12-19 Justin Fan <justin_fan@apple.com> [WebGPU] Add stubs for WebGPUPipelineLayout/Descriptor and device::createPipelineLayout https://bugs.webkit.org/show_bug.cgi?id=192843 <rdar://problem/46820395> Reviewed by Myles Maxfield. Test: webgpu/pipeline-layouts.html Implement the emtpy WebGPUPipelineLayout interface, and enable creation via WebGPUDevice::createPipelineLayout: * Modules/webgpu/WebGPUBindGroupLayout.cpp: (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout): * Modules/webgpu/WebGPUBindGroupLayout.h: (WebCore::WebGPUBindGroupLayout::bindGroupLayout const): Added getter. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createPipelineLayout const): Added. * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: Enable createPipelineLayout. * Modules/webgpu/WebGPUPipelineLayout.cpp: Added. (WebCore::WebGPUPipelineLayout::create): (WebCore::WebGPUPipelineLayout::WebGPUPipelineLayout): * Modules/webgpu/WebGPUPipelineLayout.h: Added. * Modules/webgpu/WebGPUPipelineLayout.idl: Added. * Modules/webgpu/WebGPUPipelineLayoutDescriptor.h: Added. * Modules/webgpu/WebGPUPipelineLayoutDescriptor.idl: Added. * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::createPipelineLayout const): Added. * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/GPUPipelineLayout.cpp: Added. (WebCore::GPUPipelineLayout::create): (WebCore::GPUPipelineLayout::GPUPipelineLayout): * platform/graphics/gpu/GPUPipelineLayout.h: Added. * platform/graphics/gpu/GPUPipelineLayoutDescriptor.h: Added. Add files and symbols to project: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Add missing include: * Modules/webgpu/WebGPUQueue.h: 2018-12-18 Ryosuke Niwa <rniwa@webkit.org> SVGUseElement::findTarget should return nullptr when there is a cycle https://bugs.webkit.org/show_bug.cgi?id=192840 Reviewed by Tim Horton. r233366 added an early return to updateShadowTree() when there is a cycle between an use element and its target. Consolidate this cycle detection code with the one in SVGUseElement::findTarget which detected cycles when the SVG use element itself had a corresponding element. No new tests since there should be no behavioral change. * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::updateShadowTree): (WebCore::SVGUseElement::findTarget const): 2018-12-19 Myles C. Maxfield <mmaxfield@apple.com> [WHLSL] Add a handwritten lexer https://bugs.webkit.org/show_bug.cgi?id=192294 Reviewed by Jon Lee. This is infrastructure necessary for https://bugs.webkit.org/show_bug.cgi?id=192355. The implementation matches the lexing rules in the spec (specifically, the rules that start with an uppercase letter). The spec is at https://github.com/gpuweb/WHLSL/blob/master/Spec/WHLSL.g4. This patch also modifies the lexer according to https://github.com/gpuweb/WHLSL/pull/283. No new tests because the lexer isn't hooked up yet; there are tests in the parser, once that gets committed. * Modules/webgpu/WHLSL/WHLSLLexer.cpp: Added. (WebCore::WHLSL::Lexer::Token::typeName): (WebCore::WHLSL::Lexer::recognizeKeyword): (WebCore::WHLSL::Lexer::consumeTokenFromStream): (WebCore::WHLSL::Lexer::skipWhitespaceAndComments): (WebCore::WHLSL::isWhitespace): (WebCore::WHLSL::isNewline): (WebCore::WHLSL::Lexer::skipWhitespace): (WebCore::WHLSL::Lexer::skipLineComment): (WebCore::WHLSL::Lexer::skipLongComment): (WebCore::WHLSL::Lexer::coreDecimalIntLiteral const): (WebCore::WHLSL::Lexer::decimalIntLiteral const): (WebCore::WHLSL::Lexer::decimalUintLiteral const): (WebCore::WHLSL::isHexadecimalCharacter): (WebCore::WHLSL::Lexer::coreHexadecimalIntLiteral const): (WebCore::WHLSL::Lexer::hexadecimalIntLiteral const): (WebCore::WHLSL::Lexer::hexadecimalUintLiteral const): (WebCore::WHLSL::Lexer::intLiteral const): (WebCore::WHLSL::Lexer::uintLiteral const): (WebCore::WHLSL::Lexer::digit const): (WebCore::WHLSL::Lexer::digitStar const): (WebCore::WHLSL::Lexer::character const): (WebCore::WHLSL::Lexer::coreFloatLiteralType1 const): (WebCore::WHLSL::Lexer::coreFloatLiteral const): (WebCore::WHLSL::Lexer::floatLiteral const): (WebCore::WHLSL::Lexer::validIdentifier const): (WebCore::WHLSL::Lexer::identifier const): (WebCore::WHLSL::Lexer::operatorName const): * Modules/webgpu/WHLSL/WHLSLLexer.h: Added. (WebCore::WHLSL::Lexer::Lexer): (WebCore::WHLSL::Lexer::consumeToken): (WebCore::WHLSL::Lexer::unconsumeToken): (WebCore::WHLSL::Lexer::state const): (WebCore::WHLSL::Lexer::setState): (WebCore::WHLSL::Lexer::isFullyConsumed const): (WebCore::WHLSL::Lexer::errorString): (WebCore::WHLSL::Lexer::string const): (WebCore::WHLSL::Lexer::anyCharacter const): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-12-18 Simon Fraser <simon.fraser@apple.com> Web Inspector: Timelines: correctly label Intersection Observer callbacks https://bugs.webkit.org/show_bug.cgi?id=192669 <rdar://problem/46702490> Reviewed by Joseph Pecoraro. Add InspectorInstrumentation::willFireObserverCallback() and use it to wrap calls to Intersection Observer, Performance Observer and Mutation Observer callbacks so that they get correctly labeled in the Inspector timeline. * dom/MutationObserver.cpp: (WebCore::MutationObserver::deliver): * en.lproj/Localizable.strings: * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::willFireObserverCallbackImpl): (WebCore::InspectorInstrumentation::didFireObserverCallbackImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::willFireObserverCallback): (WebCore::InspectorInstrumentation::didFireObserverCallback): * inspector/TimelineRecordFactory.cpp: (WebCore::TimelineRecordFactory::createObserverCallbackData): * inspector/TimelineRecordFactory.h: * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::willFireObserverCallback): (WebCore::InspectorTimelineAgent::didFireObserverCallback): (WebCore::toProtocol): * inspector/agents/InspectorTimelineAgent.h: * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::notify): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::deliver): 2018-12-19 Claudio Saavedra <csaavedra@igalia.com> ContentExtensions: DFANode.cpp:66:44: error: narrowing conversion of '-1' from 'int' to 'char' inside { } https://bugs.webkit.org/show_bug.cgi?id=192854 Reviewed by Alex Christensen. * contentextensions/DFANode.h: Define CharRange's chars as signed 2018-12-19 Youenn Fablet <youenn@apple.com> Remove RTCRtpTransceiver.setDirection https://bugs.webkit.org/show_bug.cgi?id=192869 Reviewed by Alex Christensen. Covered by rebased test. * Modules/mediastream/RTCRtpTransceiver.idl: 2018-12-19 Jer Noble <jer.noble@apple.com> Force synchronous decode in WebCoreDecompressionSession::decodeSampleSync() https://bugs.webkit.org/show_bug.cgi?id=192856 <rdar://problem/46843245> Reviewed by Alex Christensen. Some decoders exposed through VideoToolbox will decode asynchronously even when kVTDecodeInfo_Asynchronous is not set. Force synchronous behavior with a Semaphore. * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::decodeSampleSync): 2018-12-19 Megan Gardner <megan_gardner@apple.com> Allow clients to set the navigator platform https://bugs.webkit.org/show_bug.cgi?id=192735 Reviewed by Tim Horton. Expanded TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm. Lots of piping to allow the setting of a custom navigator platform. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomNavigatorPlatform): (WebCore::DocumentLoader::customNavigatorPlatform const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::navigatorPlatform const): * loader/FrameLoader.h: * page/Navigator.cpp: (WebCore::Navigator::platform const): * page/Navigator.h: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::platform const): (WebCore::NavigatorBase::platform): Deleted. * page/NavigatorBase.h: 2018-12-19 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r239347. Caused the leaks bot to hit an exception and the new test crashes on certain configurations. Reverted changeset: "Synchronous media query evaluation could destroy current Frame/FrameView." https://bugs.webkit.org/show_bug.cgi?id=192781 https://trac.webkit.org/changeset/239347 2018-12-19 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r239358. Revision caused imported/w3c/web-platform-tests/IndexedDB/ to crash on Debug bots Reverted changeset: "Clean up IndexedDB files between tests" https://bugs.webkit.org/show_bug.cgi?id=192796 https://trac.webkit.org/changeset/239358 2018-12-19 Don Olmstead <don.olmstead@sony.com> Sync some include directories in WebCore https://bugs.webkit.org/show_bug.cgi?id=192819 Reviewed by Michael Catanzaro. Added missing include directories around features that have only been enabled on Apple ports. Removes obsolete directories from list and moves harfbuzz directories into the freetype cmake file. * CMakeLists.txt: * platform/FreeType.cmake: 2018-12-19 Alicia Boya García <aboya@igalia.com> [MSE] Remove unused method: stopAskingForMoreSamples() https://bugs.webkit.org/show_bug.cgi?id=192754 Reviewed by Xabier Rodriguez-Calvar. The stopAskingForMoreSamples() method from SourceBufferPrivate is not being used by anyone. SourceBuffer is not calling it and no SourceBufferPrivate is implementing it. Let's remove that noise. * platform/graphics/SourceBufferPrivate.h: (WebCore::SourceBufferPrivate::setActive): (WebCore::SourceBufferPrivate::stopAskingForMoreSamples): Deleted. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::stopAskingForMoreSamples): Deleted. * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2018-12-19 Alicia Boya García <aboya@igalia.com> [MSE] Remove dead code: sourceBufferPrivateSeekToTime() https://bugs.webkit.org/show_bug.cgi?id=192827 Reviewed by Xabier Rodriguez-Calvar. This patch makes two dead code removal changes in SourceBufferPrivateClient: First, sourceBufferPrivateFastSeekTimeForMediaTime() is made pure virtual in SourceBufferPrivateClient. Since SourceBufferPrivateClient is only inherited by SourceBuffer, it makes no sense to have default implementations there (they will never be used), moreso it being a client interface. Second, sourceBufferPrivateSeekToTime() is removed entirely. It used to had an empty implementation, which SourceBuffer did not overwrite, therefore making any calls to it useless. All calls to sourceBufferPrivateSeekToTime() have been removed: SourceBufferPrivateAVFObjC::seekToTime(), which was also dead code itself, used to call this method. This patch deletes it completely. MockSourceBufferPrivate::seekToTime(), which only called this empty method, has also been removed along with its only usage in MockMediaSourcePrivate::seekToTime(). * platform/graphics/SourceBufferPrivateClient.h: (WebCore::SourceBufferPrivateClient::sourceBufferPrivateFastSeekTimeForMediaTime): Deleted. (WebCore::SourceBufferPrivateClient::sourceBufferPrivateSeekToTime): Deleted. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::seekToTime): Deleted. * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::seekToTime): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::seekToTime): Deleted. * platform/mock/mediasource/MockSourceBufferPrivate.h: 2018-12-19 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME] MediaKeySystemConfiguration distinctiveIdentifier and persistentState should default to optional https://bugs.webkit.org/show_bug.cgi?id=192815 Reviewed by Jer Noble. https://www.w3.org/TR/encrypted-media/#dom-mediakeysystemconfiguration says that distinctiveIdentifier and persistentState default to optional. Our implementation does not define a default leaving it to the first option of the enum, which currently is Required. * platform/encryptedmedia/CDMKeySystemConfiguration.h: 2018-12-19 Rob Buis <rbuis@igalia.com> Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList https://bugs.webkit.org/show_bug.cgi?id=192288 Reviewed by Frédéric Wang. Prefer return value to out parameter for parseAccessControlAllowList. * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::parse): * platform/network/HTTPParsers.h: (WebCore::parseAccessControlAllowList): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::filter): (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting): 2018-12-18 Zan Dobersek <zdobersek@igalia.com> REGRESSION(r235165): [GTK][WPE] Garbled rendering on GitLab https://bugs.webkit.org/show_bug.cgi?id=192230 Reviewed by Carlos Garcia Campos. Single tile can after r235165 be assigned multiple content updates without a commit occurring between each update, whereas before these commits were done for each update. To avoid repeating updates for a single tile purging information about the previous update, these updates are now accumulated inside a Vector and then iterated over during the commit phase. * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: (WebCore::CoordinatedBackingStoreTile::addUpdate): (WebCore::CoordinatedBackingStoreTile::swapBuffers): (WebCore::CoordinatedBackingStore::updateTile): (WebCore::CoordinatedBackingStoreTile::setBackBuffer): Deleted. * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: (WebCore::CoordinatedBackingStoreTile::scale const): 2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] A copied text selection is pasted as a web archive attachment in the entry view in Messages https://bugs.webkit.org/show_bug.cgi?id=192842 <rdar://problem/46823586> Reviewed by Tim Horton. Temporarily revert a behavior change introduced by r238661, where we now add "com.apple.webarchive" as a registered UTI when dragging or copying a text selection. This broke the Messages app on iOS, which currently inserts a copied or dragged text selection from WebKit-based views as a web archive file attachment. A fix for this is internally tracked in <rdar://problem/46830277>. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2018-12-18 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, add a missing UNUSED_PARAM() * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::getPrivateImpl): 2018-12-18 Justin Michaud <justin_michaud@apple.com> Update CSS Properties and Values API to use new cycle fallback behaviour https://bugs.webkit.org/show_bug.cgi?id=192800 Reviewed by Antti Koivisto. Make CSS variables that are registered and involved in a cycle be treated as invalid. This also fixes a crash in the wpt tests where relative units and calc() in a registered property's initial value would break things instead of failing. * css/CSSCustomPropertyValue.h: * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableReference): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyCascadedCustomProperty): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): 2018-12-18 Daniel Bates <dabates@apple.com> Wrong value for key property in keydown and keyup events generated holding Control key https://bugs.webkit.org/show_bug.cgi?id=192788 <rdar://problem/46795214> Reviewed by Wenson Hsieh. Similar to what we do on Mac, compute the DOM key property from the characters ignoring modifier keys input string when the Control key is held down. * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::keyForKeyEvent): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::keyForKeyEvent): 2018-12-18 Sihui Liu <sihui_liu@apple.com> Clean up IndexedDB files between tests https://bugs.webkit.org/show_bug.cgi?id=192796 Reviewed by Geoffrey Garen. We should clean up the IndexedDB files between tests to make sure each test is independent of others. This patch also fixes some issues in IDB. Covered by existing tests. * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince): We should shut down all open databases instead of databases from open database connections before deleting files, because database starts accessing files before connection to database is established. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::shutdownForClose): We should shutdown database after tasks in queue are completed, because tasks have pointer of UniqueIDBDatabase and UniqueIDBDatabase can be destructed after shutdown. (WebCore::IDBServer::UniqueIDBDatabase::didDeleteBackingStore): didDeleteBackingStore can be posted to main thread after immediateCloseForUserDelete, and timer should not be invoked during the hard close. (WebCore::IDBServer::UniqueIDBDatabase::handleDatabaseOperations): Tasks like didOpenBackingStore could be posted from database thread to main thread after immediateCloseForUserDelete, but we know the backing store will be deleted soon, so no need to handle any database operation. (WebCore::IDBServer::UniqueIDBDatabase::performPrefetchCursor): performPrefetchCursor needs to be aware of whether UniqueIDBDatabase is being closed, so that it will not access m_backingStore when m_backingStore may already be deleted. (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete): immediateCloseForUserDelete does not handle transactions that are in the process of commit or abort. m_objectStoreTransactionCounts and m_objectStoreWriteTransactions may be used by those transactions in transactionCompleted, so they do not need to be cleared here. 2018-12-18 Myles C. Maxfield <mmaxfield@apple.com> Thick overlines and line-throughs grow in the wrong direction https://bugs.webkit.org/show_bug.cgi?id=192264 Reviewed by Dean Jackson. Overlines should grow upward, and line-throughs should stay centered. Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintTextDecoration): * style/InlineTextBoxStyle.cpp: (WebCore::visualOverflowForDecorations): 2018-12-18 Ryosuke Niwa <rniwa@webkit.org> Some iOS app crash in FrameLoader::checkCompleted https://bugs.webkit.org/show_bug.cgi?id=192804 <rdar://problem/44240573> Reviewed by Tim Horton. It's possible for the main thread to call into WebCore / UIWebView selectors while Web thread is trying to send a delegate message. Disable the release assertion while this is happening so that iOS app would not crash. Unfortunately no new test as there is no way to easily test UIWebView in iOS, and this requires a race between the web thread & the main thread. * dom/ScriptDisallowedScope.h: (WebCore::ScriptDisallowedScope::InMainThread::isScriptAllowed): * platform/ios/wak/WebCoreThread.h: * platform/ios/wak/WebCoreThread.mm: (WebThreadDelegateMessageScope::WebThreadDelegateMessageScope): (WebThreadDelegateMessageScope::~WebThreadDelegateMessageScope): (SendDelegateMessage): 2018-12-18 David Kilzer <ddkilzer@apple.com> clang-tidy: Use const reference for MediaTime parameter to prevent object copy <https://webkit.org/b/192814> Reviewed by Mark Lam. * bindings/js/JSDOMConvertNumbers.h: (WebCore::JSConverter<IDLUnrestrictedDouble>::convert): 2018-12-18 Justin Fan <justin_fan@apple.com> [WebGPU] BindGroupLayout and Device::createBindGroupLayout https://bugs.webkit.org/show_bug.cgi?id=192817 Reviewed by Dean Jackson. Update bind-group-layouts to test new functionality. Implement the emtpy WebGPUBindGroupLayout interface, and enable creation via WebGPUDevice::createBindGroupLayout: * Modules/webgpu/WebGPUBindGroupLayout.cpp: Added. (WebCore::WebGPUBindGroupLayout::create): (WebCore::WebGPUBindGroupLayout::WebGPUBindGroupLayout): * Modules/webgpu/WebGPUBindGroupLayout.h: Added. * Modules/webgpu/WebGPUBindGroupLayout.idl: Added. Empty interface for now. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createBindGroupLayout const): Added. * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: * platform/graphics/gpu/GPUBindGroupLayout.cpp: Added. (WebCore::GPUBindGroupLayout::tryCreate): (WebCore::GPUBindGroupLayout::GPUBindGroupLayout): * platform/graphics/gpu/GPUBindGroupLayout.h: Added. * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::tryCreateBindGroupLayout const): Added. * platform/graphics/gpu/GPUDevice.h: Add files and symbols to project: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Missing includes that were previously provided via UnifiedSources: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/sql/SQLiteFileSystem.h: 2018-12-18 Youenn Fablet <youenn@apple.com> Make ReadableStreamXX constructs use PrivateIdentifier https://bugs.webkit.org/show_bug.cgi?id=192771 Reviewed by Chris Dumez. PrivateIdentifier is a better name for making sure a given construct does not show up in the global scope. Covered by existing binding tests. * Modules/streams/ReadableByteStreamController.idl: * Modules/streams/ReadableStreamBYOBReader.idl: * Modules/streams/ReadableStreamBYOBRequest.idl: * Modules/streams/ReadableStreamDefaultController.idl: * Modules/streams/ReadableStreamDefaultReader.idl: * bindings/scripts/CodeGeneratorJS.pm: (NeedsConstructorProperty): * bindings/scripts/preprocess-idls.pl: (shouldExposeInterface): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: Removed. * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h: Removed. * bindings/scripts/test/TestCustomConstructor.idl: Removed. 2018-12-18 Zalan Bujtas <zalan@apple.com> Synchronous media query evaluation could destroy current Frame/FrameView. https://bugs.webkit.org/show_bug.cgi?id=192781 <rdar://problem/34416793> Reviewed by Chris Dumez. Protect Frame and FrameView when coming back from printing and check if the current Frame/FrameView/FrameLoader objects are still valid. Test: printing/print-with-media-query-destory.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::finishedLoading): * page/Frame.cpp: (WebCore::Frame::setPrinting): * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): 2018-12-18 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: m3u8 content not shown, it should be text https://bugs.webkit.org/show_bug.cgi?id=192731 <rdar://problem/46747728> Reviewed by Devin Rousso. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::setResourceContent): Don't clobber data if setting empty content on a resource that has content. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::shouldTreatAsText): Additional non-"text/" mime types that can be treated as text. * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::isTextMediaPlaylistMIMEType): * platform/MIMETypeRegistry.h: Detect media playlist mime types that are text (m3u8/m3u). 2018-12-18 Daniel Bates <dabates@apple.com> Remove <meta http-equiv=set-cookie> support https://bugs.webkit.org/show_bug.cgi?id=185077 <rdar://problem/41791397> Reviewed by Brent Fulgham. Remove support for the HTTP-equiv. pragma Set-Cookie to set a cookie. In <https://github.com/whatwg/html/pull/3649> the HTML living standard was ammended to define this pragma as no-op. Chrome and Edge have also removed support for this pragma and Firefox has an open bug to remove it. * dom/Document.cpp: (WebCore::Document::processHttpEquiv): Emit a message that the Set-Cookie pragma is obsolete and was ignored instead of setting the cookie. * html/parser/XSSAuditor.cpp: (WebCore::isDangerousHTTPEquiv): We no longer need to consider the Set-Cookie pragma as dangerous and erase attribute http-equiv when we find it because we no longer honor this pragma. 2018-12-18 Justin Michaud <justin_michaud@apple.com> CSS Typed OM should expose attributeStyleMap https://bugs.webkit.org/show_bug.cgi?id=192671 Reviewed by Ryosuke Niwa. Exposes element.attributeStyleMap, adds a stub for the StylePropertyMap class, and updates the existing TypedOMCSSImageValue to not require a RenderObject so that it can still work inside attributeStyleMap. Test: css-typedom/attributeStyleMap.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * css/ElementCSSInlineStyle.idl: * css/typedom/StylePropertyMap.h: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.h. * css/typedom/StylePropertyMap.idl: Copied from Source/WebCore/css/typedom/StylePropertyMapReadOnly.idl. * css/typedom/StylePropertyMapReadOnly.cpp: Added. (WebCore::StylePropertyMapReadOnly::reifyValue): (WebCore::StylePropertyMapReadOnly::customPropertyValueOrDefault): * css/typedom/StylePropertyMapReadOnly.h: (WebCore::StylePropertyMapReadOnly::create): Deleted. (WebCore::StylePropertyMapReadOnly::get const): Deleted. (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): Deleted. * css/typedom/StylePropertyMapReadOnly.idl: * css/typedom/TypedOMCSSImageValue.h: * dom/Element.cpp: (WebCore::Element::attributeStyleMap): (WebCore::Element::setAttributeStyleMap): * dom/Element.h: * dom/ElementRareData.cpp: * dom/ElementRareData.h: (WebCore::ElementRareData::attributeStyleMap): (WebCore::ElementRareData::setAttributeStyleMap): * dom/StyledElement.cpp: (WebCore::StyledElement::ensureAttributeStyleMap): * dom/StyledElement.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::size): (WebCore::CanvasRenderingContext2DBase::drawImage): * platform/graphics/CustomPaintImage.cpp: (WebCore::extractComputedProperty): (WebCore::CustomPaintImage::doCustomPaint): 2018-12-18 Wenson Hsieh <wenson_hsieh@apple.com> Calling setValue() while typing should invoke -textDidChangeInTextField in the injected bundle https://bugs.webkit.org/show_bug.cgi?id=192785 <rdar://problem/45321184> Reviewed by Tim Horton. Makes a minor adjustment in `TextFieldInputType::setValue` to consider value changes as "user editing", if we're currently processing a keystroke from the user. This is useful for certain private clients, such as Safari, that need to know when the user is typing in a text form control, but the page is preventing default text insertion behavior and instead updating values programmatically. Test: fast/forms/call-text-did-change-in-text-field-when-typing.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::setValue): 2018-12-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Implement marginBeforeCollapsesWithParentMarginAfter https://bugs.webkit.org/show_bug.cgi?id=192801 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): 2018-12-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithSiblingMarginBeforeWithClearance https://bugs.webkit.org/show_bug.cgi?id=192799 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): 2018-12-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Implement marginAfterCollapsesWithParentMarginBefore https://bugs.webkit.org/show_bug.cgi?id=192798 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): 2018-12-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Expand marginsCollapseThrough collapsing logic https://bugs.webkit.org/show_bug.cgi?id=192794 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): 2018-12-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithNextSibling and marginBeforeCollapsesWithPreviousSibling collapsing logic https://bugs.webkit.org/show_bug.cgi?id=192791 Reviewed by Antti Koivisto. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): 2018-12-18 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Expand marginAfterCollapsesWithParentMarginAfter and marginBeforeCollapsesWithParentMarginBefore collapsing logic https://bugs.webkit.org/show_bug.cgi?id=192787 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::hasClearance): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithSiblingMarginBeforeWithClearance): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): 2018-12-17 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Clang] Fix compilation warnings WebCore/platform/graphics directory https://bugs.webkit.org/show_bug.cgi?id=192752 Reviewed by Don Olmstead. No new tests, no behavior changes. * platform/graphics/win/DIBPixelData.cpp: Enclosed bitmapType and bitmapPixelsPerMeter with #ifndef NDEBUG. * platform/graphics/win/FontPlatformDataWin.cpp: (WebCore::FontPlatformData::openTypeTable const): Use ASSERT_UNUSED instead of ASSERT. * platform/graphics/win/GraphicsContextWin.cpp: Removed unused variable 'deg2rad'. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp: Removed unused soft links MFCreateSampleGrabberSinkActivate, MFCreateMemoryBuffer and MFCreateSample. (WebCore::MediaPlayerPrivateMediaFoundation::MediaPlayerPrivateMediaFoundation): Reorder the initializer list. (WebCore::MediaPlayerPrivateMediaFoundation::seek): Use ASSERT_UNUSED instead of ASSERT. (WebCore::MediaPlayerPrivateMediaFoundation::setAllChannelVolumes): Ditto. (WebCore::MediaPlayerPrivateMediaFoundation::createSession): Ditto. (WebCore::MediaPlayerPrivateMediaFoundation::endSession): Ditto. (WebCore::MediaPlayerPrivateMediaFoundation::onCreatedMediaSource): Ditto. (WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame): Added default case. * platform/graphics/win/SimpleFontDataCairoWin.cpp: (WebCore::Font::platformBoundsForGlyph const): Use inner braces to initialize subobjects of MAT2. * platform/graphics/win/SimpleFontDataWin.cpp: Removed unused 'cSmallCapsFontSizeMultiplier'. (WebCore::Font::initGDIFont): Use inner braces to initialize subobjects of MAT2. (WebCore::Font::boundsForGDIGlyph const): Ditto. (WebCore::Font::widthForGDIGlyph const): Ditto. * platform/graphics/win/UniscribeController.cpp: (WebCore::UniscribeController::UniscribeController): Reorder the initializer list. (WebCore::UniscribeController::offsetForPosition): Use parentheses to combine && and ||. (WebCore::UniscribeController::shapeAndPlaceItem): Removed unused 'glyphCount'. 2018-12-17 Eric Carlson <eric.carlson@apple.com> [MediaStream] A stream's first video frame should be rendered https://bugs.webkit.org/show_bug.cgi?id=192629 <rdar://problem/46664353> Reviewed by Youenn Fablet. Test: fast/mediastream/media-stream-renders-first-frame.html * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::enqueueVideoSample): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::ensureLayers): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentDisplayMode const): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateDisplayMode): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::play): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::currentReadyState): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::characteristicsChanged): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::checkSelectedVideoTrack): (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::paintCurrentFrameInContext): * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::size const): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::processNewFrame): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): 2018-12-17 Justin Michaud <justin_michaud@apple.com> Bindings generator should support Conditional= along with CachedAttribute https://bugs.webkit.org/show_bug.cgi?id=192721 Reviewed by Ryosuke Niwa. Fix a bug where specifying both attributes causes compilation errors because the compile-time condition is not included in the derived code. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjCachedAttribute3Getter): (WebCore::jsTestObjCachedAttribute3): (WebCore::JSTestObj::visitChildren): * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/TestObj.idl: 2018-12-17 David Kilzer <ddkilzer@apple.com> clang-tidy: Fix unnecessary object copy in CPUMonitor::setCPULimit() <https://webkit.org/b/192707> <rdar://problem/46734926> Reviewed by Daniel Bates. * platform/CPUMonitor.cpp: (WebCore::CPUMonitor::setCPULimit): * platform/CPUMonitor.h: (WebCore::CPUMonitor::setCPULimit): - Change parameter to const reference to fix unnecessary copies. 2018-12-17 Ryosuke Niwa <rniwa@webkit.org> offsetLeft and offsetParent should adjust across shadow boundaries https://bugs.webkit.org/show_bug.cgi?id=157437 <rdar://problem/26154021> Reviewed by Simon Fraser. Update the WebKit's treatment of shadow boundaries in offsetLeft, offsetTop, and offsetParent to match the latest discussion in CSS WG. See https://github.com/w3c/webcomponents/issues/497 and https://github.com/w3c/webcomponents/issues/763 The latest consensus is to use the retargeting algorithm (https://dom.spec.whatwg.org/#retarget). In practice, this would mean that we need to keep walking up the offset parent ancestors until we find the one which is in the same tree as a shadow-inclusive ancestor of the context object. For example, if a node (the context object of offsetTop, offsetLeft, offsetParent) was assigned to a slot inside a shadow tree and its offset parent was in the shadow tree, we need to walk up to its offset parent, then its offset parent, etc... until we find the offset parent in the same tree as the context object. Note it's possible that the context object is inside a shadow tree which does not have its own offset parent. (e.g. all elements have position: static) For this reason, we need to consider not just offset parent in the same tree as the context object but as well as any offset parent which is in its ancestor trees. Test: fast/shadow-dom/offsetParent-across-shadow-boundaries.html * dom/Element.cpp: (WebCore::adjustOffsetForZoomAndSubpixelLayout): Extracted to share code between offsetLeft and offsetTop. (WebCore::collectAncestorTreeScopeAsHashSet): Added. (WebCore::Element::offsetLeftForBindings): Added. Sums up offsetLeft's until it finds the first offset parent which is a shadow-including ancestor (https://dom.spec.whatwg.org/#concept-shadow-including-ancestor). (WebCore::Element::offsetLeft): Now uses adjustOffsetForZoomAndSubpixelLayout. (WebCore::Element::offsetTopForBindings): Added. Like offsetLeftForBindings, this function sums up offsetTop's until it finds the first offset parent which is a shadow-including ancestor. (WebCore::Element::offsetTop): Now uses adjustOffsetForZoomAndSubpixelLayout. (WebCore::Element::offsetParentForBindings): Renamed from bindingsOffsetParent to be consistent with other functions meant to be used for bindings code. * dom/Element.h: * html/HTMLElement.idl: 2018-12-17 Simon Fraser <simon.fraser@apple.com> Don't use more expensive layer backing store formats when subpixel text antialiasing is not enabled https://bugs.webkit.org/show_bug.cgi?id=192780 rdar://problem/43394387 Reviewed by Tim Horton. macOS Mojave disabled text subpixel antialiasing by default, so we no longer need to use the memory-hungry "linear glyph mask" CALayer backing store formats for non-opaque with text in them. Add FontCascade::isSubpixelAntialiasingAvailable() which reports whether subpixel antialiasing is available, and consult it when making decisions that affect layer backing store format. Tested by new results for existing tests. * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::isSubpixelAntialiasingAvailable): * platform/graphics/FontCascade.h: * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::isSubpixelAntialiasingAvailable): CGFontRenderingGetFontSmoothingDisabled() isn't super cheap, so fetch it once. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterDescendants): * testing/Internals.cpp: (WebCore::Internals::setFontSmoothingEnabled): Remove a WebCore:: 2018-12-17 Daniel Bates <dabates@apple.com> Make DocumentMarker::allMarkers() constexpr https://bugs.webkit.org/show_bug.cgi?id=192634 Reviewed by Simon Fraser. The result of DocumentMarker::allMarkers() can be computed at compile time. We should annotate it constexpr to do just that. * dom/DocumentMarker.h: (WebCore::DocumentMarker::allMarkers): 2018-12-17 Justin Fan <justin_fan@apple.com> [WebGPU] Implement WebGPUBindGroupLayoutDescriptor and its supporting dictionaries https://bugs.webkit.org/show_bug.cgi?id=192726 Reviewed by Myles C. Maxfield. Test: webgpu/bind-group-layouts.html Implement the WebGPUBindGroupLayoutDescriptor struct and its sub-structs: * Modules/streams/WebGPUBindGroupLayoutDescriptor.h: Added. * Modules/streams/WebGPUBindGroupLayoutDescriptor.idl: Added. * Modules/webgpu/WebGPUBindGroupLayoutBinding.h: Added. * Modules/webgpu/WebGPUBindGroupLayoutBinding.idl: Added. * Modules/webgpu/WebGPUShaderStageBit.h: Added. * Modules/webgpu/WebGPUShaderStageBit.idl: Added. * platform/graphics/gpu/GPUBindGroupLayoutBinding.h: Added. * platform/graphics/gpu/GPUBindGroupLayoutDescriptor.h: Added. Add the new symbols and files to the project: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Small FIXME update for later: * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::setVertexBuffers): 2018-12-17 Zalan Bujtas <zalan@apple.com> Unreviewed build fix. * page/ios/FrameIOS.mm: (WebCore::Frame::interpretationsForCurrentRoot const): 2018-12-17 Zalan Bujtas <zalan@apple.com> Reproducible ASSERTion failure when toggling layer borders with find-in-page up https://bugs.webkit.org/show_bug.cgi?id=192762 <rdar://problem/46676873> Reviewed by Simon Fraser. DocumentMarkerController::markersFor() should take a reference instead of a Node*. Test: editing/document-marker-null-check.html * dom/DocumentMarkerController.cpp: (DocumentMarkerController::hasMarkers): * dom/DocumentMarkerController.h: * editing/AlternativeTextController.cpp: (WebCore::AlternativeTextController::respondToChangedSelection): * editing/Editor.cpp: (WebCore::Editor::selectionStartHasMarkerFor const): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const): * rendering/RenderReplaced.cpp: (WebCore::RenderReplaced::paint): * rendering/RenderText.cpp: (WebCore::RenderText::draggedContentRangesBetweenOffsets const): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForWithReason): * testing/Internals.cpp: (WebCore::Internals::markerCountForNode): 2018-12-17 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r239265 and r239274. https://bugs.webkit.org/show_bug.cgi?id=192765 unorm_normalize is deprecated, and broke an internal build (Requested by Truitt on #webkit). Reverted changesets: "[GTK][WPE] Need a function to convert internal URI to display ("pretty") URI" https://bugs.webkit.org/show_bug.cgi?id=174816 https://trac.webkit.org/changeset/239265 "Fix the Apple Internal Mac build with a newer SDK" https://trac.webkit.org/changeset/239274 2018-12-17 Daniel Bates <dabates@apple.com> [iOS] Remove -[WebEvent initWithKeyEventType:...:characterSet:] https://bugs.webkit.org/show_bug.cgi?id=192633 Reviewed by Wenson Hsieh. UIKit has long adopted the newer -[WebEvent initWithKeyEventType:] initializer that takes an input manager hint. We no longer need to keep the variant -[WebEvent initWithKeyEventType:...:characterSet:] for binary compatibility. * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Deleted. 2018-12-17 Matt Lewis <jlewis3@apple.com> Unreviewed, rolling out r239254. This broke the Windows 10 Debug build Reverted changeset: "Replace many uses of String::format with more type-safe alternatives" https://bugs.webkit.org/show_bug.cgi?id=192742 https://trac.webkit.org/changeset/239254 2018-12-17 Antoine Quint <graouts@apple.com> [Web Animations] Remove the redundant m_scheduledMicrotask from WebAnimation https://bugs.webkit.org/show_bug.cgi?id=192758 Reviewed by Dean Jackson. We tracked whether we had a pending microtask twice so we remove the m_scheduledMicrotask flag as m_finishNotificationStepsMicrotaskPending gives us enough information as it is. Additionally, we remove the scheduleMicrotaskIfNeeded() and performMicrotask() functions since there is less bookkeeping to perform. No new test since there is no user-observable change. * animation/WebAnimation.cpp: (WebCore::WebAnimation::updateFinishedState): (WebCore::WebAnimation::scheduleMicrotaskIfNeeded): Deleted. (WebCore::WebAnimation::performMicrotask): Deleted. * animation/WebAnimation.h: 2018-12-17 Antoine Quint <graouts@apple.com> [Web Animations] Ensure we don't update an animation's finished state twice when updating animations https://bugs.webkit.org/show_bug.cgi?id=192757 Reviewed by Dean Jackson. When animations are udpated and DocumentTimeline::updateAnimationsAndSendEvents() is called, we used to update an animation's finished state twice since we'd do it once when calling tick() and once again when calling resolve() in the ensuing style invalidation. We now keep track of whether we've already updated an animation's finished state during animation update in the call to tick() and avoid updating in the immediate next call to resolve(), unless any of the timing properties have changed in the meantime. No new test since there is no user-observable change. * animation/WebAnimation.cpp: (WebCore::WebAnimation::timingDidChange): (WebCore::WebAnimation::tick): (WebCore::WebAnimation::resolve): * animation/WebAnimation.h: 2018-12-17 Simon Fraser <simon.fraser@apple.com> REGRESSION (r233268): Elements animated in from offscreen sometimes don't display https://bugs.webkit.org/show_bug.cgi?id=192725 rdar://problem/46011418 Reviewed by Antoine Quint. There were two problems with backing store attachment and animation. First, animations are an input into the "backing store attached" logic, so when they change we should set the CoverageRectChanged bit on GraphicsLayerCA. Secondly, when an ancestor has unknown animation extent, all its descendants need to get backing store, so we need to set childCommitState.ancestorWithTransformAnimationIntersectsCoverageRect when the current layer has no animation extent. Tests: compositing/backing/animate-into-view-with-descendant.html compositing/backing/animate-into-view.html * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::addAnimation): (WebCore::GraphicsLayerCA::removeAnimation): (WebCore::GraphicsLayerCA::recursiveCommitChanges): 2018-12-17 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Unify margin collapse function naming https://bugs.webkit.org/show_bug.cgi?id=192747 Reviewed by Antti Koivisto. Rename some margin collapse getters. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithParentMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBeforeCollapsesWithPreviousSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfterCollapsesWithNextSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginsCollapseThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): (WebCore::Layout::isMarginBeforeCollapsedWithSibling): Deleted. (WebCore::Layout::isMarginAfterCollapsedWithSibling): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): Deleted. (WebCore::Layout::isMarginAfterCollapsedThrough): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): Deleted. 2018-12-17 David Kilzer <ddkilzer@apple.com> clang-tidy: loop variable is copied but only used as const reference in WebCore, WebKit, Tools <https://webkit.org/b/192751> <rdar://problem/46771623> Reviewed by Daniel Bates. Change loop variables to const references to avoid unnecessary copies. * Modules/indexeddb/server/MemoryBackingStoreTransaction.cpp: (WebCore::IDBServer::MemoryBackingStoreTransaction::abort): * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::populateIndexWithExistingRecords): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::maybeNotifyConnectionsOfVersionChange): * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers): * Modules/indexeddb/shared/IDBDatabaseInfo.cpp: (WebCore::IDBDatabaseInfo::IDBDatabaseInfo): (WebCore::IDBDatabaseInfo::loggingString const): * Modules/mediasource/SourceBuffer.cpp: (WebCore::removeSamplesFromTrackBuffer): * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const): * accessibility/AccessibilityTableRow.cpp: (WebCore::AccessibilityTableRow::headerObject): * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computedNeedsForcedLayout): * crypto/keys/CryptoKeyRSA.cpp: (WebCore::CryptoKeyRSA::importJwk): (WebCore::CryptoKeyRSA::exportJwk const): * css/CSSComputedStyleDeclaration.cpp: (WebCore::OrderedNamedLinesCollector::appendLines const): * dom/DataTransfer.cpp: (WebCore::readURLsFromPasteboardAsString): * dom/TreeScope.cpp: (WebCore::TreeScope::elementsFromPoint): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::checkAndStoreRegion): * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::InspectorTimelineAgent::setInstruments): * page/Page.cpp: (WebCore::Page::updateIntersectionObservations): * page/TextIndicator.cpp: (WebCore::estimatedBackgroundColorForRange): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::computeLayoutDependency): * platform/graphics/DisplayRefreshMonitorManager.cpp: (WebCore::DisplayRefreshMonitorManager::displayWasUpdated): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::moveOrCopyAnimations): (WebCore::GraphicsLayerCA::updateAnimations): (WebCore::GraphicsLayerCA::isRunningTransformAnimation const): * platform/graphics/mac/ImageMac.mm: (WebCore::BitmapImage::tiffRepresentation): * rendering/HitTestResult.cpp: (WebCore::HitTestResult::append): * testing/Internals.cpp: (WebCore::Internals::acceleratedAnimationsForElement): 2018-12-17 Ms2ger <Ms2ger@igalia.com> [GTK][WPE] Need a function to convert internal URI to display ("pretty") URI https://bugs.webkit.org/show_bug.cgi?id=174816 Reviewed by Michael Catanzaro. Tests: enabled fast/url/user-visible/. * testing/Internals.cpp: (WebCore::Internals::userVisibleString): Enable method on all platforms. 2018-12-15 Yusuke Suzuki <yusukesuzuki@slowstart.org> Null pointer dereference in JSC::WriteBarrierBase() https://bugs.webkit.org/show_bug.cgi?id=191252 Reviewed by Keith Miller. * bindings/js/JSCustomElementRegistryCustom.cpp: (WebCore::JSCustomElementRegistry::whenDefined): * bindings/js/JSDOMPromiseDeferred.cpp: (WebCore::createDeferredPromise): * bindings/js/JSDOMPromiseDeferred.h: (WebCore::DeferredPromise::create): (WebCore::callPromiseFunction): * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::moduleLoaderFetch): (WebCore::JSDOMWindowBase::moduleLoaderImportModule): * bindings/js/ScriptModuleLoader.cpp: (WebCore::ScriptModuleLoader::fetch): (WebCore::rejectPromise): 2018-12-15 Darin Adler <darin@apple.com> Use warning-ignoring macros more consistently and simply https://bugs.webkit.org/show_bug.cgi?id=192743 Reviewed by Mark Lam. * bridge/objc/WebScriptObject.mm: Use IGNORE_WARNINGS_BEGIN rather than IGNORE_CLANG_WARNINGS_BEGIN here. There is no need to compile Objective-C++ files like this one with non-clang compilers, and no need to worry about them when choosing the macro. * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::getPublicKeyComponents): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END. * css/makeprop.pl: Use IGNORE_WARNINGS_BEGIN/END, obviating the need for the "unknown-pragmas" trick, which the macro should take care of. * css/makevalues.pl: Ditto. * platform/ColorData.gperf: Ditto. * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): Use IGNORE_WARNINGS_BEGIN/END (see rationale above for Objective-C++). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): Ditto. * platform/ios/DragImageIOS.mm: Use IGNORE_WARNINGS_BEGIN/END (see rationale above for Objective-C++). * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]): Use ALLOW_NEW_API_WITHOUT_GUARDS_BEGIN/END. * platform/mac/WebPlaybackControlsManager.mm: Use IGNORE_WARNINGS_BEGIN/END (see rationale above for Objective-C++). * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): Use ALLOW_DEPRECATED_DECLARATIONS_BEGIN/END. 2018-12-15 Darin Adler <darin@apple.com> Replace many uses of String::format with more type-safe alternatives https://bugs.webkit.org/show_bug.cgi?id=192742 Reviewed by Mark Lam. A while back, String::format was more efficient than string concatenation, but that is no longer true, and we should prefer String::number, makeString, or concatenation with the "+" operator to String::format for new code. This is not as good for programmers who are fond of printf formatting style, and in some cases it's a little harder to read the strings interspersed with variables rather than a format string, but it's better in a few ways: - more efficient (I didn't measure the difference, but it's definitely slower to use String::Format which calls vsnprintf twice than to use the WTF code) - works in a type-safe way without a need to use a format specifier such as "%" PRIu64 or "%tu" making it much easier to avoid problems due to subtle differences between platforms - allows us to use StringView in some cases to sidestep the need to allocate temporary WTF::String objects - does not require converting each WTF::String to a C string, allowing us to remove many cases of ".utf8().data()" and similar expressions, eliminating the allocation of temporary WTF::CString objects This patch covers a batch of easiest-to-convert call sites. Later patches will allow us to deprecate or remove String::format. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): Use makeString. * Modules/indexeddb/shared/IDBCursorInfo.cpp: (WebCore::IDBCursorInfo::loggingString const): Ditto. * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp: (WebCore::IDBGetAllRecordsData::loggingString const): Ditto. * Modules/indexeddb/shared/IDBGetRecordData.cpp: (WebCore::IDBGetRecordData::loggingString const): Ditto. * Modules/indexeddb/shared/IDBIndexInfo.cpp: (WebCore::IDBIndexInfo::loggingString const): Ditto. (WebCore::IDBIndexInfo::condensedLoggingString const): Ditto. * Modules/indexeddb/shared/IDBIterateCursorData.cpp: (WebCore::IDBIterateCursorData::loggingString const): Ditto. * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp: (WebCore::IDBObjectStoreInfo::condensedLoggingString const): Ditto. * Modules/indexeddb/shared/IDBResourceIdentifier.cpp: (WebCore::IDBResourceIdentifier::loggingString const): Ditto. * Modules/webdatabase/Database.cpp: (WebCore::formatErrorMessage): Ditto. * Modules/webdatabase/SQLError.h: (WebCore::SQLError::create): Ditto. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): Use makeString. * bindings/scripts/test/JS/JSInterfaceName.cpp: * bindings/scripts/test/JS/JSMapLike.cpp: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCallTracer.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestException.cpp: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestStringifier.cpp: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: Updated expected results. : * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::parseHexColor): Use String::number and makeString. * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::setLength): Use makeString. * html/ImageDocument.cpp: (WebCore::ImageDocument::imageUpdated): Ditto. * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::init): Ditto. * inspector/InspectorFrontendClientLocal.cpp: (WebCore::InspectorFrontendClientLocal::setDockingUnavailable): Ditto. (WebCore::InspectorFrontendClientLocal::setAttachedWindow): Ditto. (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled): Ditto. (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled): Ditto. (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame): Ditto. * inspector/agents/InspectorCSSAgent.cpp: Ditto. * inspector/agents/InspectorIndexedDBAgent.cpp: Ditto. * page/MemoryRelease.cpp: (WebCore::logMemoryStatisticsAtTimeOfDeath): Ditto. * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::formatByteNumber): Use String::number. (WebCore::ResourceUsageOverlay::platformDraw): Use string concatenation. * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::logFootprintComparison): Use makeString. * platform/animation/TimingFunction.cpp: (WebCore::TimingFunction::cssText const): Ditto. * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm: (WebCore::AVTrackPrivateAVFObjCImpl::id const): Use AtomicString::number. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC): Ditto. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setContentsToSolidColor): Use makeString. (WebCore::GraphicsLayerCA::updateContentsImage): Ditto. (WebCore::GraphicsLayerCA::updateContentsRects): Ditto. (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): Ditto. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Ditto. * platform/mock/mediasource/MockSourceBufferPrivate.cpp: Use String::number. * platform/network/ParsedContentRange.cpp: (WebCore::ParsedContentRange::headerValue const): Use makeString. * platform/network/cf/NetworkStorageSessionCFNet.cpp: Removed some unnecessary compiler conditionals and reorganized the start/stop of namespaces. (WebCore::NetworkStorageSession::switchToNewTestingSession): Use makeString. * platform/sql/SQLiteDatabase.cpp: (WebCore::unauthorizedSQLFunction): Use makeString. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::logLayerInfo): Ditto. * workers/service/server/RegistrationDatabase.cpp: (WebCore::RegistrationDatabase::ensureValidRecordsTable): Ditto. (WebCore::RegistrationDatabase::importRecords): Ditto. 2018-12-15 Youenn Fablet <youenn@apple.com> Make RTCRtpSender.setParameters to activate specific encodings https://bugs.webkit.org/show_bug.cgi?id=192732 Reviewed by Eric Carlson. The conversion between libwebrtc and WebCore is lossy for send parameters. Libwebrtc checking the differences of values, call to setParameters will often fail. Given some parameters cannot be exposed, the sender backend keeps the current set of parameters when gathered and reuses them when parameters are set. For encodings, we only change activate/maxBitRate/maxFrameRate as these are the most important parameters to be able to modify. Covered by added tests in webrtc/video.html. * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::getParameters const): (WebCore::LibWebRTCRtpSenderBackend::setParameters): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::fromRTCRtpSendParameters): (WebCore::fromRTCEncodingParameters): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: 2018-12-14 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Avoid creating and evaluating in the InspectorOverlay page on iOS as it is unused https://bugs.webkit.org/show_bug.cgi?id=192724 <rdar://problem/46745911> Reviewed by Devin Rousso. iOS never installs the InspectorOverlay page as a page overlay. It also uses its own node highlighting painting. Avoid any work and resources associated with the overlay page for iOS. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): (WebCore::InspectorOverlay::update): (WebCore::InspectorOverlay::overlayPage): (WebCore::evaluateCommandInOverlay): 2018-12-14 Youenn Fablet <youenn@apple.com> MediaRecorderPrivateAVFImpl should have a Ref<MediaRecorderPrivateWriter> as member https://bugs.webkit.org/show_bug.cgi?id=192720 Reviewed by Eric Carlson. Make sure that MediaRecorderPrivateAVFImpl takes a Ref<MediaRecorderPrivateWriter> as member, as the latter is a ref counted object. Made some refactoring to return early in case of error. Also made sure that in the case of a MediaRecorder stopped by a track removal in the recorded stream the MediaRecorder will stop listening for its tracks. Otherwise, the tracks will continue calling the MediaRecorder even after it is dead. Test: http/wpt/mediarecorder/MediaRecorder-onremovetrack.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::didAddOrRemoveTrack): (WebCore::MediaRecorder::setNewRecordingState): Deleted. * Modules/mediarecorder/MediaRecorder.h: * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: (WebCore::MediaRecorderPrivateWriter::create): (WebCore::MediaRecorderPrivateWriter::MediaRecorderPrivateWriter): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::setupWriter): Deleted. 2018-12-14 Youenn Fablet <youenn@apple.com> getSenders/getReceivers() should not return closed transceiver senders/receivers https://bugs.webkit.org/show_bug.cgi?id=192706 Reviewed by Eric Carlson. Updated as per https://github.com/w3c/webrtc-pc/commit/85284b76baebf9e149d194e692be16a21768a91a This forces us to compute the sender/receiver list at getter call time. Updated the internal call sites of senders to use the list of transceivers instead. Covered by updated WPT tests. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::addTrack): (WebCore::RTCPeerConnection::getSenders const): (WebCore::RTCPeerConnection::getReceivers const): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::stopped const): (WebCore::RtpTransceiverSet::append): (WebCore::RtpTransceiverSet::senders const): (WebCore::RtpTransceiverSet::receivers const): * Modules/mediastream/RTCRtpTransceiver.h: (WebCore::RtpTransceiverSet::senders const): Deleted. (WebCore::RtpTransceiverSet::receivers const): Deleted. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::findExistingSender): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): 2018-12-14 David Kilzer <ddkilzer@apple.com> clang-tidy: Fix unnecessary copy of objects for operator==() methods <https://webkit.org/b/192712> <rdar://problem/46739332> Reviewed by Andy Estes. * contentextensions/HashableActionList.h: (WebCore::ContentExtensions::HashableActionList::operator== const): (WebCore::ContentExtensions::HashableActionList::operator!= const): * platform/network/FormData.h: (WebCore::FormDataElement::EncodedFileData::operator== const): (WebCore::FormDataElement::EncodedBlobData::operator== const): - Change arguments from const to const reference to avoid copies. 2018-12-14 Jer Noble <jer.noble@apple.com> CRASH in CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession(WTF::String const&, WTF::Function<void ()>&&) https://bugs.webkit.org/show_bug.cgi?id=192713 <rdar://problem/46739706> Reviewed by Eric Carlson. A callback is being called twice, and the second time has a null Promise. Instead of these callbacks being WTF::Function, make them WTF::CompletionHandlers, which self-nullify and have ASSERTS() that they are called once-and-only-once. * platform/encryptedmedia/CDMInstanceSession.h: * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::CDMInstanceSessionClearKey::closeSession): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed): 2018-12-14 David Kilzer <ddkilzer@apple.com> clang-tidy: Fix unnecessary object copies in WebCore/platform/graphics/avfoundation/objc/ <https://webkit.org/b/192708> <rdar://problem/46735907> Reviewed by Jer Noble. * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: (WebCore::toSample): - Make argument a const reference. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: - Update method signatures for implementation changes. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setAsset): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesDidChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::loadedTimeRangesDidChange): - Make RetainPtr<> argument an rvalue reference and use WTFMove(). (WebCore::MediaPlayerPrivateAVFoundationObjC::metadataDidArrive): (WebCore::MediaPlayerPrivateAVFoundationObjC::tracksDidChange): - Make RetainPtr<> argument a const reference. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): - Change for loop keys to be const references. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: - Update method signatures for implementation changes. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::fastSeekTimeForMediaTime): (WebCore::SourceBufferPrivateAVFObjC::seekToTime): - Make Mediatime arguments a const reference. 2018-12-14 Simon Fraser <simon.fraser@apple.com> REGRESSION (r233268): contents of an animated element inside overflow:hidden disappear https://bugs.webkit.org/show_bug.cgi?id=188655 rdar://problem/43382687 Reviewed by Antoine Quint. The logic that computes animation extent, used by backing store attachment code, failed to account for the behavior where a keyframe animation with a missing 0% keyframe uses the transform from the unanimated style. This resulted in the computed extent being wrong, which caused us to remove the layer's backing store in some scenarios. Fix both animation code paths to use the renderer style if the first keyframe doesn't contain a transform. Tests: compositing/backing/backing-store-attachment-empty-keyframe.html legacy-animation-engine/compositing/backing/backing-store-attachment-empty-keyframe.html * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::computeExtentOfTransformAnimation const): 2018-12-14 Chris Dumez <cdumez@apple.com> [PSON] Stop exposing PolicyAction::Suspend to WebCore https://bugs.webkit.org/show_bug.cgi?id=192701 Reviewed by Brady Eidson. Drop PolicyAction::Suspend enum value and stop dealing with it in WebCore. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::continueAfterContentPolicy): * loader/FrameLoaderTypes.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): (WebCore::PolicyChecker::checkNewWindowPolicy): 2018-12-14 Youenn Fablet <youenn@apple.com> IDB should store RTCCertificate https://bugs.webkit.org/show_bug.cgi?id=192599 Reviewed by Brady Eidson. In case there is no script execution context, do not create a JS DOM wrapper for RTCCertificate. Instead, create an empty object so that the deserialization can still succeed. This should only impact IDB deserialization in the Network Process which does not need the actual JS DOM wrapper. Test: webrtc/certificates-indexeddb.html * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readTerminal): 2018-12-14 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Transition to logical margin types. https://bugs.webkit.org/show_bug.cgi?id=192699 Reviewed by Antti Koivisto. This is in preparation for moving over to logical types. (This patch also transitions to singlular margin naming (verticalMargins -> VerticalMargin)) * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/FormattingContextQuirks.cpp: (WebCore::Layout::FormattingContext::Quirks::heightValueOfNearestContainingBlockWithFixedHeight): * layout/MarginTypes.h: (WebCore::Layout::VerticalMargin::usedValues const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBefore const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginBeforeForAncestors const): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): (WebCore::Layout::hasPrecomputedMarginBefore): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): Deleted. (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): Deleted. (WebCore::Layout::hasPrecomputedMarginTop): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): Deleted. * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::hasMarginBeforeQuirkValue): (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginBefore): (WebCore::Layout::hasMarginTopQuirkValue): Deleted. (WebCore::Layout::BlockFormattingContext::Quirks::shouldIgnoreMarginTop): Deleted. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginBeforeCollapsedWithSibling): (WebCore::Layout::isMarginAfterCollapsedWithSibling): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParent): (WebCore::Layout::isMarginAfterCollapsedThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBeforeFromFirstChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBefore): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginAfterCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBeforeCollapsedWithParentMarginAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginAfterFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginAfter): (WebCore::Layout::isMarginTopCollapsedWithSibling): Deleted. (WebCore::Layout::isMarginBottomCollapsedWithSibling): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): Deleted. (WebCore::Layout::isMarginBottomCollapsedThrough): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted. (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): Deleted. * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): (WebCore::Display::Box::marginBox const): (WebCore::Display::Box::nonCollapsedMarginBox const): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::rectWithMargin const): (WebCore::Display::Box::estimatedMarginBefore const): (WebCore::Display::Box::setEstimatedMarginBefore): (WebCore::Display::Box::top const): (WebCore::Display::Box::topLeft const): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::marginBefore const): (WebCore::Display::Box::marginStart const): (WebCore::Display::Box::marginAfter const): (WebCore::Display::Box::marginEnd const): (WebCore::Display::Box::nonCollapsedMarginBefore const): (WebCore::Display::Box::nonCollapsedMarginAfter const): (WebCore::Display::Box::nonComputedMarginStart const): (WebCore::Display::Box::nonComputedMarginEnd const): (WebCore::Display::Box::estimatedMarginTop const): Deleted. (WebCore::Display::Box::setEstimatedMarginTop): Deleted. (WebCore::Display::Box::marginTop const): Deleted. (WebCore::Display::Box::marginLeft const): Deleted. (WebCore::Display::Box::marginBottom const): Deleted. (WebCore::Display::Box::marginRight const): Deleted. (WebCore::Display::Box::nonCollapsedMarginTop const): Deleted. (WebCore::Display::Box::nonCollapsedMarginBottom const): Deleted. (WebCore::Display::Box::nonComputedMarginLeft const): Deleted. (WebCore::Display::Box::nonComputedMarginRight const): Deleted. * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): (WebCore::Layout::FloatAvoider::overflowsContainingBlock const): * layout/floats/FloatAvoider.h: (WebCore::Layout::FloatAvoider::marginBefore const): (WebCore::Layout::FloatAvoider::marginAfter const): (WebCore::Layout::FloatAvoider::marginStart const): (WebCore::Layout::FloatAvoider::marginEnd const): (WebCore::Layout::FloatAvoider::marginBoxWidth const): (WebCore::Layout::FloatAvoider::marginTop const): Deleted. (WebCore::Layout::FloatAvoider::marginBottom const): Deleted. (WebCore::Layout::FloatAvoider::marginLeft const): Deleted. (WebCore::Layout::FloatAvoider::marginRight const): Deleted. * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::rect const): (WebCore::Layout::FloatBox::horizontalPositionCandidate): (WebCore::Layout::FloatBox::verticalPositionCandidate): (WebCore::Layout::FloatBox::initialVerticalPosition const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-12-14 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Introduce VerticalMargin and HorizontalMargin types. https://bugs.webkit.org/show_bug.cgi?id=192692 Reviewed by Antti Koivisto. This is in preparation for completing block margin collapsing. * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/LayoutState.cpp: (WebCore::Layout::LayoutState::LayoutState): * layout/LayoutUnits.h: (WebCore::Layout::HeightAndMargin::usedMarginValues const): Deleted. * layout/MarginTypes.h: Added. (WebCore::Layout::VerticalMargin::nonCollapsedValues const): (WebCore::Layout::VerticalMargin::collapsedValues const): (WebCore::Layout::VerticalMargin::setCollapsedValues): (WebCore::Layout::VerticalMargin::VerticalMargin): (WebCore::Layout::VerticalMargin::usedValues const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/displaytree/DisplayBox.cpp: (WebCore::Display::Box::Box): * layout/displaytree/DisplayBox.h: (WebCore::Display::Box::setHorizontalMargin): (WebCore::Display::Box::setVerticalMargin): (WebCore::Display::Box::setHorizontalNonComputedMargin): (WebCore::Display::Box::verticalMargin const): (WebCore::Display::Box::marginTop const): (WebCore::Display::Box::marginLeft const): (WebCore::Display::Box::marginBottom const): (WebCore::Display::Box::marginRight const): (WebCore::Display::Box::nonCollapsedMarginTop const): (WebCore::Display::Box::nonCollapsedMarginBottom const): (WebCore::Display::Box::setVerticalNonCollapsedMargin): Deleted. * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): 2018-12-14 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Clang] Fix compilation warnings under Source/WebCore/platform/win https://bugs.webkit.org/show_bug.cgi?id=192693 Reviewed by Ross Kirsling. No new tests, no behavior changes. * platform/win/ClipboardUtilitiesWin.cpp: Reordered ClipboardDataItem members to match with the initializer list. * platform/win/CursorWin.cpp: (WebCore::loadCursorByName): Changed the argument type of 'name' to const char*. * platform/win/DefWndProcWindowClass.cpp: (WebCore::defWndProcWindowClassName): Removed an unused variable 'atom'. * platform/win/DragImageWin.cpp: Removed an unused variable 'MinDragLabelWidthBeforeClip'. * platform/win/PasteboardWin.cpp: (WebCore::createGlobalImageFileDescriptor): Removed an unused variable 'hr'. (WebCore::createGlobalHDropContent): Use reinterpret_cast to suppress warning. * platform/win/PlatformMouseEventWin.cpp: (WebCore::PlatformMouseEvent::PlatformMouseEvent): Reordered the initializer list. * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::paint): Removed an unused variable 'itemCount'. * platform/win/PopupMenuWin.h: Marked override methods with 'override'. * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::getSupportedKeySizes): Removed WebCore namespace prefix in WebCore namespace. (WebCore::signedPublicKeyAndChallengeString): Ditto. * platform/win/SearchPopupMenuDB.cpp: (WebCore::SearchPopupMenuDB::createPreparedStatement): Use ASSERT_UNUSED instead of ASSERT. * platform/win/StructuredExceptionHandlerSuppressor.h: Enclosed m_savedExceptionRegistration with #if defined(_M_IX86). * platform/win/SystemInfo.cpp: (WebCore::osVersionForUAString): Added default case. 2018-12-13 Youenn Fablet <youenn@apple.com> RTCRtpTransceiver.stopped should be true when applying a remote description with the corresponding m section rejected https://bugs.webkit.org/show_bug.cgi?id=192685 Reviewed by Eric Carlson. In case the remote description contains a rejected m section, the corresponding transceiver should be marked as stopped. Libwebrtc backend has that information so pipe it up to JS. Covered by updated WPT test. * Modules/mediastream/RTCRtpTransceiver.cpp: (WebCore::RTCRtpTransceiver::stopped const): * Modules/mediastream/RTCRtpTransceiver.h: (WebCore::RTCRtpTransceiver::stopped const): Deleted. * Modules/mediastream/RTCRtpTransceiverBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: (WebCore::LibWebRTCRtpTransceiverBackend::stopped const): * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: 2018-12-13 Mark Lam <mark.lam@apple.com> Ensure that StructureFlags initialization always starts with Base::StructureFlags. https://bugs.webkit.org/show_bug.cgi?id=192686 Reviewed by Keith Miller. No new tests needed because there's no new functionality. Just refactoring. * bindings/js/JSDOMWindowProperties.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateHeader): (GeneratePrototypeDeclaration): * bindings/scripts/test/JS/JSTestActiveDOMObject.h: * bindings/scripts/test/JS/JSTestEnabledBySetting.h: * bindings/scripts/test/JS/JSTestEventTarget.h: * bindings/scripts/test/JS/JSTestGlobalObject.h: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestObj.h: * bindings/scripts/test/JS/JSTestOverrideBuiltins.h: * bindings/scripts/test/JS/JSTestPluginInterface.h: * bindings/scripts/test/JS/JSTestTypedefs.h: 2018-12-13 Ryosuke Niwa <rniwa@webkit.org> Make HTMLConverter work across shadow boundaries https://bugs.webkit.org/show_bug.cgi?id=192640 Reviewed by Wenson Hsieh. Made HTMLConverter work with shadow boundaries by replacing the various tree traversal functions. Tests: editing/mac/attributed-string/attributed-string-across-shadow-boundaries-1.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-2.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-3.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-4.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-5.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-1.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-2.html editing/mac/attributed-string/attributed-string-across-shadow-boundaries-with-style-3.html * dom/Position.cpp: (WebCore::commonShadowIncludingAncestor): Moved from markup.cpp to be shared between HTMLConverter and serializePreservingVisualAppearanceInternal. * dom/Position.h: * editing/cocoa/HTMLConverter.mm: (HTMLConverter::convert): (HTMLConverterCaches::propertyValueForNode): (HTMLConverterCaches::floatPropertyValueForNode): (HTMLConverter::_blockLevelElementForNode): (HTMLConverterCaches::colorPropertyValueForNode): (HTMLConverter::aggregatedAttributesForAncestors): (HTMLConverter::aggregatedAttributesForElementAndItsAncestors): (HTMLConverter::_processElement): (HTMLConverter::_traverseNode): (HTMLConverter::_traverseFooterNode): (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): (WebCore::attributedStringFromSelection): * editing/markup.cpp: (WebCore::commonShadowIncludingAncestor): Moved to Position.cpp. 2018-12-13 Youenn Fablet <youenn@apple.com> Trying to play a media element synchronously after setting srcObject should succeed without user gesture https://bugs.webkit.org/show_bug.cgi?id=192679 Reviewed by Eric Carlson. Check the srcObject mediaProvider value which is set synchronously. Covered by updated fast/mediastream/local-audio-playing-event.html. * html/HTMLMediaElement.h: (WebCore::HTMLMediaElement::hasMediaStreamSrcObject const): 2018-12-13 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Support dropping contact card data (public.vcard) in editable content https://bugs.webkit.org/show_bug.cgi?id=192570 <rdar://problem/35626913> Reviewed by Tim Horton. Adds support for accepting vCard (.vcf) data via drop on iOS. See below for more details. Tests: DragAndDropTests.ExternalSourceContactIntoEditableAreas DragAndDropTests.ExternalSourceMapItemAndContactToUploadArea DragAndDropTests.ExternalSourceMapItemIntoEditableAreas WKAttachmentTestsIOS.InsertDroppedContactAsAttachment WKAttachmentTestsIOS.InsertDroppedMapItemAsAttachment * editing/WebContentReader.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attachmentForFilePath): Pull out logic to create an attachment from a file path out into a static helper. Use this in `readFilePaths` as well as `readVirtualContactFile`. (WebCore::WebContentReader::readFilePaths): (WebCore::WebContentReader::readVirtualContactFile): Add a pasteboard reading method that reads a vCard file (with an optional URL) as web content. The resulting fragment consists of either an anchor and an attachment element, or just an attachment element if the URL is empty. In the case of an `MKMapItem`, the URL is populated, so we generate both elements; when dragging a contact, there is no associated URL, so we only have an attachment. * platform/Pasteboard.h: * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readPasteboardWebContentDataForType): Augment this to take the current `PasteboardItemInfo` as well; use this item information to get a file path for "public.vcard" data, which is then passed on to the web content reader. Additionally, by returning `ReaderResult::DidNotReadType` here, we prevent the web content reader from extracting the plain text contents of the vCard and dumping it as plain text in the editable element (this would otherwise happen, since "public.vcard" conforms to "public.text"). (WebCore::Pasteboard::read): (WebCore::Pasteboard::readRespectingUTIFidelities): * platform/ios/WebItemProviderPasteboard.mm: (-[NSItemProvider web_fileUploadContentTypes]): Prevent the "com.apple.mapkit.map-item" UTI from being considered as file upload content. This special case is tricky, since "com.apple.mapkit.map-item" conforms to "public.content", yet its corresponding data is only suitable for deserialization into an `MKMapItem`. 2018-12-13 Devin Rousso <drousso@apple.com> Web Inspector: remove DOM.BackendNodeId and associated commands/events https://bugs.webkit.org/show_bug.cgi?id=192478 Reviewed by Matt Baker. Removing unused code, so no change in functionality. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::discardBindings): (WebCore::InspectorDOMAgent::backendNodeIdForNode): Deleted. (WebCore::InspectorDOMAgent::releaseBackendNodeIds): Deleted. (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend): Deleted. 2018-12-13 Chris Dumez <cdumez@apple.com> [PSON] We should not need to navigate to 'about:blank' to suspend pages https://bugs.webkit.org/show_bug.cgi?id=192668 <rdar://problem/46701466> Reviewed by Alex Christensen. * history/PageCache.cpp: (WebCore::PageCache::addIfCacheable): * history/PageCache.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::redirectReceived): (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::startLoadingMainResource): * loader/DocumentLoader.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::init): (WebCore::FrameLoader::stopAllLoaders): (WebCore::FrameLoader::setDocumentLoader): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): * loader/FrameLoaderTypes.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/PolicyChecker.h: 2018-12-13 Per Arne Vollan <pvollan@apple.com> [macOS] Inline WebVTT styles should override styles from Captions settings in System Preferences https://bugs.webkit.org/show_bug.cgi?id=192638 Reviewed by Eric Carlson. It is currently not possible to override caption styles generated from System Preferences with inline WebVTT styles without adding !important. The reason for this is that the generated styles from System preferences are author styles which have higher priority than the inline WebVTT styles, which are user agent styles in the video user agent shadow tree. This can be fixed by moving the generated styles to the video user agent shadow tree. Inline WebVTT styles will then have higher priority since they are added after the generated styles. This patch also fixes a problem where inline styles could be added twice to the video user agent shadow root. Test: media/track/track-cue-css.html * dom/ExtensionStyleSheets.cpp: (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const): * html/track/VTTCue.cpp: (WebCore::VTTCue::getDisplayTree): * page/CaptionUserPreferences.cpp: (WebCore::CaptionUserPreferences::setCaptionsStyleSheetOverride): * page/Page.cpp: (WebCore::Page::setCaptionUserPreferencesStyleSheet): 2018-12-13 Jer Noble <jer.noble@apple.com> Fix leak of AVPlayer boundaryTimeObserver object. https://bugs.webkit.org/show_bug.cgi?id=192674 Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime): 2018-12-13 Brent Fulgham <bfulgham@apple.com> Don't attempt to animate invalid CSS properties https://bugs.webkit.org/show_bug.cgi?id=192630 <rdar://problem/46664433> Reviewed by Antoine Quint. Inherited animation properties can cause child elements to think they need to animate CSS properties that they do not support, leading to nullptr crashes. Recognize that CSSPropertyInvalid is a potential requested animation property, and handle it cleanly. Tests: animations/invalid-property-animation.html * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::updateTransitions): * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::calculateAnimatedValue): 2018-12-13 Timothy Hatcher <timothy@apple.com> REGRESSION (r230064): Focus rings on webpages are fainter than in native UI. https://bugs.webkit.org/show_bug.cgi?id=192639 rdar://problem/42669297 Reviewed by Tim Horton. The focus ring color passed to CoreGraphics is expected to be opaque, since they will apply opacity when drawing (because opacity is normally animated). We were getting this by accident before when the old `RenderThemeMac::systemColor()` used the old `convertNSColorToColor()`, which ignored alpha on NSColor. Existing tests use fixed test focus ring color. * css/StyleResolver.cpp: (WebCore::StyleResolver::colorFromPrimitiveValue const): Use RenderTheme singleton for `focusRingColor()`. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): Ditto. * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::drawFocusRingAtTime): Use `CGContextStateSaver`. * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): Force alpha to 1 on the focus ring color. Use `CGContextStateSaver`. * rendering/RenderElement.cpp: (WebCore::RenderElement::paintFocusRing): Use RenderTheme singleton for `focusRingColor()`. * rendering/RenderImage.cpp: (WebCore::RenderImage::paintAreaElementFocusRing): Ditto. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::focusRingColor const): Made const. Cache the result of `platformFocusRingColor()`. * rendering/RenderTheme.h: Made `focusRingColor()` a member function instead of static. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformFocusRingColor const): Force alpha to 1 on the focus ring color. (WebCore::RenderThemeMac::systemColor const): Use `focusRingColor()`, instead of caching color here. 2018-12-13 Eric Carlson <eric.carlson@apple.com> [MediaStream] Calculate width or height when constraints contain only the other https://bugs.webkit.org/show_bug.cgi?id=192632 <rdar://problem/46665734> Unreviewed, remove an unneeded assert. * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): 2018-12-13 Zach Li <zachli@apple.com> Update Credit Card AutoFill button icon https://bugs.webkit.org/show_bug.cgi?id=192637 rdar://problem/46545006 Reviewed by Chris Dumez. * css/html.css: (input::-webkit-credit-card-auto-fill-button): 2018-12-13 Eric Carlson <eric.carlson@apple.com> [MediaStream] Calculate width or height when constraints contain only the other https://bugs.webkit.org/show_bug.cgi?id=192632 <rdar://problem/46665734> Reviewed by Youenn Fablet. Test: fast/mediastream/constraint-intrinsic-size.html * platform/graphics/RemoteVideoSample.cpp: (WebCore::RemoteVideoSample::create): Log errors with RELEASE_LOG_ERROR. * platform/graphics/cv/ImageTransferSessionVT.h: (WebCore::ImageTransferSessionVT::pixelFormat const): New. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Replace current size with new size. (WebCore::RealtimeMediaSource::setSize): Don't notify about width and height. (WebCore::RealtimeMediaSource::size const): Use intrinsic size when necessary. (WebCore::RealtimeMediaSource::setIntrinsicSize): New. (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): No more remoteVideoSampleAvailable. * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::settings): Report size correctly. (WebCore::DisplayCaptureSourceCocoa::frameSize const): Use intrinsicSize(). (WebCore::DisplayCaptureSourceCocoa::emitFrame): No more remoteVideoSampleAvailable. (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): Deleted. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: (WebCore::DisplayCaptureSourceCocoa::intrinsicSize const): Deleted. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Report intrinsic size. (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Minor cleanup. (WebCore::MockRealtimeVideoSource::setSizeAndFrameRateWithPreset): Report intrinsic size. (WebCore::MockRealtimeVideoSource::drawText): Don't render preset info for display source. * platform/mock/MockRealtimeVideoSource.h: 2018-12-13 David Kilzer <ddkilzer@apple.com> clang-tidy: loop variable is copied but only used as const reference in Document.cpp, Element.cpp <https://webkit.org/b/192661> <rdar://problem/46694035> Reviewed by Daniel Bates. * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): (WebCore::Document::notifyIntersectionObserversTimerFired): * dom/Element.cpp: (WebCore::Element::didMoveToNewDocument): (WebCore::Element::disconnectFromIntersectionObservers): - Change loop variables from `auto` to `const auto&` to prevent unnecessary copies of WeakPtr<IntersectionObserver> or struct IntersectionObserverRegistration objects. 2018-12-13 Carlos Garcia Campos <cgarcia@igalia.com> [FreeType] Remove HarfBuzzFace https://bugs.webkit.org/show_bug.cgi?id=192589 Reviewed by Michael Catanzaro. This was used to share the common implementation with the chromium port, but now that only freetype based ports use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either, since we are already caching glyphs in Font. * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp. * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling. (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for OpenType math. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp. (WebCore::doubleToHarfBuzzPosition): Ditto. (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler. (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp. (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp. (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed. * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed. * platform/graphics/harfbuzz/HbUniquePtr.h: (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t. * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont(). 2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com> [FreeType] Add initial implementation of variation fonts https://bugs.webkit.org/show_bug.cgi?id=192151 Reviewed by Michael Catanzaro. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): Remove platform ifdefs. * loader/cache/CachedFont.cpp: (WebCore::CachedFont::platformDataFromCustomData): Ditto. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isFixedWidth const): * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t. * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig pattern. (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern(). (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::defaultVariationValues): Parse font variations table. (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo. * platform/graphics/freetype/FontCacheFreeType.h: Added. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global. (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy. (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType. (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the FC_FONT_VARIATIONS value from the pattern. (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig pattern. (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern. (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr. (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz. * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontCustomPlatformData.h: 2018-12-12 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Clang][WebKitLegacy] WebFrame.cpp: warning: delete called on non-final 'WebFrame' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] https://bugs.webkit.org/show_bug.cgi?id=192618 Reviewed by Alex Christensen. No new tests, no behavior changes. * platform/win/PopupMenuWin.h: * platform/win/WCDataObject.cpp: * platform/win/WCDataObject.h: 2018-12-12 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238090): CAPCHA UI jumps to the wrong location https://bugs.webkit.org/show_bug.cgi?id=192651 rdar://problem/46531919 Reviewed by Zalan Bujtas. When a RenderLayer becomes non-composited because of a style change, we need to set a dirty bit to say that descendants need their geometry updated (because they now have to compute their positions relative to a different ancestor). This wasn't happening in the layerStyleChanged() code path. In the code path that did do this correctly (in the computeCompositingRequirements() tree walk), we can address a FIXME and only dirty direct children, not all descendants (that code was written before the child-only dirty bit existed). Test: compositing/geometry/update-child-geometry-on-compositing-change.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-12-13 Ryosuke Niwa <rniwa@webkit.org> Make TextInputController.legacyAttributedString take DOM nodes and offsets https://bugs.webkit.org/show_bug.cgi?id=192653 Reviewed by Wenson Hsieh. No new tests since there should be no observable behavioral change other than TextInputController API in DumpRenderTree. * editing/cocoa/HTMLConverter.h: * editing/cocoa/HTMLConverter.mm: (WebCore::attributedStringFromSelection): (WebCore::attributedStringBetweenStartAndEnd): Added. 2018-12-12 Ryosuke Niwa <rniwa@webkit.org> Fix macOS builds after r239145. * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: 2018-12-12 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238357): Pins on Yelp map disappear https://bugs.webkit.org/show_bug.cgi?id=192597 rdar://problem/46578285 Reviewed by Zalan Bujtas. RenderLayerCompositor::updateBackingAndHierarchy() had a bug where if a RenderLayer gained a negative z-order child (triggering creation of a foreground layer), we'd fail to call the "setChildren()" with the vector containing that foreground layer. When updateBackingAndHierarchy() stops visiting descendants because none are composited, it may still have to update the child list with the foreground layer, so make sure the code handles this case. Tests: compositing/z-order/add-negative-z-child.html compositing/z-order/rebuild-sibling-of-layer-with-foreground-layer.html * rendering/RenderLayer.cpp: (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): 2018-12-12 YUHAN WU <yuhan_wu@apple.com> Implement non-timeslice mode encoding for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=192069 <rdar://problem/46443290> Reviewed by Eric Carlson. Implement the encoding for non-timeslice mode of MediaRecorder. It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods. Add a API in internals to allow testings to turn on the mock source. Test: http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::setCustomPrivateRecorderCreator): (WebCore::MediaRecorder::getPrivateImpl): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::createRecordingDataBlob): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::stopRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added. (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVFImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): (WebCore::MediaRecorderPrivateAVFImpl::mimeType): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): (WebCore::MediaRecorderPrivateMock::mimeType): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added. (WebCore::MediaRecorderPrivateWriter::clear): (WebCore::MediaRecorderPrivateWriter::setupWriter): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): * testing/Internals.cpp: (WebCore::createRecorderMockSource): (WebCore::Internals::setCustomPrivateRecorderCreator): * testing/Internals.h: * testing/Internals.idl: 2018-12-12 Justin Fan <justin_fan@apple.com> [WebGPU] Vertex buffers and WebGPUInputState https://bugs.webkit.org/show_bug.cgi?id=192611 Reviewed by Dean Jackson. Test: webgpu/vertex-buffer-triangle-strip.html Basic implementation of vertex buffers with Metal shading language in WebGPU. In WebGPURenderPipelineDescriptor, refactor to match updated shader stage structure and add WebGPUInputStateDescriptor. Also implement WebGPURenderPassEncoder::setVertexBuffers. Add symbols and files for WebGPUIndexFormat, WebGPUInputStateDescriptor, WebGPUInputStepMode, WebGPUVertexAttributeDescriptor, WebGPUVertexFormat, WebGPUVertexInputDescriptor: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: Add and implement interfaces and dictionaries for WebGPUInputState: * Modules/webgpu/WebGPUBuffer.cpp: (WebCore::WebGPUBuffer::WebGPUBuffer): * Modules/webgpu/WebGPUBuffer.h: (WebCore::WebGPUBuffer::buffer const): Added getter for backing GPUBuffer. * Modules/webgpu/WebGPUBufferDescriptor.h: * Modules/webgpu/WebGPUBufferDescriptor.idl: Moving WebGPUBufferUsage out into its own IDL. * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUIndexFormat.h: Added. * Modules/webgpu/WebGPUIndexFormat.idl: Added. * Modules/webgpu/WebGPUInputStateDescriptor.h: Added. * Modules/webgpu/WebGPUInputStateDescriptor.idl: Added. * Modules/webgpu/WebGPUInputStepMode.h: Added. * Modules/webgpu/WebGPUInputStepMode.idl: Added. * Modules/webgpu/WebGPUVertexAttributeDescriptor.h: Added. * Modules/webgpu/WebGPUVertexAttributeDescriptor.idl: Added. * Modules/webgpu/WebGPUVertexFormat.h: Added. * Modules/webgpu/WebGPUVertexFormat.idl: Added. * Modules/webgpu/WebGPUVertexInputDescriptor.h: Added. * Modules/webgpu/WebGPUVertexInputDescriptor.idl: Added. * platform/graphics/gpu/GPUInputStateDescriptor.h: Added. * platform/graphics/gpu/GPURenderPassEncoder.h: Added. * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Added. * platform/graphics/gpu/GPUVertexAttributeDescriptor.h: Added. * platform/graphics/gpu/GPUVertexInputDescriptor.h: Added. Refactor to support updated structure of pipeline descriptor in sketch IDL: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::validateAndConvertPipelineStage): (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPUPipelineDescriptorBase.h: * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: * Modules/webgpu/WebGPUPipelineStageDescriptor.h: * Modules/webgpu/WebGPUPipelineStageDescriptor.idl: * Modules/webgpu/WebGPURenderPipelineDescriptor.h: * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: * Modules/webgpu/WebGPUShaderStage.*: Removed. Add and implement setVertexBuffers: * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::setVertexBuffers): Added. * Modules/webgpu/WebGPURenderPassEncoder.h: * Modules/webgpu/WebGPURenderPassEncoder.idl: * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::setVertexBuffers): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::setInputStateForPipelineDescriptor): (WebCore::GPURenderPipeline::create): 2018-12-12 Tim Horton <timothy_horton@apple.com> REGRESSION (r237565): >20 Find in Page highlights in one tile results in a single giant highlight https://bugs.webkit.org/show_bug.cgi?id=192642 <rdar://problem/46498246> Reviewed by Geoffrey Garen. No new tests; adjusted an existing test instead. * platform/graphics/PathUtilities.cpp: (WebCore::PathUtilities::pathsWithShrinkWrappedRects): Instead of uniting when we fail to shrink-wrap, just return the original rects. This seems like a more reasonable default in most cases. 2018-12-12 Vivek Seth <v_seth@apple.com> HTTPS Upgrade: Figure out if/how to tell clients that the HTTPS upgrade happened https://bugs.webkit.org/show_bug.cgi?id=192375 <rdar://problem/45851159> Reviewed by Chris Dumez. Use simulated redirect to tell clients that HTTPS Upgrade happened. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::syntheticRedirectResponse): * platform/network/ResourceResponseBase.h: * platform/network/mac/WebCoreURLResponse.mm: (WebCore::synthesizeRedirectResponseIfNecessary): 2018-12-12 Chris Dumez <cdumez@apple.com> Add a preference to enable / disable devicemotion and deviceorientation events https://bugs.webkit.org/show_bug.cgi?id=192631 <rdar://problem/46646244> Reviewed by Geoffrey Garen. Add setting to toggle support for the deviceorientation / devicemotion events: - https://w3c.github.io/deviceorientation/ * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): * page/Settings.yaml: 2018-12-11 Ryosuke Niwa <rniwa@webkit.org> Make HTMLConverter take two Positions in preparation to make it work with shadow DOM https://bugs.webkit.org/show_bug.cgi?id=192613 Reviewed by Darin Adler. This patch makes HTMLConverter store two Position's instead of a Range so that HTMLConverter can work with a selection which spans across shadow boundaries in the future. No new tests since there should be no observable behavioral change. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::writeSelectionToPasteboard): Uses the newly introduced writeSelectionToPasteboard. (WebCore::Editor::writeSelection): Ditto. * editing/cocoa/HTMLConverter.h: * editing/cocoa/HTMLConverter.mm: (HTMLConverter::HTMLConverter): Now takes two Position's. (HTMLConverter::convert): Updated to work with Position's. (HTMLConverter::_processText): Ditto. (HTMLConverter::_traverseNode): Ditto. (HTMLConverter::_traverseFooterNode): Ditto. (HTMLConverterCaches::cacheAncestorsOfStartToBeConverted): Ditto. (WebCore::attributedStringFromRange): Ditto. (WebCore::attributedStringFromSelection): Added. For now, we first create a Range via toNormalizedRange in order to preserve the exact behavior. 2018-12-12 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed manual rollout of r239100-r239102 and r239116 https://bugs.webkit.org/show_bug.cgi?id=192151 <rdar://problem/46655586> * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): * loader/cache/CachedFont.cpp: (WebCore::CachedFont::platformDataFromCustomData): * platform/FreeType.cmake: * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isFixedWidth const): Deleted. * platform/graphics/cairo/FontCustomPlatformData.h: * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::FontCache::systemFallbackForCharacters): (WebCore::FontCache::createFontPlatformData): (WebCore::getFontPropertiesFromPattern): Deleted. (WebCore::defaultVariationValues): Deleted. (WebCore::buildVariationSettings): Deleted. * platform/graphics/freetype/FontCacheFreeType.h: Removed. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): (WebCore::FontCustomPlatformData::~FontCustomPlatformData): (WebCore::FontCustomPlatformData::fontPlatformData): (WebCore::FontCustomPlatformData::supportsFormat): (WebCore::defaultFontconfigOptions): Deleted. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::setCairoFontOptionsFromFontConfigPattern): (WebCore::getDefaultFontconfigOptions): (WebCore::FontPlatformData::FontPlatformData): (WebCore::FontPlatformData::operator=): (WebCore::FontPlatformData::harfBuzzFace const): (WebCore::FontPlatformData::platformIsEqual const): (WebCore::FontPlatformData::buildScaledFont): (WebCore::FontPlatformData::fcPattern const): Deleted. (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): Deleted. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformCreateScaledFont const): * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::fontFeatures): (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): (WebCore::floatToHarfBuzzPosition): Deleted. (WebCore::doubleToHarfBuzzPosition): Deleted. (WebCore::harfBuzzFontFunctions): Deleted. (WebCore::findScriptForVerticalGlyphSubstitution): Deleted. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Added. (WebCore::HarfBuzzFace::CacheEntry::CacheEntry): (WebCore::HarfBuzzFace::CacheEntry::~CacheEntry): (WebCore::HarfBuzzFace::cache): (WebCore::HarfBuzzFace::HarfBuzzFace): (WebCore::HarfBuzzFace::~HarfBuzzFace): (WebCore::findScriptForVerticalGlyphSubstitution): (WebCore::HarfBuzzFace::setScriptForVerticalGlyphSubstitution): * platform/graphics/harfbuzz/HarfBuzzFace.h: Added. (WebCore::HarfBuzzFace::CacheEntry::create): (WebCore::HarfBuzzFace::CacheEntry::face): (WebCore::HarfBuzzFace::CacheEntry::glyphCache): * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Added. (WebCore::floatToHarfBuzzPosition): (WebCore::doubleToHarfBuzzPosition): (WebCore::CairoGetGlyphWidthAndExtents): (WebCore::harfBuzzGetGlyph): (WebCore::harfBuzzGetGlyphHorizontalAdvance): (WebCore::harfBuzzGetGlyphHorizontalOrigin): (WebCore::harfBuzzGetGlyphExtents): (WebCore::harfBuzzCairoTextGetFontFuncs): (WebCore::harfBuzzCairoGetTable): (WebCore::HarfBuzzFace::createFace): (WebCore::HarfBuzzFace::createFont): * platform/graphics/harfbuzz/HbUniquePtr.h: (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Deleted. * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontCustomPlatformData.h: * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): 2018-12-12 Chris Dumez <cdumez@apple.com> Unreviewed attempt to fix Windows Cairo build after r239100. * platform/graphics/win/FontCustomPlatformDataCairo.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): 2018-12-12 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] A few API tests are failing after r239086 https://bugs.webkit.org/show_bug.cgi?id=192608 Reviewed by Zalan Bujtas. These test failures were caused by a missing Vector size check in `Pasteboard::readFilePaths` before accessing the first item. Fix this by adding a helper method on PasteboardItemInfo to grab the file path for the highest fidelity pasteboard item (returning the null string if there are none), and use this in a few places that grab the highest fidelity path using Vector::first(). While `Pasteboard::readRespectingUTIFidelities` does have a bounds check before accessing the list of paths, this patch still replaces it with a call to `pathForHighestFidelityItem()`, so that the intent is more clear. * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::pathForHighestFidelityItem const): * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readRespectingUTIFidelities): (WebCore::Pasteboard::readFilePaths): 2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com> Unreviewed. Fix WPE build after r239101. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: Include <hb-ot.h> 2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com> [FreeType] Remove HarfBuzzFace https://bugs.webkit.org/show_bug.cgi?id=192589 Reviewed by Michael Catanzaro. This was used to share the common implementation with the chromium port, but now that only freetype based ports use it, it can be removed and use hb_ft_face_create_cached() instead. We don't need the glyph cache either, since we are already caching glyphs in Font. * platform/FreeType.cmake: Remove HarfBuzzFaceCairo.cpp and HarfBuzzFace.cpp. * platform/graphics/FontPlatformData.h: Remove HarfBuzzFace member. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: Add missing include. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::FontPlatformData::operator=): Remove m_harfBuzzFace handling. (WebCore::FontPlatformData::createOpenTypeMathHarfBuzzFont const): New funtction to create a hb_font_t for OpenType math. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::floatToHarfBuzzPosition): Moved from HarfBuzzFaceCairo.cpp. (WebCore::doubleToHarfBuzzPosition): Ditto. (WebCore::harfBuzzFontFunctions): Also moved from HarfBuzzFaceCairo.cpp, but implement get_nominal/variation functions when using HarfBuzz >= 1.2.3 and use Font::glyphForCharacter() to make it simpler. (WebCore::fontFeatures): Moved from HarfBuzzFaceCairo.cpp. (WebCore::findScriptForVerticalGlyphSubstitution): Moved from HarfBuzzFace.cpp. (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Create the HarfBuzz face and font here. * platform/graphics/harfbuzz/HarfBuzzFace.cpp: Removed. * platform/graphics/harfbuzz/HarfBuzzFace.h: Removed. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: Removed. * platform/graphics/harfbuzz/HbUniquePtr.h: (WebCore::HbPtrDeleter<hb_face_t>::operator() const): Add deleter for hb_face_t. * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): Use FontPlatformData::createOpenTypeMathHarfBuzzFont(). 2018-12-12 Carlos Garcia Campos <cgarcia@igalia.com> [FreeType] Add initial implementation of variation fonts https://bugs.webkit.org/show_bug.cgi?id=192151 Reviewed by Michael Catanzaro. * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::font): Remove platform ifdefs. * loader/cache/CachedFont.cpp: (WebCore::CachedFont::platformDataFromCustomData): Ditto. * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isFixedWidth const): * platform/graphics/cairo/FontCustomPlatformData.h: Use RefPtr for cairo_font_face_t. * platform/graphics/freetype/FontCacheFreeType.cpp: (WebCore::getFontPropertiesFromPattern): Helper function to get several font properties from the fontconfig pattern. (WebCore::FontCache::systemFallbackForCharacters): Use getFontPropertiesFromPattern(). (WebCore::FontCache::createFontPlatformData): Pass FC_VARIABLE to the pattern and call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::defaultVariationValues): Parse font variations table. (WebCore::buildVariationSettings): Build a font variations string from the settings that can be passed to cairo. * platform/graphics/freetype/FontCacheFreeType.h: Added. * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp: (WebCore::FontCustomPlatformData::FontCustomPlatformData): Use RefPtr and make freeTypeFaceKey global. (WebCore::FontCustomPlatformData::~FontCustomPlatformData): Remove explicit destroy. (WebCore::defaultFontconfigOptions): Moved here from FontCacheFreeType. (WebCore::FontCustomPlatformData::fontPlatformData): Call buildVariationSettings() before creating the FontPlatformData to set FC_FONT_VARIATIONS on the pattern. (WebCore::FontCustomPlatformData::supportsFormat): Add variation formats. * platform/graphics/freetype/FontPlatformDataFreeType.cpp: (WebCore::setCairoFontOptionsFromFontConfigPattern): Call cairo_font_options_set_variations() with the FC_FONT_VARIATIONS value from the pattern. (WebCore::FontPlatformData::FontPlatformData): Use a single constructor that always receives a valid fontconfig pattern. (WebCore::FontPlatformData::fcPattern const): Return the fontconfig pattern. (WebCore::FontPlatformData::platformIsEqual const): Update the condition now that m_pattern can't be nullptr. (WebCore::FontPlatformData::buildScaledFont): Use m_pattern unconditionally. * platform/graphics/freetype/SimpleFontDataFreeType.cpp: (WebCore::Font::platformCreateScaledFont const): Update it to use the new FontPlatformData constructor. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: (WebCore::HarfBuzzFace::createFont): Pass variations to HarfBuzz. * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): * platform/graphics/win/FontCustomPlatformData.h: 2018-12-11 Justin Michaud <justin_michaud@apple.com> Implement feature flag for CSS Typed OM https://bugs.webkit.org/show_bug.cgi?id=192610 Reviewed by Ryosuke Niwa. * Configurations/FeatureDefines.xcconfig: * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: * css/typedom/StylePropertyMapReadOnly.h: * css/typedom/StylePropertyMapReadOnly.idl: * css/typedom/TypedOMCSSImageValue.h: * css/typedom/TypedOMCSSImageValue.idl: * css/typedom/TypedOMCSSNumericValue.h: * css/typedom/TypedOMCSSNumericValue.idl: * css/typedom/TypedOMCSSStyleValue.h: * css/typedom/TypedOMCSSStyleValue.idl: * css/typedom/TypedOMCSSUnitValue.h: * css/typedom/TypedOMCSSUnitValue.idl: * css/typedom/TypedOMCSSUnparsedValue.h: * css/typedom/TypedOMCSSUnparsedValue.idl: * features.json: * html/ImageBitmap.cpp: * html/ImageBitmap.h: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasRenderingContext2DBase.cpp: * html/canvas/CanvasRenderingContext2DBase.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildAction): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSTypedOMEnabled): (WebCore::RuntimeEnabledFeatures::cssTypedOMEnabled const): * page/WindowOrWorkerGlobalScope.idl: 2018-12-10 Ryosuke Niwa <rniwa@webkit.org> connectedCallback is invoked during the removal of the element inside another element's connectedCallback https://bugs.webkit.org/show_bug.cgi?id=183586 <rdar://problem/38403504> Reviewed by Frédéric Wang. Align WebKit's behavior with Chrome/Firefox with regards to https://github.com/w3c/webcomponents/issues/760 After much discussion, it's unclear that there is a clear path forward to fixing the oddness that the presence of a custom element reaction changes the timing at which another reaction callback gets invoked. So matching Chrome/Firefox behaviors in this case seems the path of the least resistance to interoperability. Namely, this patch makes WebKit not insert a custom element to the appropriate element queue when the element does not have a matching reaction callback. Put it another way, steps 3-5 in would be done before step 6 in: https://html.spec.whatwg.org/multipage/custom-elements.html#enqueue-a-custom-element-callback-reaction 1. Let definition be element's custom element definition. 2. Let callback be the value of the entry in definition's lifecycle callbacks with key callbackName. 3. If callback is null, then return 4. If callbackName is "attributeChangedCallback", then: 1. Let attributeName be the first element of args. 2. If definition's observed attributes does not contain attributeName, then return. 5. Add a new callback reaction to element's custom element reaction queue, with callback function callback and arguments args. 6. Enqueue an element on the appropriate element queue given element. Test: fast/custom-elements/enqueue-custom-element-callback-reactions-inside-another-callback.html * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): (WebCore::CustomElementReactionQueue::enqueueElementOnAppropriateElementQueue): Renamed from ensureCurrentQueue. * dom/CustomElementReactionQueue.h: 2018-12-11 Justin Fan <justin_fan@apple.com> [WebGPU] Implement WebGPUBuffer, and some nullibility consistency in WebGPU https://bugs.webkit.org/show_bug.cgi?id=192516 Reviewed by Dean Jackson. Test: webgpu/buffers.html Enable basic creation of WebGPUBuffers, and fix nullability inconsitencies in WebGPU implementation. Add necessary symbols and files for Web/GPUBuffer, Web/GPUBufferUsage, and Web/GPUBufferDescriptor: * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * Modules/webgpu/WebGPUBuffer.cpp: Added. (WebCore::WebGPUBuffer::create): (WebCore::WebGPUBuffer::WebGPUBuffer): * Modules/webgpu/WebGPUBuffer.h: Added. (WebCore::WebGPUBuffer::mapping const): (WebCore::WebGPUBuffer::unmap): Unimplemented stub, for now, as Metal equivalent is unclear. (WebCore::WebGPUBuffer::destroy): Unimplemented stub. * Modules/webgpu/WebGPUBuffer.idl: Added. * Modules/webgpu/WebGPUBufferDescriptor.h: Added. * Modules/webgpu/WebGPUBufferDescriptor.idl: Added. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createBuffer const): Added. * platform/graphics/gpu/GPUBuffer.h: (WebCore::GPUBuffer::platformBuffer const): (WebCore::GPUBuffer::mapping const): * platform/graphics/gpu/GPUBufferDescriptor.h: Added. * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::createBuffer const): Added. * platform/graphics/gpu/GPUDevice.h: * platform/graphics/gpu/cocoa/GPUBufferMetal.mm: Added. (WebCore::GPUBuffer::create): Attempt to create a page-aligned Gigacage to back the GPUBuffer's ArrayBuffer. (WebCore::GPUBuffer::GPUBuffer): (WebCore::GPUBuffer::~GPUBuffer): Dereference mapped ArrayBuffer first. Small benign edits, most to make nullability more consistent in WebGPU classes: * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::beginRenderPass): * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::create): (WebCore::WebGPUDevice::WebGPUDevice): (WebCore::WebGPUDevice::createShaderModule const): (WebCore::WebGPUDevice::createRenderPipeline const): (WebCore::WebGPUDevice::createCommandBuffer const): * Modules/webgpu/WebGPUDevice.h: (WebCore::WebGPUDevice::device const): * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUQueue.cpp: (WebCore::WebGPUQueue::create): * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::create): * Modules/webgpu/WebGPURenderPassEncoder.h: * Modules/webgpu/WebGPUShaderModule.cpp: (WebCore::WebGPUShaderModule::create): (WebCore::WebGPUShaderModule::WebGPUShaderModule): * Modules/webgpu/WebGPUShaderModule.h: (WebCore::WebGPUShaderModule::module const): * Modules/webgpu/WebGPUSwapChain.idl: Sync with IDL changes. * Modules/webgpu/WebGPUTexture.cpp: (WebCore::WebGPUTexture::create): (WebCore::WebGPUTexture::createDefaultTextureView): * Modules/webgpu/WebGPUTextureView.cpp: (WebCore::WebGPUTextureView::create): * Modules/webgpu/WebGPUTextureView.h: * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::create): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::GPURenderPipeline::create): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: (WebCore::GPUShaderModule::create): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::setDevice): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: (WebCore::GPUTexture::GPUTexture): 2018-12-11 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Clang] Fix warning -Wmissing-field-initializers https://bugs.webkit.org/show_bug.cgi?id=192584 Reviewed by Yusuke Suzuki. Initialize a struct with '{ }' instead of '= {0}'. No new tests, no behavior changes. * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont): * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp: (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::setFileDescriptorData): (WebCore::setFileContentData): (WebCore::setUCharData): (WebCore::setUtf8Data): (WebCore::setCFData): * platform/win/CursorWin.cpp: (WebCore::createSharedCursor): * platform/win/DefWndProcWindowClass.cpp: (WebCore::registerClass): * platform/win/DragImageWin.cpp: (WebCore::createDragImageIconForCachedImageFilename): * platform/win/PasteboardWin.cpp: (WebCore::writeURL): (WebCore::Pasteboard::writeString): (WebCore::Pasteboard::writeRangeToDataObject): (WebCore::Pasteboard::writePlainTextToDataObject): (WebCore::writeFileToDataObject): (WebCore::Pasteboard::writeMarkup): * platform/win/PopupMenuWin.cpp: (WebCore::PopupMenuWin::show): * platform/win/SSLKeyGeneratorWin.cpp: (WebCore::WebCore::signedPublicKeyAndChallengeString): 2018-12-11 Jer Noble <jer.noble@apple.com> Globally namespaced objects shouldn't use framework-prefixed names https://bugs.webkit.org/show_bug.cgi?id=192600 Reviewed by Eric Carlson. Rename CMSampleBufferIs... -> isCMSampleBuffer... * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::isCMSampleBufferRandomAccess): (WebCore::isCMSampleBufferNonDisplaying): (WebCore::MediaSampleAVFObjC::flags const): (WebCore::CMSampleBufferIsRandomAccess): Deleted. (WebCore::CMSampleBufferIsNonDisplaying): Deleted. 2018-12-11 Brent Fulgham <bfulgham@apple.com> Don't attempt to compute animated values when there is no relevant animation https://bugs.webkit.org/show_bug.cgi?id=192591 <rdar://problem/34336946> Reviewed by Dean Jackson. Check if the property is supposed to be animated, or has animatable features, before attempting to calculate the current animated value. Test: svg/animations/avoid-calculating-for-non-animating-elements.html * svg/SVGAnimateElementBase.cpp: (WebCore::SVGAnimateElementBase::calculateAnimatedValue): 2018-12-11 Chris Dumez <cdumez@apple.com> Unreviewed, fix typos in console log from r239087. * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): 2018-12-11 Tim Horton <timothy_horton@apple.com> WebCore shouldn't have a Objective-C class named NSCursor https://bugs.webkit.org/show_bug.cgi?id=192602 <rdar://problem/46615532> Reviewed by Wenson Hsieh. * platform/ios/wak/WAKAppKitStubs.h: * platform/ios/wak/WAKAppKitStubs.m: (+[NSCursor setHiddenUntilMouseMoves:]): Deleted. Get rid of the class. Also remove a comment that seems to have detached from wherever it's supposed to be. 2018-12-11 Chris Dumez <cdumez@apple.com> Restrict DeviceMotion / DeviceOrientation APIs to secure contexts https://bugs.webkit.org/show_bug.cgi?id=192595 <rdar://problem/46382603> Reviewed by Dean Jackson. Tests: http/tests/events/device-orientation-motion-non-secure-context.html http/tests/events/device-orientation-motion-secure-context.html * page/DOMWindow.cpp: (WebCore::DOMWindow::addEventListener): * page/SecurityOrigin.h: (WebCore::SecurityOrigin::setIsPotentiallyTrustworthy): * testing/Internals.cpp: (WebCore::Internals::markContextAsInsecure): (WebCore::Internals::postTask): * testing/Internals.h: * testing/Internals.idl: 2018-12-11 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Send the full list of file upload URLs and types in PasteboardItemInfo https://bugs.webkit.org/show_bug.cgi?id=192598 Work towards <rdar://problem/35626913> Reviewed by Tim Horton. Refactors PasteboardItemInfo to contain lists of file URLs and corresponding pasteboard types, instead of just a "preferred" file upload URL and type. See below for more details. * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::pathForContentType const): Add a helper method to find a file upload URL corresponding to a given type. (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): Change `pathForFileUpload` to `pathsForFileUpload`, and `contentTypeForFileUpload` to `contentTypesForFileUpload`. * platform/ios/AbstractPasteboard.h: * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::readRespectingUTIFidelities): Adjust this to take the file path for the highest fidelity representation in `pathsForContentType`. (WebCore::Pasteboard::readFilePaths): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[NSItemProvider web_containsFileURLAndFileUploadContent]): (-[NSItemProvider web_fileUploadContentTypes]): Replace `web_containsFileUploadContent` with `web_fileUploadContentTypes`, which returns the full list of file upload content types (rather than just a `BOOL` indicating whether one or more of these types exist). (-[WebItemProviderPasteboard fileUploadURLsAtIndex:fileTypes:]): (-[WebItemProviderPasteboard numberOfFiles]): (-[NSItemProvider web_containsFileUploadContent]): Deleted. (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): Deleted. Replaced with `-fileUploadURLsAtIndex:fileTypes:`. This implementation currently just returns the highest fidelity loaded type identifier, but this is wrong because it doesn't take into account inline data types that shouldn't be represented as data for file uploads (for instance, it never makes sense to upload the internal data serialization for an `NSURL` as a file on the web). Instead, use existing logic in `web_fileUploadContentTypes` to determine which file types can be treated as file uploads, and return all of these file types that we've loaded. 2018-12-11 Don Olmstead <don.olmstead@sony.com> Resource Load Statistics: Use common implementation within NetworkStorageSession https://bugs.webkit.org/show_bug.cgi?id=192592 Reviewed by Alex Christensen. There's nothing within the resource load statistics implementation contained in NetworkStorageSessionCFNet that was CF specific. All of the resource load statistics methods are moved from that file to the root NetworkStorageSession implementation. * platform/network/NetworkStorageSession.cpp: (WebCore::getPartitioningDomain): (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): (WebCore::NetworkStorageSession::shouldBlockCookies const): (WebCore::NetworkStorageSession::maxAgeCacheCap): (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): (WebCore::NetworkStorageSession::removePrevalentDomains): (WebCore::NetworkStorageSession::hasStorageAccess const): (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): (WebCore::NetworkStorageSession::grantStorageAccess): (WebCore::NetworkStorageSession::removeStorageAccessForFrame): (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): (WebCore::NetworkStorageSession::removeAllStorageAccess): (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::getPartitioningDomain): Deleted. (WebCore::NetworkStorageSession::shouldBlockThirdPartyCookies const): Deleted. (WebCore::NetworkStorageSession::shouldBlockCookies const): Deleted. (WebCore::NetworkStorageSession::maxAgeCacheCap): Deleted. (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): Deleted. (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): Deleted. (WebCore::NetworkStorageSession::removePrevalentDomains): Deleted. (WebCore::NetworkStorageSession::hasStorageAccess const): Deleted. (WebCore::NetworkStorageSession::getAllStorageAccessEntries const): Deleted. (WebCore::NetworkStorageSession::grantStorageAccess): Deleted. (WebCore::NetworkStorageSession::removeStorageAccessForFrame): Deleted. (WebCore::NetworkStorageSession::removeStorageAccessForAllFramesOnPage): Deleted. (WebCore::NetworkStorageSession::removeAllStorageAccess): Deleted. (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): Deleted. (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): Deleted. 2018-12-11 Devin Rousso <drousso@apple.com> Web Inspector: overlay bounds rulers don't match element when page is scrolled https://bugs.webkit.org/show_bug.cgi?id=192577 Reviewed by Joseph Pecoraro. When drawing the highlight for a node, the canvas is translated based on the scroll position of the node. This translation was not applied to the bounds calculations, which meant that the bounds always drew where the node would have been if it wasn't scrolled. * inspector/InspectorOverlayPage.js: (Bounds.prototype.get minX): (Bounds.prototype.get minY): (Bounds.prototype.get maxX): (Bounds.prototype.get maxY): (Bounds.prototype.offset): Added. (drawNodeHighlight): Drive-by: draw bounds for every node being highlighted instead of just the first one. Drive-by: switch the bounds color to be a semi-transparent red for more visibility/contrast. 2018-12-11 Andy Estes <aestes@apple.com> Introduce makeBlockPtr for lambdas https://bugs.webkit.org/show_bug.cgi?id=192594 Reviewed by Alex Christensen. Adopted makeBlockPtr. * platform/cocoa/FileMonitorCocoa.mm: (WebCore::FileMonitor::FileMonitor): * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm: (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer): * platform/network/cocoa/WebCoreNSURLSession.mm: (-[WebCoreNSURLSession addDelegateOperation:]): (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate callFunctionOnMainThread:]): 2018-12-10 Brent Fulgham <bfulgham@apple.com> SVGViewSpec objects should mark relevant SVG elements https://bugs.webkit.org/show_bug.cgi?id=192567 <rdar://problem/46491325> Reviewed by Ryosuke Niwa. SVGViewSpec elements reflect the state of an underlying SVGElement. Teach the mark algorithm to recognize the relevant SVGElement as active as long as the SVGViewSpec is active. Update SVGElement so that it can vend WeakPtrs. I also noticed that SVGAttributeOwner used a bare pointer to the SVGElement, so switched to a WeakPtr. Test: svg/animations/view-dependency-crash.html * Sources.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * bindings/js/JSSVGViewSpecCustom.cpp: Added. (WebCore::JSSVGViewSpec::visitAdditionalChildren): * svg/SVGElement.h: * svg/SVGPathElement.h: * svg/SVGViewSpec.cpp: (WebCore::SVGViewSpec::SVGViewSpec): Hold a weak pointer (rather than a bare pointer) to the underlying element. * svg/SVGViewSpec.h: * svg/SVGViewSpec.idl: * svg/properties/SVGAttributeOwnerProxy.cpp: Added. (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Hold a weak pointer (rather than a bare pointer) to the underling SVGElement. (WebCore::SVGAttributeOwnerProxy::element const): Ditto. * svg/properties/SVGAttributeOwnerProxy.h: (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy): Move implementation to cpp file. (WebCore::SVGAttributeOwnerProxy::element const): Ditto. * svg/properties/SVGAttributeOwnerProxyImpl.h: Update for WeakPtr use. 2018-12-10 Benjamin Poulain <benjamin@webkit.org> <rdar://problem/45296285> Content blocker rule "raw" blocks media elements from loading https://bugs.webkit.org/show_bug.cgi?id=192439 Reviewed by Dean Jackson. This broken when WebKit switched to NSURLSession. In CachedResourceLoader::requestResource(), toResourceType() was turning media load into RAW. Test: http/tests/contentextensions/video-element-resource-type.html * loader/ResourceLoadInfo.cpp: (WebCore::toResourceType): 2018-12-10 Don Olmstead <don.olmstead@sony.com> Move ENABLE_RESOURCE_LOAD_STATISTICS to FeatureDefines.xcconfig https://bugs.webkit.org/show_bug.cgi?id=192573 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: 2018-12-10 Justin Michaud <justin_michaud@apple.com> CS Painting API should support multiple worklets. https://bugs.webkit.org/show_bug.cgi?id=192335 Reviewed by Dean Jackson. Adds a new map to support separate paint worklet global scopes (one for each worklet). Also adds some tests and a fix for a repaint bug that this oncovered, where changing a custom property required for paint would not trigger a repaint if there had not been a valid value set before. Test: fast/css-custom-paint/multiple-worklets.html * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/StyleResolver.cpp: (WebCore::StyleResolver::applyProperty): * dom/Document.cpp: (WebCore::Document::prepareForDestruction): (WebCore::Document::paintWorkletGlobalScope): (WebCore::Document::setPaintWorkletGlobalScope): * dom/Document.h: (WebCore::Document::paintWorkletGlobalScope): Deleted. * rendering/style/RenderStyle.cpp: (WebCore::changedCustomPaintWatchedProperty): * worklets/Worklet.cpp: (WebCore::Worklet::addModule): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::prepareForDestruction): 2018-12-10 Youenn Fablet <youenn@apple.com> Remove derived classes of RealtimeMediaSourceCenter https://bugs.webkit.org/show_bug.cgi?id=192546 Reviewed by Eric Carlson. Remove virtual methods of RealtimeMediaSourceCenter and remove derived classes of it. Instead port specific implementation directly implement the needed default factory methods. Renamed some methods for improved consistency. Moved some static variables as RealtimeMediaSourceCenter members. No change of behavior. * WebCore.xcodeproj/project.pbxproj: * page/DeprecatedGlobalSettings.cpp: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::createMediaStream): (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): (WebCore::RealtimeMediaSourceCenter::setVideoCapturePageState): (WebCore::RealtimeMediaSourceCenter::setAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): (WebCore::RealtimeMediaSourceCenter::audioCaptureFactory): (WebCore::RealtimeMediaSourceCenter::setVideoFactory): (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): (WebCore::RealtimeMediaSourceCenter::videoCaptureFactory): (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory): (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory): (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::~RealtimeVideoSource): (WebCore::RealtimeVideoSource::prepareToProduceData): * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: (WebCore::RealtimeMediaSourceCenter::singleton): (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory): * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: Removed. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::setupCaptureSession): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa): (WebCore::DisplayCaptureSourceCocoa::startProducingData): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenter::singleton): (WebCore::RealtimeMediaSourceCenter::defaultAudioCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultVideoCaptureFactory): (WebCore::RealtimeMediaSourceCenter::defaultDisplayCaptureFactory): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: Removed. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): (WebCore::MockRealtimeMediaSourceCenter::audioCaptureFactory): (WebCore::MockRealtimeMediaSourceCenter::videoCaptureFactory): * platform/mock/MockRealtimeMediaSourceCenter.h: 2018-12-10 Youenn Fablet <youenn@apple.com> DataChannels created asynchronously never open and are unusable https://bugs.webkit.org/show_bug.cgi?id=192566 Reviewed by Eric Carlson. For every new data channel (remote or local), we should check the underlying backend state. This allows firing events if needed. We were not always doing that which was prohibiting sending some open events for data channels created after the SCTP connection is set up. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp: (WebCore::LibWebRTCDataChannelHandler::channelEvent): (WebCore::LibWebRTCDataChannelHandler::setClient): (WebCore::LibWebRTCDataChannelHandler::OnStateChange): (WebCore::LibWebRTCDataChannelHandler::checkState): * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: 2018-12-10 Ryosuke Niwa <rniwa@webkit.org> Use WeakPtr to refer to VTTCue in VTTCueBox https://bugs.webkit.org/show_bug.cgi?id=192575 Reviewed by Eric Carlson. Address the FIXME in VTTCue::~VTTCue by clearing VTTCueBox::m_cue when VTTCue goes away. This is implemented by simply using WeakPtr. No new tests since there shoul be no behaivoral change. * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): * html/track/VTTCue.cpp: (WebCore::VTTCueBox::VTTCueBox): (WebCore::VTTCueBox::getCue const): (WebCore::VTTCueBox::applyCSSProperties): (WebCore::VTTCue::~VTTCue): * html/track/VTTCue.h: (WebCore::VTTCueBox::fontSizeFromCaptionUserPrefs const): 2018-12-10 Mark Lam <mark.lam@apple.com> PropertyAttribute needs a CustomValue bit. https://bugs.webkit.org/show_bug.cgi?id=191993 <rdar://problem/46264467> Reviewed by Saam Barati. This patch revealed a bug in the CodeGenerator where a constructor property is set with a ReadOnly attribute. This conflicts with the WebIDL link (see clause 12 in https://heycam.github.io/webidl/#interface-prototype-object) which states that it should be [Writable]. The ReadOnly attribute is now removed. On the WebCore side, this change is covered by existing tests. * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: (WebCore::jsTestCustomConstructorWithNoInterfaceObjectConstructor): 2018-12-10 Antti Koivisto <antti@apple.com> Rename "forced style recalc" to "full style rebuild" https://bugs.webkit.org/show_bug.cgi?id=192572 Reviewed by Zalan Bujtas. The old name is confusing. * css/CSSComputedStyleDeclaration.cpp: (WebCore::hasValidStyleForProperty): * dom/Document.cpp: (WebCore::Document::scheduleStyleRebuild): (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::unscheduleStyleRecalc): (WebCore::Document::hasPendingStyleRebuild const): (WebCore::Document::resolveStyle): (WebCore::Document::needsStyleRecalc const): (WebCore::Document::updateLayoutIgnorePendingStylesheets): (WebCore::Document::invalidateMatchedPropertiesCacheAndForceStyleRecalc): (WebCore::Document::setDesignMode): (WebCore::Document::webkitDidExitFullScreenForElement): (WebCore::Document::setAnimatingFullScreen): (WebCore::Document::setFullscreenControlsHidden): (WebCore::Document::scheduleForcedStyleRecalc): Deleted. (WebCore::Document::hasPendingForcedStyleRecalc const): Deleted. * dom/Document.h: * dom/Element.cpp: (WebCore::Element::needsStyleInvalidation const): * page/Page.cpp: (WebCore::Page::updateStyleAfterChangeInEnvironment): * style/StyleScope.cpp: (WebCore::Style::Scope::updateActiveStyleSheets): 2018-12-10 Alexey Proskuryakov <ap@apple.com> Include CoreGraphics.h from WebCorePrefix.h https://bugs.webkit.org/show_bug.cgi?id=192557 Reviewed by Tim Horton. The theory is that this will improve build time. Let's try and see what bots say. * WebCorePrefix.h: 2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Unable to upload data that conforms to "public.item" but not "public.content" https://bugs.webkit.org/show_bug.cgi?id=192555 <rdar://problem/35204990> Reviewed by Tim Horton. Add support for uploading content that conforms to "public.item" via drag and drop. Currently, iOS WebKit only supports data that conforms to "public.content", but there exist several types of files that conform to "public.item" but not "public.content". See below for more detail. Test: DragAndDropTests.ExternalSourcePKCS12ToSingleFileInput * platform/ios/PasteboardIOS.mm: (WebCore::Pasteboard::supportedFileUploadPasteboardTypes): Update this to include "public.item", and remove "public.folder", which is now redundant because "public.folder" conforms to "public.item". * platform/ios/WebItemProviderPasteboard.mm: (-[NSItemProvider web_containsFileURLAndFileUploadContent]): Pull out the "contains content that is supported for file uploads" part of this helper method into a separate method, and use it within `-web_containsFileURLAndFileUploadContent`. Note that this prevents "public.url"- conformant data from being uploaded as files (i.e., we never want to upload a URL string *itself* as a file). Drawing this distinction ensures that we don't confuse item providers that contain just a URL as files when dropping into a file upload area or file input (see API test: ExternalSourceZIPArchiveAndURLToSingleFileInput for an example of this corner case). (-[NSItemProvider web_containsFileUploadContent]): (-[WebItemProviderPasteboard numberOfFiles]): Refactor this to use `-web_containsFileUploadContent`. 2018-12-10 Chris Dumez <cdumez@apple.com> Add SPI to allow the client to set the user-agent at main frame level, from the UIProcess https://bugs.webkit.org/show_bug.cgi?id=192509 <rdar://problem/46500832> Reviewed by Alex Christensen. * loader/DocumentLoader.h: (WebCore::DocumentLoader::setCustomUserAgent): (WebCore::DocumentLoader::customUserAgent const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::userAgent const): 2018-12-10 Adrian Perez de Castro <aperez@igalia.com> [GLib] FileSystem::moveFile() should fall back to copying https://bugs.webkit.org/show_bug.cgi?id=192562 Reviewed by Michael Catanzaro. No new tests needed. * platform/glib/FileSystemGlib.cpp: (WebCore::FileSystem::moveFile): Use g_file_move() instead of a plain g_rename(), which provides a fall-back which does copy+delete when a direct move or rename cannot be done. 2018-12-10 Simon Fraser <simon.fraser@apple.com> Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 <rdar://problem/46542237> Re-land r239010 after over-zealous rollout. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::attachToStateTree): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::attachToStateTree): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::indexOfChild const): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingStateTree.h: 2018-12-10 Antti Koivisto <antti@apple.com> Document should throttle style recalc even when m_pendingStyleRecalcShouldForce is true. https://bugs.webkit.org/show_bug.cgi?id=191695 Reviewed by Zalan Bujtas. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): Don't test for m_pendingStyleRecalcShouldForce. (WebCore::Document::hasPendingStyleRecalc const): (WebCore::Document::hasPendingForcedStyleRecalc const): Don't base the pending status of these function on whether the timer is running. Instead check if the style is invalid. 2018-12-10 Rob Buis <rbuis@igalia.com> XMLHttpRequest removes spaces from content-types before processing https://bugs.webkit.org/show_bug.cgi?id=8644 Reviewed by Chris Dumez. Stop trimming white space characters from the middle of type/subtype value. Also make sure whitespace being parsed adheres to OWS definition from RFC 7230 Section 3.2.3 (referenced by RFC 7231), i.e. space or HT. Based on http://crrev.com/416586. Behavior matches Firefox and Chrome. Tests: http/tests/xmlhttprequest/supported-xml-content-types.html web-platform-tests/mimesniff/mime-types/parsing.any.html web-platform-tests/mimesniff/mime-types/parsing.any.worker.html * platform/network/HTTPParsers.cpp: (WebCore::extractMIMETypeFromMediaType): 2018-12-10 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Caret is obscured by finger when dragging over an editable element https://bugs.webkit.org/show_bug.cgi?id=192499 <rdar://problem/46570101> Reviewed by Tim Horton. * page/DragActions.h: Move DragHandlingMethod to DragActions.h, and drive-by fix some minor issues (i.e. make a couple of enum classes use 8 bits, fix the indentation levels, and update the copyright year). Also add `EnumTraits` for DragHandlingMethod so that it may be encoded over IPC. * page/DragController.cpp: (WebCore::dragIsHandledByDocument): Simplify this helper function. (WebCore::DragController::tryDocumentDrag): * page/DragController.h: Expose the current DragHandlingMethod via a const getter method. (WebCore::DragController::dragHandlingMethod const): 2018-12-10 Youenn Fablet <youenn@apple.com> Make mock capture happen in the process used for real capture https://bugs.webkit.org/show_bug.cgi?id=192544 Reviewed by Eric Carlson. MockRealtimeMediaSourceCenter previously was setting its factories whenever mock capture is on. Add booleans to choose which source (audio, video, display) will actually be toggled on. Covered by existing tests. * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): * platform/mock/MockRealtimeMediaSourceCenter.h: (WebCore::MockRealtimeMediaSourceCenter::setMockAudioCaptureEnabled): (WebCore::MockRealtimeMediaSourceCenter::setMockVideoCaptureEnabled): (WebCore::MockRealtimeMediaSourceCenter::setMockDisplayCaptureEnabled): 2018-12-10 Dean Jackson <dino@apple.com> Use text/javascript as recommended by the HTML specification https://bugs.webkit.org/show_bug.cgi?id=192525 <rdar://problem/46569636> Reviewed by Jon Lee. The HTML specification says we should use text/javascript for JavaScript files: https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type * loader/cache/CachedScript.cpp: Replace application/javascript with text/javascript. (WebCore::CachedScript::CachedScript): * platform/network/ios/WebCoreURLResponseIOS.mm: Ditto. (WebCore::createExtensionToMIMETypeMap): * platform/network/mac/WebCoreURLResponse.mm: Ditto. (WebCore::createExtensionToMIMETypeMap): 2018-12-10 Dean Jackson <dino@apple.com> [iOS] Make WebGPU work with remote layer hosting https://bugs.webkit.org/show_bug.cgi?id=192508 <rdar://problem/46560649> Reviewed by Tim Horton. WebGPU wasn't working on iOS because we were not correctly identifying the CALayers for remote hosting. Fix this by adding a new CALayer type, WebGPULayer. This will also eventually hold the code to render WebGPU into a canvas. Covered by the existing reference tests (on device). * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer class for remote hosting. (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance from CAMetalLayer. * platform/graphics/cocoa/WebGPULayer.mm: Added. (-[WebGPULayer init]): (-[WebGPULayer copyImageSnapshotWithColorSpace:]): * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather than CALayer. * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that the WebGPULayer has a reference back to this object, which it will use in the future. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): 2018-12-10 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r238965. Caused internal iOS build failures Reverted changeset: "[iOS] Make WebGPU work with remote layer hosting" https://bugs.webkit.org/show_bug.cgi?id=192508 https://trac.webkit.org/changeset/238965 2018-12-10 Youenn Fablet <youenn@apple.com> MockLibWebRTCPeerConnectionFactory should isolate copy its test case https://bugs.webkit.org/show_bug.cgi?id=192545 Reviewed by Eric Carlson. Isolate copy the test case member so that it can be destroyed on another thread. Covered by existing test that should no longer crash. * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::useMockRTCPeerConnectionFactory): (WebCore::MockLibWebRTCPeerConnectionFactory::MockLibWebRTCPeerConnectionFactory): * testing/MockLibWebRTCPeerConnection.h: (WebCore::MockLibWebRTCPeerConnectionFactory::create): 2018-12-09 Youenn Fablet <youenn@apple.com> Move capture manager from RealtimeMediaSourceCenter to capture factory https://bugs.webkit.org/show_bug.cgi?id=192542 Reviewed by Eric Carlson. We should be able to run mock captures in wither UIProcess or WebProcess. Currently, mock capture is only done in WebProcess. This patch is a first step towards that goal. It also simplifies RealtimeMediaSourceCenter implementation by starting to remove virtual methods. Further refactoring will remove the need to subclass RealtimeMediaSourceCenter. Instead, remaining virtual methods will become non virtual and their implementation will become port specific. Removed a JS internal method that is not longer used to further simplify RealtimeMediaSourceCenter. No visible change of behavior. Covered by existing tests. * platform/mediastream/CaptureDeviceManager.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::singleton): (WebCore::RealtimeMediaSourceCenter::getMediaStreamDevices): (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices): (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): (WebCore::RealtimeMediaSourceCenter::captureDeviceWithPersistentID): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory): * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSourceFactory::audioCaptureDeviceManager): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled): (WebCore::MockRealtimeMediaSourceCenter::audioFactory): (WebCore::MockRealtimeMediaSourceCenter::videoFactory): (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): * platform/mock/MockRealtimeMediaSourceCenter.h: (WebCore::MockRealtimeMediaSourceCenter::audioCaptureDeviceManager): (WebCore::MockRealtimeMediaSourceCenter::videoCaptureDeviceManager): (WebCore::MockRealtimeMediaSourceCenter::displayCaptureDeviceManager): * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2018-12-09 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r239010. https://bugs.webkit.org/show_bug.cgi?id=192537 Breaks fast/visual-viewport/tiled-drawing/zoomed-fixed- scrolling-layers-state.html again (Requested by ap on #webkit). Reverted changeset: "Allow control over child order when adding nodes to the scrolling tree" https://bugs.webkit.org/show_bug.cgi?id=176914 https://trac.webkit.org/changeset/239010 2018-12-08 Eric Carlson <eric.carlson@apple.com> [MediaStream] Scaled video frames should be resized in letterbox mode https://bugs.webkit.org/show_bug.cgi?id=192528 <rdar://problem/46576638> Reviewed by Darin Adler. Test: fast/mediastream/resize-letterbox.html * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): Use letterbox resize mode, not trim. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::captureSize const): "Capture" at the preset size, not necessarily at the requested size to be more like a physical camera. (WebCore::MockRealtimeVideoSource::settingsDidChange): (WebCore::MockRealtimeVideoSource::drawAnimation): (WebCore::MockRealtimeVideoSource::drawBoxes): (WebCore::MockRealtimeVideoSource::drawText): (WebCore::MockRealtimeVideoSource::generateFrame): (WebCore::MockRealtimeVideoSource::imageBuffer const): * platform/mock/MockRealtimeVideoSource.h: 2018-12-08 Alex Christensen <achristensen@webkit.org> Don't programmatically capitalize safe browsing warning buttons https://bugs.webkit.org/show_bug.cgi?id=192531 <rdar://problem/46417791> Reviewed by Darin Adler. This doesn't work so well in other languages. Capitalize the source strings in English instead. * en.lproj/Localizable.strings: 2018-12-08 Frederic Wang <fwang@igalia.com> Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 <rdar://problem/46542237> Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent, but with no control over sibling order. To allow for correct hit-testing overflow and frame scrolling nodes, we have to build the scrolling tree in z-order. This patch adds a 'childIndex' parameter to attachNode() which gives control over sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value for childIndex so the current behavior (appending new nodes at the end of child list) is preserved. One test marked as flakey, since scrolling tree order is currently dependent on HashSet traversal order. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::attachToStateTree): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::attachToStateTree): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::indexOfChild const): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingStateTree.h: 2018-12-07 Eric Carlson <eric.carlson@apple.com> [MediaStream] 'devicechange' event should not fire in frames that can't access capture devices https://bugs.webkit.org/show_bug.cgi?id=192511 <rdar://problem/46562063> Reviewed by Youenn Fablet. Test: http/tests/media/media-stream/device-change-event-in-iframe.html * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::addEventListener): Don't fire the event unless the document can access a camera or microphone. 2018-12-07 Eric Carlson <eric.carlson@apple.com> [MediaStream] Address post-review comments after r238904 https://bugs.webkit.org/show_bug.cgi?id=192514 <rdar://problem/46564302> Reviewed by Youenn Fablet. No new tests, no functional change. * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::ImageTransferSessionVT::setSize): * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): 2018-12-07 Antti Koivisto <antti@apple.com> [LFC] Rename LayoutFormattingState files to LayoutState https://bugs.webkit.org/show_bug.cgi?id=192520 Reviewed by Zalan Bujtas. Match the class name. * layout/FormattingContext.cpp: * layout/FormattingContextQuirks.cpp: * layout/FormattingState.h: * layout/LayoutFormattingState.cpp: Removed. * layout/LayoutFormattingState.h: Removed. * layout/LayoutState.cpp: Copied from Source/WebCore/layout/LayoutFormattingState.cpp. * layout/LayoutState.h: Copied from Source/WebCore/layout/LayoutFormattingState.h. * layout/Verification.cpp: * layout/blockformatting/BlockFormattingContext.cpp: * layout/blockformatting/BlockFormattingContextQuirks.cpp: * layout/blockformatting/BlockInvalidation.cpp: * layout/floats/FloatAvoider.cpp: * layout/floats/FloatingContext.cpp: * layout/floats/FloatingState.cpp: * layout/inlineformatting/InlineFormattingContext.cpp: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: * layout/inlineformatting/InlineInvalidation.cpp: * layout/layouttree/LayoutTreeBuilder.cpp: * page/FrameViewLayoutContext.cpp: 2018-12-07 Justin Michaud <justin_michaud@apple.com> CSS Painting API code cleanup https://bugs.webkit.org/show_bug.cgi?id=192480 Reviewed by Dean Jackson. No new tests, since the existing tests should cover it. * bindings/js/JSDOMWrapper.cpp: (WebCore::outputConstraintSubspaceFor): (WebCore::globalObjectOutputConstraintSubspaceFor): * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::toJS): * css/CSSPaintCallback.h: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::addCustomPaintWatchProperty): (WebCore::changedCustomPaintWatchedProperty): (WebCore::RenderStyle::changeRequiresRepaint const): * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::registerPaint): * worklets/PaintWorkletGlobalScope.h: 2018-12-07 Youenn Fablet <youenn@apple.com> Update libwebrtc up to 0d007d7c4f https://bugs.webkit.org/show_bug.cgi?id=192316 Reviewed by Eric Carlson. Update include according new libwebrtc. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: 2018-12-07 Dean Jackson <dino@apple.com> [iOS] Make WebGPU work with remote layer hosting https://bugs.webkit.org/show_bug.cgi?id=192508 <rdar://problem/46560649> Reviewed by Tim Horton. WebGPU wasn't working on iOS because we were not correctly identifying the CALayers for remote hosting. Fix this by adding a new CALayer type, WebGPULayer. This will also eventually hold the code to render WebGPU into a canvas. Covered by the existing reference tests (on device). * SourcesCocoa.txt: Add new files. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: Recognise the WebGPULayer class for remote hosting. (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): * platform/graphics/cocoa/WebGPULayer.h: Added. Very simple inheritance from CAMetalLayer. * platform/graphics/cocoa/WebGPULayer.mm: Added. (-[WebGPULayer init]): (-[WebGPULayer copyImageSnapshotWithColorSpace:]): * platform/graphics/gpu/GPUSwapChain.h: Reference WebGPULayer rather than CALayer. * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Ensure that the WebGPULayer has a reference back to this object, which it will use in the future. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): 2018-12-07 Antti Koivisto <antti@apple.com> Rename LayoutState to RenderLayoutState https://bugs.webkit.org/show_bug.cgi?id=192504 Reviewed by Zalan Bujtas. The name is better used in LFC. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layoutState const): (WebCore::FrameViewLayoutContext::pushLayoutState): (WebCore::FrameViewLayoutContext::pushLayoutStateForPaginationIfNeeded): * page/FrameViewLayoutContext.h: * rendering/LayoutState.cpp: Removed. * rendering/LayoutState.h: Removed. * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::checkForPaginationLogicalHeightChange): * rendering/RenderBlockLineLayout.cpp: * rendering/RenderBox.cpp: * rendering/RenderEmbeddedObject.cpp: * rendering/RenderFragmentedFlow.cpp: * rendering/RenderGrid.cpp: * rendering/RenderImage.cpp: * rendering/RenderInline.cpp: * rendering/RenderLayoutState.cpp: Copied from Source/WebCore/rendering/LayoutState.cpp. (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::RenderLayoutState::computeOffsets): (WebCore::RenderLayoutState::computeClipRect): (WebCore::RenderLayoutState::computePaginationInformation): (WebCore::RenderLayoutState::pageLogicalOffset const): (WebCore::RenderLayoutState::computeLineGridPaginationOrigin): (WebCore::RenderLayoutState::propagateLineGridInfo): (WebCore::RenderLayoutState::establishLineGrid): (WebCore::RenderLayoutState::addLayoutDelta): (WebCore::RenderLayoutState::layoutDeltaMatches const): (WebCore::LayoutState::LayoutState): Deleted. (WebCore::LayoutState::computeOffsets): Deleted. (WebCore::LayoutState::computeClipRect): Deleted. (WebCore::LayoutState::computePaginationInformation): Deleted. (WebCore::LayoutState::pageLogicalOffset const): Deleted. (WebCore::LayoutState::computeLineGridPaginationOrigin): Deleted. (WebCore::LayoutState::propagateLineGridInfo): Deleted. (WebCore::LayoutState::establishLineGrid): Deleted. (WebCore::LayoutState::addLayoutDelta): Deleted. (WebCore::LayoutState::layoutDeltaMatches const): Deleted. * rendering/RenderLayoutState.h: Copied from Source/WebCore/rendering/LayoutState.h. (WebCore::RenderLayoutState::RenderLayoutState): (WebCore::LayoutState::LayoutState): Deleted. (WebCore::LayoutState::isPaginated const): Deleted. (WebCore::LayoutState::pageLogicalHeight const): Deleted. (WebCore::LayoutState::pageLogicalHeightChanged const): Deleted. (WebCore::LayoutState::lineGrid const): Deleted. (WebCore::LayoutState::lineGridOffset const): Deleted. (WebCore::LayoutState::lineGridPaginationOrigin const): Deleted. (WebCore::LayoutState::paintOffset const): Deleted. (WebCore::LayoutState::layoutOffset const): Deleted. (WebCore::LayoutState::pageOffset const): Deleted. (WebCore::LayoutState::needsBlockDirectionLocationSetBeforeLayout const): Deleted. (WebCore::LayoutState::renderer const): Deleted. (WebCore::LayoutState::clipRect const): Deleted. (WebCore::LayoutState::isClipped const): Deleted. (WebCore::LayoutState::layoutDelta const): Deleted. * rendering/RenderListBox.cpp: * rendering/RenderMediaControlElements.cpp: * rendering/RenderMultiColumnFlow.cpp: * rendering/RenderTable.cpp: * rendering/RenderTableRow.cpp: * rendering/RenderTableSection.cpp: * rendering/RenderVTTCue.cpp: * rendering/RenderView.cpp: * rendering/RenderView.h: * rendering/RootInlineBox.cpp: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::layout): 2018-12-07 Antti Koivisto <antti@apple.com> [LFC] Rename formattingContext() to createFormattingContext() https://bugs.webkit.org/show_bug.cgi?id=192500 Reviewed by Zalan Bujtas. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): * layout/FormattingState.h: * layout/LayoutFormattingState.cpp: (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingState.cpp: (WebCore::Layout::BlockFormattingState::createFormattingContext): (WebCore::Layout::BlockFormattingState::formattingContext): Deleted. * layout/blockformatting/BlockFormattingState.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): * layout/inlineformatting/InlineFormattingState.h: 2018-12-07 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r238947. Revision caused fast/visual-viewport/tiled-drawing/zoomed- fixed-scrolling-layers-state.html to constantly fail Reverted changeset: "Allow control over child order when adding nodes to the scrolling tree" https://bugs.webkit.org/show_bug.cgi?id=176914 https://trac.webkit.org/changeset/238947 2018-12-07 Wenson Hsieh <wenson_hsieh@apple.com> [Attachment Support] Cloned attachment elements lose their unique identifiers https://bugs.webkit.org/show_bug.cgi?id=192483 Reviewed by Tim Horton. This patch adds logic to ensure that the unique identifier of a cloned attachment element is the same as the unique identifier of the original attachment element. If the cloned attachment is inserted into the same document as the original attachment, then we will exercise the same codepath for copied-and-pasted attachments, and assign a new unique identifier to the attachment element, while creating a new `_WKAttachment` in the client that's backed by the same `NSFileWrapper`. Test: WKAttachmentTests.AttachmentIdentifierOfClonedAttachment * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::copyNonAttributePropertiesFromElement): * html/HTMLAttachmentElement.h: 2018-12-07 Rob Buis <rbuis@igalia.com> Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList https://bugs.webkit.org/show_bug.cgi?id=192288 Reviewed by Frédéric Wang. Merge parseAccessControlExposeHeadersAllowList into parseAccessControlAllowList as they do the same thing. Also remove std::optional from parseAccessControlAllowList since the function can't fail. * WebCore.order: * loader/CrossOriginAccessControl.cpp: (WebCore::validatePreflightResponse): * loader/CrossOriginPreflightResultCache.cpp: (WebCore::CrossOriginPreflightResultCacheItem::parse): * loader/CrossOriginPreflightResultCache.h: * platform/network/HTTPParsers.cpp: (WebCore::parseAccessControlExposeHeadersAllowList): Deleted. * platform/network/HTTPParsers.h: (WebCore::parseAccessControlAllowList): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::filter): (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFieldsAccordingToTainting): 2018-12-07 Eric Carlson <eric.carlson@apple.com> [iOS] Don't update AVPlayerViewController currentTime while scrubbing https://bugs.webkit.org/show_bug.cgi?id=192438 <rdar://problem/42977046> Reviewed by Jer Noble. No new tests, tested manually. * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::currentTimeChanged): Don't report change during scrubbing. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController beginScrubbing:]): Set _isScrubbing. (-[WebAVPlayerController endScrubbing:]): Ditto. (-[WebAVPlayerController isScrubbing]): Return _isScrubbing. 2018-12-07 Thibault Saunier <tsaunier@igalia.com> [WPE][GTK] Implement WebAudioSourceProviderGStreamer to allow bridging MediaStream and the WebAudio APIs https://bugs.webkit.org/show_bug.cgi?id=186933 Reusing the AudioSourceProviderGStreamer itself as it was doing almost everything we needed, just added a constructor to be able to create it from a MediaStreamTrackPrivate and made it a WebAudioSourceProvider which only means it is now a ThreadSafeRefCounted. Sensibily refactored GStreamerMediaStreamSource so that we could reuse it to track a single MediaStreamTrack. Reviewed by Philippe Normand. Enabled all tests depending on that feature. * platform/audio/gstreamer/AudioSourceProviderGStreamer.cpp: (WebCore::AudioSourceProviderGStreamer::AudioSourceProviderGStreamer): (WebCore::AudioSourceProviderGStreamer::~AudioSourceProviderGStreamer): (WebCore::AudioSourceProviderGStreamer::setClient): * platform/audio/gstreamer/AudioSourceProviderGStreamer.h: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::audioSourceProvider): * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::GStreamerAudioCapturer): * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h: * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::webkitMediaStreamSrcSetupSrc): (WebCore::webkitMediaStreamSrcSetupAppSrc): (WebCore::webkitMediaStreamSrcAddTrack): (WebCore::webkitMediaStreamSrcSetStream): (WebCore::webkitMediaStreamSrcNew): * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): (WebCore::WrappedMockRealtimeAudioSource::start): (WebCore::WrappedMockRealtimeAudioSource::addHum): (WebCore::WrappedMockRealtimeAudioSource::render): (WebCore::WrappedMockRealtimeAudioSource::settingsDidChange): (WebCore::MockGStreamerAudioCaptureSource::startProducingData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): Handle the case where input buffers are "big" and process all the data we can for each runs of the method. 2018-12-06 Alexey Proskuryakov <ap@apple.com> Move USE_NEW_THEME out of WebCore's config.h https://bugs.webkit.org/show_bug.cgi?id=192426 Reviewed by Tim Horton. * config.h: 2018-12-06 Frederic Wang <fwang@igalia.com> Allow control over child order when adding nodes to the scrolling tree https://bugs.webkit.org/show_bug.cgi?id=176914 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. Previously ScrollingCoordinator just allowed nodes to be "attached" with a given parent, but with no control over sibling order. To allow for correct hit-testing overflow and frame scrolling nodes, we have to build the scrolling tree in z-order. This patch adds a 'childIndex' parameter to attachNode() which gives control over sibling order. For now, RenderLayerCompositor always uses the default 'notFound' value for childIndex so the current behavior (appending new nodes at the end of child list) is preserved. No new tests, behavior unchanged and already covered by existing tests. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::attachToStateTree): (WebCore::AsyncScrollingCoordinator::ensureRootStateNodeForFrameView): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::attachToStateTree): * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::insertChild): (WebCore::ScrollingStateNode::indexOfChild const): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::nodeTypeAndParentMatch const): (WebCore::ScrollingStateTree::attachNode): * page/scrolling/ScrollingStateTree.h: 2018-12-06 Yongjun Zhang <yongjun_zhang@apple.com> We should ignore minimumEffectiveDeviceWidth if the page specifies device-width in viewport meta-tag. https://bugs.webkit.org/show_bug.cgi?id=192377 <rdar://problem/46364206> Reviewed by Tim Horton. If the page specifies width=device-width or initial-scale=1 in the viewport meta tag, we should use the native device width and ignore the minimum effective device width in ViewportConfiguration. The patch also introduces scalableNativeWebpageParameters() which uses the device width as default and also allows the page to shrink-to-fit. If a page doesn't have viewport meta tag, or if the width argument isn't device-width and the initial scale isn't 1, we will use scalableNativeWebpageParameters() as the default configuration. Tests: fast/viewport/ios/ignore-minimum-device-width-for-page-with-viewport-device-width.html fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::updateDefaultConfiguration): pick the default configuration based on the page's viewport arguments. Also, we will always fall back to scalableNativeWebpageParameters() if we can ignore scaling constraints. (WebCore::ViewportConfiguration::setViewportArguments): When page sends us new ViewportArguments, pick up the correponsding default configuration before updating the configuration. (WebCore::ViewportConfiguration::setCanIgnoreScalingConstraints): When m_canIgnoreScalingConstraints is changed, try to pick up the correponsding default configuration. (WebCore::ViewportConfiguration::scalableNativeWebpageParameters): Add a new default set of viewport Parameters this is very close to nativeWebpageParameters() excpet that it allows shrink to fit and its minimum scale is 0.25. We will use this Parameters for pages that doesn't have viewport meta tag; or the width is not device-width and initial scale is not 1. (WebCore::ViewportConfiguration::updateConfiguration): If the page's viewport argument doesn't override the default width, use the m_minimumLayoutSize.width(). * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::shouldIgnoreMinimumEffectiveDeviceWidth const): A helper method to tell if we should avoid using minimum effective device width. (WebCore::ViewportConfiguration::canOverrideConfigurationParameters const): If we are using a default configuration that is neither nativeWebpageParameters() nor scalableNativeWebpageParameters(), don't override it. (WebCore::ViewportConfiguration::minimumEffectiveDeviceWidth const): Add a helper method to return minimum effective device width based on shouldIgnoreMinimumEffectiveDeviceWidth(). (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor const): Use minimumEffectiveDeviceWidth(). 2018-12-06 Adrian Perez de Castro <aperez@igalia.com> Content Extensions: Misc fixes to debugging / perf testing code https://bugs.webkit.org/show_bug.cgi?id=192474 Reviewed by Mark Lam. This make it possible to build the content extensions support with the debugging features enabled. In particular, building with CONTENT_EXTENSIONS_PERFORMANCE_REPORTING enabled was broken. No new tests needed. * contentextensions/ContentExtensionCompiler.cpp: (WebCore::ContentExtensions::compileRuleList): Remove usage of removed variables machinesWihthoutConditionsCount, totalBytecodeSizeForMachinesWithoutConditions, machinesWithConditionsCount, and totalBytecodeSizeForMachinesWithConditions. * contentextensions/DFA.cpp: (WebCore::ContentExtensions::DFA::debugPrintDot const): Use "%" PRIu64 instead of "%llu" to format uint64_t values. * contentextensions/NFA.cpp: (WebCore::ContentExtensions::NFA::debugPrintDot const): Use "%" PRIu64 instead of "%llu" to format uint64_t values. 2018-12-06 Alex Christensen <achristensen@webkit.org> Remove unused LoaderStrategy::storeDerivedDataToCache and associated dead code https://bugs.webkit.org/show_bug.cgi?id=192452 Reviewed by Anders Carlsson. * loader/LoaderStrategy.h: * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::didRetrieveDerivedDataFromCache): Deleted. * loader/ResourceLoader.h: * loader/ResourceLoaderOptions.h: * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::didRetrieveDerivedDataFromCache): Deleted. * loader/SubresourceLoader.h: * loader/ThreadableLoader.cpp: (WebCore::ThreadableLoaderOptions::isolatedCopy const): * loader/cache/CachedResource.h: (WebCore::CachedResource::didRetrieveDerivedDataFromCache): Deleted. 2018-12-06 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] HeightAndMargin::margin is always the non-collapsed margin value. https://bugs.webkit.org/show_bug.cgi?id=192345 Reviewed by Antti Koivisto. Rename HeightAndMargin::margin to HeightAndMargin::nonCollapsedMargin. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): * layout/LayoutUnits.h: (WebCore::Layout::HeightAndMargin::usedMarginValues const): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): 2018-12-06 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Add MarginCollapse::establishesBlockFormattingContext https://bugs.webkit.org/show_bug.cgi?id=192297 Reviewed by Antti Koivisto. WebKit treats the document element renderer as a block formatting context root. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::establishesBlockFormattingContext): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): 2018-12-06 Carlos Eduardo Ramalho <cadubentzen@gmail.com> [GStreamer] -DENABLE_VIDEO=ON -DENABLE_OPENGL=OFF still tries to build GstreamerGL https://bugs.webkit.org/show_bug.cgi?id=191998 Reviewed by Philippe Normand. Fix compilation with -DENABLE_VIDEO=ON and -DENABLE_OPENGL=OFF due to GStreamerGL. No new tests required. Only fixing the build with certain flags. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged): add required #if ENABLE(WEBGL). 2018-12-06 Carlos Eduardo Ramalho <cadubentzen@gmail.com> REGRESSION(r231043): [GTK] Undefined references to WebCore::LayerRepresentation::* with -DENABLE_OPENGL=OFF builds https://bugs.webkit.org/show_bug.cgi?id=191997 Reviewed by Philippe Normand. Fix build with -DENABLE_OPENGL=OFF and -DENABLE_VIDEO=OFF. No new tests required. Only fixing build. * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): add required #if ENABLE(ASYNC_SCROLLING) 2018-12-05 Don Olmstead <don.olmstead@sony.com> [PlayStation] Enable WebCore https://bugs.webkit.org/show_bug.cgi?id=192384 Reviewed by Brent Fulgham. Implements WebCore for the PlayStation platform. * PlatformPlayStation.cmake: Added. * loader/cache/CachedResourceLoader.cpp: * platform/generic/KeyedDecoderGeneric.cpp: Added. (WebCore::KeyedDecoder::decoder): (WebCore::KeyedDecoderGeneric::KeyedDecoderGeneric): (WebCore::KeyedDecoderGeneric::~KeyedDecoderGeneric): (WebCore::KeyedDecoderGeneric::decodeBytes): (WebCore::KeyedDecoderGeneric::decodeBool): (WebCore::KeyedDecoderGeneric::decodeUInt32): (WebCore::KeyedDecoderGeneric::decodeUInt64): (WebCore::KeyedDecoderGeneric::decodeInt32): (WebCore::KeyedDecoderGeneric::decodeInt64): (WebCore::KeyedDecoderGeneric::decodeFloat): (WebCore::KeyedDecoderGeneric::decodeDouble): (WebCore::KeyedDecoderGeneric::decodeString): (WebCore::KeyedDecoderGeneric::beginObject): (WebCore::KeyedDecoderGeneric::endObject): (WebCore::KeyedDecoderGeneric::beginArray): (WebCore::KeyedDecoderGeneric::beginArrayElement): (WebCore::KeyedDecoderGeneric::endArrayElement): (WebCore::KeyedDecoderGeneric::endArray): * platform/generic/KeyedDecoderGeneric.h: Added. * platform/generic/KeyedEncoderGeneric.cpp: Added. (WebCore::KeyedEncoder::encoder): (WebCore::KeyedEncoderGeneric::KeyedEncoderGeneric): (WebCore::KeyedEncoderGeneric::~KeyedEncoderGeneric): (WebCore::KeyedEncoderGeneric::encodeBytes): (WebCore::KeyedEncoderGeneric::encodeBool): (WebCore::KeyedEncoderGeneric::encodeUInt32): (WebCore::KeyedEncoderGeneric::encodeUInt64): (WebCore::KeyedEncoderGeneric::encodeInt32): (WebCore::KeyedEncoderGeneric::encodeInt64): (WebCore::KeyedEncoderGeneric::encodeFloat): (WebCore::KeyedEncoderGeneric::encodeDouble): (WebCore::KeyedEncoderGeneric::encodeString): (WebCore::KeyedEncoderGeneric::beginObject): (WebCore::KeyedEncoderGeneric::endObject): (WebCore::KeyedEncoderGeneric::beginArray): (WebCore::KeyedEncoderGeneric::beginArrayElement): (WebCore::KeyedEncoderGeneric::endArrayElement): (WebCore::KeyedEncoderGeneric::endArray): (WebCore::KeyedEncoderGeneric::finishEncoding): * platform/generic/KeyedEncoderGeneric.h: Added. * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::defaultCookieJarPath): * platform/network/playstation/CurlSSLHandlePlayStation.cpp: Added. (WebCore::getCACertPathEnv): (WebCore::CurlSSLHandle::platformInitialize): * platform/network/playstation/NetworkStateNotifierPlayStation.cpp: Added. (WebCore::NetworkStateNotifier::updateStateWithoutNotifying): (WebCore::NetworkStateNotifier::startObserving): * platform/playstation/EventLoopPlayStation.cpp: Added. (WebCore::EventLoop::cycle): * platform/playstation/MIMETypeRegistryPlayStation.cpp: Added. (WebCore::MIMETypeRegistry::getMIMETypeForExtension): (WebCore::MIMETypeRegistry::isApplicationPluginMIMEType): (WebCore::MIMETypeRegistry::getPreferredExtensionForMIMEType): * platform/playstation/PlatformScreenPlayStation.cpp: Added. (WebCore::screenDepth): (WebCore::screenDepthPerComponent): (WebCore::screenIsMonochrome): (WebCore::screenHasInvertedColors): (WebCore::screenRect): (WebCore::screenAvailableRect): (WebCore::screenSupportsExtendedColor): * platform/playstation/ScrollbarThemePlayStation.cpp: Added. (WebCore::ScrollbarTheme::nativeTheme): (WebCore::ScrollbarThemePlayStation::scrollbarThickness): (WebCore::ScrollbarThemePlayStation::hasButtons): (WebCore::ScrollbarThemePlayStation::hasThumb): (WebCore::ScrollbarThemePlayStation::backButtonRect): (WebCore::ScrollbarThemePlayStation::forwardButtonRect): (WebCore::ScrollbarThemePlayStation::trackRect): (WebCore::ScrollbarThemePlayStation::paintTrackBackground): (WebCore::ScrollbarThemePlayStation::paintThumb): * platform/playstation/ScrollbarThemePlayStation.h: Added. * platform/playstation/UserAgentPlayStation.cpp: Added. (WebCore::standardUserAgent): (WebCore::standardUserAgentForURL): * rendering/RenderThemePlayStation.cpp: Added. (WebCore::RenderTheme::singleton): (WebCore::RenderThemePlayStation::updateCachedSystemFontDescription const): * rendering/RenderThemePlayStation.h: Added. 2018-12-05 Ryosuke Niwa <rniwa@webkit.org> Null pointer crash in DocumentOrderedMap::getElementById via FormAssociatedElement::findAssociatedForm https://bugs.webkit.org/show_bug.cgi?id=192392 Reviewed by Dean Jackson. The crash was caused by FormAssociatedElement::findAssociatedForm invoking DocumentOrderedMap::getElementById and de-referencing nullptr Attribute* via IdTargetObserver before Element::attributeChanged had updated ElementData::m_idForStyleResolution. Fixed it by updating m_idForStyleResolution before invoking IdTargetObservers. Test: fast/dom/remove-id-form-associated-elemet-id-observer-crash.html * dom/Element.cpp: (WebCore::Element::attributeChanged): Fixed the bug. 2018-12-05 Youenn Fablet <youenn@apple.com> Enable the possibility to do video capture in UIProcess https://bugs.webkit.org/show_bug.cgi?id=192394 Reviewed by Eric Carlson. Create IOSurface-backed sample buffers so that we can easily send them through IPC. Manually tested. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): 2018-12-05 Youenn Fablet <youenn@apple.com> Update ServiceWorkerContainer::getRegistration lambdas https://bugs.webkit.org/show_bug.cgi?id=192376 Reviewed by Chris Dumez. There is no need to pass 'this' in lambdas as the last lambda takes a ScriptExecutionContext&. No change of behavior. * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::getRegistration): (WebCore::ServiceWorkerContainer::getRegistrations): 2018-12-05 Chris Dumez <cdumez@apple.com> Crash under WebCore::cachedDocumentWrapper() https://bugs.webkit.org/show_bug.cgi?id=192421 <rdar://problem/37114163> Reviewed by Alex Christensen. Fix potential null defererence of the value returned by toJSDOMWindow(). For example, if the window is frameless, it would return null. * bindings/js/JSDocumentCustom.cpp: (WebCore::cachedDocumentWrapper): 2018-12-05 Eric Carlson <eric.carlson@apple.com> [MediaStream] Cleanup up Mac screen capture class https://bugs.webkit.org/show_bug.cgi?id=192379 <rdar://problem/46465458> Reviewed by Youenn Fablet. No new tests, tested manually. * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: (WebCore::DisplayCaptureManagerCocoa::captureDevices): Initialize Screen devices first so they are first in the list of devices. * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Cleanup. Always capture at the native screen size to work around a bug. (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange): Deleted. 2018-12-05 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r238844, r238846, and r238874. https://bugs.webkit.org/show_bug.cgi?id=192414 The layout tests added with this change are flaky. (Requested by ryanhaddad on #webkit). Reverted changesets: "Implement non-timeslice mode encoding for MediaRecorder" https://bugs.webkit.org/show_bug.cgi?id=192069 https://trac.webkit.org/changeset/238844 "Fix the build" https://trac.webkit.org/changeset/238846 "Fix MediaRecorder flaky tests" https://bugs.webkit.org/show_bug.cgi?id=192371 https://trac.webkit.org/changeset/238874 2018-12-05 Frederic Wang <fwang@igalia.com> Minor refactoring of the scrolling code https://bugs.webkit.org/show_bug.cgi?id=192398 Reviewed by Simon Fraser. Based on an earlier patch by Simon Fraser. This patch performs some minor refactoring of the scrolling code: - Rename ScrollingCoordinator::uniqueScrollLayerID() to uniqueScrollingNodeID() since it is really a node id. - Inline ScrollingStateTree::setRootStateNode() so we only need to forward declare ScrollingStateFrameScrollingNode in headers. - Pass argument to ScrollingStateTree::addNode() as a reference rather than a pointer. - Initialize ScrollingStateTree::m_changedProperties and ScrollingStateTree::m_parent in the header file. - Remove obsolete comment about ScrollingCoordinatorMac. No new tests, behavior unchanged. * page/scrolling/ScrollingCoordinator.cpp: (WebCore::ScrollingCoordinator::uniqueScrollingNodeID): (WebCore::ScrollingCoordinator::uniqueScrollLayerID): Deleted. * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateNode.cpp: (WebCore::ScrollingStateNode::ScrollingStateNode): * page/scrolling/ScrollingStateNode.h: * page/scrolling/ScrollingStateTree.cpp: (WebCore::ScrollingStateTree::attachNode): (WebCore::ScrollingStateTree::setRootStateNode): (WebCore::ScrollingStateTree::addNode): * page/scrolling/ScrollingStateTree.h: (WebCore::ScrollingStateTree::setRootStateNode): Deleted. * page/scrolling/ScrollingTree.cpp: * page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::attachScrollingNode): 2018-12-05 Wenson Hsieh <wenson_hsieh@apple.com> Turn WritingDirection into an enum class https://bugs.webkit.org/show_bug.cgi?id=192401 Work towards <rdar://problem/42075638> Reviewed by Dan Bernstein. Change WritingDirection from an enum to an enum class. No change in behavior. * editing/ApplyStyleCommand.cpp: (WebCore::ApplyStyleCommand::splitAncestorsWithUnicodeBidi): (WebCore::ApplyStyleCommand::applyInlineStyle): * editing/EditingStyle.cpp: (WebCore::EditingStyle::textDirection const): (WebCore::EditingStyle::textDirectionForSelection): * editing/Editor.cpp: (WebCore::Editor::setBaseWritingDirection): (WebCore::Editor::baseWritingDirectionForSelectionStart const): * editing/EditorCommand.cpp: (WebCore::stateTextWritingDirectionLeftToRight): (WebCore::stateTextWritingDirectionNatural): (WebCore::stateTextWritingDirectionRightToLeft): * editing/WritingDirection.h: Additionally wrap this enum in `namespace WebCore`, and update the copyright year. * editing/ios/EditorIOS.mm: (WebCore::Editor::setTextAlignmentForChangedBaseWritingDirection): * page/ContextMenuController.cpp: (WebCore::ContextMenuController::contextMenuItemSelected): * testing/Internals.cpp: (WebCore::Internals::setBaseWritingDirection): 2018-12-05 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Remove the AppendPipeline state machine https://bugs.webkit.org/show_bug.cgi?id=192204 Reviewed by Xabier Rodriguez-Calvar. This patch tries to reduce the complexity of the AppendPipeline by removing the appendState state machine and cleaning all the conditional code around it that is not necessary anymore. For the most part the behavior is the same, but some edge cases have been improved in the process: Demuxing errors now result in the append being flagged as ParsingFailed and the error being propagated to the application. This fixes media/media-source/media-source-error-crash.html (or at least gets it up to date with cross platform expectations). AbortableTaskQueue now allows the task handler to perform an abort safely. This is used in the GstBus error message sync handler, since it needs to ask the MainThread to raise a parse error, which will in turn abort. An API test has been added for this new functionality. Also, code has been added to the API tests to ensure the correct destruction of the response object, especially in this case. The code handling invalid track codecs has been made clearer by also explicitly raising a parse error, but it should not expose behavior differences for the application. A test has been added for this behavior: web-platform-tests/media-source/mediasource-invalid-codec.html The reporting of EOS events have been made more rigorous. EOS is only expected after a demuxing error, otherwise it's a g_critical. AppendPipeline::abort() has been renamed to AppendPipeline::resetParserState() to honor the fact that it's not only called when the user calls abort() and match better the names used in the spec. Test: imported/w3c/web-platform-tests/media-source/mediasource-invalid-codec.html * platform/AbortableTaskQueue.h: * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::assertedElementSetState): (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::handleErrorSyncMessage): (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe): (WebCore::AppendPipeline::handleNeedContextSyncMessage): (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::appsinkNewSample): (WebCore::AppendPipeline::didReceiveInitializationSegment): (WebCore::AppendPipeline::resetParserState): (WebCore::AppendPipeline::pushNewBuffer): (WebCore::AppendPipeline::handleAppsinkNewSampleFromStreamingThread): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromStreamingThread): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): (WebCore::AppendPipeline::disconnectDemuxerSrcPadFromAppsinkFromAnyThread): (WebCore::AppendPipeline::dumpAppendState): Deleted. (WebCore::AppendPipeline::demuxerNoMorePads): Deleted. (WebCore::AppendPipeline::setAppendState): Deleted. (WebCore::AppendPipeline::appsinkEOS): Deleted. (WebCore::AppendPipeline::resetPipeline): Deleted. (WebCore::AppendPipeline::abort): Deleted. * platform/graphics/gstreamer/mse/AppendPipeline.h: (WebCore::AppendPipeline::appendState): Deleted. * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::abort): (WebCore::MediaSourceClientGStreamerMSE::resetParserState): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.cpp: (WebCore::SourceBufferPrivateGStreamer::appendParsingFailed): * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h: 2018-12-05 Rob Buis <rbuis@igalia.com> [Mac] HEAD requests changed to GET after 301, 302, and 303 redirections (http/tests/xmlhttprequest/head-redirection.html) https://bugs.webkit.org/show_bug.cgi?id=114965 Reviewed by Frédéric Wang. HEAD requests should not be changed to GET after 303 redirects, see [1]. This was fixed earlier for GTK [2]. Behavior matches Firefox and Chrome. [1] http://tools.ietf.org/html/draft-ietf-httpbis-p2-semantics-21#section-7.4 [2] https://bugs.webkit.org/show_bug.cgi?id=110127 Tests: web-platform-tests/fetch/api/redirect/redirect-method.html web-platform-tests/fetch/api/redirect/redirect-method-worker.html http/tests/xmlhttprequest/head-redirection.html * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::willSendRequest): 2018-12-05 Rob Buis <rbuis@igalia.com> Align with Fetch on data: URLs https://bugs.webkit.org/show_bug.cgi?id=182325 Reviewed by Alex Christensen. Do not accept data URLs that do not contain a comma character, as specified in the relevant specs [1, 2]. Behavior matches Firefox and Chrome. Test: web-platform-tests/fetch/api/basic/scheme-data.any.html [1] https://tools.ietf.org/html/rfc2397 [2] https://fetch.spec.whatwg.org/#data-url-processor * platform/network/DataURLDecoder.cpp: (WebCore::DataURLDecoder::parseMediaType): (WebCore::DataURLDecoder::DecodeTask::DecodeTask): (WebCore::DataURLDecoder::DecodeTask::process): (WebCore::DataURLDecoder::createDecodeTask): (WebCore::DataURLDecoder::decode): 2018-12-05 Frederic Wang <fwang@igalia.com> Unreviewed build fix. * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: Add missing header. 2018-12-05 Javier Fernandez <jfernandez@igalia.com> [css-grid] Crash on debug changing the style of a positioned element https://bugs.webkit.org/show_bug.cgi?id=191473 Reviewed by Dean Jackson and Zalan Bujtas. When an box becomes {out-of,in}-flow, it may be re-parented and it may become a grid item. In that case, we must mark the RenderGrid as dirty, so that the grid items placement logic is executed again. Test: fast/css-grid-layout/grid-crash-out-of-flow-positioned-element.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::childFlowStateChangesAndAffectsParentBlock): Consider the case of a box's new parent being a grid container. 2018-12-04 Frederic Wang <fwang@igalia.com> Always pass scrollingGeometry to update*ScrollingNode functions https://bugs.webkit.org/show_bug.cgi?id=192358 Reviewed by Simon Fraser. Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly null pointers. This commit makes things more consistent by making the parameter a reference and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes / subframes or for CSS overscroll-behavior) for which new data members have to be passed to the scrolling nodes. No new tests, no behavior changes. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): * page/scrolling/AsyncScrollingCoordinator.h: * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::updateFrameScrollingNode): (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 2018-12-04 Ryosuke Niwa <rniwa@webkit.org> Crash in HTMLCollection::updateNamedElementCache https://bugs.webkit.org/show_bug.cgi?id=192347 Reviewed by Darin Adler. The bug was caused by CollectionIndexCache's nodeAt caching the length of 1 when there are no matching elements in the subtree when the index is non-zero. A related bug was fixed in r182125 but we were not considering the possibility that the index given to this function might be non-zero even when there were no matching elements. Test: fast/dom/options-collection-zero-length-crash.html * dom/CollectionIndexCache.h: (WebCore::CollectionIndexCache<Collection, Iterator>::nodeAt): 2018-11-30 Jiewen Tan <jiewen_tan@apple.com> Don't report resource timing to parent frame for history items https://bugs.webkit.org/show_bug.cgi?id=192273 <rdar://problem/45163764> Reviewed by Youenn Fablet. We should not report history items to its parent frame as those are less interested to its parent and might not be the first navigation in the iframes. This change aligns the behavior when a cached document is not available for the history item with the available case as we don't report resource timing for any cached main document. Test: http/tests/misc/resource-timing-navigation-in-restored-iframe-2.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadDifferentDocumentItem): 2018-12-04 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed https://bugs.webkit.org/show_bug.cgi?id=192320 <rdar://problem/46429833> Reviewed by Zalan Bujtas. Re-land r238840 with a more reliable test. When we fall into slow scrolling mode (for example, because of background-attachment: fixed), RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers for viewport-constrained objects so we update them. This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already does enough dirtying that fixed layers nested inside scrollers get updated. Test: compositing/fixed-with-main-thread-scrolling.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): 2018-12-04 Youenn Fablet <youenn@apple.com> Fix MediaRecorder flaky tests https://bugs.webkit.org/show_bug.cgi?id=192371 Reviewed by Eric Carlson. No change of behavior. * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Reset to use real MediaRecorder by default. 2018-12-04 Justin Michaud <justin_michaud@apple.com> CSS Painting API should allow image values in inputProperties https://bugs.webkit.org/show_bug.cgi?id=192200 Reviewed by Dean Jackson. Adds new TypedOMCSSImageValue wrapper. We rename all the existing ones so that the naming is consistent (CSSImageValue is already a thing). Finally, we let CanvasRenderingContext2DBase render these. Tests: fast/css-custom-paint/arguments.html fast/css-custom-paint/image.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/CallTracerTypes.h: * bindings/js/JSTypedOMCSSStyleValueCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSStyleValueCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): * css/CSSCustomPropertyValue.h: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/typedom/StylePropertyMapReadOnly.h: (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get const): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: * css/typedom/TypedOMCSSImageValue.h: Copied from Source/WebCore/css/typedom/CSSUnitValue.h. * css/typedom/TypedOMCSSImageValue.idl: Copied from Source/WebCore/css/typedom/CSSStyleValue.idl. * css/typedom/TypedOMCSSNumericValue.h: Renamed from Source/WebCore/css/typedom/CSSNumericValue.h. * css/typedom/TypedOMCSSNumericValue.idl: Renamed from Source/WebCore/css/typedom/CSSNumericValue.idl. * css/typedom/TypedOMCSSStyleValue.h: Renamed from Source/WebCore/css/typedom/CSSStyleValue.h. (WebCore::TypedOMCSSStyleValue::isImageValue): * css/typedom/TypedOMCSSStyleValue.idl: Renamed from Source/WebCore/css/typedom/CSSStyleValue.idl. * css/typedom/TypedOMCSSUnitValue.h: Renamed from Source/WebCore/css/typedom/CSSUnitValue.h. * css/typedom/TypedOMCSSUnitValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnitValue.idl. * css/typedom/TypedOMCSSUnparsedValue.h: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.h. * css/typedom/TypedOMCSSUnparsedValue.idl: Renamed from Source/WebCore/css/typedom/CSSUnparsedValue.idl. * html/ImageBitmap.cpp: (WebCore::ImageBitmap::createPromise): * html/ImageBitmap.h: * html/canvas/CanvasDrawImage.idl: * html/canvas/CanvasFillStrokeStyles.idl: * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::checkOrigin): * html/canvas/CanvasRenderingContext.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::size): (WebCore::CanvasRenderingContext2DBase::drawImage): (WebCore::CanvasRenderingContext2DBase::createPattern): * html/canvas/CanvasRenderingContext2DBase.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildAction): * page/WindowOrWorkerGlobalScope.idl: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): 2018-12-04 Chris Dumez <cdumez@apple.com> Regression(r238817) PSON Page Cache API tests are failing https://bugs.webkit.org/show_bug.cgi?id=192348 Reviewed by Alex Christensen. * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): (WebCore::releaseMemory): * page/MemoryRelease.h: 2018-12-04 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238838. The layout test added with this change is failing on iOS. Reverted changeset: "Thick overlines and line-throughs grow in the wrong direction" https://bugs.webkit.org/show_bug.cgi?id=192264 https://trac.webkit.org/changeset/238838 2018-12-04 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238840. The layout test added with this change is frequently failing. Reverted changeset: "REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed" https://bugs.webkit.org/show_bug.cgi?id=192320 https://trac.webkit.org/changeset/238840 2018-12-04 Carlos Garcia Campos <cgarcia@igalia.com> [SOUP] Move URLSoup back to WebCore after r238771 https://bugs.webkit.org/show_bug.cgi?id=192306 Reviewed by Michael Catanzaro. Add soupURIToURL() and urlToSoupURI() to replace the URL contructor taking a Soup URI and URL::createSoupURI(). Fix several build failures that showed up after removing the soup includes from URL header. * platform/Cookie.h: * platform/SharedBuffer.h: * platform/SourcesSoup.txt: * platform/network/soup/CookieSoup.cpp: * platform/network/soup/GUniquePtrSoup.h: Renamed from Source/WTF/wtf/glib/GUniquePtrSoup.h. * platform/network/soup/NetworkStorageSessionSoup.cpp: (WebCore::NetworkStorageSession::setCookiesFromDOM const): (WebCore::NetworkStorageSession::deleteCookie const): (WebCore::NetworkStorageSession::getCookies): (WebCore::NetworkStorageSession::getRawCookies const): (WebCore::cookiesForSession): * platform/network/soup/ResourceErrorSoup.cpp: (WebCore::failingURI): * platform/network/soup/ResourceHandleSoup.cpp: * platform/network/soup/ResourceRequest.h: (WebCore::ResourceRequest::ResourceRequest): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessageMembers const): (WebCore::ResourceRequest::updateFromSoupMessage): (WebCore::ResourceRequest::createSoupURI const): * platform/network/soup/ResourceResponseSoup.cpp: (WebCore::ResourceResponse::updateFromSoupMessage): * platform/network/soup/SocketStreamHandleImpl.h: * platform/network/soup/SocketStreamHandleImplSoup.cpp: (WebCore::SocketStreamHandleImpl::create): * platform/network/soup/SoupNetworkSession.cpp: * platform/network/soup/URLSoup.cpp: Copied from Source/WTF/wtf/glib/URLSoup.cpp. (WebCore::soupURIToURL): (WebCore::urlToSoupURI): * platform/network/soup/URLSoup.h: Renamed from Source/WTF/wtf/glib/URLSoup.cpp. 2018-12-04 Devin Rousso <drousso@apple.com> Web Inspector: Audit: tests should support async operations https://bugs.webkit.org/show_bug.cgi?id=192171 <rdar://problem/46423562> Reviewed by Joseph Pecoraro. * page/Settings.yaml: * dom/ScriptExecutionContext.cpp: (ScriptExecutionContext::reportUnhandledPromiseRejection): Add setting for muting the "Unhandled Promise Rejection" console message. 2018-12-03 Tim Horton <timothy_horton@apple.com> Fix the build * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Unified sources, of course. 2018-12-03 Youenn Fablet <youenn@apple.com> A sender created through addTransceiver and populated using addTrack should have its source set https://bugs.webkit.org/show_bug.cgi?id=192136 Reviewed by Eric Carlson. In case libwebrtc backend is already created, we need to make sure to set the track source to the libwebrtc sender backend that is actually tied to the sender. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCPeerConnectionBackend::removeTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-12-03 YUHAN WU <yuhan_wu@apple.com> Implement non-timeslice mode encoding for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=192069 Reviewed by Youenn Fablet. Implement the encoding for non-timeslice mode of MediaRecorder. It only supports to record MP4 file through H264 and AAC encoding, we will need to support more MIME types and encoding methods. Add a API in internals to allow testings to turn on the mock source. Tests: http/wpt/mediarecorder/MediaRecorder-AV-audio-only-dataavailable.html http/wpt/mediarecorder/MediaRecorder-AV-audio-video-dataavailable.html http/wpt/mediarecorder/MediaRecorder-AV-video-only-dataavailable.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::setCustomPrivateRecorderCreator): (WebCore::MediaRecorder::getPrivateImpl): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::createRecordingDataBlob): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediarecorder/MediaRecorderPrivate.h: (WebCore::MediaRecorderPrivate::stopRecording): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.cpp: Added. (WebCore::MediaRecorderPrivateAVFImpl::create): (WebCore::MediaRecorderPrivateAVFImpl::MediaRecorderPrivateAVImpl): (WebCore::MediaRecorderPrivateAVFImpl::sampleBufferUpdated): (WebCore::MediaRecorderPrivateAVFImpl::audioSamplesAvailable): (WebCore::MediaRecorderPrivateAVFImpl::stopRecording): (WebCore::MediaRecorderPrivateAVFImpl::fetchData): (WebCore::MediaRecorderPrivateAVFImpl::mimeType): * platform/mediarecorder/MediaRecorderPrivateAVFImpl.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: (WebCore::MediaRecorderPrivateMock::fetchData): (WebCore::MediaRecorderPrivateMock::mimeType): * platform/mediarecorder/MediaRecorderPrivateMock.h: * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.h: Added. * platform/mediarecorder/cocoa/MediaRecorderPrivateWriterCocoa.mm: Added. (WebCore::MediaRecorderPrivateWriter::setupWriter): (WebCore::MediaRecorderPrivateWriter::setVideoInput): (WebCore::MediaRecorderPrivateWriter::setAudioInput): (WebCore::copySampleBufferWithCurrentTimeStamp): (WebCore::MediaRecorderPrivateWriter::appendVideoSampleBuffer): (WebCore::MediaRecorderPrivateWriter::appendAudioSampleBuffer): (WebCore::MediaRecorderPrivateWriter::stopRecording): (WebCore::MediaRecorderPrivateWriter::fetchData): * testing/Internals.cpp: (WebCore::createRecorderMockSource): (WebCore::Internals::setCustomPrivateRecorderCreator): * testing/Internals.h: * testing/Internals.idl: 2018-12-03 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238090): position:fixed sidebar on https://www.w3.org/TR/SVG2/coords.html does not stay fixed https://bugs.webkit.org/show_bug.cgi?id=192320 <rdar://problem/46429833> Reviewed by Zalan Bujtas. When we fall into slow scrolling mode (for example, because of background-attachment: fixed), RenderLayerCompositor::updateCompositingLayers() needs to set the geometry dirty bit on layers for viewport-constrained objects so we update them. This is only necessary for page scrolling; for overflow scrolls, updateLayerPositions() already does enough dirtying that fixed layers nested inside scrollers get updated. Test: compositing/fixed-with-main-thread-scrolling.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): 2018-12-03 Justin Michaud <justin_michaud@apple.com> CSS Painting API should scale display list when drawing https://bugs.webkit.org/show_bug.cgi?id=192217 Reviewed by Simon Fraser. When we replay the display list, fix the scaling. The separate buffer is needed to make sure that globalCompositeOperation functions correctly. * html/CustomPaintCanvas.cpp: (WebCore::CustomPaintCanvas::replayDisplayList const): * html/CustomPaintCanvas.h: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): 2018-12-03 Myles C. Maxfield <mmaxfield@apple.com> Thick overlines and line-throughs grow in the wrong direction https://bugs.webkit.org/show_bug.cgi?id=192264 Reviewed by Dean Jackson. Overlines should grow upward, and line-throughs should stay centered. Test: fast/css3-text/css3-text-decoration/text-decoration-thicknes-overline-grow-direction.html * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintTextDecoration): * style/InlineTextBoxStyle.cpp: (WebCore::visualOverflowForDecorations): 2018-12-03 Simon Fraser <simon.fraser@apple.com> Viewport-constrained renderers are always RenderLayerModelObjects https://bugs.webkit.org/show_bug.cgi?id=192342 Reviewed by Myles C. Maxfield. addViewportConstrainedObject/removeViewportConstrainedObject can take RenderLayerModelObjects, since all viewport-constrained renderers have layers. * page/FrameView.cpp: (WebCore::FrameView::addViewportConstrainedObject): (WebCore::FrameView::removeViewportConstrainedObject): * page/FrameView.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::styleDidChange): The 0 argument is actually a nullptr RenderGeometryMap, which has a default value, and the comment was obsolete. 2018-12-03 Don Olmstead <don.olmstead@sony.com> Fix some unused parameter warnings https://bugs.webkit.org/show_bug.cgi?id=192336 Reviewed by Fujii Hironori. * Modules/indexeddb/server/IDBSerialization.cpp: (WebCore::isLegacySerializedIDBKeyData): * platform/FileSystem.cpp: (WebCore::FileSystem::openAndLockFile): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::bindVertexArray): * platform/network/curl/CertificateInfo.h: (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): 2018-12-03 Keith Rollin <krollin@apple.com> Add .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=192082 <rdar://problem/46312533> Reviewed by Brent Fulgham. Add .xcfilelist files for Generate Derived Sources and Generate Unified Sources build phases in Xcode. These are just being staged for now; they'll be added to the Xcode projects later. No new tests -- no changed functionality. * DerivedSources-input.xcfilelist: Added. * DerivedSources-output.xcfilelist: Added. * UnifiedSources-input.xcfilelist: Added. * UnifiedSources-output.xcfilelist: Added. 2018-12-03 Alex Christensen <achristensen@webkit.org> Add WKWebProcessPlugInLoadDelegate SPI willStartProvisionalLoadForFrame with a completion handler https://bugs.webkit.org/show_bug.cgi?id=192272 Reviewed by Brady Eidson. This is needed for rdar://problem/45910057 Covered by an API test. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::prepareForLoadStart): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::loadProvisionalItemFromCachedPage): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: 2018-12-03 Zalan Bujtas <zalan@apple.com> [iOS] Unreviewed build fix. * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): 2018-12-03 Jer Noble <jer.noble@apple.com> Get rid of old, dead Mac video fullscreen code. https://bugs.webkit.org/show_bug.cgi?id=192315 Reviewed by Eric Carlson. * PlatformMac.cmake: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const): 2018-12-03 Ryosuke Niwa <rniwa@webkit.org> title attribute on style & link elements should be ignored inside a shadow tree https://bugs.webkit.org/show_bug.cgi?id=191297 Reviewed by Antti Koivisto. Fixed the by not setting the stylesheet's title even when the title content attribute is present or set on SVG/HTML style and link elements inside a shadow tree. Test: fast/shadow-dom/stylesheet-title-in-shadow-tree.html * dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::parseAttribute): (WebCore::HTMLLinkElement::initializeStyleSheet): * html/HTMLStyleElement.cpp: (WebCore::HTMLStyleElement::parseAttribute): * style/StyleScope.cpp: (WebCore::Style::Scope::collectActiveStyleSheets): * svg/SVGStyleElement.cpp: (WebCore::SVGStyleElement::parseAttribute): 2018-12-03 Zalan Bujtas <zalan@apple.com> [iOS] Add logging channel for hover related content observation https://bugs.webkit.org/show_bug.cgi?id=192312 Reviewed by Simon Fraser. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::updateStyleIfNeeded): (WebCore::Document::platformSuspendOrStopActiveDOMObjects): * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * page/DOMWindow.cpp: (WebCore::DOMWindow::clearTimeout): * page/Frame.cpp: (WebCore::Frame::willDetachPage): * platform/Logging.h: 2018-12-03 Michael Catanzaro <mcatanzaro@igalia.com> [SOUP] Use SoupSession instead of SoupSessionAsync https://bugs.webkit.org/show_bug.cgi?id=107451 Reviewed by Carlos Garcia Campos. With glib-networking 2.57.1, WebKit is no longer able to load TLS error pages. The problem is a network process deadlock caused by a change in how glib-networking performs certificate verification. Previously it verified certificates *after* the TLS handshake had completed, which was weirdly late, but previously not problematic. But now that TLS 1.3 exists, application data can be sent before certificate verification occurs, which is no good. So I moved verification to occur during the handshake. I needed to do this regardless because I need to add a new callback in GnuTLS for another feature. This introduced a deadlock in WebKit: - glib-networking detects an unacceptable certificate, emits accept-certificate signal - NetworkDataTaskSoup::tlsConnectionAcceptCertificate calls NetworkDataTaskSoup::invalidateAndCancel calls NetworkDataTaskSoup::clearRequest - NetworkDataTaskSoup::clearRequest calls soup_session_cancel_message The problem is that, in the deprecated SoupSessionAsync used by WebKit, cancellation is always *synchronous* despite the name of the class. So soup_session_cancel_message winds up doing its thing to close everything out, and that eventually ends up in a synchronous call to g_tls_connection_gnutls_close. The close operation can't proceed until the TLS handshake is finished, and the handshake is blocked waiting for WebKit to return from its accept-certificate handler. So the close operation winds up polling forever waiting for the handshake to finish. Deadlock. The only changes required in WebKit to use the modern SoupSession are adjustments for the new default property values. Most of the properties we used to set explicitly are now defaults and should be removed. Additionally, SoupSession has default timeouts, which we want to override to allow NetworkDataTaskSoup to implement its own timeouts. No new tests because this is covered by TestSSL (which would be failing if run with the newer glib-networking). * platform/network/soup/SoupNetworkSession.cpp: (WebCore::SoupNetworkSession::SoupNetworkSession): 2018-12-03 Yusuke Suzuki <yusukesuzuki@slowstart.org> Use WallTime for file time https://bugs.webkit.org/show_bug.cgi?id=192287 Reviewed by Darin Adler. This patch changes a type of file time from double to WallTime to use strongly typed file time. No behavior change. * Modules/webdatabase/Database.cpp: (WebCore::Database::details const): * Modules/webdatabase/DatabaseDetails.h: (WebCore::DatabaseDetails::DatabaseDetails): (WebCore::DatabaseDetails::creationTime const): (WebCore::DatabaseDetails::modificationTime const): * Modules/webdatabase/DatabaseManager.cpp: (WebCore::DatabaseManager::ProposedDatabase::ProposedDatabase): * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::detailsForNameAndOrigin): * fileapi/AsyncFileStream.cpp: (WebCore::AsyncFileStream::getSize): * fileapi/AsyncFileStream.h: * fileapi/File.cpp: (WebCore::File::lastModified const): * page/Page.cpp: (WebCore::Page::userStyleSheetLocationChanged): (WebCore::Page::userStyleSheet const): * page/Page.h: * platform/FileMetadata.h: * platform/FileStream.cpp: (WebCore::FileStream::getSize): * platform/FileStream.h: * platform/FileSystem.cpp: (WebCore::FileSystem::getFileModificationTime): Deleted. * platform/FileSystem.h: (WebCore::FileSystem::invalidFileTime): Deleted. (WebCore::FileSystem::isValidFileTime): Deleted. * platform/glib/FileSystemGlib.cpp: (WebCore::FileSystem::getFileCreationTime): (WebCore::FileSystem::getFileModificationTime): (WebCore::FileSystem::fileMetadataUsingFunction): * platform/network/BlobDataFileReference.cpp: (WebCore::BlobDataFileReference::BlobDataFileReference): (WebCore::BlobDataFileReference::expectedModificationTime): * platform/network/BlobDataFileReference.h: * platform/network/FormData.cpp: (WebCore::FormData::appendFile): (WebCore::FormData::appendFileRange): * platform/network/FormData.h: (WebCore::FormDataElement::FormDataElement): (WebCore::FormDataElement::EncodedFileData::decode): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::advanceCurrentStream): * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::appendEncodedBlobItemToSoupMessageBody): * platform/posix/FileSystemPOSIX.cpp: (WebCore::FileSystem::getFileCreationTime): (WebCore::FileSystem::getFileModificationTime): * platform/sql/SQLiteFileSystem.cpp: (WebCore::SQLiteFileSystem::databaseCreationTime): (WebCore::SQLiteFileSystem::databaseModificationTime): * platform/sql/SQLiteFileSystem.h: * platform/win/FileSystemWin.cpp: (WebCore::FileSystem::getFileModificationTime): (WebCore::FileSystem::getFileCreationTime): (WebCore::FileSystem::findDataToFileMetadata): 2018-12-03 Dean Jackson <dino@apple.com> Fix iOS Simulator Release test crashes. * platform/network/ios/WebCoreURLResponseIOS.mm: (WebCore::adjustMIMETypeIfNecessary): Check for null before using the new MIME type. 2018-12-03 Eric Carlson <eric.carlson@apple.com> [MediaStream] 'devicechange' event when more capture device information are revealed. https://bugs.webkit.org/show_bug.cgi?id=192268 Reviewed by Youenn Fablet. Test: fast/mediastream/enumerate-devices-change-event.html * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): Remove code to modify device based on access, that is now done in the UI process. (WebCore::MediaDevicesRequest::filterDeviceList): Deleted. * Modules/mediastream/MediaDevicesRequest.h: * platform/mediastream/RealtimeMediaSourceCenter.h: 2018-12-03 Wenson Hsieh <wenson_hsieh@apple.com> [iOSMac] Unable to upload non-image files using drag and drop in WKWebView https://bugs.webkit.org/show_bug.cgi?id=192283 <rdar://problem/46399461> Reviewed by Ryosuke Niwa. Currently on iOS, file URLs aren't generally written to the pasteboard during drag and drop unless the application providing the data explicitly registers "public.file-url" to item providers. As such, our current logic on iOS for handling drops does not attempt to prevent "public.file-url" from being advertised as the "text/uri-list" MIME type in DataTransfer, though we do currently succeed in suppressing access to the file URL. However, on iOSMac, the scenario in which file URLs are registered to item providers becomes pertinent when uploading files from other macOS apps (e.g. Finder) into a WKWebView running in iOSMac. Furthermore, the `preferredPresentationStyle` flag on `NSItemProvider` is unavailable in iOSMac; currently, this flag is our primary cue on iOS that an item should be treated as an attachment rather than inline data. In order to support file uploads in iOSMac, we make several adjustments to drop handling logic in iOS to handle the case where the "public.file-url" type is registered. See below for more details. Tests: DragAndDropTests.DataTransferExposePlainTextWithFileURLAsFile DragAndDropTests.DataTransferGetDataWhenDroppingImageWithFileURL * platform/PasteboardItemInfo.h: (WebCore::PasteboardItemInfo::encode const): (WebCore::PasteboardItemInfo::decode): Add a new flag that is set if and only if the item provider contains the "public.file-url" type, and also contains some non-URL data type that conforms to one of the file types supported for file uploads (i.e. "public.content", zip archives, and folders). * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::fileContentState): Consider the pasteboard to contain files in the case where one or more of the items contains a file URL, along with some other pasteboard data that can be represented as a file upload. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): If the pasteboard contains "public.file-url", don't consider "text/uri-list" to be one of the data types that's safe to expose to the page. Our current behavior in this case is that we will advertise "text/uri-list" as a pasteboard type in the DataTransfer, but if the page attempts to request this information, we simply return the empty string. Instead, we shouldn't expose "text/uri-list" as a type in the first place. * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: Add a few more `__bridge`-ing casts where appropriate. (typeConformsToTypes): Move this further up the file so that it can be used in `NSItemProvider (WebCoreExtras)`. (-[NSItemProvider web_containsFileURLAndFileUploadContent]): Add a helper method on NSItemProvider to determine whether an item provider has a file URL, as well as a content type suitable for file uploads. (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]): This currently always returns `NO` in iOSMac; instead, return `YES` on both iOS and iOSMac in the case where the item provider contains a file URL and content which may be uploaded. (-[WebItemProviderPasteboard preferredFileUploadURLAtIndex:fileType:]): (-[WebItemProviderPasteboard typeIdentifiersToLoad:]): Refactor this to take an `NSItemProvider` instead of a list of type identifiers, and bail out of loading data for "public.url" if the item provider contains a file URL. (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]): (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]): Deleted. 2018-12-02 Zalan Bujtas <zalan@apple.com> Add a runtime feature flag for LayoutFormattingContext. https://bugs.webkit.org/show_bug.cgi?id=192280 Reviewed by Simon Fraser. * Configurations/FeatureDefines.xcconfig: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setLayoutFormattingContextEnabled): (WebCore::RuntimeEnabledFeatures::layoutFormattingContextEnabled const): 2018-12-01 Brent Fulgham <bfulgham@apple.com> Lifetime of HTMLMediaElement is not properly handled in asynchronous actions https://bugs.webkit.org/show_bug.cgi?id=192087 <rdar://problem/45975230> Reviewed by Dean Jackson. The HTMLMediaElement performs operations that allow arbitrary JavaScript to run. We need to make sure the active media element is protected until those calls complete. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::didFinishInsertingNode): (WebCore::HTMLMediaElement::exitFullscreen): (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): 2018-12-01 Chris Dumez <cdumez@apple.com> [PSON] process-swapping may occur even though opener has handle to openee https://bugs.webkit.org/show_bug.cgi?id=192277 Reviewed by Antti Koivisto. Process-swapping may occur even though opener has handle to openee, which is not Web-compatible. The reason is that we rely on the window not having an opener to process-swap. However, the opener can be disowned, which does not mean that the opener doesn't still have a handle to its openee. To address the issue: - Renamed openedViaWindowOpenWithOpener flag to openedByDOMWithOpener - Make sure this flag gets set if an opener have ever been set for the browsing context - Do not process-swap if this flag is set - Drop opener from NavigationAction since it does not provide meaningful information to decide whether to process-swap or not. * loader/FrameLoader.cpp: (WebCore::FrameLoader::setOpener): * loader/NavigationAction.h: (WebCore::NavigationAction::openedByDOMWithOpener const): (WebCore::NavigationAction::setOpenedByDOMWithOpener): (WebCore::NavigationAction::setOpener): Deleted. (WebCore::NavigationAction::opener const): Deleted. (WebCore::NavigationAction::openedViaWindowOpenWithOpener const): Deleted. (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener): Deleted. * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): * page/Page.h: (WebCore::Page::openedByDOMWithOpener const): (WebCore::Page::setOpenedByDOMWithOpener): (WebCore::Page::openedViaWindowOpenWithOpener const): Deleted. (WebCore::Page::setOpenedViaWindowOpenWithOpener): Deleted. 2018-12-01 Christopher Reid <chris.reid@sony.com> Add generic implementations to FileSystemPOSIX.cpp https://bugs.webkit.org/show_bug.cgi?id=192263 Reviewed by Yusuke Suzuki. No new tests, no change in behavior. Add generic FileSystemPOSIX implementations for: - stringFromFileSystemRepresentation - fileSystemRepresentation - moveFile - getVolumeFreeSpace Also removing an unneeded PLATFORM(GTK) check since GTK is only using FileSystemGlib * platform/posix/FileSystemPOSIX.cpp: 2018-12-01 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Call instrinsicWidthConstraints on the correct formatting state. https://bugs.webkit.org/show_bug.cgi?id=192274 Reviewed by Antti Koivisto. When we call intrinsic width on a formatting context root, we need to use the formatting state that this root constructs and not the one it lives in. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): it's the caller's responsiblitiy to store the intrinsic values. 2018-11-30 Alex Christensen <achristensen@webkit.org> Fix Windows build. * platform/network/curl/CookieJarCurl.cpp: * platform/network/curl/PublicSuffixCurl.cpp: 2018-11-30 Alex Christensen <achristensen@webkit.org> Fix Windows build. * platform/network/curl/CookieJarCurl.h: 2018-11-30 Alex Christensen <achristensen@webkit.org> Move URL from WebCore to WTF https://bugs.webkit.org/show_bug.cgi?id=190234 Reviewed by Keith Miller. A URL is a low-level concept that does not depend on other classes in WebCore. We are starting to use URLs in JavaScriptCore for modules. I need URL and URLParser in a place with fewer dependencies for rdar://problem/44119696 * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePayValidateMerchantEvent.h: * Modules/applepay/PaymentCoordinator.cpp: * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentCoordinatorClient.h: * Modules/applepay/PaymentSession.h: * Modules/applicationmanifest/ApplicationManifest.h: * Modules/beacon/NavigatorBeacon.cpp: * Modules/cache/DOMCache.cpp: * Modules/fetch/FetchLoader.h: * Modules/mediasession/MediaSessionMetadata.h: * Modules/mediasource/MediaSourceRegistry.cpp: * Modules/mediasource/MediaSourceRegistry.h: * Modules/mediastream/MediaStream.cpp: * Modules/mediastream/MediaStreamRegistry.cpp: * Modules/mediastream/MediaStreamRegistry.h: * Modules/navigatorcontentutils/NavigatorContentUtilsClient.h: * Modules/notifications/Notification.h: * Modules/paymentrequest/MerchantValidationEvent.h: * Modules/paymentrequest/PaymentRequest.h: * Modules/plugins/PluginReplacement.h: * Modules/webaudio/AudioContext.h: * Modules/websockets/ThreadableWebSocketChannel.h: * Modules/websockets/WebSocket.h: * Modules/websockets/WebSocketHandshake.cpp: * Modules/websockets/WebSocketHandshake.h: * Modules/websockets/WorkerThreadableWebSocketChannel.h: * PlatformMac.cmake: * PlatformWin.cmake: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/CachedModuleScriptLoader.h: * bindings/js/CachedScriptFetcher.h: * bindings/js/ScriptController.cpp: (WebCore::ScriptController::executeIfJavaScriptURL): * bindings/js/ScriptController.h: * bindings/js/ScriptModuleLoader.h: * bindings/js/ScriptSourceCode.h: * bindings/scripts/CodeGeneratorJS.pm: (GenerateImplementation): * bindings/scripts/test/JS/JSInterfaceName.cpp: * bindings/scripts/test/JS/JSMapLike.cpp: * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp: * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: * bindings/scripts/test/JS/JSTestCEReactions.cpp: * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp: * bindings/scripts/test/JS/JSTestCallTracer.cpp: * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp: * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp: * bindings/scripts/test/JS/JSTestDOMJIT.cpp: * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp: * bindings/scripts/test/JS/JSTestEventConstructor.cpp: * bindings/scripts/test/JS/JSTestEventTarget.cpp: * bindings/scripts/test/JS/JSTestException.cpp: * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp: * bindings/scripts/test/JS/JSTestGlobalObject.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestInterface.cpp: * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp: * bindings/scripts/test/JS/JSTestIterable.cpp: * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedConstructor.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp: * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp: * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestNode.cpp: * bindings/scripts/test/JS/JSTestObj.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp: * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp: * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp: * bindings/scripts/test/JS/JSTestPluginInterface.cpp: * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp: * bindings/scripts/test/JS/JSTestSerialization.cpp: * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp: * bindings/scripts/test/JS/JSTestSerializationInherit.cpp: * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp: * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp: * bindings/scripts/test/JS/JSTestStringifier.cpp: * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp: * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp: * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp: * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp: * bindings/scripts/test/JS/JSTestTypedefs.cpp: * contentextensions/ContentExtensionsBackend.cpp: (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad): (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForPingLoad): (WebCore::ContentExtensions::applyBlockedStatusToRequest): * contentextensions/ContentExtensionsBackend.h: * css/CSSValue.h: * css/StyleProperties.h: * css/StyleResolver.h: * css/StyleSheet.h: * css/StyleSheetContents.h: * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue): * css/parser/CSSParserIdioms.h: * dom/DataTransfer.cpp: (WebCore::DataTransfer::setDataFromItemList): * dom/Document.cpp: (WebCore::Document::setURL): (WebCore::Document::processHttpEquiv): (WebCore::Document::completeURL const): (WebCore::Document::ensureTemplateDocument): * dom/Document.h: (WebCore::Document::urlForBindings const): * dom/Element.cpp: (WebCore::Element::isJavaScriptURLAttribute const): * dom/InlineStyleSheetOwner.cpp: (WebCore::parserContextForElement): * dom/Node.cpp: (WebCore::Node::baseURI const): * dom/Node.h: * dom/ScriptElement.h: * dom/ScriptExecutionContext.h: * dom/SecurityContext.h: * editing/Editor.cpp: (WebCore::Editor::pasteboardWriterURL): * editing/Editor.h: * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendQuotedURLAttributeValue): * editing/cocoa/DataDetection.h: * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::userVisibleString): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::replaceRichContentWithAttachments): (WebCore::WebContentReader::readWebArchive): * editing/mac/EditorMac.mm: (WebCore::Editor::plainTextFromPasteboard): (WebCore::Editor::writeImageToPasteboard): * editing/markup.cpp: (WebCore::removeSubresourceURLAttributes): (WebCore::createFragmentFromMarkup): * editing/markup.h: * fileapi/AsyncFileStream.cpp: * fileapi/AsyncFileStream.h: * fileapi/Blob.h: * fileapi/BlobURL.cpp: * fileapi/BlobURL.h: * fileapi/File.h: * fileapi/FileReaderLoader.h: * fileapi/ThreadableBlobRegistry.h: * history/CachedFrame.h: * history/HistoryItem.h: * html/DOMURL.cpp: (WebCore::DOMURL::create): * html/DOMURL.h: * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::archiveResourceURL): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::isURLAllowed const): (WebCore::HTMLFrameElementBase::openURL): (WebCore::HTMLFrameElementBase::setLocation): * html/HTMLInputElement.h: * html/HTMLLinkElement.h: * html/HTMLMediaElement.cpp: (WTF::LogArgument<URL>::toString): (WTF::LogArgument<WebCore::URL>::toString): Deleted. * html/HTMLPlugInImageElement.cpp: (WebCore::HTMLPlugInImageElement::allowedToLoadFrameURL): * html/ImageBitmap.h: * html/MediaFragmentURIParser.h: * html/PublicURLManager.cpp: * html/PublicURLManager.h: * html/URLInputType.cpp: * html/URLRegistry.h: * html/URLSearchParams.cpp: (WebCore::URLSearchParams::URLSearchParams): (WebCore::URLSearchParams::toString const): (WebCore::URLSearchParams::updateURL): (WebCore::URLSearchParams::updateFromAssociatedURL): * html/URLUtils.h: (WebCore::URLUtils<T>::setHost): (WebCore::URLUtils<T>::setPort): * html/canvas/CanvasRenderingContext.cpp: * html/canvas/CanvasRenderingContext.h: * html/parser/HTMLParserIdioms.cpp: * html/parser/XSSAuditor.cpp: (WebCore::semicolonSeparatedValueContainsJavaScriptURL): (WebCore::XSSAuditor::filterScriptToken): (WebCore::XSSAuditor::filterObjectToken): (WebCore::XSSAuditor::filterParamToken): (WebCore::XSSAuditor::filterEmbedToken): (WebCore::XSSAuditor::filterFormToken): (WebCore::XSSAuditor::filterInputToken): (WebCore::XSSAuditor::filterButtonToken): (WebCore::XSSAuditor::eraseDangerousAttributesIfInjected): (WebCore::XSSAuditor::isLikelySafeResource): * html/parser/XSSAuditor.h: * html/parser/XSSAuditorDelegate.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::openInNewTab): * inspector/InspectorInstrumentation.h: * inspector/agents/InspectorNetworkAgent.cpp: * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorPageAgent.h: * inspector/agents/InspectorWorkerAgent.h: * loader/ApplicationManifestLoader.h: * loader/CookieJar.h: * loader/CrossOriginAccessControl.h: * loader/CrossOriginPreflightResultCache.h: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::willSendRequest): (WebCore::DocumentLoader::maybeLoadEmpty): * loader/DocumentLoader.h: (WebCore::DocumentLoader::serverRedirectSourceForHistory const): * loader/DocumentWriter.h: * loader/FormSubmission.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::submitForm): (WebCore::FrameLoader::receivedFirstData): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::createWindow): * loader/FrameLoaderClient.h: * loader/HistoryController.cpp: (WebCore::HistoryController::currentItemShouldBeReplaced const): (WebCore::HistoryController::initializeItem): * loader/LinkLoader.h: * loader/LoadTiming.h: * loader/LoaderStrategy.h: * loader/MixedContentChecker.cpp: (WebCore::MixedContentChecker::checkFormForMixedContent const): * loader/MixedContentChecker.h: * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::shouldScheduleNavigation const): * loader/NavigationScheduler.h: * loader/PingLoader.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/ResourceLoadInfo.h: * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener): * loader/ResourceLoadObserver.h: * loader/ResourceLoadStatistics.h: * loader/ResourceLoader.h: * loader/ResourceTiming.h: * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::requestFrame): * loader/SubframeLoader.h: * loader/SubstituteData.h: * loader/appcache/ApplicationCache.h: * loader/appcache/ApplicationCacheGroup.h: * loader/appcache/ApplicationCacheHost.h: * loader/appcache/ApplicationCacheStorage.cpp: * loader/appcache/ApplicationCacheStorage.h: * loader/appcache/ManifestParser.cpp: * loader/appcache/ManifestParser.h: * loader/archive/ArchiveResourceCollection.h: * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::createFromSelection): * loader/cache/CachedResource.cpp: * loader/cache/CachedResourceLoader.h: * loader/cache/CachedStyleSheetClient.h: * loader/cache/MemoryCache.h: * loader/icon/IconLoader.h: * loader/mac/LoaderNSURLExtras.mm: * page/CaptionUserPreferencesMediaAF.cpp: * page/ChromeClient.h: * page/ClientOrigin.h: * page/ContextMenuClient.h: * page/ContextMenuController.cpp: (WebCore::ContextMenuController::checkOrEnableIfNeeded const): * page/DOMWindow.cpp: (WebCore::DOMWindow::isInsecureScriptAccess): * page/DragController.cpp: (WebCore::DragController::startDrag): * page/DragController.h: * page/EventSource.h: * page/Frame.h: * page/FrameView.h: * page/History.h: * page/Location.cpp: (WebCore::Location::url const): (WebCore::Location::reload): * page/Location.h: * page/Page.h: * page/PageSerializer.h: * page/Performance.h: * page/PerformanceResourceTiming.cpp: * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::SecurityOrigin): (WebCore::SecurityOrigin::create): * page/SecurityOrigin.h: * page/SecurityOriginData.h: * page/SecurityOriginHash.h: * page/SecurityPolicy.cpp: (WebCore::SecurityPolicy::shouldInheritSecurityOriginFromOwner): * page/SecurityPolicy.h: * page/SettingsBase.h: * page/ShareData.h: * page/SocketProvider.h: * page/UserContentProvider.h: * page/UserContentURLPattern.cpp: * page/UserContentURLPattern.h: * page/UserScript.h: * page/UserStyleSheet.h: * page/VisitedLinkStore.h: * page/csp/ContentSecurityPolicy.h: * page/csp/ContentSecurityPolicyClient.h: * page/csp/ContentSecurityPolicyDirectiveList.h: * page/csp/ContentSecurityPolicySource.cpp: (WebCore::ContentSecurityPolicySource::portMatches const): * page/csp/ContentSecurityPolicySource.h: * page/csp/ContentSecurityPolicySourceList.cpp: * page/csp/ContentSecurityPolicySourceList.h: * page/csp/ContentSecurityPolicySourceListDirective.cpp: * platform/ContentFilterUnblockHandler.h: * platform/ContextMenuItem.h: * platform/Cookie.h: * platform/CookiesStrategy.h: * platform/DragData.h: * platform/DragImage.h: * platform/FileStream.h: * platform/LinkIcon.h: * platform/Pasteboard.cpp: (WebCore::Pasteboard::canExposeURLToDOMWhenPasteboardContainsFiles): * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PasteboardWriterData.cpp: (WebCore::PasteboardWriterData::setURLData): (WebCore::PasteboardWriterData::setURL): Deleted. * platform/PasteboardWriterData.h: * platform/PlatformPasteboard.h: * platform/PromisedAttachmentInfo.h: * platform/SSLKeyGenerator.h: * platform/SchemeRegistry.cpp: (WebCore::SchemeRegistry::isBuiltinScheme): * platform/SharedBuffer.h: * platform/SharedStringHash.cpp: * platform/SharedStringHash.h: * platform/SourcesSoup.txt: * platform/UserAgent.h: * platform/UserAgentQuirks.cpp: * platform/UserAgentQuirks.h: * platform/cocoa/NetworkExtensionContentFilter.h: * platform/cocoa/NetworkExtensionContentFilter.mm: (WebCore::NetworkExtensionContentFilter::willSendRequest): * platform/glib/SSLKeyGeneratorGLib.cpp: Copied from Source/WebCore/page/ShareData.h. (WebCore::getSupportedKeySizes): (WebCore::signedPublicKeyAndChallengeString): * platform/glib/UserAgentGLib.cpp: * platform/graphics/GraphicsContext.h: * platform/graphics/Image.cpp: * platform/graphics/Image.h: * platform/graphics/ImageObserver.h: * platform/graphics/ImageSource.cpp: * platform/graphics/ImageSource.h: * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcSetUri): * platform/graphics/iso/ISOVTTCue.cpp: * platform/graphics/win/GraphicsContextDirect2D.cpp: * platform/gtk/DragImageGtk.cpp: * platform/gtk/PasteboardGtk.cpp: * platform/gtk/PlatformPasteboardGtk.cpp: * platform/gtk/SelectionData.h: * platform/ios/PasteboardIOS.mm: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): * platform/ios/QuickLook.h: * platform/mac/DragDataMac.mm: (WebCore::DragData::asPlainText const): * platform/mac/DragImageMac.mm: * platform/mac/FileSystemMac.mm: (WebCore::FileSystem::setMetadataURL): * platform/mac/PasteboardMac.mm: * platform/mac/PasteboardWriter.mm: (WebCore::createPasteboardWriter): * platform/mac/PlatformPasteboardMac.mm: * platform/mac/PublicSuffixMac.mm: (WebCore::decodeHostName): * platform/mac/SSLKeyGeneratorMac.mm: * platform/mac/WebCoreNSURLExtras.h: * platform/mac/WebCoreNSURLExtras.mm: (WebCore::isArmenianLookalikeCharacter): Deleted. (WebCore::isArmenianScriptCharacter): Deleted. (WebCore::isASCIIDigitOrValidHostCharacter): Deleted. (WebCore::isLookalikeCharacter): Deleted. (WebCore::whiteListIDNScript): Deleted. (WebCore::readIDNScriptWhiteListFile): Deleted. (WebCore::allCharactersInIDNScriptWhiteList): Deleted. (WebCore::isSecondLevelDomainNameAllowedByTLDRules): Deleted. (WebCore::isRussianDomainNameCharacter): Deleted. (WebCore::allCharactersAllowedByTLDRules): Deleted. (WebCore::mapHostNameWithRange): Deleted. (WebCore::hostNameNeedsDecodingWithRange): Deleted. (WebCore::hostNameNeedsEncodingWithRange): Deleted. (WebCore::decodeHostNameWithRange): Deleted. (WebCore::encodeHostNameWithRange): Deleted. (WebCore::decodeHostName): Deleted. (WebCore::encodeHostName): Deleted. (WebCore::collectRangesThatNeedMapping): Deleted. (WebCore::collectRangesThatNeedEncoding): Deleted. (WebCore::collectRangesThatNeedDecoding): Deleted. (WebCore::applyHostNameFunctionToMailToURLString): Deleted. (WebCore::applyHostNameFunctionToURLString): Deleted. (WebCore::mapHostNames): Deleted. (WebCore::stringByTrimmingWhitespace): Deleted. (WebCore::URLByTruncatingOneCharacterBeforeComponent): Deleted. (WebCore::URLByRemovingResourceSpecifier): Deleted. (WebCore::URLWithData): Deleted. (WebCore::dataWithUserTypedString): Deleted. (WebCore::URLWithUserTypedString): Deleted. (WebCore::URLWithUserTypedStringDeprecated): Deleted. (WebCore::hasQuestionMarkOnlyQueryString): Deleted. (WebCore::dataForURLComponentType): Deleted. (WebCore::URLByRemovingComponentAndSubsequentCharacter): Deleted. (WebCore::URLByRemovingUserInfo): Deleted. (WebCore::originalURLData): Deleted. (WebCore::createStringWithEscapedUnsafeCharacters): Deleted. (WebCore::userVisibleString): Deleted. (WebCore::isUserVisibleURL): Deleted. (WebCore::rangeOfURLScheme): Deleted. (WebCore::looksLikeAbsoluteURL): Deleted. * platform/mediastream/MediaEndpointConfiguration.h: * platform/network/BlobPart.h: * platform/network/BlobRegistry.h: * platform/network/BlobRegistryImpl.h: * platform/network/BlobResourceHandle.cpp: * platform/network/CookieRequestHeaderFieldProxy.h: * platform/network/CredentialStorage.cpp: * platform/network/CredentialStorage.h: * platform/network/DataURLDecoder.cpp: * platform/network/DataURLDecoder.h: * platform/network/FormData.h: * platform/network/ProxyServer.h: * platform/network/ResourceErrorBase.h: * platform/network/ResourceHandle.cpp: (WebCore::ResourceHandle::didReceiveResponse): * platform/network/ResourceHandle.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::redirectedRequest const): * platform/network/ResourceRequestBase.h: * platform/network/ResourceResponseBase.h: * platform/network/SocketStreamHandle.h: * platform/network/cf/DNSResolveQueueCFNet.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: * platform/network/cf/ProxyServerCFNet.cpp: * platform/network/cf/ResourceErrorCF.cpp: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: * platform/network/curl/CookieJarCurlDatabase.cpp: Added. (WebCore::cookiesForSession): (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const): (WebCore::CookieJarCurlDatabase::cookiesForDOM const): (WebCore::CookieJarCurlDatabase::cookieRequestHeaderFieldValue const): (WebCore::CookieJarCurlDatabase::cookiesEnabled const): (WebCore::CookieJarCurlDatabase::getRawCookies const): (WebCore::CookieJarCurlDatabase::deleteCookie const): (WebCore::CookieJarCurlDatabase::getHostnamesWithCookies const): (WebCore::CookieJarCurlDatabase::deleteCookiesForHostnames const): (WebCore::CookieJarCurlDatabase::deleteAllCookies const): (WebCore::CookieJarCurlDatabase::deleteAllCookiesModifiedSince const): * platform/network/curl/CookieJarDB.cpp: * platform/network/curl/CookieUtil.h: * platform/network/curl/CurlContext.h: * platform/network/curl/CurlProxySettings.h: * platform/network/curl/CurlResponse.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: * platform/network/curl/ProxyServerCurl.cpp: * platform/network/curl/SocketStreamHandleImplCurl.cpp: * platform/network/mac/ResourceErrorMac.mm: * platform/network/soup/NetworkStorageSessionSoup.cpp: * platform/network/soup/ProxyServerSoup.cpp: * platform/network/soup/ResourceHandleSoup.cpp: * platform/network/soup/ResourceRequest.h: * platform/network/soup/ResourceRequestSoup.cpp: * platform/network/soup/SocketStreamHandleImplSoup.cpp: * platform/network/soup/SoupNetworkSession.cpp: * platform/network/soup/SoupNetworkSession.h: * platform/text/TextEncoding.h: * platform/win/BString.cpp: * platform/win/BString.h: * platform/win/ClipboardUtilitiesWin.cpp: (WebCore::markupToCFHTML): * platform/win/ClipboardUtilitiesWin.h: * platform/win/DragImageWin.cpp: * platform/win/PasteboardWin.cpp: * plugins/PluginData.h: * rendering/HitTestResult.h: * rendering/RenderAttachment.cpp: * svg/SVGImageLoader.cpp: (WebCore::SVGImageLoader::sourceURI const): * svg/SVGURIReference.cpp: * svg/graphics/SVGImage.h: * svg/graphics/SVGImageCache.h: * svg/graphics/SVGImageForContainer.h: * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): * testing/Internals.mm: (WebCore::Internals::userVisibleString): * testing/MockContentFilter.cpp: (WebCore::MockContentFilter::willSendRequest): * testing/MockPaymentCoordinator.cpp: * testing/js/WebCoreTestSupport.cpp: * workers/AbstractWorker.h: * workers/WorkerGlobalScope.h: * workers/WorkerGlobalScopeProxy.h: * workers/WorkerInspectorProxy.h: * workers/WorkerLocation.h: * workers/WorkerScriptLoader.h: * workers/WorkerThread.cpp: * workers/WorkerThread.h: * workers/service/ServiceWorker.h: * workers/service/ServiceWorkerClientData.h: * workers/service/ServiceWorkerContainer.cpp: * workers/service/ServiceWorkerContextData.h: * workers/service/ServiceWorkerData.h: * workers/service/ServiceWorkerJobData.h: * workers/service/ServiceWorkerRegistrationKey.cpp: * workers/service/ServiceWorkerRegistrationKey.h: (WTF::HashTraits<WebCore::ServiceWorkerRegistrationKey>::constructDeletedValue): * worklets/WorkletGlobalScope.h: * xml/XMLHttpRequest.h: 2018-11-30 Chris Dumez <cdumez@apple.com> Drop unused Cross-Origin-Window-Policy from HTTPHeaderNames.in https://bugs.webkit.org/show_bug.cgi?id=192253 Reviewed by Geoffrey Garen. * platform/network/HTTPHeaderNames.in: 2018-11-30 Justin Fan <justin_fan@apple.com> [WebGPU] WebGPUQueue::submit and WebGPURenderingContext::present() implementation https://bugs.webkit.org/show_bug.cgi?id=192254 Reviewed by Dean Jackson. Final plumbing to render onto an HTMLCanvasElement with WebGPU. Also added ref-test that draws a green square onto a canvas using WebGPU; reference uses 2D canvas. Test: webgpu/simple-triangle-strip.html * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUSwapChain.h: Needs to override platformLayer() for CanvasBasedRenderingContext. * platform/graphics/gpu/GPUQueue.h: * platform/graphics/gpu/GPUSwapChain.h: (WebCore::GPUSwapChain::metalLayer const): Renamed from platformLayer. (WebCore::GPUSwapChain::platformLayer const): Deleted. * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::submit): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::getNextTexture): Returns the texture of the swap layer's next drawable. (WebCore::GPUSwapChain::present): Presents the last-returned drawable from getNextTexture, and frees it. (WebCore::GPUSwapChain::platformLayer const): 2018-11-30 Zalan Bujtas <zalan@apple.com> Can’t use RalphLauren.com on iPad because hover menus don’t stay up https://bugs.webkit.org/show_bug.cgi?id=192236 <rdar://problem/45792118> Reviewed by Geoffrey Garen. This patch introduces asynchronous content change observation. 1. Start observing synchronous content change and timer install as the result of dispatching mouseMoved event. 2. Start observing synchronous content change and style recalc schedule as the result of a timer callback (installed at #1). 3. Start observing synchronous content change as the result of a style recalc (scheduled at #2). This patch also extends the timeout value from 100ms to 250ms. Certain content prefer longer timeouts (see http://briancherne.github.io/jquery-hoverIntent/ for details). Test: fast/events/touch/ios/hover-when-style-change-is-async.html * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::updateStyleIfNeeded): * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * platform/ios/wak/WKContentObservation.cpp: (WKStartObservingStyleRecalcScheduling): (WKStopObservingStyleRecalcScheduling): (WKIsObservingStyleRecalcScheduling): (WKSetShouldObserveNextStyleRecalc): (WKShouldObserveNextStyleRecalc): (WKSetObservedContentChange): * platform/ios/wak/WKContentObservation.h: 2018-11-30 Ryosuke Niwa <rniwa@webkit.org> ShadowRoot should have styleSheets property https://bugs.webkit.org/show_bug.cgi?id=191311 Reviewed by Antti Koivisto. Added the support for ShadowRoot.prototype.styleSheets by making StyleSheetList refer to either a document or a shadow root. We don't support the named getter in shadow root since that's not a standard feature: https://drafts.csswg.org/cssom/#the-stylesheetlist-interface Tests: fast/shadow-dom/shadowroot-stylesheets-wrapper-gc.html imported/w3c/web-platform-tests/shadow-dom/ShadowRoot-interface.html * css/StyleSheetList.cpp: (WebCore::StyleSheetList::StyleSheetList): Added a variant which takes ShadowRoot. (WebCore::StyleSheetList::styleSheets const): (WebCore::StyleSheetList::ownerNode): Added. The replacement for document() since now the opaque root could be either a Document or a ShadowRoot. (WebCore::StyleSheetList::detach): Renamed from detachFromDocument. (WebCore::StyleSheetList::namedItem const): Added a comment that the named getter is only supported for Document since it's not in the standard. * css/StyleSheetList.h: (WebCore::StyleSheetList::create): Added a variant which takes ShadowRoot. (WebCore::StyleSheetList::document): Deleted. Replaced by StyleSheetList::ownerNode in .cpp file. * css/StyleSheetList.idl: * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::styleSheets): * dom/Document.idl: * dom/DocumentOrShadowRoot.idl: Moved the declaration of styleSheets here from Document.idl. * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::~ShadowRoot): Call detach. (WebCore::ShadowRoot::styleSheets): * dom/ShadowRoot.h: 2018-11-30 Chris Dumez <cdumez@apple.com> [PSON] We are sometimes swapping processes even though there is an opened window with an opener link to us https://bugs.webkit.org/show_bug.cgi?id=192242 Reviewed by Geoffrey Garen. Move the setting of the openedViaWindowOpenWithOpener & hasOpenedFrames flags on the NavigationAction from FrameLoader::loadURL(), to PolicyChecker::checkNavigationPolicy() to make sure those are always accurate and so that the UIProcess can make correct process swapping decisions. NavigationAction objects are created in other places than FrameLoader::loadURL() as well. Even PolicyChecker::checkNavigationPolicy() will create a NavigationAction object if there is not already one. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): * loader/FrameLoader.h: (WebCore::FrameLoader::hasOpenedFrames const): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): 2018-11-30 Don Olmstead <don.olmstead@sony.com> Rename ENABLE_SUBTLE_CRYPTO to ENABLE_WEB_CRYPTO https://bugs.webkit.org/show_bug.cgi?id=192197 Reviewed by Jiewen Tan. No new tests. No change in behavior. * Configurations/FeatureDefines.xcconfig: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::readTerminal): * crypto/CommonCryptoUtilities.cpp: * crypto/CommonCryptoUtilities.h: * crypto/CryptoAlgorithm.cpp: * crypto/CryptoAlgorithm.h: * crypto/CryptoAlgorithmIdentifier.h: * crypto/CryptoAlgorithmParameters.h: * crypto/CryptoAlgorithmParameters.idl: * crypto/CryptoAlgorithmRegistry.cpp: * crypto/CryptoAlgorithmRegistry.h: * crypto/CryptoKey.cpp: * crypto/CryptoKey.h: * crypto/CryptoKey.idl: * crypto/CryptoKeyFormat.h: * crypto/CryptoKeyPair.h: * crypto/CryptoKeyPair.idl: * crypto/CryptoKeyType.h: * crypto/CryptoKeyUsage.h: * crypto/CryptoKeyUsage.idl: * crypto/JsonWebKey.h: * crypto/JsonWebKey.idl: * crypto/RsaOtherPrimesInfo.h: * crypto/RsaOtherPrimesInfo.idl: * crypto/SerializedCryptoKeyWrap.h: * crypto/SubtleCrypto.cpp: * crypto/SubtleCrypto.h: * crypto/SubtleCrypto.idl: * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp: * crypto/algorithms/CryptoAlgorithmAES_CBC.h: * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp: * crypto/algorithms/CryptoAlgorithmAES_CFB.h: * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp: * crypto/algorithms/CryptoAlgorithmAES_CTR.h: * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp: * crypto/algorithms/CryptoAlgorithmAES_GCM.h: * crypto/algorithms/CryptoAlgorithmAES_KW.cpp: * crypto/algorithms/CryptoAlgorithmAES_KW.h: * crypto/algorithms/CryptoAlgorithmECDH.cpp: * crypto/algorithms/CryptoAlgorithmECDH.h: * crypto/algorithms/CryptoAlgorithmECDSA.cpp: * crypto/algorithms/CryptoAlgorithmECDSA.h: * crypto/algorithms/CryptoAlgorithmHKDF.cpp: * crypto/algorithms/CryptoAlgorithmHKDF.h: * crypto/algorithms/CryptoAlgorithmHMAC.cpp: * crypto/algorithms/CryptoAlgorithmHMAC.h: * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp: * crypto/algorithms/CryptoAlgorithmPBKDF2.h: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp: * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp: * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h: * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp: * crypto/algorithms/CryptoAlgorithmRSA_PSS.h: * crypto/algorithms/CryptoAlgorithmSHA1.cpp: * crypto/algorithms/CryptoAlgorithmSHA1.h: * crypto/algorithms/CryptoAlgorithmSHA224.cpp: * crypto/algorithms/CryptoAlgorithmSHA224.h: * crypto/algorithms/CryptoAlgorithmSHA256.cpp: * crypto/algorithms/CryptoAlgorithmSHA256.h: * crypto/algorithms/CryptoAlgorithmSHA384.cpp: * crypto/algorithms/CryptoAlgorithmSHA384.h: * crypto/algorithms/CryptoAlgorithmSHA512.cpp: * crypto/algorithms/CryptoAlgorithmSHA512.h: * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmAES_KWGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmECDSAGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmHMACGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp: * crypto/gcrypt/CryptoAlgorithmRegistryGCrypt.cpp: * crypto/gcrypt/CryptoKeyECGCrypt.cpp: * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: * crypto/gcrypt/SerializedCryptoKeyWrapGCrypt.cpp: * crypto/keys/CryptoAesKeyAlgorithm.idl: * crypto/keys/CryptoEcKeyAlgorithm.idl: * crypto/keys/CryptoHmacKeyAlgorithm.idl: * crypto/keys/CryptoKeyAES.cpp: * crypto/keys/CryptoKeyAES.h: * crypto/keys/CryptoKeyAlgorithm.idl: * crypto/keys/CryptoKeyEC.cpp: * crypto/keys/CryptoKeyEC.h: * crypto/keys/CryptoKeyHMAC.cpp: * crypto/keys/CryptoKeyHMAC.h: * crypto/keys/CryptoKeyRSA.cpp: * crypto/keys/CryptoKeyRSA.h: * crypto/keys/CryptoKeyRSAComponents.cpp: * crypto/keys/CryptoKeyRSAComponents.h: * crypto/keys/CryptoKeyRaw.cpp: * crypto/keys/CryptoKeyRaw.h: * crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: * crypto/keys/CryptoRsaKeyAlgorithm.idl: * crypto/mac/CommonCryptoDERUtilities.cpp: * crypto/mac/CommonCryptoDERUtilities.h: * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp: * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp: * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp: * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: * crypto/mac/CryptoAlgorithmAES_KWMac.cpp: * crypto/mac/CryptoAlgorithmECDHMac.cpp: * crypto/mac/CryptoAlgorithmECDSAMac.cpp: * crypto/mac/CryptoAlgorithmHKDFMac.cpp: * crypto/mac/CryptoAlgorithmHMACMac.cpp: * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp: * crypto/mac/CryptoAlgorithmRSAES_PKCS1_v1_5Mac.cpp: * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp: * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp: * crypto/mac/CryptoAlgorithmRegistryMac.cpp: * crypto/mac/CryptoDigestAlgorithm.h: * crypto/mac/CryptoKeyECMac.cpp: * crypto/mac/CryptoKeyMac.cpp: * crypto/mac/CryptoKeyRSAMac.cpp: * crypto/mac/SerializedCryptoKeyWrapMac.mm: * crypto/parameters/AesCbcCfbParams.idl: * crypto/parameters/AesCtrParams.idl: * crypto/parameters/AesGcmParams.idl: * crypto/parameters/AesKeyParams.idl: * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h: * crypto/parameters/CryptoAlgorithmAesCtrParams.h: * crypto/parameters/CryptoAlgorithmAesGcmParams.h: * crypto/parameters/CryptoAlgorithmAesKeyParams.h: * crypto/parameters/CryptoAlgorithmEcKeyParams.h: * crypto/parameters/CryptoAlgorithmEcdhKeyDeriveParams.h: * crypto/parameters/CryptoAlgorithmEcdsaParams.h: * crypto/parameters/CryptoAlgorithmHkdfParams.h: * crypto/parameters/CryptoAlgorithmHmacKeyParams.h: * crypto/parameters/CryptoAlgorithmPbkdf2Params.h: * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h: * crypto/parameters/CryptoAlgorithmRsaHashedKeyGenParams.h: * crypto/parameters/CryptoAlgorithmRsaKeyGenParams.h: * crypto/parameters/CryptoAlgorithmRsaOaepParams.h: * crypto/parameters/CryptoAlgorithmRsaPssParams.h: * crypto/parameters/EcKeyParams.idl: * crypto/parameters/EcdhKeyDeriveParams.idl: * crypto/parameters/EcdsaParams.idl: * crypto/parameters/HkdfParams.idl: * crypto/parameters/HmacKeyParams.idl: * crypto/parameters/Pbkdf2Params.idl: * crypto/parameters/RsaHashedImportParams.idl: * crypto/parameters/RsaHashedKeyGenParams.idl: * crypto/parameters/RsaKeyGenParams.idl: * crypto/parameters/RsaOaepParams.idl: * crypto/parameters/RsaPssParams.idl: * dom/Document.cpp: * dom/Document.h: * dom/ScriptExecutionContext.h: * page/ChromeClient.h: * page/Crypto.cpp: (WebCore::Crypto::Crypto): * page/Crypto.h: * page/Crypto.idl: * platform/GCrypt.cmake: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * workers/WorkerGlobalScope.cpp: * workers/WorkerGlobalScope.h: * worklets/WorkletGlobalScope.h: 2018-11-30 Wenson Hsieh <wenson_hsieh@apple.com> Replace "auto fill" with "AutoFill" in some localizable strings https://bugs.webkit.org/show_bug.cgi?id=192233 <rdar://problem/46311614> Reviewed by Chris Fleizach. Replace "autofill" with "AutoFill". * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::AXAutoFillCredentialsLabel): (WebCore::AXAutoFillContactsLabel): (WebCore::AXAutoFillStrongPasswordLabel): (WebCore::AXAutoFillCreditCardLabel): 2018-11-29 Ryosuke Niwa <rniwa@webkit.org> Add CEReactions=NotNeeded on all the relevant IDL files https://bugs.webkit.org/show_bug.cgi?id=188368 <rdar://problem/42987753> Rubber-stamped by Antti Koivisto. Based on a patch written by Frederic Wang. Added CEReactions=NotNeeded to all the places we don't need CEReactions because we don't implement customized builtins but are marked with CEReactions in the HTML specification. * html/HTMLAnchorElement.idl: * html/HTMLAreaElement.idl: * html/HTMLBRElement.idl: * html/HTMLBaseElement.idl: * html/HTMLBodyElement.idl: * html/HTMLButtonElement.idl: * html/HTMLCanvasElement.idl: * html/HTMLDListElement.idl: * html/HTMLDataElement.idl: * html/HTMLDetailsElement.idl: * html/HTMLDirectoryElement.idl: * html/HTMLDivElement.idl: * html/HTMLEmbedElement.idl: * html/HTMLFieldSetElement.idl: * html/HTMLFontElement.idl: * html/HTMLFormElement.idl: * html/HTMLFrameElement.idl: * html/HTMLFrameSetElement.idl: * html/HTMLHRElement.idl: * html/HTMLHeadingElement.idl: * html/HTMLHtmlElement.idl: * html/HTMLHyperlinkElementUtils.idl: * html/HTMLImageElement.idl: * html/HTMLInputElement.idl: * html/HTMLLIElement.idl: * html/HTMLLabelElement.idl: * html/HTMLLegendElement.idl: * html/HTMLLinkElement.idl: * html/HTMLMapElement.idl: * html/HTMLMarqueeElement.idl: * html/HTMLMediaElement.idl: * html/HTMLMenuElement.idl: * html/HTMLMetaElement.idl: * html/HTMLMeterElement.idl: * html/HTMLModElement.idl: * html/HTMLOListElement.idl: * html/HTMLObjectElement.idl: * html/HTMLOptGroupElement.idl: * html/HTMLOptionElement.idl: * html/HTMLOutputElement.idl: * html/HTMLParagraphElement.idl: * html/HTMLParamElement.idl: * html/HTMLPreElement.idl: * html/HTMLProgressElement.idl: * html/HTMLQuoteElement.idl: * html/HTMLScriptElement.idl: * html/HTMLSlotElement.idl: * html/HTMLSourceElement.idl: * html/HTMLStyleElement.idl: * html/HTMLTableCaptionElement.idl: * html/HTMLTableCellElement.idl: * html/HTMLTableColElement.idl: * html/HTMLTableElement.idl: * html/HTMLTableRowElement.idl: * html/HTMLTableSectionElement.idl: * html/HTMLTextAreaElement.idl: * html/HTMLTimeElement.idl: * html/HTMLTrackElement.idl: * html/HTMLUListElement.idl: * html/HTMLVideoElement.idl: 2018-11-30 Alexey Proskuryakov <ap@apple.com> Move USE_CFNETWORK_IGNORE_HSTS to its proper place https://bugs.webkit.org/show_bug.cgi?id=192173 Reviewed by Tim Horton. * platform/network/mac/WebCoreURLResponse.mm: (WebCore::schemeWasUpgradedDueToDynamicHSTS): 2018-11-30 Basuke Suzuki <basuke.suzuki@sony.com> [Curl] Add API for ProtectionSpace. https://bugs.webkit.org/show_bug.cgi?id=191648 Reviewed by Alex Christensen. Create a platform dependent header and implementation files for ProtectionSpace. No new tests because there's no behavior change. * platform/Curl.cmake: * platform/network/ProtectionSpace.h: * platform/network/curl/ProtectionSpaceCurl.cpp: Added. (WebCore::ProtectionSpace::certificateInfo const): * platform/network/curl/ProtectionSpaceCurl.h: Added. (WebCore::ProtectionSpace::ProtectionSpace): (WebCore::ProtectionSpace::encodingRequiresPlatformData const): (WebCore::ProtectionSpace::platformCompare): 2018-11-30 Justin Fan <justin_fan@apple.com> [WebGPU] Flesh out WebGPURenderPassDescriptor to match the WebGPU IDL https://bugs.webkit.org/show_bug.cgi?id=192213 Reviewed by Dean Jackson. WebGPU prototype now uses WebGPURenderPassColorAttachmentDescriptor in WebGPURenderPassDescriptor to match the WebGPU Sketch. WebGPU developer can now also set the clearColor in WebGPURenderPassDescriptor. No new tests. Older WebGPURenderPass* tests updated. * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/WebGPUColor.h: Added. Typedef'd to GPUColor.h. * Modules/webgpu/WebGPUColor.idl: Added. * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::beginRenderPass): Updated to error check and support the new structure of WebGPURenderPassDescriptor. * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.h: Added. * Modules/webgpu/WebGPURenderPassColorAttachmentDescriptor.idl: Added. * Modules/webgpu/WebGPURenderPassDescriptor.h: * Modules/webgpu/WebGPURenderPassDescriptor.idl: Updated to match the sketch IDL. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUColor.h: Added. * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Added. Backing struct for WebGPU__. * platform/graphics/gpu/GPURenderPassDescriptor.h: Updated to match new WebGPURenderPassDescriptor. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::create): Now also uses clearColor set by developer. 2018-11-30 Andy Estes <aestes@apple.com> [Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 <rdar://problem/46330293> Reviewed by Tim Horton. * DerivedSources.make: Added an extension point for derived sources. * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for PaymentCoordinatorClient. * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source. * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm. * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names. * page/SettingsBase.h: Added an extension point for settings. * platform/cocoa/WebCoreAdditions.mm: Added. 2018-11-30 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME] CDMInstance should be shipped as a GstContext to the decryptors https://bugs.webkit.org/show_bug.cgi?id=192075 Reviewed by Philippe Normand. So far, we were shipping the CDMInstance in an event to the decryptors and they were requesting it with bus messages when it was not found. Now we ship it with a GstContext that is set to the pipeline and read from the decryptors, which is now always available. As a consequence of changing this flow, the attemptToDecrypt one was affected as well because it was tied to CDMInstance shipment. A workaround was added: when the decryptors send the waitingForKey, an attemptToDecrypt will be performed. A FIXME was added for this. A subconsequence is that attemptToDecryptWithInstance is reworked to rely always in attemptToDecryptWithLocal instance, the former becomes final and the latter virtual. This is a rework, no new tests needed. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceAttached): (WebCore::MediaPlayerPrivateGStreamerBase::cdmInstanceDetached): (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance): (WebCore::MediaPlayerPrivateGStreamerBase::dispatchCDMInstance): Deleted. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkit_media_common_encryption_decrypt_class_init): (webkitMediaCommonEncryptionDecryptTransformInPlace): (webkitMediaCommonEncryptionDecryptIsCDMInstanceAvailable): (webkitMediaCommonEncryptionDecryptSinkEventHandler): (webKitMediaCommonEncryptionDecryptorSetContext): * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithLocalInstance): (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance): Deleted. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h: 2018-11-30 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Compute min/maxHeight margins only when they are needed. https://bugs.webkit.org/show_bug.cgi?id=192223 Reviewed by Antti Koivisto. Test: fast/block/block-only/collapsed-margin-with-min-height.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): 2018-11-30 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Geometry::inFlowNonReplacedHeightAndMargin should check for empty inline formatting context. https://bugs.webkit.org/show_bug.cgi?id=192215 Reviewed by Antti Koivisto. Check if the inline formatting context actually has any lines. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): 2018-11-30 Zalan Bujtas <zalan@apple.com> [LFC][BFC][MarginCollapsing] Do not use computed display box values for border and padding https://bugs.webkit.org/show_bug.cgi?id=192214 Reviewed by Antti Koivisto. Border and padding values are not necessarily computed yet when we try to estimate the margin top value. Estimating margin top is required to be able to place floats (vertically) sooner than we would compute the final vertical position for a regular block box. <body><div style="float: left"></div><div><div style="margin: 10px;"></div></div> In the above example, to estimate a final vertical position of the floating box, we need to know whether the nested div's margin is collapsed all the way up to the body. However in order to find it out we need to check for borders and paddings (they stop margin collapsing). At the time when the floating box is being laied out, those <div> block boxes are still far down in the layout queue. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::hasBorder): (WebCore::Layout::hasPadding): (WebCore::Layout::hasBorderBefore): (WebCore::Layout::hasBorderAfter): (WebCore::Layout::hasPaddingBefore): (WebCore::Layout::hasPaddingAfter): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): (WebCore::Layout::isMarginBottomCollapsedThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): 2018-11-29 Frederic Wang <fwang@igalia.com> Separate paint and scroll offsets for RenderLayerBacking::m_scrollingContentsLayer https://bugs.webkit.org/show_bug.cgi?id=183040 Currently, scroll offset of RenderLayerBacking::m_scrollingContentsLayer is stored in the GraphicsLayer::m_offsetFromRenderer member used for paint offset. This patch separates these two concept by introducing a new GraphicsLayer::m_scrollOffset for the scroll offset. This makes the API a little bit cleaner, the code easier to understand and might avoid unnecessary repaints in composited scroll. Reviewed by Simon Fraser. No new tests, already covered by existing tests. * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::setScrollOffset): Setter function to update the scroll offset of the content layer inside its scrolling parent layer. Ask a repaint if it has changed and is requested by the caller. (WebCore::GraphicsLayer::paintGraphicsLayerContents): Take into account the scroll offset when painting. (WebCore::GraphicsLayer::dumpProperties const): Dump the scroll offset property. * platform/graphics/GraphicsLayer.h: Include ScrollableArea for the ScrollOffset typedef. Add member for the scroll offset of the content layer inside its scrolling parent layer. (WebCore::GraphicsLayer::scrollOffset const): Getter function. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateGeometry): Do not include the scroll offset in the paint offset of m_scrollingContentsLayer since it is now taken into account in paintGraphicsLayerContents. Update the scroll offset of m_scrollingContentsLayer separately. Leave the paint offset of m_foregroundLayer unchanged. (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): Take into account the scroll offset of m_scrollingContentsLayer when calculating the dirty rect. 2018-11-29 Simon Fraser <simon.fraser@apple.com> Overflow scrolling layers need to be self-painting https://bugs.webkit.org/show_bug.cgi?id=192201 Reviewed by Dean Jackson. Overflow scrolling layers paint their contents, so need to be self-painting in the RenderLayer sense. Without this change, the overflow in the testcase doesn't get any compositing layers. Test: compositing/scrolling/overflow-scrolling-layers-are-self-painting.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): 2018-11-29 Christopher Reid <chris.reid@sony.com> [Win] listDirectory in FileSystemWin.cpp should not skip all directories https://bugs.webkit.org/show_bug.cgi?id=192042 Reviewed by Fujii Hironori. Covered by existing tests. listDirectory is not returning any child directories which is causing ASSERT(diskUsage >= databaseFileSize) in SQLiteIDBBackingStore.cpp to fail. Change listDirectory in FileSystemWin to match FileSystemPOSIX's behavior. listDirectory should only skip the current and previous directories. * platform/win/FileSystemWin.cpp: 2018-11-29 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238713. Breaks internal builds. Reverted changeset: "[Cocoa] Add some WKA extension points" https://bugs.webkit.org/show_bug.cgi?id=192131 https://trac.webkit.org/changeset/238713 2018-11-29 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238680. Caused existing webrtc layout tests to fail an assertion. Reverted changeset: "A sender created through addTransceiver and populated using addTrack should have its source set" https://bugs.webkit.org/show_bug.cgi?id=192136 https://trac.webkit.org/changeset/238680 2018-11-29 Justin Fan <justin_fan@apple.com> Remove dangling WebGPU file references from WebCore project https://bugs.webkit.org/show_bug.cgi?id=192185 Unreviewed project file gardening. No new tests. * WebCore.xcodeproj/project.pbxproj: 2018-11-29 Keith Rollin <krollin@apple.com> Unreviewed build fix. r238637 introduced some DerivedSources.make changes that could produce some invalid .idl files, leading to IDLParser.pm error messages. * DerivedSources.make: 2018-11-29 Simon Fraser <simon.fraser@apple.com> Add an internal feature flag to enable async overflow scrolling https://bugs.webkit.org/show_bug.cgi?id=192184 Reviewed by Tim Horton. Add a new internal feature flag that will enable async overflow-scrolling for most overflow:scroll elements. Defaults to off. Make the "UseAcceleratedTouchScrolling" terminology in RenderLayer etc be more generic, and refer to async overflow scrolling. * page/Settings.yaml: * rendering/RenderLayer.cpp: (WebCore::canCreateStackingContext): Remove a line which is not necessary, since -webkit-overflow-scrolling: touch already triggers non-auto z-index via code in StyleResolver::adjustRenderStyle(). (WebCore::RenderLayer::canUseCompositedScrolling const): (WebCore::RenderLayer::hasCompositedScrollableOverflow const): (WebCore::RenderLayer::handleTouchEvent): (WebCore::RenderLayer::usesAsyncScrolling const): (WebCore::RenderLayer::updateScrollInfoAfterLayout): (WebCore::RenderLayer::showsOverflowControls const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::RenderLayer::canUseAcceleratedTouchScrolling const): Deleted. (WebCore::RenderLayer::hasTouchScrollableOverflow const): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const): (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const): (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): 2018-11-29 Andy Estes <aestes@apple.com> [Cocoa] Add some WKA extension points https://bugs.webkit.org/show_bug.cgi?id=192131 <rdar://problem/46330293> Reviewed by Tim Horton. * DerivedSources.make: Added an extension point for derived sources. * Modules/applepay/PaymentCoordinatorClient.h: Added an extension point for PaymentCoordinatorClient. * SourcesCocoa.txt: Added WebCoreAdditions.mm as a non-unified source. * WebCore.xcodeproj/project.pbxproj: Added WebCoreAdditions.mm. * bindings/js/WebCoreBuiltinNames.h: Added an extension point for built-in names. * page/SettingsBase.h: Added an extension point for settings. * platform/cocoa/WebCoreAdditions.mm: Added. 2018-11-29 Tim Horton <timothy_horton@apple.com> Make drawing tools available when an editable image is focused https://bugs.webkit.org/show_bug.cgi?id=192172 <rdar://problem/30337960> Reviewed by Dean Jackson. * editing/Editor.cpp: (WebCore::Editor::insertEditableImage): * editing/Editor.h: * editing/InsertEditableImageCommand.cpp: (WebCore::InsertEditableImageCommand::insertEditableImage): (WebCore::InsertEditableImageCommand::doApply): * editing/InsertEditableImageCommand.h: Add InsertEditableImageCommand::insertEditableImage, which returns the inserted image element. * html/HTMLImageElement.h: Make HTMLImageElement focusable if it is editable. 2018-11-29 Zalan Bujtas <zalan@apple.com> [LFC][BFC][Quirk] Body and html height stretching. https://bugs.webkit.org/show_bug.cgi?id=192154 Reviewed by Antti Koivisto. This patch takes the document box's margin/border/padding into account when stretching html/body to the height of the initial containing block. Tests: fast/block/block-only/body-height-with-auto-html-height-quirk.html fast/block/block-only/body-height-with-auto-html-height-quirk2.html fast/block/block-only/body-height-with-non-auto-html-height-quirk.html fast/block/block-only/body-height-with-non-auto-html-height-quirk2.html * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginBottom): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::stretchedHeight): 2018-11-29 Justin Fan <justin_fan@apple.com> [WebGPU] Replace forward declare of WebGPUCommandBuffer with include https://bugs.webkit.org/show_bug.cgi?id=192179 Unreviewed build fix. No new tests. No behavior change. * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: * Modules/webgpu/WebGPUProgrammablePassEncoder.h: 2018-11-29 Zalan Bujtas <zalan@apple.com> [ContentObservation] Make WKSetObservedContentChange logic more explicit. https://bugs.webkit.org/show_bug.cgi?id=192183 Reviewed by Simon Fraser. * platform/ios/wak/WKContentObservation.cpp: (WKSetObservedContentChange): (WebThreadRemoveObservedDOMTimer): 2018-11-29 Youenn Fablet <youenn@apple.com> CSS subresource loads should not be observable from resource timing if the stylesheet is opaque https://bugs.webkit.org/show_bug.cgi?id=192132 Reviewed by Ryosuke Niwa. Introduce a new ResourceLoaderOptions to determine whether a load is made from a resource that is opaque. Make use of that option to disable exposing such loads to the web page through resource timing. The same option might later be used to bypass service workers. Make use of this option for CSS subresource loads. When the CSS stylesheet is opaque for the page, set this option. Test: http/tests/security/clean-origin-exposed-resource-timing.html http/tests/security/cross-origin-resource-timing.html * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::CSSCursorImageValue): (WebCore::CSSCursorImageValue::loadImage): * css/CSSCursorImageValue.h: * css/CSSFontFaceSrcValue.cpp: (WebCore::CSSFontFaceSrcValue::cachedFont): * css/CSSFontFaceSrcValue.h: * css/CSSImageSetValue.cpp: (WebCore::CSSImageSetValue::CSSImageSetValue): (WebCore::CSSImageSetValue::loadBestFitImage): * css/CSSImageSetValue.h: * css/CSSImageValue.cpp: (WebCore::CSSImageValue::CSSImageValue): (WebCore::CSSImageValue::loadImage): * css/CSSImageValue.h: * css/CSSStyleSheet.h: * css/StyleRuleImport.cpp: (WebCore::StyleRuleImport::setCSSStyleSheet): (WebCore::StyleRuleImport::requestStyleSheet): * css/StyleSheetContents.h: * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeCursor): (WebCore::consumeFontFaceSrcURI): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeImageSet): (WebCore::CSSPropertyParserHelpers::consumeImage): * html/HTMLBodyElement.cpp: (WebCore::HTMLBodyElement::collectStyleForPresentationAttribute): * html/HTMLLinkElement.cpp: (WebCore::HTMLLinkElement::initializeStyleSheet): (WebCore::HTMLLinkElement::setCSSStyleSheet): * html/HTMLTableElement.cpp: (WebCore::HTMLTableElement::collectStyleForPresentationAttribute): * html/HTMLTablePartElement.cpp: (WebCore::HTMLTablePartElement::collectStyleForPresentationAttribute): * loader/ResourceLoaderOptions.h: * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::shouldAddResourceTiming): * svg/SVGFontFaceUriElement.cpp: (WebCore::SVGFontFaceUriElement::srcValue const): 2018-11-29 Megan Gardner <megan_gardner@apple.com> Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-29 Joseph Pecoraro <pecoraro@apple.com> [Cocoa] Move ServerTimingParser.* into a better group in the Xcode project https://bugs.webkit.org/show_bug.cgi?id=192180 Reviewed by Simon Fraser. * WebCore.xcodeproj/project.pbxproj: 2018-11-29 Zalan Bujtas <zalan@apple.com> [ContentObservation] DOMTimer::install should explicitly check if timer observation is on https://bugs.webkit.org/show_bug.cgi?id=192181 Reviewed by Simon Fraser. * page/DOMTimer.cpp: (WebCore::DOMTimer::install): * platform/ios/wak/WKContentObservation.cpp: (WKIsObservingDOMTimerScheduling): * platform/ios/wak/WKContentObservation.h: 2018-11-29 Ryosuke Niwa <rniwa@webkit.org> Executing "insertunorderedlist" while selecting a contenteditable element inside a shadow dom hangs the browser https://bugs.webkit.org/show_bug.cgi?id=184049 <rdar://problem/38931033> Reviewed by Antti Koivisto. The primary hung was caused by TextIterator::advance traversing the next node in the tree order using NodeTraversal::next which doesn't take the composed tree into account. Fixed the bug by traversing the composed tree while sharing code with StylizedMarkupAccumulator. This revealed a second hang in InsertListCommand::doApply() caused by endingSelection() being null, which was caused by CompositeEditCommand::moveParagraphs failing to restore the ending selection properly because it was computing the text indices difference from the beginning of the document until the destination. Fixed this second bug by computing the indices against the beginning of the root editable element. Note that editability never crosses a shadow boundary. Test: editing/execCommand/insert-unordered-list-in-shadow-tree.html * dom/ComposedTreeIterator.h: (WebCore::nextSkippingChildrenInComposedTreeIgnoringUserAgentShadow): Extracted out of nextSkippingChildren in markup.cpp. (WebCore::nextInComposedTreeIgnoringUserAgentShadow): Added. * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): Compute the index from the beginning of the root editable element as opposed to the beginning of the document. * editing/TextIterator.cpp: (WebCore::nextNode): Added. (WebCore::isDescendantOf): Added. (WebCore::TextIterator::advance): Use the newly added functions to traverse the composed tree when the options contains TextIteratorTraversesFlatTree. * editing/markup.cpp: 2018-11-29 Zalan Bujtas <zalan@apple.com> [ContentObservation] Decouple content change and DOM timer scheduling observation https://bugs.webkit.org/show_bug.cgi?id=192170 Reviewed by Simon Fraser. This is in preparation for adding style recalc scheduling observation (the main goal here is to simplify the indeterminate change logic). * page/DOMTimer.cpp: (WebCore::DOMTimer::fired): * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::mouseMoved): * platform/ios/wak/WKContentObservation.cpp: (WKStartObservingContentChanges): (WKStopObservingContentChanges): (WKStartObservingDOMTimerSchedules): (WKStopObservingDOMTimerSchedules): (WKSetObservedContentChange): (WebThreadAddObservedDOMTimer): (WKBeginObservingContentChanges): Deleted. * platform/ios/wak/WKContentObservation.h: 2018-11-29 Frederic Wang <fwang@igalia.com> Make reconcileViewportConstrainedLayerPositions start from a specified scrolling node https://bugs.webkit.org/show_bug.cgi?id=180002 Reviewed by Simon Fraser. For non-programmatic scrolling of frames, AsyncScrollingCoordinator::reconcileScrollingState currently always call reconcileViewportConstrainedLayerPositions for the main frame since async subframe scrolling is not supported yet (bug 171667 and bug 149264). This function in turn calls reconcileLayerPositionForViewportRect on the whole scrolling tree to readjust position of fixed/sticky descendants. This patch refactors a bit the code so that the operation is actually only applied to the descendants of the frame's scrolling node, which would mean a small optimization when subframe are asynchronously scrollable. The code is already covered by reconcile-layer-position-recursive.html. No new tests, behavior unchanged and already covered by existing tests. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): Pass the frame's scrolling node id. (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Start reconciliation from the specified scrolling node and log its ID. * page/scrolling/AsyncScrollingCoordinator.h: Add ScrollingNodeID parameter. * page/scrolling/ScrollingCoordinator.h: (WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Ditto. 2018-11-29 Zalan Bujtas <zalan@apple.com> Rename *ObservedContentModifier(s) to *ObservedDOMTimer(s) https://bugs.webkit.org/show_bug.cgi?id=192168 Reviewed by Simon Fraser. * dom/Document.cpp: (WebCore::Document::platformSuspendOrStopActiveDOMObjects): * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * page/DOMWindow.cpp: (WebCore::DOMWindow::clearTimeout): * page/Frame.cpp: (WebCore::Frame::willDetachPage): * platform/ios/wak/WKContentObservation.cpp: (WKBeginObservingContentChanges): (WKSetObservedContentChange): (WebThreadGetObservedDOMTimers): (WebThreadCountOfObservedDOMTimers): (WebThreadClearObservedDOMTimers): (WebThreadContainsObservedDOMTimer): (WebThreadAddObservedDOMTimer): (WebThreadRemoveObservedDOMTimer): (WebThreadCountOfObservedContentModifiers): Deleted. (WebThreadClearObservedContentModifiers): Deleted. (WebThreadContainsObservedContentModifier): Deleted. (WebThreadAddObservedContentModifier): Deleted. (WebThreadRemoveObservedContentModifier): Deleted. * platform/ios/wak/WKContentObservation.h: * platform/ios/wak/WKContentObservationInternal.h: 2018-11-29 Justin Fan <justin_fan@apple.com> [WebGPU] WebGPURenderPassEncoder::setPipeline, draw, and endPass prototypes https://bugs.webkit.org/show_bug.cgi?id=192134 Reviewed by Dean Jackson. Wrap up prototype features for WebGPURenderPassEncoder. Test: webgpu/render-command-encoding.html * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::beginRenderPass): * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: (WebCore::WebGPUProgrammablePassEncoder::WebGPUProgrammablePassEncoder): (WebCore::WebGPUProgrammablePassEncoder::endPass): Returns a reference to the WebGPUCommandBuffer that created this encoder. (WebCore::WebGPUProgrammablePassEncoder::setPipeline): * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Updated to support endPass and setPipeline. * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: * Modules/webgpu/WebGPURenderPassEncoder.cpp: (WebCore::WebGPURenderPassEncoder::create): Must be provided with the WebGPUCommandBuffer. (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder): (WebCore::WebGPURenderPassEncoder::draw): * Modules/webgpu/WebGPURenderPassEncoder.h: Updated to cache a reference to the WebGPUCommandBuffer, and for draw. * Modules/webgpu/WebGPURenderPassEncoder.idl: * Modules/webgpu/WebGPURenderPipeline.cpp: (WebCore::WebGPURenderPipeline::create): (WebCore::WebGPURenderPipeline::WebGPURenderPipeline): * Modules/webgpu/WebGPURenderPipeline.h: (WebCore::WebGPURenderPipeline::renderPipeline): * Modules/webgpu/WebGPUTexture.cpp: * Modules/webgpu/WebGPUTexture.h: Replaced include with forward declaration. * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Updated to support new WebGPU_PassEncoder functionality. * platform/graphics/gpu/GPURenderPassEncoder.h: (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): Now ends encoding on the MTLCommandEncoder, if not already ended, before freeing it. * platform/graphics/gpu/GPURenderPipeline.h: Now remembers the GPUPrimitiveTopology that it was created with. (WebCore::GPURenderPipeline::primitiveTopology const): * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: (WebCore::GPUProgrammablePassEncoder::endPass): Calls endEncoding on the backing MTLCommandEncoder, if not already ended. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: (WebCore::GPURenderPassEncoder::platformPassEncoder const): (WebCore::GPURenderPassEncoder::setPipeline): Added. (WebCore::primitiveTypeForGPUPrimitiveTopology): Added. Helper function to convert GPUPrimitiveTopology to MTLPrimitiveType. (WebCore::GPURenderPassEncoder::draw): Added. Draws using primitive topology specified during pipeline creation. * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): Now must store the GPURenderPipelineDescriptor for later reference. 2018-11-29 Justin Michaud <justin_michaud@apple.com> CSS Painting API should pass 'this' correctly to paint callback, and repaint when properties change. https://bugs.webkit.org/show_bug.cgi?id=191443 Reviewed by Dean Jackson. Instantiate a new instance of the paint class, and pass it as 'this' object when the paint callback is called. Also, this patch makes sure that custom paint elements get repainted when properties that they care about get changed. Finally, we fix two reference cycles that caused WorkletGlobalScope to never be destroyed. Tests: fast/css-custom-paint/animate-repaint.html fast/css-custom-paint/animate.html * bindings/js/JSDOMWrapper.cpp: * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren): * bindings/js/JSWorkletGlobalScopeBase.cpp: (WebCore::toJS): * bindings/js/ScriptState.cpp: (WebCore::execStateFromWorkletGlobalScope): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::applyProperty): * dom/Document.cpp: (WebCore::Document::prepareForDestruction): * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::addCustomPaintWatchProperty): (WebCore::RenderStyle::changeRequiresRepaint const): * rendering/style/RenderStyle.h: * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * testing/Internals.cpp: (WebCore::Internals::isAnyWorkletGlobalScopeAlive const): * testing/Internals.h: * testing/Internals.idl: * worklets/PaintWorkletGlobalScope.cpp: (WebCore::PaintWorkletGlobalScope::devicePixelRatio const): (WebCore::PaintWorkletGlobalScope::PaintDefinition::PaintDefinition): (WebCore::PaintWorkletGlobalScope::registerPaint): * worklets/PaintWorkletGlobalScope.h: (WebCore::PaintWorkletGlobalScope::~PaintWorkletGlobalScope): * worklets/WorkletGlobalScope.cpp: (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::~WorkletGlobalScope): (WebCore::WorkletGlobalScope::prepareForDestruction): (WebCore::WorkletGlobalScope::allWorkletGlobalScopesSet): (WebCore::WorkletGlobalScope::isJSExecutionForbidden const): (WebCore::WorkletGlobalScope::logExceptionToConsole): (WebCore::WorkletGlobalScope::addConsoleMessage): (WebCore::WorkletGlobalScope::addMessage): * worklets/WorkletGlobalScope.h: (WebCore::WorkletGlobalScope::script): (WebCore::WorkletGlobalScope::responsibleDocument): (WebCore::WorkletGlobalScope::responsibleDocument const): (WebCore::WorkletGlobalScope::identifier const): Deleted. (WebCore::WorkletGlobalScope::responsableDocument): Deleted. (WebCore::WorkletGlobalScope::responsableDocument const): Deleted. * worklets/WorkletScriptController.cpp: (WebCore::WorkletScriptController::~WorkletScriptController): (WebCore::WorkletScriptController::disableEval): (WebCore::WorkletScriptController::disableWebAssembly): (WebCore::WorkletScriptController::initScript): 2018-11-29 Alexey Proskuryakov <ap@apple.com> Modernize the check for kCFURLRequestContentDecoderSkipURLCheck existence https://bugs.webkit.org/show_bug.cgi?id=192041 Reviewed by Tim Horton. * loader/ResourceLoaderOptions.h: Added a FIXME for poor naming of loader options. There is a lot of code that needs to be cleaned up here. * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded): 2018-11-29 Youenn Fablet <youenn@apple.com> Updating a service worker during a navigation load sometimes makes the load fail https://bugs.webkit.org/show_bug.cgi?id=191986 <rdar://problem/46259790> Reviewed by Chris Dumez. Previously, we were registering a document as service worker client at creation of the document. According the service worker spec, this should be done when handling the fetch event of the corresponding navigation load. This ensures that the service worker will have a client and will not get updated in the middle of the navigation load. At navigation load start, we do not have a document yet since it is created when receiving the first bytes. Instead, we register a temporary document when starting the navigation load and unregister it when the real document is registered. Test: imported/w3c/web-platform-tests/service-workers/service-worker/update-on-navigation.https.html * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::commitData): (WebCore::DocumentLoader::registerTemporaryServiceWorkerClient): (WebCore::DocumentLoader::unregisterTemporaryServiceWorkerClient): (WebCore::DocumentLoader::loadMainResource): (WebCore::DocumentLoader::clearMainResource): * loader/DocumentLoader.h: 2018-11-29 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238678. Breaks internal builds. Reverted changeset: "Move Lookup Code for better cross platform usage" https://bugs.webkit.org/show_bug.cgi?id=191732 https://trac.webkit.org/changeset/238678 2018-11-29 Youenn Fablet <youenn@apple.com> A sender created through addTransceiver and populated using addTrack should have its source set https://bugs.webkit.org/show_bug.cgi?id=192136 Reviewed by Eric Carlson. In case libwebrtc backend is already created, we need to make sure to set the track source to the libwebrtc sender backend that is actually tied to the sender. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: 2018-11-29 Megan Gardner <megan_gardner@apple.com> Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-29 Sihui Liu <sihui_liu@apple.com> IndexedDB: breaks if binary data (Uint8Array) and autoIncrement key in store https://bugs.webkit.org/show_bug.cgi?id=185869 <rdar://problem/40453623> Reviewed by Geoffrey Garen. lexicalGlobalObject is casted to JSDOMGlobalObject in CloneSerializer::dumpArrayBufferView, so we should use JSDOMGlobalObject instead of JSGlobalObject in IDB database thread. Covered by modified test: storage/indexeddb/objectstore-autoincrement.html * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadVM): (WebCore::IDBServer::UniqueIDBDatabase::databaseThreadExecState): * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::create): * bindings/js/JSDOMGlobalObject.h: * bindings/js/JSDOMWrapper.cpp: (WebCore::JSDOMObject::JSDOMObject): 2018-11-29 Sihui Liu <sihui_liu@apple.com> Unexpected constructor / instanceof behavior when retrieving indexedDB data in an iframe https://bugs.webkit.org/show_bug.cgi?id=185906 <rdar://problem/40583100> Reviewed by Geoffrey Garen. ScriptExecutionContext::execState() returned state of main frame, so deserialization of IDBValue in iframe used constructors of main frame, which is wrong. Test: storage/indexeddb/instanceof-iframe.html * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::execState): 2018-11-29 Don Olmstead <don.olmstead@sony.com> Make generic ScrollAnimator https://bugs.webkit.org/show_bug.cgi?id=192128 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Moves ScrollAnimatorGtk into ScrollAnimatorGeneric where it can be used by other implementations. Fixed some compilation issues around using this as a default implementation. Removing ScrollAnimatorSmooth since it is dead code and doesn't even compile at this time. Fixing a compilation issue within LowPowerModeNotifierGLib implementation that appeared due to unified sources changes. * PlatformGTK.cmake: * SourcesGTK.txt: * platform/LowPowerModeNotifier.h: * platform/PlatformWheelEvent.h: (WebCore::PlatformWheelEvent::swipeVelocity const): * platform/ScrollAnimatorSmooth.cpp: Removed. * platform/ScrollAnimatorSmooth.h: Removed. * platform/generic/ScrollAnimatorGeneric.cpp: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.cpp. (WebCore::ScrollAnimator::create): (WebCore::ScrollAnimatorGeneric::ScrollAnimatorGeneric): (WebCore::ScrollAnimatorGeneric::ensureSmoothScrollingAnimation): (WebCore::ScrollAnimatorGeneric::scroll): (WebCore::ScrollAnimatorGeneric::scrollToOffsetWithoutAnimation): (WebCore::ScrollAnimatorGeneric::computeVelocity): (WebCore::ScrollAnimatorGeneric::handleWheelEvent): (WebCore::ScrollAnimatorGeneric::willEndLiveResize): (WebCore::ScrollAnimatorGeneric::updatePosition): (WebCore::ScrollAnimatorGeneric::didAddVerticalScrollbar): (WebCore::ScrollAnimatorGeneric::didAddHorizontalScrollbar): (WebCore::ScrollAnimatorGeneric::willRemoveVerticalScrollbar): (WebCore::ScrollAnimatorGeneric::willRemoveHorizontalScrollbar): (WebCore::ScrollAnimatorGeneric::updateOverlayScrollbarsOpacity): (WebCore::ScrollAnimatorGeneric::overlayScrollbarAnimationTimerFired): (WebCore::ScrollAnimatorGeneric::showOverlayScrollbars): (WebCore::ScrollAnimatorGeneric::hideOverlayScrollbars): (WebCore::ScrollAnimatorGeneric::mouseEnteredContentArea): (WebCore::ScrollAnimatorGeneric::mouseExitedContentArea): (WebCore::ScrollAnimatorGeneric::mouseMovedInContentArea): (WebCore::ScrollAnimatorGeneric::contentAreaDidShow): (WebCore::ScrollAnimatorGeneric::contentAreaDidHide): (WebCore::ScrollAnimatorGeneric::notifyContentAreaScrolled): (WebCore::ScrollAnimatorGeneric::lockOverlayScrollbarStateToHidden): * platform/generic/ScrollAnimatorGeneric.h: Renamed from Source/WebCore/platform/gtk/ScrollAnimatorGtk.h. * platform/glib/LowPowerModeNotifierGLib.cpp: * platform/gtk/PlatformWheelEventGtk.cpp: (WebCore::PlatformWheelEvent::swipeVelocity const): Deleted. 2018-11-28 Dean Jackson <dino@apple.com> [ES Modules] Allow .mjs content when loaded from file:// https://bugs.webkit.org/show_bug.cgi?id=192100 <rdar://problem/46320065> Reviewed by Sam Weinig. Node JS requires ES Module files to be identified by the file extension of ".mjs" (no relation to Maciej Stachowiak). This new extension causes issues because it isn't recognised as a JavaScript file. When using the script tag, the author is able to force the type of the referenced file using an attribute, but this isn't possible for the import() function or import statement. Add a new entry into our table that maps file extensions to MIME types so that when a .mjs file is loaded from a file:// reference it is identified as JavaScript. Test: js/dom/modules/import-mjs-module.html * platform/network/mac/WebCoreURLResponse.mm: Add .mjs to the existing dictionary. (WebCore::createExtensionToMIMETypeMap): * platform/network/ios/WebCoreURLResponseIOS.mm: Add code just for .mjs. (WebCore::createExtensionToMIMETypeMap): 2018-11-29 Zalan Bujtas <zalan@apple.com> [LFC][BFC][Quirk] Width does not need stretching quirk. https://bugs.webkit.org/show_bug.cgi?id=192135 Reviewed by Antti Koivisto. In BFC the block box's width (auto) always streches to the content width of the containing block. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): * layout/blockformatting/BlockFormattingContextQuirks.cpp: (WebCore::Layout::BlockFormattingContext::Quirks::needsStretching): (WebCore::Layout::BlockFormattingContext::Quirks::isStretchedToInitialContainingBlock): Deleted. (WebCore::Layout::BlockFormattingContext::Quirks::stretchedWidth): Deleted. 2018-11-29 Zalan Bujtas <zalan@apple.com> [LFC][Quirk] Move quirk functions to dedicated classes. https://bugs.webkit.org/show_bug.cgi?id=192133 Reviewed by Antti Koivisto. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::initialContainingBlock): Deleted. (WebCore::Layout::isStretchedToInitialContainingBlock): Deleted. (WebCore::Layout::stretchHeightToInitialContainingBlockQuirk): Deleted. (WebCore::Layout::stretchWidthToInitialContainingBlock): Deleted. * layout/blockformatting/BlockFormattingState.cpp: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): (WebCore::Layout::isQuirkContainer): Deleted. (WebCore::Layout::hasMarginTopQuirkValue): Deleted. (WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): Deleted. (WebCore::Layout::isMarginTopCollapsedWithParent): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: * layout/inlineformatting/text/TextUtil.h: 2018-11-29 Rob Buis <rbuis@igalia.com> Remove some superfluous code in ContentSecurityPolicy::upgradeInsecureRequestIfNeeded https://bugs.webkit.org/show_bug.cgi?id=192076 Reviewed by Frédéric Wang. Since we do an early return if the protocol is not http or ws, the if check for ws protocol and else statement are not needed, so use an ASSERT instead. * page/csp/ContentSecurityPolicy.cpp: (WebCore::ContentSecurityPolicy::upgradeInsecureRequestIfNeeded const): 2018-11-29 Frederic Wang <fwang@igalia.com> Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry https://bugs.webkit.org/show_bug.cgi?id=172914 Reviewed by Simon Fraser. This patch adds a ParentRelativeScrollableRect ScrollingCoordinator::ScrollingGeometry and the corresponding set/get/dump APIs. Currently, the setter is never used so the behavior is unchanged. In the future, this rect will be used for hit testing of subframes during asynchronous macOS scrolling (but 172917). No new tests, behavior unchanged. * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): * page/scrolling/ScrollingCoordinator.h: * page/scrolling/ScrollingStateScrollingNode.cpp: (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect): (WebCore::ScrollingStateScrollingNode::dumpProperties const): * page/scrolling/ScrollingStateScrollingNode.h: (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const): * page/scrolling/ScrollingTreeScrollingNode.cpp: (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren): (WebCore::ScrollingTreeScrollingNode::dumpProperties const): * page/scrolling/ScrollingTreeScrollingNode.h: (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const): 2018-11-28 Wenson Hsieh <wenson_hsieh@apple.com> [iOSMac] Dropping text selections from web content into editable elements crashes the web process https://bugs.webkit.org/show_bug.cgi?id=192113 <rdar://problem/46323701> Reviewed by Ryosuke Niwa. In iOSMac, registering invalid UTIs on NSItemProvider when starting a drag or handling a drop does not work. Since iOS writes and reads only "Apple Web Archive pasteboard type" (a.k.a. `WebArchivePboardType`) during drag and drop as well as copy and paste, we fail to read or write any web archive data, and subsequently fall back to reading RTF or flat RTFD, both of which are not supported in iOSMac, since UIFoundation links against the system's macOS WebKit stack. To fix this, we add support for reading and writing com.apple.webarchive (`kUTTypeWebArchive`) on iOS, so that WebKit-based iOSMac applications can understand web archive data from the host running macOS, and the host can also understand web archive data written by the iOSMac app. Additionally, don't allow reading RTF and flat RTFD as web content in iOSMac. (Note that writing RTF and flat RTFD is still safe, since it does not depend on UIFoundation.framework but rather `WebCore::HTMLConverter`). Test: DragAndDropTests.ModernWebArchiveType * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragment): Additionally make sure that we never call into UIFoundation's NSAttributedString to markup conversion codepath by making `createFragment` an empty stub on iOSMac. * platform/ios/PasteboardIOS.mm: (WebCore::supportedImageTypes): (WebCore::isTypeAllowedByReadingPolicy): (WebCore::Pasteboard::readPasteboardWebContentDataForType): (WebCore::Pasteboard::supportedWebContentPasteboardTypes): * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::write): 2018-11-28 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r238653 and r238656. https://bugs.webkit.org/show_bug.cgi?id=192130 Breaks iOS build (Requested by smfr on #webkit). Reverted changesets: "Move Lookup Code for better cross platform usage" https://bugs.webkit.org/show_bug.cgi?id=191732 https://trac.webkit.org/changeset/238653 "Attempt to fix the iOS build by only including RevealSPI.h when it's needed." https://trac.webkit.org/changeset/238656 2018-11-28 Simon Fraser <simon.fraser@apple.com> Attempt to fix the iOS build by only including RevealSPI.h when it's needed. * editing/cocoa/DictionaryLookup.mm: 2018-11-28 Alex Christensen <achristensen@webkit.org> Modernize BlobRegistry::writeBlobsToTemporaryFiles https://bugs.webkit.org/show_bug.cgi?id=192117 Reviewed by Dean Jackson. No change in behavior. Just use CompletionHandlers and the new sendWithAsyncReply instead of two way messaging and manual completion handler management. * bindings/js/SerializedScriptValue.cpp: (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB): * platform/network/BlobRegistry.h: * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles): * platform/network/BlobRegistryImpl.h: 2018-11-15 Megan Gardner <megan_gardner@apple.com> Move Lookup Code for better cross platform usage https://bugs.webkit.org/show_bug.cgi?id=191732 Reviewed by Alex Christensen. Not currenlty testable DictionaryLookup uses Reveal now, which is slated to be cross-platform. That patch gates the parts of DictionaryLookup that currently do not have an available implementation on iOS. Once Reveal is ready, this code will be replaced or expanded upon, as appropriate. * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-28 Christopher Reid <chris.reid@sony.com> SQLiteDatabase::open is constantly printing "SQLite database failed to checkpoint: database table is locked" errors https://bugs.webkit.org/show_bug.cgi?id=192111 Reviewed by Alex Christensen. Ensure the journal_mode=WAL statement is finalized before wal_checkpoint is executed. * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): 2018-11-28 Said Abou-Hallawa <sabouhallawa@apple.com> Updating href on linearGradient and radialGradient doesn't update its rendering https://bugs.webkit.org/show_bug.cgi?id=191934 Reviewed by Ryosuke Niwa. Mark the gradient renderer for repaint when the value of the 'href' attribute changes. Tests: fast/shadow-dom/svg-linear-gradient-dynamic-update-href-in-shadow-tree.html fast/shadow-dom/svg-radial-gradient-dynamic-update-href-in-shadow-tree.html svg/dynamic-updates/SVGLinearGradientElement-svgdom-href-prop.html svg/dynamic-updates/SVGRadialGradientElement-svgdom-href-prop.html * svg/SVGGradientElement.cpp: (WebCore::SVGGradientElement::svgAttributeChanged): 2018-11-28 Youenn Fablet <youenn@apple.com> imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-transceivers.https.html is flaky on iOS simulator https://bugs.webkit.org/show_bug.cgi?id=192037 Reviewed by Eric Carlson. The stats report JS map should be created when resolving the stats promise with WebCore RTCStatsReport. But resolving the promise might fail in case of a page being suspended. In that case, no JSRTCStatsReport is created and there is no backing map. Update the code to reflect that. Covered by existing test. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::getStats): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector): (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: 2018-11-28 Keith Rollin <krollin@apple.com> Update generate-{derived,unified}-sources scripts to support generating .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=192031 <rdar://problem/46286816> Reviewed by Alex Christensen. The Generate Derived Sources and Generate Unified Sources build phases in Xcode need to have their inputs and outputs specified. This specification will come in the form of .xcfilelist files that will be attached to these build phases. There is one .xcfilelist file that lists the input file and one that lists the output files. As part of this work, the various generate-{derived,unified}-sources scripts that are executed in these Generate build phases are modified to help in the creation of these .xcfilelist files. In particular, they can now be invoked with command-line parameters. These parameters are then used to alter the normal execution of these scripts, causing them to produce the .xcfilelist files as opposed to actually generating the files that are listed in those files. No new tests -- no changed functionality. * Scripts/generate-derived-sources.sh: * Scripts/generate-unified-sources.sh: 2018-11-28 Keith Rollin <krollin@apple.com> Revert print_all_generated_files work in r238008; tighten up target specifications https://bugs.webkit.org/show_bug.cgi?id=192025 <rdar://problem/46284301> Reviewed by Alex Christensen. In r238008, I added a facility for DerivedSources.make makefiles to print out the list of files that they generate. This output was used in the generation of .xcfilelist files used to specify the output of the associated Generate Derived Sources build phases in Xcode. This approach worked, but it meant that people would need to follow a specific convention to keep this mechanism working. Instead of continuing this approach, I'm going to implement a new facility based on the output of `make` when passed the -d flag (which prints dependency information). This new mechanism is completely automatic and doesn't need maintainers to follow a convention. To that end, remove most of the work performed in r238008 that supports the print_all_generated_files target. At the same time, it's important for the sets of targets and their dependencies to be complete and correct. Therefore, also include changes to bring those up-to-date. As part of that, you'll see prevalent use of a particular technique. Here's an example: BYTECODE_FILES = \ Bytecodes.h \ BytecodeIndices.h \ BytecodeStructs.h \ InitBytecodes.asm \ # BYTECODE_FILES_PATTERNS = $(subst .,%,$(BYTECODE_FILES)) all : $(BYTECODE_FILES) $(BYTECODE_FILES_PATTERNS): $(wildcard $(JavaScriptCore)/generator/*.rb) $(JavaScriptCore)/bytecode/BytecodeList.rb ... These lines indicate a set of generated files (those specified in BYTECODE_FILES). These files are generated by the BytecodeList.rb tool. But, as opposed to the normal rule where a single foo.output is generated by foo.input plus some additional dependencies, this rule produces multiple output files from a tool whose connection to the output files is not immediately clear. A special approach is needed where a single rule produces multiple output files. The normal way to implement this is to use an .INTERMEDIATE target. However, we used this approach in the past and ran into a problem with it, addressing it with an alternate approach in r210507. The above example shows this approach. The .'s in the list of target files are replaced with %'s, and the result is used as the left side of the dependency rule. No new tests -- no changed functionality. * DerivedSources.make: 2018-11-28 Alex Christensen <achristensen@webkit.org> Remove dead code from an earlier attempt at implementing safe browsing https://bugs.webkit.org/show_bug.cgi?id=192067 Reviewed by Chris Dumez. * WebCore.xcodeproj/project.pbxproj: * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck): Deleted. (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck): Deleted. * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadArchive): (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadPostRequest): * loader/FrameLoader.h: (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadWithNavigationAction): * loader/FrameLoaderClient.h: * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/PolicyChecker.h: * loader/ShouldSkipSafeBrowsingCheck.h: Removed. 2018-11-28 Alex Christensen <achristensen@webkit.org> Add SessionIDs wherever BlobURLs are used in SerializedScriptValue https://bugs.webkit.org/show_bug.cgi?id=192062 Reviewed by Dean Jackson. Just adding infrastructure for fixing "the blob bug" * Modules/indexeddb/IDBDatabaseIdentifier.cpp: (WebCore::IDBDatabaseIdentifier::IDBDatabaseIdentifier): (WebCore::IDBDatabaseIdentifier::isolatedCopy const): * Modules/indexeddb/IDBDatabaseIdentifier.h: (WebCore::IDBDatabaseIdentifier::hash const): (WebCore::IDBDatabaseIdentifier::sessionID const): (WebCore::IDBDatabaseIdentifier::encode const): (WebCore::IDBDatabaseIdentifier::decode): * Modules/indexeddb/IDBFactory.cpp: (WebCore::IDBFactory::openInternal): (WebCore::IDBFactory::deleteDatabase): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::putOrAddOnServer): * Modules/indexeddb/IDBValue.cpp: (WebCore::IDBValue::IDBValue): (WebCore::IDBValue::setAsIsolatedCopy): * Modules/indexeddb/IDBValue.h: (WebCore::IDBValue::sessionID const): (WebCore::IDBValue::encode const): (WebCore::IDBValue::decode): * Modules/indexeddb/server/MemoryIndexCursor.cpp: (WebCore::IDBServer::MemoryIndexCursor::currentData): * Modules/indexeddb/server/MemoryObjectStoreCursor.cpp: (WebCore::IDBServer::MemoryObjectStoreCursor::currentData): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::internalFetchNextRecord): * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd): * bindings/js/IDBBindingUtilities.cpp: (WebCore::deserializeIDBValueToJSValue): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::serialize): (WebCore::CloneSerializer::CloneSerializer): (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::deserialize): (WebCore::CloneDeserializer::CloneDeserializer): (WebCore::SerializedScriptValue::SerializedScriptValue): (WebCore::SerializedScriptValue::create): (WebCore::SerializedScriptValue::deserialize): (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDB): (WebCore::SerializedScriptValue::writeBlobsToDiskForIndexedDBSynchronously): * bindings/js/SerializedScriptValue.h: (WebCore::SerializedScriptValue::sessionID const): 2018-11-28 Justin Fan <justin_fan@apple.com> [WebGPU] Begin implementation of WebGPURenderPassEncoder and barebones WebGPURenderPassDescriptor https://bugs.webkit.org/show_bug.cgi?id=191990 Reviewed by Dean Jackson. Begin implementation of WebGPURenderPassEncoder and its parent interface, WebGPUProgrammablePassEncoder. Also add code to allow creation of a primitive WebGPURenderPassDescriptor with the sole purpose of providing a WebGPUTextureView reference to the render pass creation function, WebGPUCommandBuffer::beginRenderPass(). Test: webgpu/render-passes.html * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/WebGPUCommandBuffer.cpp: (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): (WebCore::WebGPUCommandBuffer::beginRenderPass): Added. Returns a WebGPURenderPassEncoder upon success. * Modules/webgpu/WebGPUCommandBuffer.h: * Modules/webgpu/WebGPUCommandBuffer.idl: * Modules/webgpu/WebGPUProgrammablePassEncoder.cpp: Added. * Modules/webgpu/WebGPUProgrammablePassEncoder.h: Added. * Modules/webgpu/WebGPUProgrammablePassEncoder.idl: Added. Empty (for now) interface parenting WebGPURenderPassEncoder. * Modules/webgpu/WebGPURenderPassDescriptor.h: * Modules/webgpu/WebGPURenderPassDescriptor.idl: Added. Directly handles a WebGPUTextureView attachment; all other color attachment properties set by implementation for now. * Modules/webgpu/WebGPURenderPassEncoder.cpp: Added. (WebCore::WebGPURenderPassEncoder::create): (WebCore::WebGPURenderPassEncoder::WebGPURenderPassEncoder): (WebCore::WebGPURenderPassEncoder::passEncoder const): * Modules/webgpu/WebGPURenderPassEncoder.h: Added. Interface to GPURenderPassEncoder. * Modules/webgpu/WebGPURenderPassEncoder.idl: Added. Allows WebGPU developer to encode commands for the WebGPUCommandBuffer. * Modules/webgpu/WebGPUTextureView.cpp: (WebCore::WebGPUTextureView::WebGPUTextureView): * Modules/webgpu/WebGPUTextureView.h: (WebCore::WebGPUTextureView::texture): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * platform/graphics/gpu/GPUCommandBuffer.h: (WebCore::GPUCommandBuffer::platformCommandBuffer const): * platform/graphics/gpu/GPUProgrammablePassEncoder.h: Added. Base class for GPURenderPassEncoder. * platform/graphics/gpu/GPURenderPassDescriptor.h: Added. * platform/graphics/gpu/GPURenderPassEncoder.h: Added. Wrapper class for MTLRenderCommandEncoder. * platform/graphics/gpu/GPUTexture.h: (WebCore::GPUTexture::platformTexture const): * platform/graphics/gpu/cocoa/GPUProgrammablePassEncoderMetal.mm: Added. * platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm: Added. (WebCore::GPURenderPassEncoder::create): Creates the backing MTLRenderCommandEncoder; returns null if this fails. (WebCore::GPURenderPassEncoder::GPURenderPassEncoder): (WebCore::GPURenderPassEncoder::~GPURenderPassEncoder): End encoding before destroying the MTLCommandEncoder to prevent an exception. (WebCore::GPURenderPassEncoder::platformPassEncoder const): 2018-11-28 Rob Buis <rbuis@igalia.com> [XHR] Document.lastModified doesn't work for non-rendered documents https://bugs.webkit.org/show_bug.cgi?id=179375 Reviewed by Alexey Proskuryakov. Add setOverrideLastModified to override last modified date for standalone Documents. Behavior matches Firefox and Chrome. Test: web-platform-tests/xhr/responsexml-document-properties.htm * dom/Document.cpp: (WebCore::Document::overrideLastModified): (WebCore::Document::lastModified const): no need to test m_frame since that's already done in loader(). (WebCore::Document::lastModified): Deleted. * dom/Document.h: * xml/XMLHttpRequest.cpp: 2018-11-28 Yongjun Zhang <yongjun_zhang@apple.com> Allow WebKit clients to specify a minimum effective width for layout. https://bugs.webkit.org/show_bug.cgi?id=191499 <rdar://problem/45362678> Reviewed by Wenson Hsieh. If we ignore the meta viewport (_shouldIgnoreMetaViewport is true), the default layout width will be device width. For clients that wish to lay out the content with a different width value, we would need to add a way to specify the effective width for layout. Tests: fast/viewport/ios/ipad/viewport-overriden-by-minimum-effective-width-if-ignore-meta-viewport.html fast/viewport/ios/ipad/viewport-unchanged-by-minimum-effective-width-if-not-ignore-meta-viewport.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::setViewLayoutSize): Add a new argument effectiveWidth. (WebCore::ViewportConfiguration::nativeWebpageParameters): Make sure minimumScale for nativeWebpageParameters is small enough so that it won't clamp out the initial scale. If content is wider than the viewport, this ensures we can still zoom out the page. (WebCore::ViewportConfiguration::updateConfiguration): update _minimumEffectiveDeviceWidth and apply that to the layout size scale computation. (WebCore::ViewportConfiguration::effectiveLayoutSizeScaleFactor): A helper method to return the effective layout scale factor which is also effected by _minimumEffectiveDeviceWidth. (WebCore::ViewportConfiguration::updateMinimumLayoutSize): Update m_minimumLayoutSize based on effectiveLayoutSizeScaleFactor(). (WebCore::ViewportConfiguration::description const): Also dump m_minimumEffectiveDeviceWidth. * page/ViewportConfiguration.h: Add a member variable m_minimumEffectiveDeviceWidth. 2018-11-28 Stephan Szabo <stephan.szabo@sony.com> Make generic EventHandler methods https://bugs.webkit.org/show_bug.cgi?id=192032 Reviewed by Michael Catanzaro. No new tests. No new behavior. Move mostly generic for non-Apple platform implementations of methods from EventHandlerGlib into EventHandler. Two of these also had different Windows implementations, so to limit behavior change from this, those are currently overridden for Windows as well as Mac and IOS. * page/EventHandler.cpp: (WebCore::EventHandler::passMousePressEventToSubframe): (WebCore::EventHandler::passMouseReleaseEventToSubframe): (WebCore::EventHandler::widgetDidHandleWheelEvent): (WebCore::EventHandler::tabsToAllFormControls const): (WebCore::EventHandler::passWidgetMouseDownEventToWidget): (WebCore::EventHandler::passMouseDownEventToWidget): (WebCore::EventHandler::focusDocumentView): (WebCore::EventHandler::eventActivatedView const): (WebCore::EventHandler::passMouseMoveEventToSubframe): * page/win/EventHandlerWin.cpp: (WebCore::EventHandler::passMouseMoveEventToSubframe): (WebCore::EventHandler::passMousePressEventToSubframe): Deleted. (WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted. (WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted. (WebCore::EventHandler::tabsToAllFormControls const): Deleted. (WebCore::EventHandler::focusDocumentView): Deleted. (WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted. (WebCore::EventHandler::accessKeyModifiers): Deleted. * platform/glib/EventHandlerGLib.cpp: (WebCore::EventHandler::tabsToAllFormControls const): Deleted. (WebCore::EventHandler::focusDocumentView): Deleted. (WebCore::EventHandler::passWidgetMouseDownEventToWidget): Deleted. (WebCore::EventHandler::passMouseDownEventToWidget): Deleted. (WebCore::EventHandler::eventActivatedView const): Deleted. (WebCore::EventHandler::widgetDidHandleWheelEvent): Deleted. (WebCore::EventHandler::passMousePressEventToSubframe): Deleted. (WebCore::EventHandler::passMouseMoveEventToSubframe): Deleted. (WebCore::EventHandler::passMouseReleaseEventToSubframe): Deleted. (WebCore::EventHandler::accessKeyModifiers): Deleted. 2018-11-28 Zalan Bujtas <zalan@apple.com> [LFC][Quirk] Use non-collapsed vertical margin values when the container is stretched to the size of the ICB. https://bugs.webkit.org/show_bug.cgi?id=192078 Reviewed by Antti Koivisto. This quirk happens when the body height is 0 which means its vertical margins collapse through (top and bottom margins are adjoining). However now that we stretch the body they don't collapse through anymore, so we need to use the non-collapsed values instead. * layout/LayoutUnits.h: (WebCore::Layout::HeightAndMargin::usedMarginValues const): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::stretchHeightToInitialContainingBlock): 2018-11-28 Zalan Bujtas <zalan@apple.com> [LFC] Add support for quirk container's collapsing top margin in quirks mode. https://bugs.webkit.org/show_bug.cgi?id=192070 Reviewed by Antti Koivisto. In quirk mode when the top margin collapsing is computed for a quirk container (body, table cell) and the canditate margin value is also a quirk value, we just ignore it. * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isQuirkContainer): (WebCore::Layout::hasMarginTopQuirkValue): (WebCore::Layout::shouldIgnoreMarginTopInQuirkContext): (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::isTableCell const): 2018-11-28 Ali Juma <ajuma@chromium.org> Intersection Observer: rootMargin: '' gives weird results https://bugs.webkit.org/show_bug.cgi?id=191975 Reviewed by Simon Fraser. When converting the rootMargin string into a LengthBox, explicitly construct a Length of size 0px for each dimension, instead of using Length's default constructor. The default constructor creates a Length with value Auto, which causes us to incorrectly apply a non-zero rootMargin. Test: imported/w3c/web-platform-tests/intersection-observer/empty-root-margin.html * page/IntersectionObserver.cpp: (WebCore::parseRootMargin): 2018-11-28 Thibault Saunier <tsaunier@igalia.com> [WebRTC][GStreamer] Make sure to have the default microphone on the top of the list https://bugs.webkit.org/show_bug.cgi?id=192026 Reviewed by Philippe Normand. Otherwise we might end up picking a useless one in some applications (not sure what those application do though). GStreamer patch proposed as https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/merge_requests/34/diffs * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: (WebCore::sortDevices): (WebCore::GStreamerCaptureDeviceManager::addDevice): (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices): * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: 2018-11-28 Thibault Saunier <tsaunier@igalia.com> [WebRTC][GStreamer] Tag all cameras with as 'Unknown' facing mode https://bugs.webkit.org/show_bug.cgi?id=192028 Reviewed by Philippe Normand. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::capabilities): 2018-11-28 Thibault Saunier <tsaunier@igalia.com> [WebRTC][GStreamer] Use a GUniquePtr to hold the GstAudioConverter in our OutgoingAudioSource https://bugs.webkit.org/show_bug.cgi?id=192027 Reviewed by Xabier Rodriguez-Calvar. Cleaning up a bit the code. It is a minor refactoring, no new test required. * platform/graphics/gstreamer/GUniquePtrGStreamer.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: 2018-11-28 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Do not run device monitor for device type we do not handle https://bugs.webkit.org/show_bug.cgi?id=191904 This is useless work and it throws warning about use GstDeviceMonitor without filters. Reviewed by Philippe Normand. * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp: (WebCore::GStreamerCaptureDeviceManager::refreshCaptureDevices): 2018-11-27 Rob Buis <rbuis@igalia.com> Block more ports (427, 548, 6697) https://bugs.webkit.org/show_bug.cgi?id=186092 Reviewed by Frédéric Wang. Block port 427, ports 548 and 6697 are aleady blocked and are tested by the updated request-bad-port.html wpt test. Behavior matches Firefox and Chrome. Test: web-platform-tests/fetch/api/request/request-bad-port.html * platform/URL.cpp: (WebCore::portAllowed): 2018-11-27 Youenn Fablet <youenn@apple.com> Log WebRTC stats in inspector console only when setting is verbose https://bugs.webkit.org/show_bug.cgi?id=192014 Reviewed by Eric Carlson. Add a WebRTCStats channel that is used by default to output WebRTC stats in console. When WebRTC Debug logging is enabled, log WebRTC stats in WebRTC channel, so that they appear as debug information in Web Inspector. No change of JS behavior. Covered by manually testing what is logged in inspector and console. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): * platform/Logging.h: 2018-11-27 Simon Fraser <simon.fraser@apple.com> Fix the mis-spelled "m_clienstWaitingForAsyncDecoding" https://bugs.webkit.org/show_bug.cgi?id=192060 Reviewed by Wenson Hsieh. Fix the mis-spelling of "m_clienstWaitingForAsyncDecoding". * loader/cache/CachedImage.cpp: (WebCore::CachedImage::didRemoveClient): (WebCore::CachedImage::isClientWaitingForAsyncDecoding const): (WebCore::CachedImage::addClientWaitingForAsyncDecoding): (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding): (WebCore::CachedImage::allClientsRemoved): (WebCore::CachedImage::clear): (WebCore::CachedImage::createImage): (WebCore::CachedImage::imageFrameAvailable): * loader/cache/CachedImage.h: 2018-11-27 Mark Lam <mark.lam@apple.com> ENABLE_FAST_JIT_PERMISSIONS should be false for iosmac. https://bugs.webkit.org/show_bug.cgi?id=192055 <rdar://problem/46288783> Reviewed by Saam Barati. No new tests needed. Removing an invalid configuration that is not used in WebCore. * Configurations/FeatureDefines.xcconfig: 2018-11-27 Jiewen Tan <jiewen_tan@apple.com> Remove kCCNotVerified https://bugs.webkit.org/show_bug.cgi?id=192034 <rdar://problem/46235863> Reviewed by Alexey Proskuryakov. No change of behaviours. * crypto/CommonCryptoUtilities.h: * crypto/mac/CryptoAlgorithmRSASSA_PKCS1_v1_5Mac.cpp: (WebCore::verifyRSASSA_PKCS1_v1_5): 2018-11-27 Simon Fraser <simon.fraser@apple.com> Avoid triggering compositing updates when only the root layer is composited https://bugs.webkit.org/show_bug.cgi?id=191813 Reviewed by Zalan Bujtas. If we know that the only composited layer is the root, we can avoid triggering deep compositing updates sometimes, for example when layout changes size or position, or when z-order lists change. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant() flag to cut off descendants traversal when possible. (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-27 Eric Carlson <eric.carlson@apple.com> Refactor duplicate code for calling into media controls https://bugs.webkit.org/show_bug.cgi?id=192040 <rdar://problem/46278931> Reviewed by Youenn Fablet. No new tests, no functional change. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setupAndCallJS): (WebCore::HTMLMediaElement::updateCaptionContainer): (WebCore::HTMLMediaElement::configureTextTrackDisplay): (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): (WebCore::HTMLMediaElement::setControllerJSProperty): (WebCore::HTMLMediaElement::didAddUserAgentShadowRoot): (WebCore::HTMLMediaElement::updateMediaControlsAfterPresentationModeChange): (WebCore::HTMLMediaElement::getCurrentMediaControlsStatus): * html/HTMLMediaElement.h: 2018-11-27 Simon Fraser <simon.fraser@apple.com> Momentum scrolling ends at the wrong place when a scrolling overflow element has a non-zero border https://bugs.webkit.org/show_bug.cgi?id=191322 Reviewed by Dean Jackson. The scrolling momentum logic in ScrollController::handleWheelEvent() which computes whether the scroll is pinned to the end makes use of ScrollableArea::visibleContentRect(). RenderLayer's implementation of this was incorrect when the layer's element had borders, causing the momentum scroll to stop early. Fix by using the correct size (visible size, not layer size). Test: fast/scrolling/momentum-scroll-with-borders.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::visibleContentRectInternal const): 2018-11-27 Simon Fraser <simon.fraser@apple.com> Composited and tiled layers fail to update on scrolling in WebView https://bugs.webkit.org/show_bug.cgi?id=191821 rdar://problem/46009272 Reviewed by Zalan Bujtas. We relied on AppKit calling -[NSView viewWillDraw] on scrolling to trigger compositing layer flushes which are necessary to update backing store attachment, and tile coverage for tiled layers. However, we no longer get these reliably in WebView, so explicitly trigger flushes if necessary from FrameView::scrollOffsetChangedViaPlatformWidgetImpl(). didChangeVisibleRect() is the same code path used by iOS UIWebView for the same purpose. Tests: compositing/backing/backing-store-attachment-scroll.html compositing/tiling/tile-coverage-on-scroll.html * page/FrameView.cpp: (WebCore::FrameView::scrollOffsetChangedViaPlatformWidgetImpl): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateCoverage): 2018-11-27 Timothy Hatcher <timothy@apple.com> Web Inspector: Add support for forcing color scheme appearance in DOM tree. https://bugs.webkit.org/show_bug.cgi?id=191820 rdar://problem/46153172 Reviewed by Devin Rousso. Test: inspector/css/force-page-appearance.html * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::defaultAppearanceDidChangeImpl): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::defaultAppearanceDidChange): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::enable): Fire defaultAppearanceDidChange() on macOS Majave. (WebCore::InspectorPageAgent::disable): Call setForcedAppearance() with empty string. (WebCore::InspectorPageAgent::defaultAppearanceDidChange): Added. (WebCore::InspectorPageAgent::setForcedAppearance): Added. * inspector/agents/InspectorPageAgent.h: * page/Page.cpp: (WebCore::Page::setUseDarkAppearance): Call InspectorInstrumentation::defaultAppearanceDidChange(). (WebCore::Page::useDarkAppearance const): Return override value if not nullopt. (WebCore::Page::setUseDarkAppearanceOverride): Added. * page/Page.h: (WebCore::Page::defaultUseDarkAppearance const): Added. 2018-11-27 Tim Horton <timothy_horton@apple.com> Serialize and deserialize editable image strokes https://bugs.webkit.org/show_bug.cgi?id=192002 <rdar://problem/30900149> Reviewed by Dean Jackson. Test: editing/images/paste-editable-image.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::didFinishInsertingNode): (WebCore::HTMLImageElement::removedFromAncestor): (WebCore::HTMLImageElement::hasEditableImageAttribute const): (WebCore::HTMLImageElement::updateEditableImage): Call updateEditableImage() from didFinishInsertingNode instead of insertedIntoAncestor. This is helpful because it means we get the final, deduplicated attachment identifier instead of the original one when cloning or pasting. This also means that isConnected() is now always accurate when updateEditableImage() is called, so we can remove the argument that allowed us to lie from inside insertedIntoAncestor. * html/HTMLImageElement.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::isEditableImage const): Make use of hasEditableImage instead of separately checking for the attribute. 2018-11-16 Jiewen Tan <jiewen_tan@apple.com> Disallow loading webarchives as iframes https://bugs.webkit.org/show_bug.cgi?id=191728 <rdar://problem/45524528> Reviewed by Youenn Fablet. Disallow loading webarchives as iframes. We don't allow loading remote webarchives. Now, this policy is hardened to disallow loading webarchives as iframes for local documents as well. To allow old tests still be able to run, a flag is added to always allow loading local webarchives in document. The flag can be set via window.internals. Tests: webarchive/loading/test-loading-archive-subresource.html webarchive/loading/test-loading-top-archive.html * dom/Document.h: (WebCore::Document::setAlwaysAllowLocalWebarchive): (WebCore::Document::alwaysAllowLocalWebarchive): * loader/DocumentLoader.cpp: (WebCore::disallowWebArchive): (WebCore::DocumentLoader::continueAfterContentPolicy): (WebCore::isRemoteWebArchive): Deleted. * testing/Internals.cpp: (WebCore::Internals::setAlwaysAllowLocalWebarchive const): * testing/Internals.h: * testing/Internals.idl: 2018-11-27 Jer Noble <jer.noble@apple.com> Unregister CDMSessionMediaSourceAVFObjC for error notifications during destruction. https://bugs.webkit.org/show_bug.cgi?id=191985 <rdar://problem/45972018> Reviewed by Eric Carlson. * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.mm: (WebCore::CDMSessionMediaSourceAVFObjC::~CDMSessionMediaSourceAVFObjC): 2018-11-27 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Use LibWebRTC provided vp8 decoders and encoders https://bugs.webkit.org/show_bug.cgi?id=191861 The GStreamer implementations are less feature full and less tested, now that Apple also use the LibWebRTC provided implementations it makes a lot of sense for us to do the same. Basically everything related to temporal scalability is not implemented in GStreamer. We should make sure to use GStreamer elements on low powered platforms and for accelerated encoders and decoders. Reviewed by Philippe Normand. This is mostly refactoring, no new test required. * platform/graphics/gstreamer/GStreamerCommon.h: Added GstMappedFrame similar to GstMappedBuffer but for video frames. (WebCore::GstMappedFrame::GstMappedFrame): (WebCore::GstMappedFrame::get): (WebCore::GstMappedFrame::ComponentData): (WebCore::GstMappedFrame::ComponentStride): (WebCore::GstMappedFrame::info): (WebCore::GstMappedFrame::width): (WebCore::GstMappedFrame::height): (WebCore::GstMappedFrame::format): (WebCore::GstMappedFrame::~GstMappedFrame): (WebCore::GstMappedFrame::operator bool const): * platform/graphics/gstreamer/GUniquePtrGStreamer.h: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::GStreamerVideoFrameLibWebRTC::ToI420): Implemented support for converting frame formats with the GstVideoConverter API * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: (WebCore::GStreamerVideoDecoder::GstDecoderFactory): (WebCore::GStreamerVideoDecoder::HasGstDecoder): (WebCore::VP8Decoder::Create): Creates a `webrtc::LibvpxVp8Decoder()` if GStreamer decoder would be the LibVPX based one. (WebCore::GStreamerVideoDecoderFactory::CreateVideoDecoder): * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: (gst_webrtc_video_encoder_class_init): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Stop using vp8enc and use LibWebRTC based implementation (WebCore::GStreamerH264Encoder::GStreamerH264Encoder): Renamed H264Encoder to GStreamerH264Encoder to be more coherent with what is done in LibVPX (WebCore::GStreamerVP8Encoder::GStreamerVP8Encoder): Renamed VP8Encoder to GStreamerVP8Encoder to be more coherent with what is done in LibVPX (WebCore::GStreamerVideoEncoderFactory::CreateVideoEncoder): (WebCore::GStreamerVideoEncoderFactory::GetSupportedFormats const): 2018-11-27 Javier Fernandez <jfernandez@igalia.com> [css-grid] align-self center and position sticky don't work together https://bugs.webkit.org/show_bug.cgi?id=191963 Reviewed by Manuel Rego Casasnovas. This is a fix for a regression introduced in r515391, where we landed the implementation of alignment for positioned objects in a Grid Layout container. We assumed that items with non-static positions shouldn't honor the CSS Box Alignment properties. This is only true for out-of-flow items, absolute or fixed positioned elements. However, sticky positioned elements are treated as relative positioned items, but they indeed use non-static position to define their behavior. No new tests, this change is covered by current tests and make several cases to pass now. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::columnAxisPositionForChild const): (WebCore::RenderGrid::rowAxisPositionForChild const): 2018-11-26 Daniel Bates <dabates@apple.com> REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown https://bugs.webkit.org/show_bug.cgi?id=191969 <rdar://problem/46247569> Reviewed by Dean Jackson. Following r238078 we now support drawing the caps lock indicator in password fields on iOS. However it is not meaningful to show the caps lock indicator when the Strong Password button is visible because the password field is not editable. We should not paint the caps lock indicator when the Strong Password button is visible. Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-after-hiding-auto-fill-strong-password-button.html fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps lock indicator when the password field has the Strong Password button. (WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to update the visibility of the caps lock indicator when the auto fill button has changed. 2018-11-26 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238357. One of the layout tests added with this change is failing on Mojave. Reverted changeset: "REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown" https://bugs.webkit.org/show_bug.cgi?id=191969 https://trac.webkit.org/changeset/238513 2018-11-26 Tim Horton <timothy_horton@apple.com> Insert <attachment> elements under editable images to make their backing data accessible https://bugs.webkit.org/show_bug.cgi?id=191844 <rdar://problem/30900149> Reviewed by Simon Fraser. Test: editing/images/editable-image-creates-attachment.html * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::parseAttribute): (WebCore::HTMLImageElement::insertedIntoAncestor): (WebCore::HTMLImageElement::removedFromAncestor): When the x-apple-editable-image attribute changes, or the element is moved into or out of a document, call updateEditableImage. (WebCore::HTMLImageElement::editableImageViewID const): Adopt EditableImageReference. (WebCore::HTMLImageElement::updateEditableImage): When the image element moves into a document, the setting is on, and the appropriate attribute is applied, add an <attachment> into the shadow DOM, and inform the UI process both of the editable image's creation and that it should be associated with the new attachment. Use an EditableImageReference to extend the lifetime of the corresponding editable image in the UI process, and to communicate the attachment association. If the element was cloned from another editable image element, use the EditableImageReference and attachmentID from the original; the embedded view will be re-parented under this element's layer, and the attachment will be cloned (with a new ID) by editing code if the element is parented. (WebCore::HTMLImageElement::attachmentIdentifier const): (WebCore::HTMLImageElement::copyNonAttributePropertiesFromElement): Store the aforementioned bits of information when cloned so that we can reconstitute the appropriate attachment data and embedded view. * html/HTMLImageElement.h: * page/ChromeClient.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * page/EditableImageReference.cpp: Added. (WebCore::EditableImageReference::EditableImageReference): (WebCore::EditableImageReference::~EditableImageReference): (WebCore::EditableImageReference::associateWithAttachment): * page/EditableImageReference.h: Added. (WebCore::EditableImageReference::create): (WebCore::EditableImageReference::embeddedViewID const): Add EditableImageReference, which manages the lifetime of the UI-side EditableImage and helps clients communicate about it. It is refcounted so that cloned <img> elements can potentially borrow the UI-side state (in the case where they end up getting parented). * page/NavigatorBase.cpp: Fix an unrelated unified build failure that I exposed. 2018-11-26 Jer Noble <jer.noble@apple.com> Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI https://bugs.webkit.org/show_bug.cgi?id=190951 <rdar://problem/45213065> Reviewed by Alex Christensen. Request the correct route policy and context from the VideoFullscreenModel. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID): * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID): * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]): (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): (VideoFullscreenInterfaceAVKit::doSetup): 2018-11-24 Ryosuke Niwa <rniwa@webkit.org> SVG use element inside a shadow tree cannot reference an element in the same tree https://bugs.webkit.org/show_bug.cgi?id=174977 <rdar://problem/33665636> Reviewed by Zalan Bujtas. Make fragment URL references used by SVGelements within a shadow tree to refer to other elements in the same shadow tree. To do this, this patch makes targetElementFromIRIString take a TreeScope instead of a Document, and updates its call sites. This patch updates the most uses of targetElementFromIRIString except CSS cursor image, altGraph, and glyphRef since the cursor image isn't really a SVG feature, and there aren't really real world use cases in which altGraph and glyphRef are used within shadow trees. Tests: fast/shadow-dom/svg-animate-href-change-in-shadow-tree.html fast/shadow-dom/svg-animate-href-in-shadow-tree.html fast/shadow-dom/svg-feimage-href-in-shadow-tree.html fast/shadow-dom/svg-linear-gradient-href-in-shadow-tree.html fast/shadow-dom/svg-mpath-href-change-in-shadow-tree.html fast/shadow-dom/svg-mpath-href-in-shadow-tree.html fast/shadow-dom/svg-radial-gradient-href-in-shadow-tree.html fast/shadow-dom/svg-text-path-href-change-in-shadow-tree.html fast/shadow-dom/svg-text-path-href-in-shadow-tree.html fast/shadow-dom/svg-thref-href-change-in-shadow-tree.html fast/shadow-dom/svg-thref-href-in-shadow-tree.html fast/shadow-dom/svg-use-href-change-in-shadow-tree.html fast/shadow-dom/svg-use-href-in-shadow-tree.html * accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::targetForUseElement const): * css/CSSCursorImageValue.cpp: * rendering/svg/RenderSVGTextPath.cpp: (WebCore::RenderSVGTextPath::layoutPath const): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::buildPendingResource): (WebCore::SVGFEImageElement::build): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement const): * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::buildPendingResource): (WebCore::SVGMPathElement::pathElement): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::buildPendingResource): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::buildPendingResource): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::targetElementFromIRIString): * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::updateShadowTree): (WebCore::SVGUseElement::findTarget const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::buildPendingResource): (WebCore::SVGSMILElement::insertedIntoAncestor): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::FEImage): (WebCore::FEImage::createWithIRIReference): (WebCore::FEImage::referencedRenderer const): * svg/graphics/filters/SVGFEImage.h: 2018-11-26 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r238357. Casued three css tests to fail and crash on ios sim Reverted changeset: "Avoid triggering compositing updates when only the root layer is composited" https://bugs.webkit.org/show_bug.cgi?id=191813 https://trac.webkit.org/changeset/238357 2018-11-26 Daniel Bates <dabates@apple.com> Caret disappears at end of password field when caps lock indicator is shown; password field not scrolled when caps lock indicator is shown https://bugs.webkit.org/show_bug.cgi?id=191164 <rdar://problem/45738179> Reviewed by Dean Jackson. Fixes an issue where the caret may be occluded by- or paint on top of- the caps lock indicator on Mac and iOS, respectively. If there has not been a previous selection in a focused password field, including a caret selection made by pressing the arrow keys, then we never scroll the password field to reveal the current selection when the caps lock indicator is made visible. When the caps lock indicator is made visible or hidden the size of the inner text renderer changes as it shrinks or expands to make space for the caps lock indicator or to fill the void of the now hidden caps lock indicator, respectively. We should detect such size changes and schedule an update and reveal of the current selection after layout. Test: fast/forms/password-scrolled-after-caps-lock-toggled.html * editing/FrameSelection.cpp: (WebCore::FrameSelection::setNeedsSelectionUpdate): Modified to take an enum to override the current selection reveal mode for the next update. * editing/FrameSelection.h: * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): Schedule post-layout a selection update that reveals the current selection. We pass FrameSelection::RevealSelectionAfterUpdate::Forced to ensure that the scheduled selection update scrolls to the reveal the current selection regardless of selection reveal mode. This is necessary because typing into a password field does not change the current selection reveal mode. 2018-11-26 Daniel Bates <dabates@apple.com> Placeholder text is not repainted after caps lock indicator is hidden https://bugs.webkit.org/show_bug.cgi?id=191968 <rdar://problem/46247234> Reviewed by Zalan Bujtas. Fixes an issue where the placeholder text in a password field is not repainted when the caps lock indicator is hidden. The placeholder renderer is special. It is an excluded child renderer and does not take part in normal flow layout. It is also created and destroyed as needed. The caps lock indicator is also special in that it is implemented as a RenderImage and we do not know its dimensions before it is loaded and the load happens asynchronously. As a result we detect when the inner text size changes and mark the placeholder as dirty as a way to keep the dimensions of the placeholder in sync with the dimensions of the inner text. Test: fast/repaint/placeholder-after-caps-lock-hidden.html * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): Mark the placeholder as needing layout the size of the inner text changes. 2018-11-26 Jeremy Jones <jeremyj@apple.com> Picture-in-picture window size changes unnecesarily when URL changes. https://bugs.webkit.org/show_bug.cgi?id=191787 Reviewed by Jer Noble. When loading a new URL, the video dimensions are temporarily 0,0. Instead of defaulting back to 4:3 sized pip window temporarily, keep the old dimensions until there is a new valid size. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (VideoFullscreenInterfaceAVKit::videoDimensionsChanged): 2018-11-26 Andy Estes <aestes@apple.com> [Cocoa] Make it easier to encode NSObjects https://bugs.webkit.org/show_bug.cgi?id=191948 Reviewed by Dean Jackson. * Modules/applepay/Payment.h: Changed the PKPayment * constructor to take a RetainPtr<PKPayment>&& instead. * Modules/applepay/PaymentContact.h: Ditto for PKContact. * Modules/applepay/PaymentMerchantSession.h: Ditto for PKPaymentMerchantSession. * Modules/applepay/PaymentMethod.h: Ditto for PKPaymentMethod. * Modules/applepay/cocoa/PaymentCocoa.mm: (WebCore::Payment::Payment): Moved definition out-of-line. (WebCore::Payment::pkPayment const): Ditto. * Modules/applepay/cocoa/PaymentContactCocoa.mm: (WebCore::PaymentContact::PaymentContact): Ditto. (WebCore::PaymentContact::pkContact const): Ditto. * Modules/applepay/cocoa/PaymentMethodCocoa.mm: (WebCore::PaymentMethod::PaymentMethod): Ditto. (WebCore::PaymentMethod::pkPaymentMethod const): Ditto. 2018-11-26 Daniel Bates <dabates@apple.com> REGRESSION (r238078): Do not draw caps lock indicator when Strong Password button is shown https://bugs.webkit.org/show_bug.cgi?id=191969 <rdar://problem/46247569> Reviewed by Dean Jackson. Following r238078 we now support drawing the caps lock indicator in password fields on iOS. However it is not meaningful to show the caps lock indicator when the Strong Password button is visible because the password field is not editable. We should not paint the caps lock indicator when the Strong Password button is visible. Tests: fast/forms/auto-fill-button/caps-lock-indicator-should-be-visible-when-after-hiding-auto-fill-strong-password-button.html fast/forms/auto-fill-button/caps-lock-indicator-should-not-be-visible-when-auto-fill-strong-password-button-is-visible.html * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::shouldDrawCapsLockIndicator const): Do not draw the caps lock indicator when the password field has the Strong Password button. (WebCore::TextFieldInputType::updateAutoFillButton): Call capsLockStateMayHaveChanged() to update the visibility of the caps lock indicator when the auto fill button has changed. 2018-11-26 Sam Weinig <sam@webkit.org> Streamline ListHashSet use in floating object code https://bugs.webkit.org/show_bug.cgi?id=191957 Reviewed by Alex Christensen. Simplify use of ListHashSet by using new raw pointer overloads and making use of reversed order of template arguments in the find() and contains() overloads that take hash translators. * rendering/FloatingObjects.cpp: (WebCore::FloatingObjects::remove): Use raw pointer overloads of contains and remove. Remove seperate call to find / check agains end() which is unnecessary as remove() already does that. * rendering/FloatingObjects.h: (WebCore::FloatingObjectHashFunctions::hash): (WebCore::FloatingObjectHashFunctions::equal): (WebCore::FloatingObjectHashTranslator::hash): (WebCore::FloatingObjectHashTranslator::equal): Add hash()/equal() overloads for the raw pointer cases. As the FIXME notes, this could be simplified by changing PtrHashBase to use designated bottleneck functions for hash() and equal(). * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::containsFloat const): (WebCore::RenderBlockFlow::insertFloatingObject): (WebCore::RenderBlockFlow::removeFloatingObject): (WebCore::RenderBlockFlow::hasOverhangingFloat): (WebCore::RenderBlockFlow::addIntrudingFloats): Use simplified calls. * rendering/RenderBlockLineLayout.cpp: (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): (WebCore::RenderBlockFlow::linkToEndLineIfNeeded): Use simplified calls. 2018-11-26 Jeremy Jones <jeremyj@apple.com> Use Full Screen consistently in localizable strings. https://bugs.webkit.org/show_bug.cgi?id=190363 rdar://problem/43882333 Reviewed by Jon Lee. No new tests because only change is to localizable strings. Rename "Fullscreen" to "Full Screen" in localizable strings for consistency. * English.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::contextMenuItemTagEnterVideoFullscreen): (WebCore::contextMenuItemTagExitVideoFullscreen): (WebCore::localizedMediaControlElementHelpText): 2018-11-26 Brent Fulgham <bfulgham@apple.com> [Win] Reduce the use of WKSI library calls: CoreAnimation https://bugs.webkit.org/show_bug.cgi?id=191777 <rdar://problem/46140542> Reviewed by Zalan Bujtas. Update the Windows build of WebKit to refer to the SPI headers, rather than WebKitSystemInterface. Move a small amount of glue code from WKSI to WebCore, and remove any includes or link directives for WebKitSystemInterface.lib. No new tests. No change in behavior. * platform/graphics/BitmapImage.cpp: * platform/graphics/ca/win/CACFLayerTreeHost.h: * platform/graphics/ca/win/PlatformCALayerWin.cpp: (layerTreeHostForLayer): * platform/graphics/cg/GraphicsContextCG.cpp: * platform/graphics/cg/PathCG.cpp: * platform/graphics/cg/PatternCG.cpp: * platform/graphics/win/WKCAImageQueue.cpp: 2018-11-25 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use float box's margin box to adjust the line constraints. https://bugs.webkit.org/show_bug.cgi?id=191961 Reviewed by Antti Koivisto. Test: fast/inline/inline-content-with-float-and-margin.html (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): 2018-11-26 Carlos Garcia Campos <cgarcia@igalia.com> [GTK] Accessing default web context before gtk_init results in drawing failure (Gtk-WARNING **: drawing failure for widget 'WebKitWebView': invalid value for an input Visual*) https://bugs.webkit.org/show_bug.cgi?id=150303 Reviewed by Michael Catanzaro. Ensure gtk has been initialized before trying to get the default display. * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): 2018-11-26 Javier Fernandez <jfernandez@igalia.com> [css-grid] absolute positioned child is sized wrongly when using auto-fit, generating spurious collapsed tracks https://bugs.webkit.org/show_bug.cgi?id=191938 Reviewed by Manuel Rego Casasnovas. The guttersSize function has a complex logic to compute the gaps in a specific GridSpan, considering different scenarios of collapsed tracks for such span. The first case is avoiding the duplicated gap because of trailing collapsed tracks. The second case considered is looking for non-empty tracks before the GridSpan end, if it points to an empty track, so we must add this gap. The last case is to consider the gap of non-empty tracks after the GridSpan end line, if it points to an empty track. There are several cases that are not considered or incorrectly computed. This patch addresses those cases; basically, we should only consider gaps when there are non-empty tracks before and after the collapsed tracks. Additionally, we should avoid duplicating the gaps size adding both, before and after non-empty track's gap. No new tests, this change is covered by current tests and make several cases to pass now. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::guttersSize const): 2018-11-26 Manuel Rego Casasnovas <rego@igalia.com> [css-grid] Fix grid container sizing under min-content height https://bugs.webkit.org/show_bug.cgi?id=191889 Reviewed by Javier Fernandez. The spec is quite clear (https://drafts.csswg.org/css-sizing/#valdef-width-min-content): "min-content If specified for the inline axis, use the min-content inline size; otherwise behaves as the property’s initial value." So if a grid container has "height: min-content" it should behave the same than with "height: auto". The patch removes computeIntrinsicLogicalContentHeightUsing() in RenderGrid as we don't need a custom one anymore. We can also get rid of m_minContentHeight and m_maxContentHeight attributes that were only used for this logic. Test: fast/css-grid-layout/grid-track-sizing-with-orthogonal-flows.html fast/css-grid-layout/maximize-tracks-definite-indefinite-height.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-sizing-constraints-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths const): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const): * rendering/RenderGrid.h: 2018-11-25 Zalan Bujtas <zalan@apple.com> [LFC] Remove PointInContainingBlock and PositionInContainingBlock https://bugs.webkit.org/show_bug.cgi?id=191954 Reviewed by Antti Koivisto. Use Point and Position instead. Points and positions are by default in the containing block's coordinate system. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): * layout/LayoutUnits.h: (WebCore::Layout::Position::operator LayoutUnit const): (WebCore::Layout::operator<): (WebCore::Layout::operator==): * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): (WebCore::Layout::FloatAvoider::setHorizontalConstraints): (WebCore::Layout::FloatAvoider::horizontalPositionCandidate): (WebCore::Layout::FloatAvoider::initialHorizontalPosition const): * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::horizontalPositionCandidate): (WebCore::Layout::FloatBox::verticalPositionCandidate): (WebCore::Layout::FloatBox::initialVerticalPosition const): * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): (WebCore::Layout::FloatingContext::floatingPosition const): (WebCore::Layout::FloatingPair::horizontalConstraints const): (WebCore::Layout::FloatingPair::bottom const): * layout/floats/FloatingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): (WebCore::Layout::FloatingState::bottom const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::FloatItem::bottom const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::initializeNewLine const): 2018-11-25 Zalan Bujtas <zalan@apple.com> [LFC] Rename Layout::Position to Layout::Point https://bugs.webkit.org/show_bug.cgi?id=191950 Reviewed by Antti Koivisto. It actually represents a point. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): * layout/FormattingContext.h: * layout/LayoutUnits.h: (WebCore::Layout::Point::Point): (WebCore::Layout::Point::moveBy): (WebCore::Layout::Position::operator LayoutPoint const): Deleted. (WebCore::Layout::Position::Position): Deleted. (WebCore::Layout::Position::moveBy): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): 2018-11-25 Zalan Bujtas <zalan@apple.com> [LFC] Floating code should use typed positions (PositionInContextRoot). https://bugs.webkit.org/show_bug.cgi?id=191949 Reviewed by Antti Koivisto. Use PositionInContextRoot instead of LayoutUnit. * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): (WebCore::Layout::FloatingState::bottom const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::leftBottom const): (WebCore::Layout::FloatingState::rightBottom const): (WebCore::Layout::FloatingState::bottom const): 2018-11-25 Zalan Bujtas <zalan@apple.com> Fix build after r238472. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::textWidth const): 2018-11-25 Tim Horton <timothy_horton@apple.com> Make it possible to insert editable images with a gesture https://bugs.webkit.org/show_bug.cgi?id=191937 Reviewed by Wenson Hsieh. Tests: editing/images/redo-insert-editable-image-maintains-strokes.html, editing/images/undo-insert-editable-image.html, editing/images/basic-editable-image-from-execCommand.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * Source/WebCore/editing/EditorCommand.cpp: * Source/WebCore/en.lproj/Localizable.strings: * editing/EditAction.h: * editing/Editor.cpp: (WebCore::Editor::insertEditableImage): * editing/Editor.h: * editing/InsertEditableImageCommand.cpp: Added. (WebCore::InsertEditableImageCommand::InsertEditableImageCommand): (WebCore::InsertEditableImageCommand::doApply): * editing/InsertEditableImageCommand.h: Added. (WebCore::InsertEditableImageCommand::create): * editing/VisibleSelection.cpp: Add an editor command that inserts an editable image. It will likely get a bit more complicated, but for now it just inserts a 100% by 300px editable image. 2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] Fix a few localizable string descriptions in WebEditCommandProxy.cpp and WebEditorClient.mm https://bugs.webkit.org/show_bug.cgi?id=191945 Reviewed by Anders Carlsson. Run `update-webkit-localizable-strings`. * en.lproj/Localizable.strings: 2018-11-24 Sam Weinig <sam@webkit.org> Remove now unnecessary specialized ListHashSet from InlineItem.h https://bugs.webkit.org/show_bug.cgi?id=191946 Reviewed by Zalan Bujtas. Now that ListHashSet supports raw pointer overloads for smart pointers, we can fix the FIXME in InlineItem.h and remove the specialized ListHashSet and ListHashSet::find calls. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItemHashFunctions::hash): Deleted. (WebCore::Layout::InlineItemHashFunctions::equal): Deleted. (WebCore::Layout::InlineItemHashTranslator::hash): Deleted. (WebCore::Layout::InlineItemHashTranslator::equal): Deleted. * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::textWidth const): 2018-11-24 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] Add WKWebView SPI to trigger and remove data detection https://bugs.webkit.org/show_bug.cgi?id=191918 <rdar://problem/36185051> Reviewed by Tim Horton. Add a helper method on DataDetection to remove all data detected links in the given document. See WebKit changes for more detail. * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::removeDataDetectedLinksInDocument): 2018-11-24 Andy Estes <aestes@apple.com> [Cocoa] SOFT_LINK_CLASS_FOR_{HEADER,SOURCE} should generate a more concise getter function https://bugs.webkit.org/show_bug.cgi?id=191899 Reviewed by Dean Jackson. * editing/cocoa/DataDetection.mm: * editing/cocoa/FontAttributesCocoa.mm: * editing/cocoa/FontShadowCocoa.mm: * platform/cocoa/DataDetectorsCoreSoftLink.h: * platform/graphics/cocoa/ColorCocoa.mm: * platform/ios/PlatformScreenIOS.mm: 2018-11-23 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Enable Web Authentication as an experimental feature for macOS https://bugs.webkit.org/show_bug.cgi?id=191932 rdar://problem/46225210 Reviewed by Brent Fulgham. Add myself to the contact of Web Authentication. * features.json: 2018-11-23 Ryosuke Niwa <rniwa@webkit.org> REGRESSION (r236785): Nullptr crash in StyledMarkupAccumulator::traverseNodesForSerialization https://bugs.webkit.org/show_bug.cgi?id=191921 Reviewed by Dean Jackson. The bug was caused by traverseNodesForSerialization not being able to traverse past the end of shadow root when skipping children of a node for which enterNode returns false because it was using NodeTraversal's nextSkippingChildren instead of a member function which supports traversing the composed tree. Fixed the crash by using variant of nextSkippingChildren which knows how to traverse past the last node in a shadow tree. Also added more assertions to help debug issues like this in the future. Test: editing/pasteboard/copy-paste-across-shadow-boundaries-5.html * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): 2018-11-22 Ryosuke Niwa <rniwa@webkit.org> Updating href on textPath doesn't update its rendering https://bugs.webkit.org/show_bug.cgi?id=191920 Reviewed by Dean Jackson. Fixed the bug by invalidating the RenderSVGResource in SVGTextPathElement::svgAttributeChanged in addition to updating the pending resources. Test: svg/text/textpath-reference-update.html * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::svgAttributeChanged): 2018-11-23 Ross Kirsling <ross.kirsling@sony.com> Introduce user-defined literal for LayoutUnit https://bugs.webkit.org/show_bug.cgi?id=191915 Reviewed by Dean Jackson. * platform/LayoutUnit.h: Introduce a user-defined literal for LayoutUnit, _lu, replacing the existing "fromPixel" factory function. * layout/FormattingContextGeometry.cpp: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: * layout/inlineformatting/InlineLineBreaker.cpp: * page/FrameView.cpp: * page/FrameViewLayoutContext.h: * page/Page.cpp: * page/SpatialNavigation.h: * platform/ScrollableArea.cpp: * rendering/EllipsisBox.cpp: * rendering/FlexibleBoxAlgorithm.cpp: * rendering/FloatingObjects.cpp: * rendering/GridLayoutFunctions.cpp: * rendering/GridTrackSizingAlgorithm.cpp: * rendering/InlineFlowBox.cpp: * rendering/InlineTextBox.cpp: * rendering/LayoutState.h: * rendering/LogicalSelectionOffsetCaches.h: * rendering/RenderBlock.cpp: * rendering/RenderBlock.h: * rendering/RenderBlockFlow.cpp: * rendering/RenderBlockFlow.h: * rendering/RenderBlockLineLayout.cpp: * rendering/RenderBox.cpp: * rendering/RenderBoxModelObject.cpp: * rendering/RenderDeprecatedFlexibleBox.cpp: * rendering/RenderDeprecatedFlexibleBox.h: * rendering/RenderElement.cpp: * rendering/RenderFlexibleBox.cpp: * rendering/RenderFlexibleBox.h: * rendering/RenderFragmentContainer.cpp: * rendering/RenderFragmentedFlow.cpp: * rendering/RenderGrid.cpp: * rendering/RenderGrid.h: * rendering/RenderImage.cpp: * rendering/RenderLayer.cpp: * rendering/RenderListMarker.cpp: * rendering/RenderMultiColumnFlow.cpp: * rendering/RenderMultiColumnSet.cpp: * rendering/RenderReplaced.cpp: * rendering/RenderReplaced.h: * rendering/RenderRubyRun.h: * rendering/RenderTable.cpp: * rendering/RenderTable.h: * rendering/RenderTableSection.cpp: * rendering/RenderTheme.cpp: * rendering/RenderTreeAsText.cpp: * rendering/RenderView.cpp: * rendering/RootInlineBox.h: * rendering/SimpleLineLayout.cpp: * rendering/SimpleLineLayoutPagination.cpp: * rendering/TableLayout.h: * rendering/line/BreakingContext.h: * rendering/line/LineLayoutState.h: * rendering/line/LineWidth.h: * rendering/mathml/MathOperator.cpp: * rendering/mathml/MathOperator.h: * rendering/mathml/RenderMathMLBlock.h: * rendering/mathml/RenderMathMLFraction.cpp: * rendering/mathml/RenderMathMLFraction.h: * rendering/mathml/RenderMathMLMath.cpp: * rendering/mathml/RenderMathMLMath.h: * rendering/mathml/RenderMathMLMenclose.h: * rendering/mathml/RenderMathMLOperator.cpp: * rendering/mathml/RenderMathMLOperator.h: * rendering/mathml/RenderMathMLPadded.h: * rendering/mathml/RenderMathMLRoot.cpp: * rendering/mathml/RenderMathMLRoot.h: * rendering/mathml/RenderMathMLRow.h: * rendering/mathml/RenderMathMLScripts.cpp: * rendering/mathml/RenderMathMLScripts.h: * rendering/mathml/RenderMathMLSpace.h: * rendering/mathml/RenderMathMLToken.cpp: * rendering/mathml/RenderMathMLToken.h: * rendering/mathml/RenderMathMLUnderOver.h: * rendering/shapes/ShapeOutsideInfo.cpp: * rendering/style/CollapsedBorderValue.h: Update all instances of LayoutUnit(), LayoutUnit(0), LayoutUnit { 0 }, etc. and add any other literal conversions that will be needed when making non-int LayoutUnit constructors explicit. For good measure, also mark all default values for LayoutUnit parameters. 2018-11-23 Jim Mason <jmason@ibinx.com> [GTK] Scrollbars not following gtk-primary-button-warps-slider setting https://bugs.webkit.org/show_bug.cgi?id=191067 Updated code per the style guide, removed unreachable break (non-semantic change) Reviewed by Michael Catanzaro. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::handleMousePressEvent): 2018-11-23 Wenson Hsieh <wenson_hsieh@apple.com> Enable drag and drop support for iOSMac https://bugs.webkit.org/show_bug.cgi?id=191818 <rdar://problem/43907454> Reviewed by Dean Jackson. Enables drag and drop by default on iOSMac by switching on ENABLE_DATA_INTERACTION and ENABLE_DRAG_SUPPORT. This enables support for dragging links, text selections, and images, though many advanced features (e.g. custom pasteboard data) will require additional support from the platform. * Configurations/FeatureDefines.xcconfig: * platform/ios/PlatformPasteboardIOS.mm: (WebCore::PlatformPasteboard::informationForItemAtIndex): (WebCore::registerItemToPasteboard): (WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const): * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderLoadResult canBeRepresentedAsFileUpload]): (-[WebItemProviderPasteboard numberOfFiles]): Disable codepaths which attempt to access or set `teamData` or `preferredPresentationStyle` on `NSItemProvider` in iOSMac, since these are currently unimplemented. 2018-11-23 Zalan Butjas <zalan@apple.com> [LFC][IFC] Add support for variable height runs. https://bugs.webkit.org/show_bug.cgi?id=191925 Reviewed by Antti Koivisto. https://www.w3.org/TR/CSS22/visudet.html#inline-box-height 10.8 Line height calculations: the 'line-height' and 'vertical-align' properties The height of each inline-level box in the line box is calculated. For replaced elements, inline-block elements, and inline-table elements, this is the height of their margin box; for inline boxes, this is their 'line-height'. The line box height is the distance between the uppermost box top and the lowermost box bottom. The minimum height consists of a minimum height above the baseline and a minimum depth below it, exactly as if each line box starts with a zero-width inline box with the element's font and line height properties. We call that imaginary box a "strut." (The name is inspired by TeX.). Test: fast/inline/inline-content-with-image-simple.html * layout/Verification.cpp: (WebCore::Layout::checkForMatchingNonTextRuns): (WebCore::Layout::checkForMatchingTextRuns): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::initializeNewLine const): (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::createFinalRuns const): (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::logicalHeight const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::logicalWidth const): (WebCore::Layout::InlineRun::logicalHeight const): (WebCore::Layout::InlineRun::setLogicalWidth): (WebCore::Layout::InlineRun::width const): Deleted. (WebCore::Layout::InlineRun::height const): Deleted. (WebCore::Layout::InlineRun::setWidth): Deleted. * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): 2018-11-23 Antti Koivisto <antti@apple.com> UI side compositing doesn't paint on Mac https://bugs.webkit.org/show_bug.cgi?id=191908 Reviewed by Tim Horton. For clarity put RGB10 and RGB10A8 formats behind PLATFORM(IOS_FAMILY). They are not supported on Mac. * platform/graphics/cocoa/IOSurface.h: * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::IOSurface): (WebCore::IOSurface::ensurePlatformContext): (WebCore::IOSurface::format const): (WebCore::operator<<): 2018-11-23 Javier Fernandez <jfernandez@igalia.com> [css-grid] Implement Baseline Alignment for grid items https://bugs.webkit.org/show_bug.cgi?id=145566 Reviewed by Manuel Rego Casasnovas. This patch impements the Baseline Self-Alignment feature for grid items according to the CSS Box Alignment specification [1]. This new layout logic is handled by the Self-Alignment (justify-self and align-self) and Default-Alignment (justify-items and align-items) CSS properties. This feature allows users to align the grid items sharing a Baseline Alignment Context, either row or column contexts, based on their respective baselines. [1] https://drafts.csswg.org/css-align-3/#baseline-align-self Tests: fast/css-grid-layout/grid-self-baseline-and-flex-tracks-with-indefinite-container-crash.html fast/css-grid-layout/grid-self-baseline-and-flexible-tracks-should-not-crash.html fast/css-grid-layout/grid-self-baseline-and-item-relayout-should-not-crash.html fast/css-grid-layout/grid-self-baseline-and-relative-sized-items-crash.html fast/css-grid-layout/grid-self-baseline-and-relative-sized-tracks-crash.html fast/css-grid-layout/grid-self-baseline-followed-by-item-style-change-should-not-crash.html * Sources.txt: * rendering/GridBaselineAlignment.cpp: Added. (WebCore::GridBaselineAlignment::marginOverForChild const): (WebCore::GridBaselineAlignment::marginUnderForChild const): (WebCore::GridBaselineAlignment::logicalAscentForChild const): (WebCore::GridBaselineAlignment::ascentForChild const): (WebCore::GridBaselineAlignment::descentForChild const): (WebCore::GridBaselineAlignment::isDescentBaselineForChild const): (WebCore::GridBaselineAlignment::isHorizontalBaselineAxis const): (WebCore::GridBaselineAlignment::isOrthogonalChildForBaseline const): (WebCore::GridBaselineAlignment::isParallelToBaselineAxisForChild const): (WebCore::GridBaselineAlignment::baselineGroupForChild const): (WebCore::GridBaselineAlignment::updateBaselineAlignmentContext): (WebCore::GridBaselineAlignment::baselineOffsetForChild const): (WebCore::GridBaselineAlignment::clear): (WebCore::BaselineGroup::BaselineGroup): (WebCore::BaselineGroup::update): (WebCore::BaselineGroup::isOppositeBlockFlow const): (WebCore::BaselineGroup::isOrthogonalBlockFlow const): (WebCore::BaselineGroup::isCompatible const): (WebCore::BaselineContext::BaselineContext): (WebCore::BaselineContext::sharedGroup const): (WebCore::BaselineContext::updateSharedGroup): (WebCore::BaselineContext::findCompatibleSharedGroup): * rendering/GridBaselineAlignment.h: Added. (WebCore::BaselineGroup::maxAscent const): (WebCore::BaselineGroup::maxDescent const): (WebCore::BaselineGroup::size const): (WebCore::isBaselinePosition): (WebCore::GridBaselineAlignment::setBlockFlow): * rendering/GridLayoutFunctions.h: * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::gridAxisForDirection): (WebCore::gridDirectionForAxis): (WebCore::GridTrackSizingAlgorithm::availableSpace const): (WebCore::GridTrackSizingAlgorithm::isIntrinsicSizedGridArea const): (WebCore::GridTrackSizingAlgorithmStrategy::logicalHeightForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const): (WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const): (WebCore::GridTrackSizingAlgorithm::canParticipateInBaselineAlignment const): (WebCore::GridTrackSizingAlgorithm::participateInBaselineAlignment const): (WebCore::GridTrackSizingAlgorithm::updateBaselineAlignmentContext): (WebCore::GridTrackSizingAlgorithm::baselineOffsetForChild const): (WebCore::GridTrackSizingAlgorithm::clearBaselineItemsCache): (WebCore::GridTrackSizingAlgorithm::cacheBaselineAlignedItem): (WebCore::GridTrackSizingAlgorithm::copyBaselineItemsCache): (WebCore::GridTrackSizingAlgorithm::setup): (WebCore::GridTrackSizingAlgorithm::computeBaselineAlignmentContext): * rendering/GridTrackSizingAlgorithm.h: * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::firstLineBaseline const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths const): (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::performGridItemsPreLayout const): (WebCore::synthesizedBaselineFromMarginBox): (WebCore::RenderGrid::isBaselineAlignmentForChild const): (WebCore::RenderGrid::baselinePosition const): (WebCore::RenderGrid::firstLineBaseline const): (WebCore::RenderGrid::inlineBlockBaseline const): (WebCore::RenderGrid::columnAxisBaselineOffsetForChild const): (WebCore::RenderGrid::rowAxisBaselineOffsetForChild const): (WebCore::RenderGrid::columnAxisOffsetForChild const): (WebCore::RenderGrid::rowAxisOffsetForChild const): * rendering/RenderGrid.h: 2018-11-22 Wenson Hsieh <wenson_hsieh@apple.com> Address post-review feedback after r238438 https://bugs.webkit.org/show_bug.cgi?id=191913 Reviewed by Ryosuke Niwa. Replace `bool` arguments to `FrameSelection::setSelectedRange`, `Editor::replaceSelectionWithText`, and `Editor::replaceSelectionWithFragment` with `enum class`es instead. In particular, introduce the following: FrameSelection::ShouldCloseTyping { No, Yes } Editor::SelectReplacement { No, Yes } Editor::SmartReplace { No, Yes } Editor::MatchStyle { No, Yes } * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::selectText): * editing/Editor.cpp: (WebCore::Editor::handleTextEvent): (WebCore::Editor::replaceSelectionWithFragment): (WebCore::Editor::replaceSelectionWithText): (WebCore::Editor::setComposition): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::changeBackToReplacedString): (WebCore::Editor::transpose): (WebCore::Editor::insertAttachment): At various call sites, replace boolean arguments with named enums. * editing/Editor.h: * editing/EditorCommand.cpp: (WebCore::expandSelectionToGranularity): (WebCore::executeDeleteToMark): (WebCore::executeSelectToMark): * editing/FrameSelection.cpp: (WebCore::FrameSelection::setSelectedRange): * editing/FrameSelection.h: * page/Page.cpp: (WebCore::replaceRanges): Avoid a bit of ref-count churn, and adjust a few functions to take `const Vector&`s instead of `Vector&&`s. (WebCore::Page::replaceRangesWithText): (WebCore::Page::replaceSelectionWithText): * page/Page.h: 2018-11-21 Ryosuke Niwa <rniwa@webkit.org> Modernize SVGURIReference::targetElementFromIRIString https://bugs.webkit.org/show_bug.cgi?id=191898 Reviewed by Daniel Bates. Made targetElementFromIRIString return an element and the fragment identifier, and merged urlFromIRIStringWithFragmentIdentifier into it. Also replaced the code computing the full URL using the base URL after removing the fragment identifier and rejoining it later with a single call to completeURL. No new tests since there should be no observable behavior change. * accessibility/AccessibilitySVGElement.cpp: (WebCore::AccessibilitySVGElement::targetForUseElement const): * css/CSSCursorImageValue.cpp: (WebCore::CSSCursorImageValue::updateCursorElement): * rendering/svg/RenderSVGTextPath.cpp: (WebCore::RenderSVGTextPath::layoutPath const): * svg/SVGAltGlyphElement.cpp: (WebCore::SVGAltGlyphElement::hasValidGlyphElements const): * svg/SVGFEImageElement.cpp: (WebCore::SVGFEImageElement::buildPendingResource): * svg/SVGGlyphRefElement.cpp: (WebCore::SVGGlyphRefElement::hasValidGlyphElement const): * svg/SVGLinearGradientElement.cpp: (WebCore::SVGLinearGradientElement::collectGradientAttributes): * svg/SVGMPathElement.cpp: (WebCore::SVGMPathElement::buildPendingResource): (WebCore::SVGMPathElement::pathElement): * svg/SVGRadialGradientElement.cpp: (WebCore::SVGRadialGradientElement::collectGradientAttributes): * svg/SVGTRefElement.cpp: (WebCore::SVGTRefElement::detachTarget): (WebCore::SVGTRefElement::buildPendingResource): * svg/SVGTextPathElement.cpp: (WebCore::SVGTextPathElement::buildPendingResource): * svg/SVGURIReference.cpp: (WebCore::SVGURIReference::targetElementFromIRIString): (WebCore::urlFromIRIStringWithFragmentIdentifier): Deleted. * svg/SVGURIReference.h: * svg/SVGUseElement.cpp: (WebCore::SVGUseElement::findTarget const): * svg/animation/SVGSMILElement.cpp: (WebCore::SVGSMILElement::buildPendingResource): * svg/graphics/filters/SVGFEImage.cpp: (WebCore::FEImage::referencedRenderer const): 2018-11-22 Dean Jackson <dino@apple.com> Implement WebGPUQueue and device.getQueue() https://bugs.webkit.org/show_bug.cgi?id=191911 <rdar://problem/46214871> Reviewed by Antoine Quint. Implement WebGPUDevice::getQueue(), which creates a WebGPUQueue instance if necessary. Also link WebGPUQueue to the existing GPUQueue object, and expose the label IDL property. This patch is based on some work from Justin Fan. Test: webgpu/queue-creation.html * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: New files. * Modules/webgpu/WebGPUCommandBuffer.h: (WebCore::WebGPUCommandBuffer::commandBuffer const): Expose a GPUCommandBuffer getter, used when submitting (even though the actual GPU submission isn't implemented yet). * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::getQueue): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: Implement getQueue(). * Modules/webgpu/WebGPUQueue.cpp: (WebCore::WebGPUQueue::create): (WebCore::WebGPUQueue::WebGPUQueue): (WebCore::WebGPUQueue::submit): * Modules/webgpu/WebGPUQueue.h: (WebCore::WebGPUQueue::label const): (WebCore::WebGPUQueue::setLabel): * Modules/webgpu/WebGPUQueue.idl: New class. Mostly sends stuff onto GPUQueue. * bindings/js/WebCoreBuiltinNames.h: Add WebGPUQueue. * platform/graphics/gpu/GPUQueue.h: * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: (WebCore::GPUQueue::create): (WebCore::GPUQueue::submit): (WebCore::GPUQueue::label const): (WebCore::GPUQueue::setLabel const): "label" getter/setter that uses the underlying MTLCommandQueue label property, but prefixes it with a WebKit identifier, so it can be correctly identified in system crash logs as coming from WebGPU. 2018-11-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Merge addNonBreakableStart/NonBreakableEnd calls. https://bugs.webkit.org/show_bug.cgi?id=191903 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Offset formatting context root runs with horizontal margins. https://bugs.webkit.org/show_bug.cgi?id=191900 Reviewed by Antti Koivisto. Inline runs generated by formatting roots (inline-block) need to be adjusted with the horizontal margins. (The test case has padding and border as well, but they are _inside_ the formatting context.) Test: fast/inline/inline-content-and-nested-formatting-root-with-margin-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-22 Simon Fraser <simon.fraser@apple.com> Extremely small monospace text size when SVG is included as an img https://bugs.webkit.org/show_bug.cgi?id=191834 Reviewed by Myles C. Maxfield. Give defaultFixedFontSize a reasonable default value in Settings, so that clients who omit to set it (like SVGImages) don't get broken rendering. Test: svg/text/monospace-text-size-in-img.html * page/Settings.yaml: 2018-11-22 Javier Fernandez <jfernandez@igalia.com> Tables with vertical-lr writing-mode doesn't apply correctly vertical-align: baseline https://bugs.webkit.org/show_bug.cgi?id=191881 Reviewed by Manuel Rego Casasnovas. We should use the font's descent value when wriring-mode flips line flow (vertical-lr). This change also fixes bug 170175, since Flexbox use the same code to determine the first line baseline of a flex item. Test: fast/writing-mode/vertical-align-table-baseline-latin.html * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::firstLineBaseline const): 2018-11-21 Ryosuke Niwa <rniwa@webkit.org> Phantom focus/blur events fire on clicking between text input fields when listening with addEventListener https://bugs.webkit.org/show_bug.cgi?id=179990 Reviewed by Tim Horton. The bug was caused by TemporarySelectionChange which is used by TextIndicator::createWithRange to set and restore the selection putting the focus on the newly mouse-down'ed input element and restoring the focus back to the input element which originally had the focus immediately. Fixed the bug by avoiding to set the focus since only selection highlights need to be updated here. Also made TemporarySelectionOption an enum class. Unfortunately, no new tests since force click testing is broken :( See <rdar://problem/31301721>. * editing/Editor.cpp: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::TemporarySelectionChange::~TemporarySelectionChange): (WebCore::TemporarySelectionChange::setSelection): Extracted. Fixed the bug by adding FrameSelection::DoNotSetFocus to the option when TemporarySelectionOption::DoNotSetFocus is set. * editing/Editor.h: * page/DragController.cpp: (WebCore::DragController::performDragOperation): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): Set TemporarySelectionOption::DoNotSetFocus. 2018-11-21 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] [WebKit2] Add support for replacing find-in-page text matches https://bugs.webkit.org/show_bug.cgi?id=191786 <rdar://problem/45813871> Reviewed by Ryosuke Niwa. Add support for replacing Find-in-Page matches. See below for details. Covered by new layout tests as well as a new API test. Tests: editing/find/find-and-replace-adjacent-words.html editing/find/find-and-replace-at-editing-boundary.html editing/find/find-and-replace-basic.html editing/find/find-and-replace-in-subframes.html editing/find/find-and-replace-no-matches.html editing/find/find-and-replace-noneditable-matches.html editing/find/find-and-replace-replacement-text-input-events.html API test: WebKit.FindAndReplace * page/Page.cpp: (WebCore::replaceRanges): (WebCore::Page::replaceRangesWithText): Add a helper that, given a list of Ranges, replaces each range with the given text. To do this, we first map each Range to editing offsets within the topmost editable root for each Range. This results in a map of editable root to list of editing offsets we need to replace. To apply the replacements, for each editable root in the map, we iterate over each replacement range (i.e. an offset and length), set the current selection to contain that replacement range, and use `Editor::replaceSelectionWithText`. To prevent prior text replacements from clobbering the offsets of latter text replacement ranges, we also iterate backwards through text replacement ranges when performing each replacement. Likewise, we also apply text replacement to each editing container in backwards order: for nodes in the same frame, we compare their position in the document, and for nodes in different frames, we instead compare their frames in frame tree traversal order. We map Ranges to editing offsets and back when performing text replacement because each text replacement may split or merge text nodes, which causes adjacent Ranges to shrink or extend while replacing text. In an earlier attempt to implement this, I simply iterated over each Range to replace and carried out text replacement for each Range. This led to incorrect behavior in some cases, such as replacing adjacent matches. Thus, by computing the set of text replacement offsets prior to replacing any text, we're able to target the correct ranges for replacement. (WebCore::Page::replaceSelectionWithText): Add a helper method on Page to replace the current selection with some text. This simply calls out to `Editor::replaceSelectionWithText`. * page/Page.h: 2018-11-21 Andy Estes <aestes@apple.com> [Cocoa] Create a soft-linking file for PassKit https://bugs.webkit.org/show_bug.cgi?id=191875 <rdar://problem/46203215> Reviewed by Myles Maxfield. * Modules/applepay/cocoa/PaymentContactCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. * Modules/applepay/cocoa/PaymentMerchantSessionCocoa.mm: Ditto. * SourcesCocoa.txt: Removed @no-unify from PaymentMerchantSessionCocoa.mm. * WebCore.xcodeproj/project.pbxproj: Removed PaymentMerchantSessionCocoa.mm from the WebCore target. * rendering/RenderThemeCocoa.mm: Removed SOFT_LINK macros and included PassKitSoftLink.h instead. 2018-11-21 Zalan Bujtas <zalan@apple.com> [LFC] LayoutState should always be initialized with the initial containing block. https://bugs.webkit.org/show_bug.cgi?id=191896 Reviewed by Antti Koivisto. There should always be only one LayoutState per layout tree (it does not mean that layout always starts at the ICB). The ICB is a special formatting context root because it does not have a parent formatting context. All the other formatting contexts first need to be laid out (partially at least e.g margin) in their parent formatting context. Having a non-null parent formatting context as root could lead to undefined behaviour. * layout/LayoutFormattingState.cpp: (WebCore::Layout::LayoutState::LayoutState): (WebCore::Layout::LayoutState::initializeRoot): Deleted. * layout/LayoutFormattingState.h: * layout/Verification.cpp: (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): 2018-11-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Horizontal margins should be considered as non-breakable space https://bugs.webkit.org/show_bug.cgi?id=191894 Reviewed by Antti Koivisto. Like padding and border, horizontal margins also force run breaks and offset them. Test: fast/inline/inline-content-with-margin-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-20 Ryosuke Niwa <rniwa@webkit.org> Mutation observers doesn't get notified of character data mutation made by the parser https://bugs.webkit.org/show_bug.cgi?id=191874 Reviewed by Antti Koivisto. Fixed the bug that CharacterData::parserAppendData was never notifying MutationObserver. Test: fast/dom/MutationObserver/observe-parser-character-data-change.html * dom/CharacterData.cpp: (WebCore::CharacterData::parserAppendData): 2018-11-21 Claudio Saavedra <csaavedra@igalia.com> [SOUP] Follow-up robustness improvements to the certificate decoder https://bugs.webkit.org/show_bug.cgi?id=191892 Reviewed by Michael Catanzaro. If at any point the certificate fails to be constructed from the DER data, bail out. Likewise, if the certificate returned is NULL, return false from the decoder to notify the failure to decode it. * platform/network/soup/CertificateInfo.h: (WTF::Persistence::certificateFromCertificatesDataList): (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): 2018-11-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Border should be considered as non-breakable space https://bugs.webkit.org/show_bug.cgi?id=191891 Reviewed by Antti Koivisto. Like padding, border also forces run breaks and offsets them. Test: fast/inline/inline-content-with-border-left-right.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): 2018-11-21 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Use contains and containsAll in InlineFormattingContext::splitInlineRunIfNeeded consistently https://bugs.webkit.org/show_bug.cgi?id=191890 Rearrange the comment numbers to match the logic below. Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): 2018-11-20 Dean Jackson <dino@apple.com> Move WebGPU platform code to platform/graphics/gpu https://bugs.webkit.org/show_bug.cgi?id=191867 <rdar://problem/46190993> Reviewed by Antoine Quint. The underlying implementation of WebGPU doesn't need to live in Modules, since it technically could be used by other parts of the system. It makes more sense for it to be in platform/graphics/gpu. Move... - Modules/webgpu/GPU* -> platform/graphics/gpu - Modules/webgpu/cocoa -> platform/graphics/gpu/cocoa - platform/graphics/gpu/GPULegacy* -> platform/graphics/gpu/legacy/ - platform/graphics/gpu/cocoa/GPULegacy* -> platform/graphics/gpu/legacy/cocoa * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/gpu/GPUCommandBuffer.h: Renamed from Source/WebCore/Modules/webgpu/GPUCommandBuffer.h. * platform/graphics/gpu/GPUDevice.cpp: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.cpp. (WebCore::GPUDevice::createShaderModule const): (WebCore::GPUDevice::createRenderPipeline const): (WebCore::GPUDevice::createCommandBuffer): (WebCore::GPUDevice::getQueue): * platform/graphics/gpu/GPUDevice.h: Renamed from Source/WebCore/Modules/webgpu/GPUDevice.h. (WebCore::GPUDevice::platformDevice const): * platform/graphics/gpu/GPUPipelineDescriptorBase.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineDescriptorBase.h. * platform/graphics/gpu/GPUPipelineStageDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUPipelineStageDescriptor.h. * platform/graphics/gpu/GPUQueue.h: Renamed from Source/WebCore/Modules/webgpu/GPUQueue.h. (WebCore::GPUQueue::platformQueue const): * platform/graphics/gpu/GPURenderPipeline.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipeline.h. (WebCore::GPURenderPipeline::platformRenderPipeline const): * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPURenderPipelineDescriptor.h. * platform/graphics/gpu/GPUShaderModule.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModule.h. (WebCore::GPUShaderModule::platformShaderModule const): * platform/graphics/gpu/GPUShaderModuleDescriptor.h: Renamed from Source/WebCore/Modules/webgpu/GPUShaderModuleDescriptor.h. * platform/graphics/gpu/GPUSwapChain.h: Renamed from Source/WebCore/Modules/webgpu/GPUSwapChain.h. (WebCore::GPUSwapChain::platformLayer const): * platform/graphics/gpu/GPUTexture.h: Renamed from Source/WebCore/Modules/webgpu/GPUTexture.h. * platform/graphics/gpu/GPUTextureFormatEnum.h: Renamed from Source/WebCore/Modules/webgpu/GPUTextureFormatEnum.h. * platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUCommandBufferMetal.mm. (WebCore::GPUCommandBuffer::create): (WebCore::GPUCommandBuffer::GPUCommandBuffer): * platform/graphics/gpu/cocoa/GPUDeviceMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUDeviceMetal.mm. (WebCore::GPUDevice::create): (WebCore::GPUDevice::GPUDevice): * platform/graphics/gpu/cocoa/GPUQueueMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUQueueMetal.mm. (WebCore::GPUQueue::create): (WebCore::GPUQueue::GPUQueue): * platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipelineMetal.mm. (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): * platform/graphics/gpu/cocoa/GPUShaderModuleMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUShaderModuleMetal.mm. (WebCore::GPUShaderModule::create): (WebCore::GPUShaderModule::GPUShaderModule): * platform/graphics/gpu/cocoa/GPUSwapChainMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChainMetal.mm. (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): (WebCore::GPUSwapChain::setDevice): (WebCore::platformTextureFormatForGPUTextureFormat): (WebCore::GPUSwapChain::setFormat): (WebCore::GPUSwapChain::reshape): (WebCore::GPUSwapChain::getNextTexture): (WebCore::GPUSwapChain::present): * platform/graphics/gpu/cocoa/GPUTextureMetal.mm: Renamed from Source/WebCore/Modules/webgpu/cocoa/GPUTextureMetal.mm. (WebCore::GPUTexture::create): (WebCore::GPUTexture::GPUTexture): (WebCore::GPUTexture::createDefaultTextureView): * platform/graphics/gpu/legacy/GPULegacyBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.cpp. (WebCore::GPULegacyBuffer::~GPULegacyBuffer): (WebCore::GPULegacyBuffer::length const): * platform/graphics/gpu/legacy/GPULegacyBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyBuffer.h. (WebCore::GPULegacyBuffer::contents const): (WebCore::GPULegacyBuffer::metal const): * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.cpp. (WebCore::GPULegacyCommandBuffer::~GPULegacyCommandBuffer): * platform/graphics/gpu/legacy/GPULegacyCommandBuffer.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandBuffer.h. (WebCore::GPULegacyCommandBuffer::metal const): * platform/graphics/gpu/legacy/GPULegacyCommandQueue.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.cpp. (WebCore::GPULegacyCommandQueue::~GPULegacyCommandQueue): * platform/graphics/gpu/legacy/GPULegacyCommandQueue.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyCommandQueue.h. (WebCore::GPULegacyCommandQueue::metal const): * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.cpp. (WebCore::GPULegacyComputeCommandEncoder::~GPULegacyComputeCommandEncoder): * platform/graphics/gpu/legacy/GPULegacyComputeCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputeCommandEncoder.h. * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.cpp. (WebCore::GPULegacyComputePipelineState::~GPULegacyComputePipelineState): * platform/graphics/gpu/legacy/GPULegacyComputePipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyComputePipelineState.h. (WebCore::GPULegacyComputePipelineState::metal const): * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.cpp. (WebCore::GPULegacyDepthStencilDescriptor::~GPULegacyDepthStencilDescriptor): * platform/graphics/gpu/legacy/GPULegacyDepthStencilDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilDescriptor.h. (WebCore::GPULegacyDepthStencilDescriptor::metal const): * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.cpp. (WebCore::GPULegacyDepthStencilState::~GPULegacyDepthStencilState): * platform/graphics/gpu/legacy/GPULegacyDepthStencilState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDepthStencilState.h. (WebCore::GPULegacyDepthStencilState::metal const): * platform/graphics/gpu/legacy/GPULegacyDevice.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.cpp. (WebCore::GPULegacyDevice::~GPULegacyDevice): * platform/graphics/gpu/legacy/GPULegacyDevice.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDevice.h. (WebCore::GPULegacyDevice::layer const): (WebCore::GPULegacyDevice::metal const): (WebCore::GPULegacyDevice::markLayerComposited const): * platform/graphics/gpu/legacy/GPULegacyDrawable.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.cpp. (WebCore::GPULegacyDrawable::~GPULegacyDrawable): * platform/graphics/gpu/legacy/GPULegacyDrawable.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyDrawable.h. * platform/graphics/gpu/legacy/GPULegacyEnums.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyEnums.h. * platform/graphics/gpu/legacy/GPULegacyFunction.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.cpp. (WebCore::GPULegacyFunction::~GPULegacyFunction): * platform/graphics/gpu/legacy/GPULegacyFunction.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyFunction.h. (WebCore::GPULegacyFunction::metal const): * platform/graphics/gpu/legacy/GPULegacyLibrary.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.cpp. (WebCore::GPULegacyLibrary::~GPULegacyLibrary): * platform/graphics/gpu/legacy/GPULegacyLibrary.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyLibrary.h. (WebCore::GPULegacyLibrary::metal const): * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.cpp. (WebCore::GPULegacyRenderCommandEncoder::~GPULegacyRenderCommandEncoder): * platform/graphics/gpu/legacy/GPULegacyRenderCommandEncoder.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderCommandEncoder.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassAttachmentDescriptor::~GPULegacyRenderPassAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::~GPULegacyRenderPassColorAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassColorAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::~GPULegacyRenderPassDepthAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDepthAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.cpp. (WebCore::GPULegacyRenderPassDescriptor::~GPULegacyRenderPassDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPassDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPassDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.cpp. (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::~GPULegacyRenderPipelineColorAttachmentDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineColorAttachmentDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.cpp. (WebCore::GPULegacyRenderPipelineDescriptor::~GPULegacyRenderPipelineDescriptor): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineDescriptor.h. * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.cpp. (WebCore::GPULegacyRenderPipelineState::~GPULegacyRenderPipelineState): * platform/graphics/gpu/legacy/GPULegacyRenderPipelineState.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyRenderPipelineState.h. * platform/graphics/gpu/legacy/GPULegacySize.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacySize.h. * platform/graphics/gpu/legacy/GPULegacyTexture.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.cpp. (WebCore::GPULegacyTexture::~GPULegacyTexture): * platform/graphics/gpu/legacy/GPULegacyTexture.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTexture.h. * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.cpp: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.cpp. (WebCore::GPULegacyTextureDescriptor::~GPULegacyTextureDescriptor): * platform/graphics/gpu/legacy/GPULegacyTextureDescriptor.h: Renamed from Source/WebCore/platform/graphics/gpu/GPULegacyTextureDescriptor.h. * platform/graphics/gpu/legacy/cocoa/GPULegacyBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyBufferMetal.mm. (WebCore::GPULegacyBuffer::GPULegacyBuffer): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandBufferMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandBufferMetal.mm. (WebCore::GPULegacyCommandBuffer::GPULegacyCommandBuffer): (WebCore::GPULegacyCommandBuffer::presentDrawable const): (WebCore::GPULegacyCommandBuffer::commit const): * platform/graphics/gpu/legacy/cocoa/GPULegacyCommandQueueMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyCommandQueueMetal.mm. (WebCore::GPULegacyCommandQueue::GPULegacyCommandQueue): (WebCore::GPULegacyCommandQueue::label const): (WebCore::GPULegacyCommandQueue::setLabel const): * platform/graphics/gpu/legacy/cocoa/GPULegacyComputeCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputeCommandEncoderMetal.mm. (WebCore::MTLSizeMake): (WebCore::GPULegacyComputeCommandEncoder::GPULegacyComputeCommandEncoder): (WebCore::GPULegacyComputeCommandEncoder::setComputePipelineState const): (WebCore::GPULegacyComputeCommandEncoder::setBuffer const): (WebCore::GPULegacyComputeCommandEncoder::dispatch const): (WebCore::GPULegacyComputeCommandEncoder::endEncoding const): * platform/graphics/gpu/legacy/cocoa/GPULegacyComputePipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyComputePipelineStateMetal.mm. (WebCore::GPULegacyComputePipelineState::GPULegacyComputePipelineState): * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilDescriptorMetal.mm. (WebCore::GPULegacyDepthStencilDescriptor::GPULegacyDepthStencilDescriptor): (WebCore::GPULegacyDepthStencilDescriptor::depthWriteEnabled const): (WebCore::GPULegacyDepthStencilDescriptor::setDepthWriteEnabled const): (WebCore::GPULegacyDepthStencilDescriptor::depthCompareFunction const): (WebCore::GPULegacyDepthStencilDescriptor::setDepthCompareFunction const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDepthStencilStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDepthStencilStateMetal.mm. (WebCore::GPULegacyDepthStencilState::GPULegacyDepthStencilState): (WebCore::GPULegacyDepthStencilState::label const): (WebCore::GPULegacyDepthStencilState::setLabel const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDeviceMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDeviceMetal.mm. (WebCore::GPULegacyDevice::GPULegacyDevice): (WebCore::GPULegacyDevice::disconnect): (WebCore::GPULegacyDevice::reshape const): (WebCore::GPULegacyDevice::platformLayer const): (WebCore::GPULegacyDevice::operator! const): * platform/graphics/gpu/legacy/cocoa/GPULegacyDrawableMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyDrawableMetal.mm. (WebCore::GPULegacyDrawable::GPULegacyDrawable): (WebCore::GPULegacyDrawable::release): (WebCore::GPULegacyDrawable::metal const): (WebCore::GPULegacyDrawable::texture const): * platform/graphics/gpu/legacy/cocoa/GPULegacyFunctionMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyFunctionMetal.mm. (WebCore::GPULegacyFunction::GPULegacyFunction): (WebCore::GPULegacyFunction::name const): (WebCore::GPULegacyFunction::operator! const): * platform/graphics/gpu/legacy/cocoa/GPULegacyLibraryMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyLibraryMetal.mm. (WebCore::GPULegacyLibrary::GPULegacyLibrary): (WebCore::GPULegacyLibrary::label const): (WebCore::GPULegacyLibrary::setLabel const): (WebCore::GPULegacyLibrary::functionNames const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderCommandEncoderMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderCommandEncoderMetal.mm. (WebCore::GPULegacyRenderCommandEncoder::GPULegacyRenderCommandEncoder): (WebCore::GPULegacyRenderCommandEncoder::setRenderPipelineState const): (WebCore::GPULegacyRenderCommandEncoder::setDepthStencilState const): (WebCore::GPULegacyRenderCommandEncoder::setVertexBuffer const): (WebCore::GPULegacyRenderCommandEncoder::setFragmentBuffer const): (WebCore::GPULegacyRenderCommandEncoder::drawPrimitives const): (WebCore::GPULegacyRenderCommandEncoder::endEncoding const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassAttachmentDescriptor::GPULegacyRenderPassAttachmentDescriptor): (WebCore::GPULegacyRenderPassAttachmentDescriptor::loadAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setLoadAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::storeAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setStoreAction const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::setTexture const): (WebCore::GPULegacyRenderPassAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassColorAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::GPULegacyRenderPassColorAttachmentDescriptor): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::clearColor const): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::setClearColor const): (WebCore::GPULegacyRenderPassColorAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDepthAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::GPULegacyRenderPassDepthAttachmentDescriptor): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::clearDepth const): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::setClearDepth const): (WebCore::GPULegacyRenderPassDepthAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPassDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPassDescriptorMetal.mm. (WebCore::GPULegacyRenderPassDescriptor::GPULegacyRenderPassDescriptor): (WebCore::GPULegacyRenderPassDescriptor::colorAttachments const): (WebCore::GPULegacyRenderPassDescriptor::depthAttachment const): (WebCore::GPULegacyRenderPassDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineColorAttachmentDescriptorMetal.mm. (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::GPULegacyRenderPipelineColorAttachmentDescriptor): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::pixelFormat const): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::setPixelFormat const): (WebCore::GPULegacyRenderPipelineColorAttachmentDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineDescriptorMetal.mm. (WebCore::GPULegacyRenderPipelineDescriptor::GPULegacyRenderPipelineDescriptor): (WebCore::GPULegacyRenderPipelineDescriptor::depthAttachmentPixelFormat const): (WebCore::GPULegacyRenderPipelineDescriptor::setDepthAttachmentPixelFormat const): (WebCore::GPULegacyRenderPipelineDescriptor::setVertexFunction const): (WebCore::GPULegacyRenderPipelineDescriptor::setFragmentFunction const): (WebCore::GPULegacyRenderPipelineDescriptor::colorAttachments const): (WebCore::GPULegacyRenderPipelineDescriptor::reset const): (WebCore::GPULegacyRenderPipelineDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyRenderPipelineStateMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyRenderPipelineStateMetal.mm. (WebCore::GPULegacyRenderPipelineState::GPULegacyRenderPipelineState): (WebCore::GPULegacyRenderPipelineState::label const): (WebCore::GPULegacyRenderPipelineState::setLabel const): (WebCore::GPULegacyRenderPipelineState::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureDescriptorMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureDescriptorMetal.mm. (WebCore::GPULegacyTextureDescriptor::GPULegacyTextureDescriptor): (WebCore::GPULegacyTextureDescriptor::width const): (WebCore::GPULegacyTextureDescriptor::setWidth const): (WebCore::GPULegacyTextureDescriptor::height const): (WebCore::GPULegacyTextureDescriptor::setHeight const): (WebCore::GPULegacyTextureDescriptor::sampleCount const): (WebCore::GPULegacyTextureDescriptor::setSampleCount const): (WebCore::GPULegacyTextureDescriptor::textureType const): (WebCore::GPULegacyTextureDescriptor::setTextureType const): (WebCore::GPULegacyTextureDescriptor::storageMode const): (WebCore::GPULegacyTextureDescriptor::setStorageMode const): (WebCore::GPULegacyTextureDescriptor::usage const): (WebCore::GPULegacyTextureDescriptor::setUsage const): (WebCore::GPULegacyTextureDescriptor::metal const): * platform/graphics/gpu/legacy/cocoa/GPULegacyTextureMetal.mm: Renamed from Source/WebCore/platform/graphics/metal/GPULegacyTextureMetal.mm. (WebCore::GPULegacyTexture::GPULegacyTexture): (WebCore::GPULegacyTexture::width const): (WebCore::GPULegacyTexture::height const): (WebCore::GPULegacyTexture::metal const): 2018-11-21 Adrian Perez de Castro <aperez@igalia.com> [SOUP] Certificate decoder always returns GByteArray with zero size https://bugs.webkit.org/show_bug.cgi?id=191888 Reviewed by Žan Doberšek. No new tests needed. * platform/network/soup/CertificateInfo.h: (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Add missing call to g_byte_array_set_size() to make sure byteArray->len has the correct value. 2018-11-21 Zalan Butjas <zalan@apple.com> [LFC][IFC] Take nonBreakableStart/End into use. https://bugs.webkit.org/show_bug.cgi?id=191873 Reviewed by Antti Koivisto. Offset the final inline runs with the nonBreakableStart/End values. (This patch also fixes relative positioned run verification.) Test: fast/inline/inline-content-with-padding-left-right.html * layout/Verification.cpp: (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): 2018-11-21 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r237845): [cairo] Hyperlink underscore layout issue https://bugs.webkit.org/show_bug.cgi?id=191630 Reviewed by Michael Catanzaro. Only flip Y in GlyphToPathTranslator for ports using CG. * platform/graphics/FontCascade.cpp: (WebCore::GlyphToPathTranslator::GlyphToPathTranslator): 2018-11-21 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Refactor AppendPipeline deinitialization https://bugs.webkit.org/show_bug.cgi?id=191759 Reviewed by Xabier Rodriguez-Calvar. AppendPipeline currently has a method, clearPlayerPrivate(), that the client code uses to deinitialize most of the AppendPipeline... just before actually destructing it in the next line of code. Since at that point there should not be alive RefPtr's pointing to the AppendPipeline there is no need for this kind of pre-deinitialization in this usage pattern. Instead, we can just rely on C++ destructors, cleaning the code a bit and removing the potential for the question "what if `clearPlayerPrivate() has been called before?`": it has not. Assertions have been added to ensure that there is only one alive RefPtr pointing to AppendPipeline, therefore guaranteeing its immediate destruction. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::deinitialize): (WebCore::AppendPipeline::clearPlayerPrivate): Deleted. * platform/graphics/gstreamer/mse/AppendPipeline.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::~MediaPlayerPrivateGStreamerMSE): * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp: (WebCore::MediaSourceClientGStreamerMSE::removedFromMediaSource): 2018-11-20 Dean Jackson <dino@apple.com> Removing using namespace WebCore from WebLayer https://bugs.webkit.org/show_bug.cgi?id=191870 <rdar://problem/46192206> Rubber-stamped by Sam Weinig. Remove "using namespace WebCore" from WebLayer.mm because it will cause type clashes in unified source builds. * platform/graphics/mac/WebLayer.mm: (-[WebLayer drawInContext:]): (-[WebSimpleLayer setNeedsDisplay]): (-[WebSimpleLayer setNeedsDisplayInRect:]): (-[WebSimpleLayer display]): (-[WebSimpleLayer drawInContext:]): 2018-11-20 Ryosuke Niwa <rniwa@webkit.org> Input element gains focus when a selectstart event listener on document prevents the default action https://bugs.webkit.org/show_bug.cgi?id=191714 <rdar://problem/46174389> Reviewed by Antti Koivisto. The bug was caused by WebKit keep firing selectstart upon mousemove after the drag had already started when preventDefault had been called in the previous firings of selectstart event. Because input element has its own editable element and fires selectstart on the input element itself, which won't be prevented by selectstart on docuemnt, this allowed the selection to be set inside the input element even though the mouse cursor was simply passing over the input element after the drag had already started. Fixed the bug by not firing selectstart if the default action had been prevented by the initial firing of selectstart by setting m_mouseDownMayStartDrag to false. This also matches the behaviors of Chrome and Firefox. Test: fast/events/selectstart-prevent-default-should-not-focus-input.html * page/EventHandler.cpp: (WebCore::EventHandler::updateSelectionForMouseDownDispatchingSelectStart): (WebCore::EventHandler::updateSelectionForMouseDrag): 2018-11-20 Christopher Reid <chris.reid@sony.com> Remove the need for LocalizedStringsWPE.cpp https://bugs.webkit.org/show_bug.cgi?id=191854 Reviewed by Michael Catanzaro. No change in behavior. Consolidate "Search the Web" as the default search context menu text on non-COCOA ports. GTK, WPE, and non-CF WIN all had the same default localizedString function of String::fromUTF8. Move that to LocalizedString.cpp as the default implementation for all ports not using CF. * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: * platform/gtk/LocalizedStringsGtk.cpp: * platform/win/LocalizedStringsWin.cpp: * platform/wpe/LocalizedStringsWPE.cpp: Removed. 2018-11-20 Zan Dobersek <zdobersek@igalia.com> Segfaults on https://terminalizer.com/ https://bugs.webkit.org/show_bug.cgi?id=191805 Reviewed by Michael Catanzaro. In HarfBuzzFace, the CacheEntry's HashMap object that caches Unicode codepoints and their corresponding glyph indices should allow zero values as valid keys since zero is a valid Unicode codepoint. This change enables properly caching zero codepoints, avoiding repetitive additions to the HashMap cache that end up in a crash. * platform/graphics/harfbuzz/HarfBuzzFace.h: Move the elongated GlyphCache type alias to the public section of HarfBuzzFace class declaration, making it reusable in the helper HarfBuzzFontData struct. * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 2018-11-20 Antti Koivisto <antti@apple.com> Update hover state in composed tree https://bugs.webkit.org/show_bug.cgi?id=191860 Reviewed by Zalan Bujtas. The code was already mostly switched over from render tree to composed tree. This patch replaces the remaining common ancestor search code with a DOM based equivalent. * dom/Document.cpp: (WebCore::findNearestCommonComposedAncestor): (WebCore::Document::updateHoverActiveState): (WebCore::nearestCommonHoverAncestor): Deleted. * rendering/RenderBlock.cpp: (WebCore::RenderBlock::hoverAncestor const): Deleted. * rendering/RenderBlock.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::hoverAncestor const): Deleted. No longer needed. * rendering/RenderElement.h: 2018-11-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Measure run with non-breakable start/end. https://bugs.webkit.org/show_bug.cgi?id=191850 Reviewed by Antti Koivisto. Line breaking needs to know the complete width of the run including padding etc. * layout/Verification.cpp: (WebCore::Layout::collectFlowBoxSubtree): (WebCore::Layout::collectInlineBoxes): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::runWidth): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): (WebCore::Layout::InlineLineBreaker::runWidth const): (WebCore::Layout::InlineLineBreaker::textWidth const): * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/text/TextUtil.cpp: (WebCore::Layout::TextUtil::hyphenPositionBefore): (WebCore::Layout::TextUtil::width): (WebCore::Layout::TextUtil::fixedPitchWidth): (WebCore::Layout::TextUtil::TextUtil): Deleted. (WebCore::Layout::TextUtil::width const): Deleted. (WebCore::Layout::TextUtil::hyphenPositionBefore const): Deleted. (WebCore::Layout::TextUtil::textWidth const): Deleted. (WebCore::Layout::TextUtil::fixedPitchWidth const): Deleted. * layout/inlineformatting/text/TextUtil.h: 2018-11-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] InlineFormattingContext::Line should hold the list of runs for the current line. https://bugs.webkit.org/show_bug.cgi?id=191845 Reviewed by Antti Koivisto. Collect the runs in InlineFormattingContext::Line and transfer them to InlineFormattingState during line closing. (In the most common cases, this is only one extra vector::append() call.) * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::createFinalRuns const): (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): (WebCore::Layout::InlineFormattingContext::closeLine const): (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::hasContent const): (WebCore::Layout::InlineFormattingContext::Line::runs): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): (WebCore::Layout::InlineFormattingContext::Geometry::alignRuns): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): (WebCore::Layout::InlineFormattingContext::Line::Line): Deleted. 2018-11-20 Zalan Butjas <zalan@apple.com> [LFC][IFC] Introduce InlineItem::nonBreakableStart/End https://bugs.webkit.org/show_bug.cgi?id=191839 Reviewed by Antti Koivisto. Non-breakable start/end marks margin/padding/border space (even when it does not directly come from the associated layout box) <span style="padding: 5px"><span>nested content with padding parent</span</span> <nested content with padding parent> <- inline run has 5px non-breakable start/end. <span style="border: 5px solid green"><span style="padding-right: 10px; margin-right: 1px">1</span>2</span><span> 3</span> <1> <- inline run has 5px non-breakable start and 11px non-breakable end. <2> <- inline run has 0px non-breakable start and 5px non-breakable end. <3> <- no non-breakable values. This is what the runs look like (input to line breaking) < 1 2 > < > (whitespace) <3> The line breaking treats the paddding/border etc space as part of the run and as non-breaking opportunity. With the given runs the first position where we can break the line is at the whitespace. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::nonBreakableStart const): (WebCore::Layout::InlineItem::nonBreakableEnd const): (WebCore::Layout::InlineItem::addNonBreakableStart): (WebCore::Layout::InlineItem::addNonBreakableEnd): 2018-11-20 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move detaching rules from InlineFormattingState to InlineItem https://bugs.webkit.org/show_bug.cgi?id=191838 Reviewed by Antti Koivisto. This is in preparation for adding more context to InlineItem. In addition to detaching rules it will also hold non-breakable start/end information. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted. (WebCore::Layout::InlineFormattingState::detachingRules const): Deleted. * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::setDetachingRules): Deleted. * layout/inlineformatting/InlineItem.h: (WebCore::Layout::InlineItem::addDetachingRule): (WebCore::Layout::InlineItem::detachingRules const): 2018-11-20 Zalan Bujjtas <zalan@apple.com> [LFC][IFC] InlineRunProvider::append() should just take const InlineItem&. https://bugs.webkit.org/show_bug.cgi?id=191837 Reviewed by Antti Koivisto. This allows us to remove the InlineFormattingState dependency as well. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineRunProvider.cpp: (WebCore::Layout::InlineRunProvider::InlineRunProvider): (WebCore::Layout::InlineRunProvider::append): * layout/inlineformatting/InlineRunProvider.h: 2018-11-20 Thibault Saunier <tsaunier@igalia.com> [GStreamer] Enhance debugging by making sure to print the pipeline in MediaPlayerPrivateGStreamer https://bugs.webkit.org/show_bug.cgi?id=191586 Reviewed by Xabier Rodriguez-Calvar. This is minor changes that do not require tests. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::setAudioStreamProperties): (WebCore::MediaPlayerPrivateGStreamer::~MediaPlayerPrivateGStreamer): (WebCore::MediaPlayerPrivateGStreamer::setPlaybinURL): (WebCore::MediaPlayerPrivateGStreamer::loadFull): (WebCore::MediaPlayerPrivateGStreamer::commitLoad): (WebCore::MediaPlayerPrivateGStreamer::readyTimerFired): (WebCore::MediaPlayerPrivateGStreamer::changePipelineState): (WebCore::MediaPlayerPrivateGStreamer::prepareToPlay): (WebCore::MediaPlayerPrivateGStreamer::play): (WebCore::MediaPlayerPrivateGStreamer::pause): (WebCore::MediaPlayerPrivateGStreamer::durationMediaTime const): (WebCore::MediaPlayerPrivateGStreamer::seek): (WebCore::MediaPlayerPrivateGStreamer::updatePlaybackRate): (WebCore::MediaPlayerPrivateGStreamer::paused const): (WebCore::MediaPlayerPrivateGStreamer::enableTrack): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio): (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfText): (WebCore::MediaPlayerPrivateGStreamer::handleMessage): (WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): (WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): (WebCore::MediaPlayerPrivateGStreamer::maxMediaTimeSeekable const): (WebCore::MediaPlayerPrivateGStreamer::totalBytes const): (WebCore::MediaPlayerPrivateGStreamer::uriDecodeBinElementAddedCallback): (WebCore::MediaPlayerPrivateGStreamer::downloadBufferFileCreatedCallback): (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone): (WebCore::MediaPlayerPrivateGStreamer::updateStates): (WebCore::MediaPlayerPrivateGStreamer::loadNextLocation): (WebCore::MediaPlayerPrivateGStreamer::didEnd): (WebCore::MediaPlayerPrivateGStreamer::setDownloadBuffering): (WebCore::MediaPlayerPrivateGStreamer::setPreload): (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): 2018-11-20 Manuel Rego Casasnovas <rego@igalia.com> [css-grid] Consider scrollbars in populateGridPositionsForDirection() https://bugs.webkit.org/show_bug.cgi?id=191656 Reviewed by Javier Fernandez. We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(), that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction) but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction). The patch modifies the method so it takes into account scrollbar size in order to compute the position of the columns/rows depending on the direction and the writing mode. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateGridPositionsForDirection): 2018-11-19 Ryosuke Niwa <rniwa@webkit.org> Click on node assigned to slot in button's shadow cause loss of button focus https://bugs.webkit.org/show_bug.cgi?id=191694 <rdar://problem/46107920> Reviewed by Wenson Hsieh. Fixed the bug by traversing the parent in the composed tree when looking for an element to focus. Test: fast/shadow-dom/focus-slot-parent.html * page/EventHandler.cpp: (WebCore::EventHandler::dispatchMouseEvent): Fixed the bug. Also use RefPtr instead of a raw pointer. 2018-11-19 Fujii Hironori <Hironori.Fujii@sony.com> REGRESSION(r238350) [curl] CertificateInfo.h: error: template specialization requires 'template<>' https://bugs.webkit.org/show_bug.cgi?id=191849 Unreviewed build fix for clang-cl builds. No new tests because there's no behaviour change. * platform/network/curl/CertificateInfo.h: (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): 2018-11-19 Basuke Suzuki <basuke.suzuki@sony.com> [Curl] Add API for CertificateInfo. https://bugs.webkit.org/show_bug.cgi?id=191647 Reviewed by Alex Christensen. Minor changes for WebKit API. Tests: TestWebKitAPI/Tests/WebKit/curl/Certificates.cpp * platform/network/curl/CertificateInfo.h: * platform/network/curl/CertificateInfoCurl.cpp: (WebCore::CertificateInfo::CertificateInfo): (WebCore::CertificateInfo::makeCertificate): * platform/network/curl/CurlSSLVerifier.cpp: (WebCore::BIOHolder::asCertificate): 2018-11-19 Justin Fan <justin_fan@apple.com> [WebGPU] Begin implementing WebGPUTexture, WebGPUTextureView, and WebGPUTextureFormatEnum, and WebGPUSwapChain::configure upgrades https://bugs.webkit.org/show_bug.cgi?id=191794 Reviewed by Dean Jackson. Test: webgpu/textures-textureviews.html Implement basic functionality for getting the next WebGPUTexture and TextureView from the WebGPURenderingContext to use as a render destination for the next draw call. Also introduce WebGPUTextureFormatEnum and the ability to configure the context with a chosen texture format. * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/GPUSwapChain.h: Texture/Pixel format can now be set. * Modules/webgpu/GPUTexture.h: Added. Interface to a MTLTexture. * Modules/webgpu/GPUTextureFormatEnum.h: Added. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createRenderPipeline const): Removed now-unnecessary enum class cast. * Modules/webgpu/WebGPURenderPipelineDescriptor.h: Rather than duplicate GPURenderPipelineDescriptor::PrimitiveTopology, alias to it. * Modules/webgpu/WebGPUSwapChain.cpp: (WebCore::WebGPUSwapChain::configure): Can now specify a specific texture format for the underlying CAMetalLayer. (WebCore::WebGPUSwapChain::getNextTexture): Added. Request the next drawable texture. * Modules/webgpu/WebGPUSwapChain.h: Expose getNextTexture(). * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/WebGPUTexture.cpp: Added. (WebCore::WebGPUTexture::create): (WebCore::WebGPUTexture::WebGPUTexture): (WebCore::WebGPUTexture::createDefaultTextureView): * Modules/webgpu/WebGPUTexture.h: Added. * Modules/webgpu/WebGPUTexture.idl: Added. * Modules/webgpu/WebGPUTextureFormatEnum.h: Added. Type alias for GPUTextureFormatEnum. * Modules/webgpu/WebGPUTextureFormatEnum.idl: Added. Used to represent any texture format used by WebGPU. * Modules/webgpu/WebGPUTextureView.cpp: Added. (WebCore::WebGPUTextureView::create): (WebCore::WebGPUTextureView::WebGPUTextureView): * Modules/webgpu/WebGPUTextureView.h: Added. * Modules/webgpu/WebGPUTextureView.idl: Added. * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::setFormat): Called by WebGPUSwapChain::configure(). (WebCore::GPUSwapChain::getNextTexture): * Modules/webgpu/cocoa/GPUTextureFormatEnumMetal.mm: Added. (WebCore::convertAndValidate): Convert the WebGPUTextureFormatEnum to a MTLPixelFormat. * Modules/webgpu/cocoa/GPUTextureMetal.mm: Added. (WebCore::GPUTexture::create): (WebCore::GPUTexture::GPUTexture): (WebCore::GPUTexture::createDefaultTextureView): Uses the pixelFormat of the original texture. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2018-11-19 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: "Reload Web Inspector" button no longer partially works https://bugs.webkit.org/show_bug.cgi?id=191773 <rdar://problem/46139932> Reviewed by Devin Rousso. * inspector/InspectorFrontendClient.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::reopen): * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.idl: Provide a host call to reopen an inspector window to reload it. * testing/Internals.cpp: Stub implementation, this is not used in tests. 2018-11-19 Rob Buis <rbuis@igalia.com> Setting document.title should have no effect for non SVG/HTML documents https://bugs.webkit.org/show_bug.cgi?id=191643 Reviewed by Chris Dumez. Setting document.title should have no effect for non SVG/HTML documents, see https://html.spec.whatwg.org/multipage/dom.html#document.title. Behavior matches Firefox and Chrome. Test: imported/w3c/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-not-in-html-svg.html * dom/Document.cpp: (WebCore::Document::setTitle): 2018-11-19 Wenson Hsieh <wenson_hsieh@apple.com> Dragging image with a border-image larger than the image element crashes https://bugs.webkit.org/show_bug.cgi?id=191817 <rdar://problem/46159222> Reviewed by Ryosuke Niwa. When dragging an image element, if the image element has: (1) box-sizing: border-box; (2) a border-image (3) a border-top-width that is at least as large as the height of the element and/or a border-left-width that is at least as large as the width of the element ...then upon drag, we will fail to create a suitable drag image using the bounding box of the image element since the size is empty, thereby causing a crash. To fix this, we bail out of this bounding-rect-dependent codepath for generating a drag image in the case where the bounding rect is empty, and instead fall back to an icon representation for the drag image. Test: fast/events/drag-image-with-border-image.html * page/DragController.cpp: (WebCore::DragController::doImageDrag): 2018-11-18 Zan Dobersek <zdobersek@igalia.com> HarfBuzzFace::CacheEntry should use 32-bit values in its HashMap https://bugs.webkit.org/show_bug.cgi?id=191825 Reviewed by Michael Catanzaro. The HashMap-based glyph cache contained in HarfBuzzFace::CacheEntry objects is used to map given Unicode codepoints to corresponding glyph indices (which occurs in the harfBuzzGetGlyph() function that's invoked by HarfBuzz). The 16-bit unsigned integer as the map's value type is not enough here when the glyph index mapping is done through Freetype -- its API returns 32-bit glyph indices, and Cairo assigns this value to the 64-bit unsigned index variable in the cairo_glyph_t struct. The value type is thus bumped to 32 bits to match the unsigned type size of the index's origin. * platform/graphics/harfbuzz/HarfBuzzFace.h: * platform/graphics/harfbuzz/HarfBuzzFaceCairo.cpp: 2018-11-17 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Remove all usages of UIItemProvider, UIItemProviderReading, and related classes https://bugs.webkit.org/show_bug.cgi?id=191819 Reviewed by Dan Bernstein. Replace UIItemProvider (and related classes) with NSItemProvider. * platform/ios/PlatformPasteboardIOS.mm: (WebCore::registerItemToPasteboard): * platform/ios/WebItemProviderPasteboard.h: * platform/ios/WebItemProviderPasteboard.mm: (-[WebItemProviderDataRegistrar registerItemProvider:]): (-[WebItemProviderWritableObjectRegistrar initWithObject:]): (-[WebItemProviderWritableObjectRegistrar representingObject]): (-[WebItemProviderWritableObjectRegistrar registerItemProvider:]): (-[WebItemProviderRegistrationInfoList addRepresentingObject:]): (-[WebItemProviderRegistrationInfoList itemProvider]): (-[WebItemProviderPasteboard pasteboardTypes]): (-[WebItemProviderPasteboard _preLoadedDataConformingToType:forItemProviderAtIndex:]): (-[WebItemProviderPasteboard dataForPasteboardType:inItemSet:]): (allLoadableClasses): (classForTypeIdentifier): (-[WebItemProviderPasteboard valuesForPasteboardType:inItemSet:]): (-[WebItemProviderPasteboard numberOfFiles]): (-[WebItemProviderPasteboard itemProviderAtIndex:]): (-[WebItemProviderPasteboard enumerateItemProvidersWithBlock:]): * platform/mac/DragDataMac.mm: (WebCore::DragData::containsURL const): 2018-11-17 Ross Kirsling <ross.kirsling@sony.com> Remove superfluous LayoutUnit initializations https://bugs.webkit.org/show_bug.cgi?id=191791 Reviewed by Simon Fraser. First step toward making LayoutUnit constructors explicit: eliminate `= 0` when constructing LayoutUnit lvalues. * editing/Editor.cpp: (WebCore::Editor::firstRectForRange const): * editing/FrameSelection.cpp: (WebCore::FrameSelection::modify): (WebCore::FrameSelection::lineDirectionPointForBlockDirectionNavigation): * html/shadow/SliderThumbElement.cpp: (WebCore::RenderSliderContainer::computeLogicalHeight const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): * page/FrameView.cpp: (WebCore::FrameView::forceLayoutForPagination): * page/SpatialNavigation.cpp: (WebCore::scrollInDirection): (WebCore::distanceDataForNode): * rendering/AutoTableLayout.cpp: (WebCore::AutoTableLayout::layout): * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::marginIntrinsicLogicalWidthForChild): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::placeBoxesInBlockDirection): (WebCore::InlineFlowBox::paintFillLayer): (WebCore::InlineFlowBox::paintBoxDecorations): (WebCore::InlineFlowBox::paintMask): (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const): (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const): * rendering/RenderBlock.cpp: (WebCore::RenderBlock::marginIntrinsicLogicalWidthForChild const): (WebCore::RenderBlock::layoutPositionedObject): (WebCore::RenderBlock::selectionGapRectsForRepaint): (WebCore::RenderBlock::paintSelection): (WebCore::RenderBlock::textIndentOffset const): (WebCore::RenderBlock::computeBlockPreferredLogicalWidths const): * rendering/RenderBlockFlow.cpp: (WebCore::RenderBlockFlow::rebuildFloatingObjectSetFromIntrudingFloats): (WebCore::RenderBlockFlow::layoutBlock): (WebCore::RenderBlockFlow::layoutBlockChildren): (WebCore::RenderBlockFlow::marginValuesForChild const): (WebCore::RenderBlockFlow::estimateLogicalTopPosition): (WebCore::RenderBlockFlow::applyBeforeBreak): (WebCore::RenderBlockFlow::applyAfterBreak): (WebCore::RenderBlockFlow::adjustBlockChildForPagination): (WebCore::RenderBlockFlow::clearFloats): (WebCore::RenderBlockFlow::lowestFloatLogicalBottom const): (WebCore::RenderBlockFlow::lowestInitialLetterLogicalBottom const): (WebCore::RenderBlockFlow::addOverhangingFloats): (WebCore::RenderBlockFlow::getClearDelta): (WebCore::RenderBlockFlow::computeInlinePreferredLogicalWidths const): * rendering/RenderBlockLineLayout.cpp: (WebCore::setLogicalWidthForTextRun): (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange): (WebCore::RenderBlockFlow::determineStartPosition): * rendering/RenderBox.cpp: (WebCore::RenderBox::fillAvailableMeasure const): (WebCore::RenderBox::computeIntrinsicLogicalWidthUsing const): (WebCore::RenderBox::computeLogicalWidthInFragmentUsing const): (WebCore::RenderBox::computePercentageLogicalHeight const): (WebCore::RenderBox::computeReplacedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalWidthUsing const): (WebCore::RenderBox::computePositionedLogicalHeightUsing const): (WebCore::RenderBox::computePositionedLogicalWidthReplaced const): (WebCore::RenderBox::computePositionedLogicalHeightReplaced const): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::computedCSSPadding const): (WebCore::RenderBoxModelObject::calculateBackgroundImageGeometry const): * rendering/RenderDeprecatedFlexibleBox.cpp: (WebCore::marginWidthForChild): (WebCore::RenderDeprecatedFlexibleBox::layoutHorizontalBox): (WebCore::RenderDeprecatedFlexibleBox::layoutVerticalBox): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::paintObject): * rendering/RenderFragmentedFlow.cpp: (WebCore::RenderFragmentedFlow::validateFragments): (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const): (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect): * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::paint): * rendering/RenderListItem.cpp: (WebCore::RenderListItem::positionListMarker): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::computePreferredLogicalWidths): (WebCore::RenderListMarker::updateMargins): * rendering/RenderMultiColumnSet.cpp: (WebCore::RenderMultiColumnSet::initialBlockOffsetForPainting const): * rendering/RenderRubyRun.cpp: (WebCore::RenderRubyRun::layoutBlock): * rendering/RenderTable.cpp: (WebCore::RenderTable::convertStyleLogicalWidthToComputedWidth): (WebCore::RenderTable::layout): (WebCore::RenderTable::offsetWidthForColumn const): (WebCore::RenderTable::offsetHeightForColumn const): (WebCore::RenderTable::outerBorderBefore const): (WebCore::RenderTable::outerBorderAfter const): (WebCore::RenderTable::outerBorderStart const): (WebCore::RenderTable::outerBorderEnd const): * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::logicalWidthFromColumns const): (WebCore::RenderTableCell::computeIntrinsicPadding): * rendering/RenderTableSection.cpp: (WebCore::RenderTableSection::calcRowLogicalHeight): (WebCore::RenderTableSection::distributeExtraLogicalHeightToPercentRows): (WebCore::RenderTableSection::distributeExtraLogicalHeightToAutoRows): (WebCore::RenderTableSection::distributeRemainingExtraLogicalHeight): (WebCore::RenderTableSection::layoutRows): (WebCore::RenderTableSection::calcOuterBorderBefore const): (WebCore::RenderTableSection::calcOuterBorderAfter const): (WebCore::RenderTableSection::calcOuterBorderStart const): (WebCore::RenderTableSection::calcOuterBorderEnd const): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::alignBoxesInBlockDirection): (WebCore::RootInlineBox::beforeAnnotationsAdjustment const): (WebCore::RootInlineBox::lineSnapAdjustment const): (WebCore::RootInlineBox::verticalPositionForBox): * rendering/line/BreakingContext.h: (WebCore::inlineLogicalWidth): * rendering/mathml/RenderMathMLBlock.cpp: (WebCore::RenderMathMLBlock::layoutItems): * rendering/mathml/RenderMathMLFraction.cpp: (WebCore::RenderMathMLFraction::layoutBlock): * rendering/mathml/RenderMathMLOperator.cpp: (WebCore::RenderMathMLOperator::computePreferredLogicalWidths): * rendering/mathml/RenderMathMLRoot.cpp: (WebCore::RenderMathMLRoot::computePreferredLogicalWidths): (WebCore::RenderMathMLRoot::paint): * rendering/mathml/RenderMathMLRow.cpp: (WebCore::RenderMathMLRow::computePreferredLogicalWidths): * rendering/mathml/RenderMathMLScripts.cpp: (WebCore::RenderMathMLScripts::layoutBlock): * rendering/mathml/RenderMathMLUnderOver.cpp: (WebCore::RenderMathMLUnderOver::stretchHorizontalOperatorsAndLayoutChildren): (WebCore::RenderMathMLUnderOver::layoutBlock): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::getShadowInsetExtent const): * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::layout): 2018-11-17 Simon Fraser <simon.fraser@apple.com> Avoid triggering compositing updates when only the root layer is composited https://bugs.webkit.org/show_bug.cgi?id=191813 Reviewed by Zalan Bujtas. If we know that the only composited layer is the root, we can avoid triggering deep compositing updates sometimes, for example when layout changes size or position, or when z-order lists change. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): Consult the layer.hasCompositingDescendant() flag to cut off descendants traversal when possible. (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-17 Simon Fraser <simon.fraser@apple.com> Fix an error in 238354 - !=, not ==. Fixes test failures. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerBecameNonComposited): 2018-11-17 Simon Fraser <simon.fraser@apple.com> Clarify RenderLayerCompositor::hasAnyAdditionalCompositedLayers() and related code. https://bugs.webkit.org/show_bug.cgi?id=191810 Reviewed by Zalan Bujtas. Rename m_compositedLayerCount to m_contentLayersCount and have it track layers other than the RenderView's layer. hasAnyAdditionalCompositedLayers() is really about whether we can drop out of compositing because no content layer is composited, and overlays don't require compositing, so rename it. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::needsCompositingForContentOrOverlays const): (WebCore::RenderLayerCompositor::layerBecameComposited): (WebCore::RenderLayerCompositor::layerBecameNonComposited): (WebCore::RenderLayerCompositor::layerTreeAsText): (WebCore::RenderLayerCompositor::hasAnyAdditionalCompositedLayers const): Deleted. * rendering/RenderLayerCompositor.h: 2018-11-17 Simon Fraser <simon.fraser@apple.com> Rename RenderLayerCompositor::inCompositingMode() to usesCompositing() https://bugs.webkit.org/show_bug.cgi?id=191808 Reviewed by Zalan Bujtas. Other code uses "usesCompositing" so standardize on that (future changes will make "compositing mode" more ambiguous). Also remove a FrameView function that only had one caller. * page/FrameView.cpp: (WebCore::FrameView::clearBackingStores): (WebCore::FrameView::handleDeferredScrollbarsUpdateAfterDirectionChange): (WebCore::FrameView::delegatesScrollingDidChange): (WebCore::FrameView::hasCompositedContent const): Deleted. * page/FrameView.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::rebuildZOrderLists): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingPolicy): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::layerStyleChanged): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::parentFrameContentLayers): (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::needsToBeComposited const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged): (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): * rendering/RenderLayerCompositor.h: * rendering/RenderView.cpp: (WebCore::RenderView::repaintViewAndCompositedLayers): (WebCore::RenderView::usesCompositing const): 2018-11-17 Devin Rousso <drousso@apple.com> Web Inspector: Network: add button to show system certificate dialog https://bugs.webkit.org/show_bug.cgi?id=191458 <rdar://problem/45977019> Reviewed by Joseph Pecoraro. Test: http/tests/inspector/network/getSerializedCertificate.html * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::getSerializedCertificate): Added. * inspector/InspectorFrontendHost.idl: * inspector/InspectorFrontendHost.h: * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::supportsShowCertificate): Added. (WebCore::InspectorFrontendHost::showCertificate): Added. * inspector/InspectorFrontendClient.h: (InspectorFrontendClient::showCertificate): Added. * testing/Internals.cpp: (InspectorStubFrontend::showCertificate): Added. * platform/network/cf/CertificateInfo.h: (WTF::Persistence::encodeCFData): Added. (WTF::Persistence::decodeCFData): Added. (WTF::Persistence::encodeSecTrustRef): Added. (WTF::Persistence::decodeSecTrustRef): Added. (WTF::Persistence::encodeCertificateChain): Added. (WTF::Persistence::decodeCertificateChain): Added. (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added. (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added. * platform/network/cf/CertificateInfoCFNet.cpp: * platform/network/cocoa/CertificateInfoCocoa.mm: * platform/network/curl/CertificateInfo.h: (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added. (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added. * platform/network/soup/CertificateInfo.h: (WTF::Persistence::Coder<GRefPtr<GByteArray>>::encode): Added. (WTF::Persistence::Coder<GRefPtr<GByteArray>>::decode): Added. (WTF::Persistence::certificatesDataListFromCertificateInfo): Added. (WTF::Persistence::certificateFromCertificatesDataList): Added. (WTF::Persistence::Coder<WebCore::CertificateInfo>::encode): Added. (WTF::Persistence::Coder<WebCore::CertificateInfo>::decode): Added. 2018-11-17 Zalan Bujtas <zalan@apple.com> [LFC][IFC] InlineFormattingState::addDetachingRule should accumulate rules. https://bugs.webkit.org/show_bug.cgi?id=191801 Reviewed by Antti Koivisto. before<span style="position: relative">positioned</span>after In the example above the <positioned> inline box has both the BreakAtStart and the BreakAtEnd rules. While walking through the inline tree, we add BreakAtStart first and when we figure it's the last child too, we add BreakAtEnd as well. BreakAtEnd should not clear the BreakAtStart rule. Test: fast/inline/simple-inline-with-out-of-flow-descendant2.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::addDetachingRule): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::addDetachingRule): Deleted. 2018-11-17 Jonathan Hammer <jonathan@e3software.com> Caret stops blinking after context menu shown https://bugs.webkit.org/show_bug.cgi?id=191715 Reviewed by Ryosuke Niwa. Changed EventHandler::sendContextMenuEvent to un-suspend caret blinking so that the caret continues to blink even after the context menu is dismissed. The normal way of un-suspendeding caret blinking (in EventHandler::handleMouseReleaseEvent) does not apply in the case of context menus because handleMouseReleaseEvent is not called once the context menu is up. Test: fast/events/contextmenu-dismiss-blink-caret.html * page/EventHandler.cpp: (WebCore::EventHandler::sendContextMenuEvent): * testing/Internals.cpp: (WebCore::Internals::isCaretBlinkingSuspended): * testing/Internals.h: * testing/Internals.idl: 2018-11-16 Antoine Quint <graouts@apple.com> [Pointer Events] event.isPrimary doesn't always represent the oldest active touch https://bugs.webkit.org/show_bug.cgi?id=191752 <rdar://problem/46129270> Reviewed by Dean Jackson. Provide isPrimary to the constructor so its value can be determined at the call site. Test: pointerevents/ios/pointer-events-is-primary.html * dom/PointerEvent.h: * dom/ios/PointerEventIOS.cpp: (WebCore::PointerEvent::create): (WebCore::PointerEvent::PointerEvent): (WebCore::m_isPrimary): 2018-11-16 Alex Christensen <achristensen@webkit.org> Tweak _showSafeBrowsingWarningWithTitle SPI https://bugs.webkit.org/show_bug.cgi?id=191799 Reviewed by Wenson Hsieh. It turns out I needed to expose both sentinel values used in safe browsing for my application of this SPI in Mac Safari. Allowing the caller to make its own sentinel values is insufficient because the malware confirmation needs to be over the warning. The completion handler parameter should just be a bool indicating whether the user has chosen to continue after all warnings. Covered by updated API tests. * en.lproj/Localizable.strings: * platform/LocalizedStrings.cpp: (WebCore::formControlCancelButtonTitle): Make "Cancel"'s description a little more generic. 2018-11-16 Simon Fraser <simon.fraser@apple.com> Optimize composited iframe layer hookup https://bugs.webkit.org/show_bug.cgi?id=191778 Reviewed by Zalan Bujtas. The change made in r238229 can be more targeted; we only need to hook up iframe content layers when the layer is already composited (otherwise the updateBacking() above would have triggered the work), and when it's a RenderWidget layer. Tested by existing tests. * rendering/RenderLayer.cpp: (WebCore::outputPaintOrderTreeRecursive): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-16 Ross Kirsling <ross.kirsling@sony.com> Provide default implementation of Widget https://bugs.webkit.org/show_bug.cgi?id=191784 Reviewed by Michael Catanzaro. * SourcesWPE.txt: * platform/Widget.cpp: (WebCore::Widget::Widget): (WebCore::Widget::frameRect const): (WebCore::Widget::~Widget): (WebCore::Widget::setFrameRect): (WebCore::Widget::paint): (WebCore::Widget::setFocus): (WebCore::Widget::setCursor): (WebCore::Widget::show): (WebCore::Widget::hide): (WebCore::Widget::setIsSelected): * platform/gtk/WidgetGtk.cpp: (WebCore::Widget::Widget): Deleted. (WebCore::Widget::frameRect const): Deleted. * platform/win/WidgetWin.cpp: (WebCore::Widget::Widget): Deleted. (WebCore::Widget::frameRect const): Deleted. * platform/wpe/WidgetWPE.cpp: Removed. 2018-11-16 Chris Dumez <cdumez@apple.com> [macOS] Label "prewarmed" WebContent processes in Activity Monitor https://bugs.webkit.org/show_bug.cgi?id=191765 <rdar://problem/45953463> Reviewed by Geoffrey Garen. * en.lproj/Localizable.strings: 2018-11-16 Jeremy Jones <jeremyj@apple.com> Enable external playback for video in element fullscreen. https://bugs.webkit.org/show_bug.cgi?id=190359 rdar://problem/42560085 Reviewed by Jer Noble. No new tests because we don't have a good way to test external playback. Any video that might be auto-pipped from element fullscreen should also enable external playback for video out. PiP and external playback are mutually exclusive. Instead of preventing PiP when external playback is active, allow PiP, but disable external playback while PiP is active. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::setVideoFullscreenStandby): * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::setVideoFullscreenStandby): (WebCore::MediaPlayer::videoFullscreenStandby const): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerVideoFullscreenStandby const): * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::setVideoFullscreenStandby): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenStandby): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback): 2018-11-16 Jer Noble <jer.noble@apple.com> Regression(r233865): Causes synchronous IPC in the middle of layout https://bugs.webkit.org/show_bug.cgi?id=188307 <rdar://problem/42807306> Reviewed by Eric Carlson. Revert the changes added in r233865. Rather than make a syncronous call to the UIProcess to query whether the view has been backgrounded while (e.g.) JS has been spinning, perform the steps of the requestFullscreen() method on the next run loop, allowing messages from the UIProcess about page visibilty to be delivered first. * dom/Document.cpp: (WebCore::Document::requestFullScreenForElement): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::enterFullscreen): * html/HTMLMediaElement.h: * page/ChromeClient.h: 2018-11-16 Ross Kirsling <ross.kirsling@sony.com> Provide default implementation of Cursor https://bugs.webkit.org/show_bug.cgi?id=191772 Reviewed by Michael Catanzaro. * SourcesWPE.txt: * platform/Cursor.cpp: (WebCore::Cursor::ensurePlatformCursor const): * platform/wpe/CursorWPE.cpp: Removed. 2018-11-16 Don Olmstead <don.olmstead@sony.com> EditorWPE should be EditorLibWPE https://bugs.webkit.org/show_bug.cgi?id=191774 Reviewed by Michael Catanzaro. The platform specific implementations of Editor are all around the platform's Pasteboard. Since the Pasteboard implementation is now based around USE(LIBWPE) EditorWPE should be renamed to EditorLibWPE. * SourcesWPE.txt: * editing/libwpe/EditorLibWPE.cpp: Renamed from Source/WebCore/editing/wpe/EditorWPE.cpp. 2018-11-16 Jeremy Jones <jeremyj@apple.com> Include AirPlay destination name in AirPlay placard. https://bugs.webkit.org/show_bug.cgi?id=191574 rdar://problem/45536144 Reviewed by Eric Carlson. Updated existing tests. Include the name of the AirPlay destination in the video element's AirPlay placard. * Modules/modern-media-controls/controls/airplay-placard.js: (AirplayPlacard): * Modules/modern-media-controls/controls/placard.js: * Modules/modern-media-controls/media/placard-support.js: (PlacardSupport.prototype._updatePlacard): (PlacardSupport.prototype._updateAirPlayPlacard): (PlacardSupport): * en.lproj/modern-media-controls-localized-strings.js: 2018-11-16 Zalan Bujtas <zalan@apple.com> Add DidFirstMeaningfulPaint milestone. https://bugs.webkit.org/show_bug.cgi?id=191754 Reviewed by Simon Fraser. This milestone fires sone after the paint triggered by the first visually non-empty layout. * page/FrameView.cpp: (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded): (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded): * page/LayoutMilestone.h: 2018-11-16 Don Olmstead <don.olmstead@sony.com> Provide default implementations of Image and Icon https://bugs.webkit.org/show_bug.cgi?id=191764 Reviewed by Michael Catanzaro. Makes IconWPE and ImageWPE implementations the default. * Sources.txt: * SourcesWPE.txt: * platform/graphics/Icon.cpp: Renamed from Source/WebCore/platform/graphics/wpe/IconWPE.cpp. * platform/graphics/Image.cpp: (WebCore::BitmapImage::invalidatePlatformData): Placed here for consistency with implementing ports. (WebCore::Image::loadPlatformResource): * platform/graphics/wpe/ImageWPE.cpp: Removed. 2018-11-16 Brent Fulgham <bfulgham@apple.com> [Win] Reduce the use of WKSI library calls: CFNetwork https://bugs.webkit.org/show_bug.cgi?id=191718 <rdar://problem/46108732> Reviewed by Alex Christensen. Remove custom WKSI CFNetwork calls, since the SPI is already documented in PAL. Just make the same calls on Windows, like we did for iOS and macOS back in 2017. Stop including WebKitSystemInterface.h for files that used to rely on it for font-related features. Tested by existing Windows regression tests. There should be no change in behavior. * platform/graphics/win/FontCacheWin.cpp: * platform/graphics/win/FontCustomPlatformData.cpp: * platform/graphics/win/FontPlatformDataCGWin.cpp: * platform/network/cf/CookieStorageCFNet.cpp: * platform/network/cf/CredentialStorageCFNet.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::createPrivateStorageSession): (WebCore::NetworkStorageSession::switchToNewTestingSession): (WebCore::NetworkStorageSession::ensureSession): * platform/network/cf/ResourceError.h: * platform/network/cf/ResourceErrorCF.cpp: (WebCore::getSSLPeerCertificateData): (WebCore::setSSLPeerCertificateData): (WebCore::ResourceError::getSSLPeerCertificateDataBytePtr): (WebCore::ResourceError::platformLazyInit): (WebCore::ResourceError::cfError const): * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::setClientCertificateInSSLProperties): (WebCore::ResourceHandle::createCFURLConnection): * platform/network/cf/ResourceHandleCFURLConnectionDelegate.cpp: * platform/network/cf/ResourceRequestCFNet.cpp: * platform/network/cf/SocketStreamHandleImplCFNet.cpp: 2018-11-16 Timothy Hatcher <timothy@apple.com> Add html{color:text} to the simpleUserAgentStyleSheet on macOS. https://bugs.webkit.org/show_bug.cgi?id=191760 Reviewed by Antti Koivisto. * css/CSSDefaultStyleSheets.cpp: Added html{color:text} to simpleUserAgentStyleSheet inside a PLATFORM(MAC) copy of the string. 2018-11-16 Jer Noble <jer.noble@apple.com> An early return from updateSchedulingInfo can leave some variables uninitialized. https://bugs.webkit.org/show_bug.cgi?id=191755 <rdar://problem/39910089> Reviewed by Brent Fulgham. * Modules/webaudio/AudioBufferSourceNode.cpp: (WebCore::AudioBufferSourceNode::process): * Modules/webaudio/AudioScheduledSourceNode.cpp: (WebCore::AudioScheduledSourceNode::updateSchedulingInfo): * Modules/webaudio/OscillatorNode.cpp: (WebCore::OscillatorNode::process): 2018-11-16 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Ignore caps notifications when tearing down the pipeline https://bugs.webkit.org/show_bug.cgi?id=191578 Reviewed by Xabier Rodriguez-Calvar. Changing the demuxer to READY state (which is done only in the main thread) triggers the unlinking of its srcpads, which in turns emits a caps change notification in the previously linked element since they become unnegotiated again. We are not interested in caps notifications in these cases, so let's just ignore caps notifications emitted from the main thread. This fixes an assertion failure in the debug builds. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): 2018-11-16 Sihui Liu <sihui_liu@apple.com> Storing blobs in IDB on iOS: "Error preparing blob/file" https://bugs.webkit.org/show_bug.cgi?id=188438 <rdar://problem/43097279> Reviewed by Alex Christensen. Grant sandbox extension of temp folder to network process, because we suggested network process had access to the folder on iOS device but it didn't. This makes some existing tests about IDB blob pass on iOS device. * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBTransaction.cpp: (WebCore::IDBServer::SQLiteIDBTransaction::moveBlobFilesIfNecessary): (WebCore::IDBServer::SQLiteIDBTransaction::deleteBlobFilesIfNecessary): (WebCore::IDBServer::SQLiteIDBTransaction::abort): * Modules/indexeddb/shared/InProcessIDBServer.h: 2018-11-16 Don Olmstead <don.olmstead@sony.com> Add USE(LIBWPE) to WebCore https://bugs.webkit.org/show_bug.cgi?id=191401 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Migrates all PLATFORM(WPE) code that calls into wpe_* APIs to USE(LIBWPE) instead. Renames classes and files to use the suffix LibWPE. * PlatformWPE.cmake: * SourcesWPE.txt: * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformKeyboardEvent.h: * platform/PlatformPasteboard.h: * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::createPlatformDisplay): * platform/graphics/PlatformDisplay.h: * platform/graphics/egl/GLContextEGL.h: * platform/graphics/egl/GLContextEGLLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/egl/GLContextEGLWPE.cpp. (WebCore::GLContextEGL::createWPEContext): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::ensureGstGLContext): * platform/graphics/libwpe/PlatformDisplayLibWPE.cpp: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.cpp. (WebCore::PlatformDisplayLibWPE::create): (WebCore::PlatformDisplayLibWPE::PlatformDisplayLibWPE): (WebCore::PlatformDisplayLibWPE::~PlatformDisplayLibWPE): (WebCore::PlatformDisplayLibWPE::initialize): * platform/graphics/libwpe/PlatformDisplayLibWPE.h: Renamed from Source/WebCore/platform/graphics/wpe/PlatformDisplayWPE.h. * platform/libwpe/PasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PasteboardWPE.cpp. * platform/libwpe/PlatformKeyboardEventLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformKeyboardEventWPE.cpp. * platform/libwpe/PlatformPasteboardLibWPE.cpp: Renamed from Source/WebCore/platform/wpe/PlatformPasteboardWPE.cpp. 2018-11-16 Zalan Bujtas <zalan@apple.com> [iOS] 2 subsequent taps are required to trigger certain tasks on the desktop version of YouTube.com (hover vs click). https://bugs.webkit.org/show_bug.cgi?id=191712 <rdar://problem/45612900> Reviewed by Simon Fraser. In handleSyntheticClick() we use WKContentObservation to figure out whether the tap should be treated as a hover or a click. In general, if the mouse-move event triggers a visible content change, we assume we hit a hover-like drop down menu (or something similar) and no need to dispatch a click event. The idea here is that if the new content (result of the mouse-move event) does not respond to mouse click, it is most likely only for tooltip-like reasons and it's ok to proceed with the click event. Test: fast/events/touch/ios/click-instead-of-hover-simple.html * rendering/updating/RenderTreeUpdater.cpp: (WebCore::CheckForVisibilityChange::~CheckForVisibilityChange): 2018-11-16 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for out-of-flow positioned boxes https://bugs.webkit.org/show_bug.cgi?id=191726 Reviewed by Antti Koivisto. While laying out formatting context roots (inline-block, floats) in an inline formatting context, we need to make sure that their out-of-flow descendants get laid out as well. Test: fast/inline/simple-inline-with-out-of-flow-descendant.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): * layout/layouttree/LayoutTreeBuilder.cpp: This was returning the wrong context root when the container was also a context root. (WebCore::Layout::TreeBuilder::createSubTree): 2018-11-16 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Add API to enable/disable device mocks https://bugs.webkit.org/show_bug.cgi?id=191699 This basically us to test MediaStream/WebRTC support without requiring cameras or microphones and is quite useful. Also fix the GStreamerAudioMock by: - Stop setting `leaky-upstream` on the GStreamerCapturer queue, this was usefull when we were trying to bring the MediaStream sources inside the main pipeline, it is not the case anymore (and not doable with latest version of LibWebRTC). - Use a 'ticks' wave on the gstreamer audiotestsrc so the test stream is similar to what Apple port does. Reviewed by Xabier Rodriguez-Calvar. The mocks are already tested and the API is really simple. * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: (WebCore::GStreamerAudioCapturer::createSource): * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: * platform/mediastream/gstreamer/GStreamerCapturer.cpp: (WebCore::GStreamerCapturer::addSink): * platform/mediastream/gstreamer/GStreamerCapturer.h: 2018-11-16 Thibault Saunier <tsaunier@igalia.com> [GStreamer][MediaStream] Handle track addition and removal https://bugs.webkit.org/show_bug.cgi?id=191599 Reviewed by Xabier Rodriguez-Calvar. Test: fast/mediastream/MediaStream-video-element-remove-track.html * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: (WebCore::WebKitMediaStreamObserver::~WebKitMediaStreamObserver): (WebCore::WebKitMediaStreamObserver::WebKitMediaStreamObserver): (WebCore::webkitMediaStreamSrcFinalize): (WebCore::webkitMediaStreamSrcChangeState): (WebCore::webkit_media_stream_src_init): (WebCore::webkitMediaStreamSrcSetupSrc): (WebCore::webkitMediaStreamSrcAddTrack): (WebCore::webkitMediaStreamSrcRemoveTrackByType): (WebCore::webkitMediaStreamSrcSetStream): 2018-11-16 Zan Dobersek <zdobersek@igalia.com> ScalableImageDecoder: don't forcefully decode image data when querying frame completeness, duration https://bugs.webkit.org/show_bug.cgi?id=191354 Reviewed by Michael Catanzaro. ScalableImageDecoder::frameIsCompleteAtIndex() should only check the index validity and, if the index is valid, check for completeness of the corresponding frame. ScalableImageDecoder::frameDurationAtIndex() should also only retrieve duration for already-complete frames. Both methods avoid calling ScalableImageDecoder::frameBufferAtIndex() as that method goes on and decodes image data to determine specific information. The ImageSource class that's querying this information doesn't anticipate this, and doesn't handle the increased memory consumption of the decoded data, leaving MemoryCache in the blind about the image resource's actual amount of consumed memory. ImageSource can instead gracefully handle any incomplete frame by marking the decoding status for this frame as only partial. * platform/image-decoders/ScalableImageDecoder.cpp: (WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): (WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): (WebCore::ScalableImageDecoder::frameDurationAtIndex const): 2018-11-16 Antoine Quint <graouts@apple.com> PointerEvents should not require touch event listeners to be registered https://bugs.webkit.org/show_bug.cgi?id=191333 <rdar://problem/45857523> Reviewed by Dean Jackson. Tests: pointerevents/ios/pointer-events-dispatch-on-touch.html pointerevents/ios/pointer-events-prevent-default.html * dom/EventNames.h: (WebCore::EventNames::isTouchEventType const): (WebCore::EventNames::touchAndPointerEventNames const): (WebCore::EventNames::touchEventNames const): Deleted. * dom/Node.cpp: (WebCore::Node::moveNodeToNewDocument): 2018-11-15 Zalan Bujtas <zalan@apple.com> [iOS] Do not get stuck in indeterminate content observation state. https://bugs.webkit.org/show_bug.cgi?id=191719 Reviewed by Simon Fraser. Reset the _WKContentChange flag to WKContentNoChange when the last observing timer is removed and we are in the "can't decide yet if it's a hover or click" state. This bug prevents us from firing click event when JS installs and removes the same set of timer(s) during mouse-move dispatch. Test: fast/events/touch/ios/stuck-with-hover-state.html * platform/ios/wak/WKContentObservation.cpp: (WebThreadRemoveObservedContentModifier): 2018-11-15 Simon Fraser <simon.fraser@apple.com> REGRESSION (r238090) Composited iframes that resize from zero don't show https://bugs.webkit.org/show_bug.cgi?id=191733 rdar://problem/46107764 Reviewed by Zalan Bujtas. A zero-sized iframe whose contents are composited should not trigger compositing in the parent document (see code in requiresCompositingForFrame()), but when the <iframe> element was resized without a style change (e.g. because it's width: 100%, height: 100% and the parent resizes), there was no code that triggered a compositing update. Fix by having RenderLayer::updateLayerPosition() trigger an update when the size changes, for a RenderWidget whose contents are composited. Test: compositing/iframes/resize-from-zero-size.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateLayerPosition): 2018-11-15 Simon Fraser <simon.fraser@apple.com> Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller https://bugs.webkit.org/show_bug.cgi?id=158342 rdar://problem/26652811 Reviewed by Zalan Bujtas. Patch partly by Frédéric Wang. This commit fixes an issue when resizing the content of a -webkit-overflow-scrolling: touch overflow node on iOS. Indeed, the RenderLayerBacking's scrolling layer may not be properly created and hence the UIProcess receives a null UIScrollView pointer. This triggers an assertion in debug mode and prevents the user from scrolling the overflow node in release mode. This was partially fixed by the refactoring of bug 90342 but this commit addresses the remaining issues by forcing a configuration update after layout in order to ensure that RenderLayerBacking's scrolling layer is available. For an overflow element that is not yet composited, trigger a post-layout update that is necessary to check if we need to make it composited when it gains scrollable overflow. Tests: fast/scrolling/ios/change-scrollability-on-content-resize-nested.html fast/scrolling/ios/change-scrollability-on-content-resize.html * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollInfoAfterLayout): Force a configuration update so that RenderLayerCompositor::updateBackingAndHierarchy will later instantiate RenderLayerBacking::m_scrollingLayer. 2018-11-15 Fujii Hironori <Hironori.Fujii@sony.com> [curl] warning: delete called on non-final 'WebCore::CurlDownload' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor] https://bugs.webkit.org/show_bug.cgi?id=191582 Reviewed by Alex Christensen. No new tests because there's no behaviour change. * platform/network/curl/CurlDownload.h: Marked CurlDownload final. 2018-11-15 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r238244. Caused High Sierra test runs to fail early with 50 crashes and casued 25 API failures. Reverted changeset: "[css-logical] Implement flow-relative margin, padding and border shorthands" https://bugs.webkit.org/show_bug.cgi?id=188697 https://trac.webkit.org/changeset/238244 2018-11-15 Jer Noble <jer.noble@apple.com> AVKit will set videoGravity to a nil string when building against iosmac https://bugs.webkit.org/show_bug.cgi?id=191573 Reviewed by Dean Jackson. Workaround AVKit behavior by treating nil videoGravity as the default, which is AVLayerVideoGravityResizeAspect. * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer setVideoGravity:]): 2018-11-15 Brent Fulgham <bfulgham@apple.com> [Win] Reduce the use of WKSI library calls: Font Handling https://bugs.webkit.org/show_bug.cgi?id=191701 <rdar://problem/46104809> Reviewed by Myles C. Maxfield. Move the old Windows font handling code out of WKSI to our regular repository. We now handle SPI differently, and don't need to keep these implementations in a separate library. This should also help avoid the somewhat frequent build failures caused when WKSI is not updated in sync with WebKit. Tested by existing Windows test cases. * platform/graphics/FontCascade.h: * platform/graphics/win/FontCGWin.cpp: (WebCore::FontCascade::drawGlyphs): (WebCore::FontCascade::setFontSmoothingLevel): (WebCore::setCGFontSmoothingStyle): (WebCore::FontCascade::setFontSmoothingStyle): (WebCore::FontCascade::setFontSmoothingContrast): (WebCore::clearTypeContrast): (WebCore::FontCascade::systemFontSmoothingChanged): (WebCore::FontCascade::setCGContextFontRenderingStyle): (WebCore::renderingStyleForFont): (WebCore::FontCascade::getGlyphAdvances): * platform/graphics/win/GlyphPageTreeNodeCGWin.cpp: (WebCore::GlyphPage::fill): * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawFocusRing): (WebCore::GraphicsContext::drawDotsForDocumentMarker): * platform/graphics/win/SimpleFontDataCGWin.cpp: (WebCore::Font::platformWidthForGlyph const): * rendering/RenderMediaControls.cpp: (WebCore::RenderMediaControls::adjustMediaSliderThumbSize): 2018-11-15 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Use a real nonce for CTAPHID_INIT https://bugs.webkit.org/show_bug.cgi?id=191533 <rdar://problem/46103502> Reviewed by Brent Fulgham. New tests are added into existing test files. * Modules/webauthn/fido/FidoConstants.h: 2018-11-15 Justin Fan <justin_fan@apple.com> [WebGPU] WebGPUCommandBuffer prototype https://bugs.webkit.org/show_bug.cgi?id=191663 Reviewed by Dean Jackson. Begin implementation of WebGPUCommandBuffers as well as GPUQueues (MTLCommandBuffer, MTLCommandQueue). Test: webgpu/command-buffers.html * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/GPUCommandBuffer.h: Added. Wrapper class around a MTLCommandBuffer. * Modules/webgpu/GPUDevice.cpp: (WebCore::GPUDevice::createCommandBuffer): Added. (WebCore::GPUDevice::getQueue): Returns RefPtr to the device's singleton queue. * Modules/webgpu/GPUDevice.h: Now manages the device's GPUQueue. (WebCore::GPUDevice::platformDevice const): * Modules/webgpu/GPUQueue.h: Added. Wrapper class around a MTLCommandQueue. (WebCore::GPUQueue::platformQueue const): * Modules/webgpu/GPURenderPipeline.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPURenderPipeline.h. (WebCore::GPURenderPipeline::platformRenderPipeline const): * Modules/webgpu/GPUShaderModule.h: (WebCore::GPUShaderModule::platformShaderModule const): * Modules/webgpu/GPUSwapChain.h: Moved from Source/WebCore/Modules/webgpu/cocoa/GPUSwapChain.h. (WebCore::GPUSwapChain::platformLayer const): * Modules/webgpu/WebGPUCommandBuffer.cpp: Added. Web interface for a GPU device's command buffer. (WebCore::WebGPUCommandBuffer::create): (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): * Modules/webgpu/WebGPUCommandBuffer.h: Added. * Modules/webgpu/WebGPUCommandBuffer.idl: Added. * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createCommandBuffer const): Added. * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/cocoa/GPUCommandBufferMetal.mm: Added. MTLCommandBuffer impl for GPUCommandBuffer. (WebCore::GPUCommandBuffer::create): Create a MTLCommandBuffer from the MTLCommandQueue. (WebCore::GPUCommandBuffer::GPUCommandBuffer): * Modules/webgpu/cocoa/GPUDeviceMetal.mm: (WebCore::GPUDevice::GPUDevice): * Modules/webgpu/cocoa/GPUQueueMetal.mm: Added. MTLCommandQueue impl for GPUQueue. (WebCore::GPUQueue::create): (WebCore::GPUQueue::GPUQueue): * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::GPURenderPipeline::GPURenderPipeline): * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm: (WebCore::GPUShaderModule::create): (WebCore::GPUShaderModule::GPUShaderModule): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2018-11-15 Oriol Brufau <obrufau@igalia.com> [css-logical] Implement flow-relative margin, padding and border shorthands https://bugs.webkit.org/show_bug.cgi?id=188697 Reviewed by Simon Fraser and Antti Koivisto. Tests: imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html webexposed/css-properties-as-js-properties.html webexposed/css-properties-behind-flags.html webexposed/css-property-listing.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): Allow the new properties to serialize their computed value. (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor2SidesShorthand): (WebCore::ComputedStyleExtractor::getCSSPropertyValuesFor4SidesShorthand): * css/CSSComputedStyleDeclaration.h: Rename getCSSPropertyValuesForSidesShorthand to getCSSPropertyValuesFor4SidesShorthand, and add analogous getCSSPropertyValuesFor2SidesShorthand for serializing 2-sided shorthands. * css/CSSProperties.json: Add the new properties behind the CSSLogicalEnabled runtime flag. * css/CSSStyleDeclaration.cpp: (WebCore::CSSStyleDeclaration::supportedPropertyNames const): Prevent CSS properties disabled behind a runtime flag from being exposed in style declarations. * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): Allow the new properties to serialize their specified value. (WebCore::StyleProperties::get2Values const): Add get2Values, analogous to get4Values, for serializing 2-sided shorthands. (WebCore::StyleProperties::borderPropertyValue const): Allow borderPropertyValue to serialize arbitrary multi-sided border shorthands corresponding to width, style and color. (WebCore::MutableStyleProperties::setProperty): Prevent CSS properties disabled behind a runtime flag from being set a value. (WebCore::StyleProperties::asText const): Allow the new properties to be serialized in cssText. Prevent CSS shorthands disabled behind a runtime flag from appearing in cssText, and serialize the longhands instead. Note that there could be another shorthand available which is enabled, but a proper solution would require bug 190496. * css/StyleProperties.h: Update declarations of borderPropertyValue and get2Values. * css/makeprop.pl: (addProperty): Add isEnabledCSSProperty function for checking that a CSS property is not disabled behind a runtime flag. * css/parser/CSSPropertyParser.cpp: (WebCore::cssPropertyID): Prevent CSS properties disabled behind a runtime flag from being exposed in computed styles. (WebCore::CSSPropertyParser::addProperty): Prevent CSS properties disabled behind a runtime flag from being set a value. (WebCore::CSSPropertyParser::consumeBorder): Change consumeBorder to provide the caller with the parsed values instead of setting properties. Then the caller can decide to which properties the values should be set, and whether border-image should be reset or not. (WebCore::CSSPropertyParser::consume2ValueShorthand): (WebCore::CSSPropertyParser::consume4ValueShorthand): Rename consume4Values to consume4ValueShorthand, and add analogous consume2ValueShorthand for parsing shorthands with two longhands. (WebCore::CSSPropertyParser::parseShorthand): Allow the new properties to be parsed. * css/parser/CSSPropertyParser.h: Update declarations of consumeBorder, consume2ValueShorthand and consume4ValueShorthand. * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getSupportedCSSProperties): Prevent CSS properties disabled behind a runtime flag from being exposed in the CSS inspector tool. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSLogicalEnabled): (WebCore::RuntimeEnabledFeatures::cssLogicalEnabled const): Add the CSSLogicalEnabled runtime flag. 2018-11-15 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r238220. Introduced failing tests to iOS and is slowing down EWS Reverted changeset: "[css-grid] Consider scrollbars in populateGridPositionsForDirection()" https://bugs.webkit.org/show_bug.cgi?id=191656 https://trac.webkit.org/changeset/238220 2018-11-15 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional https://bugs.webkit.org/show_bug.cgi?id=191522 Reviewed by Brent Fulgham. Accordign to the WebIDL, AuthenticatorSelectionCriteria::AuthenticatorAttachment should be optional. https://www.w3.org/TR/webauthn/#dictdef-authenticatorselectioncriteria Covered by existing tests. * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode): 2018-11-15 Ross Kirsling <ross.kirsling@sony.com> DragImage should have a complete default implementation https://bugs.webkit.org/show_bug.cgi?id=191666 Reviewed by Dean Jackson. Move WPE's stub implementation down into the base implementation file. * SourcesWPE.txt: * platform/DragImage.cpp: (WebCore::dragImageSize): (WebCore::deleteDragImage): (WebCore::scaleDragImage): (WebCore::dissolveDragImageToFraction): (WebCore::createDragImageFromImage): (WebCore::createDragImageIconForCachedImageFilename): (WebCore::createDragImageForLink): * platform/wpe/DragImageWPE.cpp: Removed. 2018-11-15 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] UserHandle can be null https://bugs.webkit.org/show_bug.cgi?id=191521 Reviewed by Alex Christensen. According to the newest spec as of 7 August, 2018: https://www.w3.org/TR/webauthn/#conforming-authenticators-u2f. UserHandle can now be null. Covered by existing tests. * Modules/webauthn/AuthenticatorAssertionResponse.h: (WebCore::AuthenticatorAssertionResponse::create): (WebCore::AuthenticatorAssertionResponse::userHandle const): (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse): * Modules/webauthn/AuthenticatorAssertionResponse.idl: * Modules/webauthn/PublicKeyCredential.cpp: (WebCore::PublicKeyCredential::tryCreate): * Modules/webauthn/PublicKeyCredentialData.h: (WebCore::PublicKeyCredentialData::encode const): (WebCore::PublicKeyCredentialData::decode): * Modules/webauthn/fido/DeviceResponseConverter.cpp: (fido::readCTAPGetAssertionResponse): 2018-11-15 Youenn Fablet <youenn@apple.com> Modernize RTCPeerConnection handling of pendingActivity https://bugs.webkit.org/show_bug.cgi?id=191661 Reviewed by Eric Carlson. makePendingActivity is the modern way to handle set/unset of pending activity. No change of behavior. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::create): (WebCore::RTCPeerConnection::doStop): * Modules/mediastream/RTCPeerConnection.h: 2018-11-15 Keith Rollin <krollin@apple.com> Delete old .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=191669 <rdar://problem/46081994> Reviewed by Chris Dumez. .xcfilelist files were created and added to the Xcode project files in https://trac.webkit.org/changeset/238008/webkit. However, they caused build issues and they were removed from the Xcode projects in https://trac.webkit.org/changeset/238055/webkit. This check-in removes the files from the repository altogether. They'll ultimately be replaced with new files with names that indicate whether the associated files are inputs to the Run Script phase or are files created by the Run Script phase. No new tests -- no changed functionality. * DerivedSources.xcfilelist: Removed. * UnifiedSources.xcfilelist: Removed. 2018-11-15 Youenn Fablet <youenn@apple.com> Update RTCPeerConnection JS built-ins to be closer to specWe https://bugs.webkit.org/show_bug.cgi?id=191665 Reviewed by Eric Carlson. Simplify JS built-ins since we no longer need to support callback versions of the API. Make sure to have the right number of parameters in the JS built-in functions. Make some simplification to the code. Covered by existing tests and rebased test. * Modules/mediastream/RTCPeerConnection.js: (createOffer): (createAnswer): (setLocalDescription): (setRemoteDescription): (addIceCandidate): * Modules/mediastream/RTCPeerConnectionInternals.js: (enqueueOperation): (callbacksAndDictionaryOverload): Deleted. 2018-11-15 Simon Fraser <simon.fraser@apple.com> REGRESSION(r238090): Composited iframe contents disappear after switching tabs in Safari https://bugs.webkit.org/show_bug.cgi?id=191673 rdar://problem/46083440 Reviewed by Antti Koivisto. Switching tabs in Safari triggers the "setIsInWindow" code path, that detaches the layer tree for every Frame. They get re-attached on tab show, and for subframes this involves the triggering of a fake style recalc in the parent document via scheduleInvalidateStyleAndLayerComposition(). The style diff that's sent to RenderLayerCompositor::layerStyleChanged() as a result of that fake style recalc is RecompositeLayer, but the code was failing to trigger the necessary layer configuration update that gets iframe layers parented. This stop-gap patch triggers layer config updates on every RecompositeLayer diff. A future patch will optimize this, and add a layout test. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-15 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Skip non-inflow boxes while splitting the inline runs. https://bugs.webkit.org/show_bug.cgi?id=191690 Reviewed by Antti Koivisto. Skip all non-inflow boxes (floats, out-of-flow positioned elements). They don't participate in the inline run context. * layout/Verification.cpp: (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): 2018-11-15 Zalan Bujtas <zalan@apple.com> [LFC] FormattingContext base class should not declare computeStaticPosition. https://bugs.webkit.org/show_bug.cgi?id=191683 Reviewed by Antti Koivisto. Apparently only BlockFormattingContext uses it. * layout/FormattingContext.h: * layout/blockformatting/BlockFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: 2018-11-14 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for in-flow positioned inline boxes. https://bugs.webkit.org/show_bug.cgi?id=191672 Reviewed by Antti Koivisto. We might offset the in-flow positioned runs differently once runs are moved over to the display tree. Test: fast/inline/simple-inline-inflow-positioned.html * layout/Verification.cpp: (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunsIfNeeded const): (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): (WebCore::Layout::InlineFormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::InlineFormattingContext::collectInlineContentForSubtree const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::moveVertically): * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): 2018-11-15 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Add support for sending silence or silencing an incoming track https://bugs.webkit.org/show_bug.cgi?id=191631 Reviewed by Xabier Rodriguez-Calvar. This will be tested once webkit.org/b/186933 is implemented. * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeIncomingAudioSourceLibWebRTC::OnData): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): 2018-11-15 Antti Koivisto <antti@apple.com> REGRESSION(r238178): fast/forms/access-key-mutated.html and fast/forms/access-key-case-insensitive.html are timing out https://bugs.webkit.org/show_bug.cgi?id=191642 Reviewed by Zalan Bujtas. Invalidate access key map even when thorttling style recalcs. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): 2018-11-15 Antti Koivisto <antti@apple.com> Remove fonts from CSSFontFaceSet safely https://bugs.webkit.org/show_bug.cgi?id=191676 Reviewed by Zalan Bujtas. Test: fast/text/font-face-set-remove-safely.html * css/CSSFontFaceSet.cpp: (WebCore::CSSFontFaceSet::remove): 2018-11-15 Manuel Rego Casasnovas <rego@igalia.com> [css-grid] Consider scrollbars in populateGridPositionsForDirection() https://bugs.webkit.org/show_bug.cgi?id=191656 Reviewed by Javier Fernandez. We never care about scrollbars in RenderGrid::populateGridPositionsForDirection(), that's fine if the scrollbars are at the end (e.g. on the right in horizontal writing mode and LTR direction) but it causes problems when they're at the beginning (e.g. on the left in horizontal writing mode and RTL direction). The patch modifies the method so it takes into account scrollbar size in order to compute the position of the columns/rows depending on the direction and the writing mode. Tests: imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-001.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-lr-001.html imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-scrollbar-vertical-rl-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::populateGridPositionsForDirection): 2018-11-14 Keith Rollin <krollin@apple.com> Move scripts for Derived and Unified Sources to external files https://bugs.webkit.org/show_bug.cgi?id=191670 <rdar://problem/46082278> Reviewed by Keith Miller. Move the scripts in the Generate Derived Sources and Generate Unified Sources Run Script phases from the Xcode projects to external shell script files. Then invoke those scripts from the Run Script phases. This refactoring is being performed to support later work that will invoke these scripts in other contexts. The scripts were maintained as-is when making the move. I did a little reformatting and added 'set -e' to the top of each file, but that's it. No new tests -- no changed functionality. * Scripts/generate-derived-sources.sh: Added. * Scripts/generate-unified-sources.sh: Added. * WebCore.xcodeproj/project.pbxproj: 2018-11-14 Keith Rollin <krollin@apple.com> Fix #end vs. #endif typo. https://bugs.webkit.org/show_bug.cgi?id=191668 <rdar://problem/46081704> Reviewed by Alexey Proskuryakov. Source/WebCore/SourcesCocoa.txt had a #end that should have been a #endif. Fix this, an add a check to generate-unified-source-bundles.rb to detect similar typos. No new tests -- no changed functionality. * SourcesCocoa.txt: 2018-11-14 Keith Rollin <krollin@apple.com> Remove VideoFullscreenLayerManager.mm from WebCore/SourcesCocoa.txt https://bugs.webkit.org/show_bug.cgi?id=191667 <rdar://problem/46081286> Reviewed by Eric Carlson. VideoFullscreenLayerManager.mm no longer exists. No new tests -- No changed functionality. * SourcesCocoa.txt: 2018-11-14 Timothy Hatcher <timothy@apple.com> Enabled dark mode CSS support by default. https://bugs.webkit.org/show_bug.cgi?id=191609 rdar://problem/46046861 Reviewed by Megan Gardner. * page/RuntimeEnabledFeatures.h: Set m_isDarkModeCSSEnabled to true. 2018-11-14 Timothy Hatcher <timothy@apple.com> Default the view background color and text color to different values when in dark mode. https://bugs.webkit.org/show_bug.cgi?id=191607 rdar://problem/46045854 Reviewed by Dean Jackson. Test: css-dark-mode/default-colors.html * css/html.css: (html): Set color: text on macOS. * dom/Document.cpp: (WebCore::Document::processSupportedColorSchemes): Call recalculateBaseBackgroundColor(). * editing/EditingStyle.cpp: (WebCore::caretColorFromStyle): Added. (WebCore::EditingStyle::prepareToApplyAt): Use equalIgnoringSemanticColor. Check for caret-color directly since removeEquivalentProperties fails with semantic colors. (WebCore::extractPropertiesNotIn): Use equalIgnoringSemanticColor. Check for caret-color directly since removeEquivalentProperties fails with semantic colors. * page/Frame.cpp: (WebCore::Frame::createView): Drop backgroundColor. * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::recalculateBaseBackgroundColor): Added. (WebCore::FrameView::updateBackgroundRecursively): Drop backgroundColor argument. Calculate the backgroundColor based on the transparent argument only. * page/FrameView.h: * platform/graphics/Color.h: (WebCore::equalIgnoringSemanticColor): Added for EditingStyle. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleDidChange): Call recalculateBaseBackgroundColor(). * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::shouldDumpPropertyForLayer const): Use isWhiteColor() since it ignores the semantic color flag. * testing/Internals.cpp: (WebCore::Internals::setViewIsTransparent): Drop backgroundColor. (WebCore::Internals::viewBaseBackgroundColor): Added. * testing/Internals.h: * testing/Internals.idl: Added viewBaseBackgroundColor. 2018-11-14 Justin Fan <justin_fan@apple.com> [WebGPU] Code quality concerns raised for 191291: [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain https://bugs.webkit.org/show_bug.cgi?id=191383 Reviewed by Dean Jackson. Covered by existing WebGPU tests introduced in original patch. * Modules/webgpu/GPUDevice.h: * Modules/webgpu/GPUPipelineStageDescriptor.h: * Modules/webgpu/GPURenderPipelineDescriptor.h: Now a base struct with a guaranteed vertex stage member. (): Refactored into enum class. (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Removed in favor of init-list construction. (WebCore::GPURenderPipelineDescriptor::primitiveTopology): Now a proper enum class member. * Modules/webgpu/GPUShaderModule.h: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPUShaderModule.h: (WebCore::WebGPUShaderModule::module const): * Modules/webgpu/WebGPUShaderStage.h: Replaced enum with constants to better reflect IDL. * Modules/webgpu/cocoa/GPURenderPipeline.h: * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): * Modules/webgpu/cocoa/GPUSwapChain.h: * WebCore.xcodeproj/project.pbxproj: Removed GPUPipelineDescriptorBase. 2018-11-14 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Pass Inspector::FrontendChannel as a reference connect/disconnect methods https://bugs.webkit.org/show_bug.cgi?id=191612 Reviewed by Matt Baker. * inspector/InspectorController.cpp: (WebCore::InspectorController::connectFrontend): (WebCore::InspectorController::disconnectFrontend): (WebCore::InspectorController::show): * inspector/InspectorController.h: * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::connectFrontend): (WebCore::WorkerInspectorController::disconnectFrontend): * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): (WebCore::PageDebuggable::disconnect): * page/PageDebuggable.h: * testing/Internals.cpp: (WebCore::InspectorStubFrontend::InspectorStubFrontend): (WebCore::InspectorStubFrontend::closeWindow): * workers/service/context/ServiceWorkerDebuggable.cpp: (WebCore::ServiceWorkerDebuggable::connect): (WebCore::ServiceWorkerDebuggable::disconnect): * workers/service/context/ServiceWorkerDebuggable.h: * workers/service/context/ServiceWorkerInspectorProxy.cpp: (WebCore::ServiceWorkerInspectorProxy::connectToWorker): (WebCore::ServiceWorkerInspectorProxy::disconnectFromWorker): * workers/service/context/ServiceWorkerInspectorProxy.h: 2018-11-14 Timothy Hatcher <timothy@apple.com> Update prefers-color-scheme media query matching based on GitHub issue #3278. https://bugs.webkit.org/show_bug.cgi?id=191654 rdar://problem/46074307 Reviewed by Simon Fraser. Test: css-dark-mode/prefers-color-scheme.html * css/MediaQueryEvaluator.cpp: (WebCore::prefersColorSchemeEvaluate): Return true when there is no value. Return false for `no-preference` since there is no macOS option for no user preference. * css/MediaQueryExpression.cpp: (WebCore::isFeatureValidWithoutValue): Added prefers-color-scheme. 2018-11-14 Devin Rousso <drousso@apple.com> Web Inspector: Canvas: send a call stack with each action instead of an array of call frames https://bugs.webkit.org/show_bug.cgi?id=191628 Reviewed by Dean Jackson. Updated existing test: inspector/model/recording.html * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::indexForData): (WebCore::InspectorCanvas::buildInitialState): (WebCore::InspectorCanvas::buildAction): Drive-by: prevent de-duplicated objects from being destroyed while recording. 2018-11-14 Stephan Szabo <stephan.szabo@sony.com> [Win] Compile Service Worker support https://bugs.webkit.org/show_bug.cgi?id=191409 Reviewed by Youenn Fablet. Fix compilation errors when ENABLE(SERVICE_WORKER) on Windows with clang-cl. Clang on dllexport platforms does not support specifying the dllexport on both a class and members of the class and unistd.h isn't provided but also appeared to not be used. No new tests, should be covered by existing tests. * workers/service/ServiceWorkerProvider.h: * workers/service/context/SWContextManager.cpp: 2018-11-14 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Keep Web Inspector window alive across process swaps (PSON) (Remote Inspector) https://bugs.webkit.org/show_bug.cgi?id=191494 <rdar://problem/45469854> Reviewed by Devin Rousso. * inspector/InspectorClient.h: (WebCore::InspectorClient::allowRemoteInspectionToPageDirectly const): Provide a hook so that a client may wish to allow direct remote inspection of the Page. This is used by WebKitLegacy only. * page/Page.cpp: (Page::Page): Only enable the PageDebuggable if the client wishes remote inspection of the Page directly. This is used by WebKitLegacy only. * inspector/InspectorController.cpp: (WebCore::InspectorController::connectFrontend): * inspector/InspectorController.h: * page/PageDebuggable.cpp: (WebCore::PageDebuggable::connect): (WebCore::PageDebuggable::disconnect): * page/PageDebuggable.h: When a frontend connects, always enable the developer extras for the Page. This is pretty much only for the remote path, which allows inspection if developer extras were not already enabled (iOS). This simplifies the logic, and toggling developer extras after it was already enabled is not really important. 2018-11-14 Per Arne Vollan <pvollan@apple.com> REGRESSION (WEBPROCESS_WINDOWSERVER_BLOCKING): requestAnimationFrame Stops Completing https://bugs.webkit.org/show_bug.cgi?id=190884 Reviewed by Dean Jackson. Only notify display refresh monitors with matching display ID. Test: fast/animation/request-animation-frame-in-two-pages.html * platform/graphics/DisplayRefreshMonitorManager.cpp: (WebCore::DisplayRefreshMonitorManager::displayWasUpdated): * platform/graphics/DisplayRefreshMonitorManager.h: 2018-11-14 Youenn Fablet <youenn@apple.com> Convert libwebrtc error types to DOM exceptions https://bugs.webkit.org/show_bug.cgi?id=191590 Reviewed by Alex Christensen. Make use of overloaded callback method that provides an error type. This type is then used to create a DOM exception with the correct type. Covered by existing tests. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::doSetRemoteDescription): (WebCore::LibWebRTCMediaEndpoint::createSessionDescriptionFailed): (WebCore::LibWebRTCMediaEndpoint::setLocalSessionDescriptionFailed): (WebCore::LibWebRTCMediaEndpoint::setRemoteSessionDescriptionFailed): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: (WebCore::toExceptionCode): 2018-11-14 Youenn Fablet <youenn@apple.com> Allow to remove MediaStreamPrivate observers when iterating over observers https://bugs.webkit.org/show_bug.cgi?id=187256 Reviewed by Eric Carlson. Migrate the observer list from a Vector to a HashSet. This is more robust to multiple observing and keeping of order of observers is not required. Copy the set of observers to a vector before iterating over it. This allows to remove an observer while iterating, which is now used in UserMediaRequest. Covered by existing tests. * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::mediaStreamIsReady): * platform/mediastream/MediaStreamPrivate.cpp: (WebCore::MediaStreamPrivate::addObserver): (WebCore::MediaStreamPrivate::removeObserver): (WebCore::MediaStreamPrivate::forEachObserver const): (WebCore::MediaStreamPrivate::updateActiveState): (WebCore::MediaStreamPrivate::addTrack): (WebCore::MediaStreamPrivate::removeTrack): (WebCore::MediaStreamPrivate::characteristicsChanged): * platform/mediastream/MediaStreamPrivate.h: 2018-11-14 Youenn Fablet <youenn@apple.com> Calling removeTrack on different RTCPeerConnection should throw InvalidAccessError https://bugs.webkit.org/show_bug.cgi?id=191603 Reviewed by Chris Dumez. Make sure to check that the sender peer connection backend is matching. Covered by rebased WPT test. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::removeTrack): * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::isCreatedBy const): * Modules/mediastream/RTCRtpSender.h: 2018-11-14 Fujii Hironori <Hironori.Fujii@sony.com> [curl] Unify CookieJarCurlDatabase and the abstract class CookieJarCurl https://bugs.webkit.org/show_bug.cgi?id=191620 Reviewed by Alex Christensen. Remove a abstract class CookieJarCurl which is not needed anymore. And, rename CookieJarCurlDatabase to CookieJarCurl. No new tests because there's no behaviour change in WebCore. * platform/Curl.cmake: Replaced CookieJarCurlDatabase.cpp with CookieJarCurl.cpp. * platform/network/curl/CookieJarCurl.cpp: Renamed from Source/WebCore/platform/network/curl/CookieJarCurlDatabase.cpp. * platform/network/curl/CookieJarCurl.h: Merged CookieJarCurl.h and CookieJarCurlDatabase.h. * platform/network/curl/CookieJarCurlDatabase.h: Removed. * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::NetworkStorageSession::NetworkStorageSession): Replaced CookieJarCurlDatabase with CookieJarCurl. 2018-11-14 Christopher Reid <chris.reid@sony.com> [WPE] Remove glib usage in PlatformKeyboardEventWPE.cpp https://bugs.webkit.org/show_bug.cgi?id=191606 Reviewed by Michael Catanzaro. No behavior change. Use StringBuilder::append(UChar32) as a generic way to convert a uint32_t code point to WTFString. * platform/wpe/PlatformKeyboardEventWPE.cpp: (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode): (WebCore::PlatformKeyboardEvent::singleCharacterString): 2018-11-13 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Construct dedicated runs when the inline element requires it (part 2) https://bugs.webkit.org/show_bug.cgi?id=191623 Reviewed by Antti Koivisto. This patch expands the breaking behaviour to support separate start/end breaks. <span>parent </span><span style="padding: 10px;">start<span> middle </span>end</span><span> parent</span> input to line breaking -> <parent start middle end parent> output of line breaking (considering infinite constraint) -> <parent start middle end parent> due to padding, final runs -> <parent><start middle end><parent> "parent" -> n/a "start" -> BreakAtStart " middle " -> n/a "end" -> BreakAtEnd "parent" -> n/a Another example: <span>parent </span><span style="padding-right: 10px;">start<span> middle </span>end</span><span> parent</span> line breaking -> <parent start middle end parent> due to padding-right, final runs -> <parent start middle end><parent> "parent" -> n/a "start" -> n/a " middle " -> n/a "end" -> BreakAtEnd "parent" -> n/a * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::collectInlineContent const): Move to a recursive algorithm (which is fine, inline contents don't tend to be too deep) (WebCore::Layout::InlineFormattingContext::contentRequiresSeparateRun const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::detachingRules const): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::lastInlineItem const): (WebCore::Layout::InlineFormattingState::addDetachingRule): 2018-11-14 Youenn Fablet <youenn@apple.com> Add support for RTCRtpCodecParameters.sdpFmtpLine https://bugs.webkit.org/show_bug.cgi?id=191591 Reviewed by Eric Carlson. Covered by rebased test. * Modules/mediastream/RTCRtpCodecParameters.h: * Modules/mediastream/RTCRtpCodecParameters.idl: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCCodecParameters): 2018-11-14 Youenn Fablet <youenn@apple.com> Add support for transport and peerConnection stats https://bugs.webkit.org/show_bug.cgi?id=191592 Reviewed by Alex Christensen. Covered by rebased tests. * Modules/mediastream/RTCStatsReport.h: (WebCore::RTCStatsReport::TransportStats::TransportStats): (WebCore::RTCStatsReport::PeerConnectionStats::PeerConnectionStats): * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCTransportStats): (WebCore::fillRTCPeerConnectionStats): (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): 2018-11-14 Ali Juma <ajuma@chromium.org> Transform of composited layer not updated when layer also needs repaint https://bugs.webkit.org/show_bug.cgi?id=191598 Reviewed by Simon Fraser. Trigger a compositing geometry update whenever a RenderLayer's transform changes, even when other parts of its style have changed in a way that produces a StyleDifference greater than RecompositeLayer. Test: compositing/geometry/transform-and-repaint-updates-geometry.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::layerStyleChanged): 2018-11-13 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Support CTAP HID authenticators on macOS https://bugs.webkit.org/show_bug.cgi?id=188623 <rdar://problem/43353777> Reviewed by Brent Fulgham and Chris Dumez. This patch removes AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient to ignore any incompleted CompletionHandlers as calling them in destructors could cause unexpected cyclic dependency. Also, it adds a hack to temporarily deal with nullable userhandle. Tests: http/wpt/webauthn/ctap-hid-failure.https.html http/wpt/webauthn/ctap-hid-success.https.html http/wpt/webauthn/public-key-credential-create-failure-hid-silent.https.html http/wpt/webauthn/public-key-credential-create-failure-hid.https.html http/wpt/webauthn/public-key-credential-create-success-hid.https.html http/wpt/webauthn/public-key-credential-get-failure-hid-silent.https.html http/wpt/webauthn/public-key-credential-get-failure-hid.https.html http/wpt/webauthn/public-key-credential-get-success-hid.https.html * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient): Deleted. * Modules/webauthn/AuthenticatorCoordinatorClient.h: * Modules/webauthn/PublicKeyCredentialCreationOptions.h: * Modules/webauthn/fido/DeviceResponseConverter.cpp: (fido::readCTAPGetAssertionResponse): * Modules/webauthn/fido/FidoConstants.h: 2018-11-13 Ross Kirsling <ross.kirsling@sony.com> [WebRTC] Provide default implementation of LibWebRTCProvider https://bugs.webkit.org/show_bug.cgi?id=191611 Reviewed by Michael Catanzaro. Refactor LibWebRTCProvider such that platform-specific implementations need not worry about specifying defaults. * PlatformWin.cmake: * platform/GStreamer.cmake: * platform/SourcesGLib.txt: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.cpp: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp. * platform/mediastream/libwebrtc/LibWebRTCProviderGStreamer.h: Renamed from Source/WebCore/platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h. * platform/mediastream/libwebrtc/LibWebRTCProviderWin.cpp: Removed. 2018-11-13 Timothy Hatcher <timothy@apple.com> Use a light scrollbar for transparent web views in dark mode. https://bugs.webkit.org/show_bug.cgi?id=191559 rdar://problem/46000489 Reviewed by Dean Jackson. Test: css-dark-mode/supported-color-schemes-scrollbar.html * css/CSSProperties.json: Marked supported-color-schemes as a custom Value. * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyValueSupportedColorSchemes): * editing/cocoa/WebContentReaderCocoa.mm: Use FrameView's useDarkAppearance(). (WebCore::createFragment): * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): Use FrameView's useDarkAppearance(). * page/FrameView.cpp: (WebCore::FrameView::recalculateScrollbarOverlayStyle): Use a light scrollbar for transparent web views in dark mode. (WebCore::FrameView::rendererForSupportedColorSchemes const): Added. Return the body for document element renderer. (WebCore::FrameView::useDarkAppearance const): Use rendererForSupportedColorSchemes. (WebCore::FrameView::styleColorOptions const): Added. Ditto. * page/FrameView.h: * rendering/style/RenderStyle.cpp: (WebCore::rareInheritedDataChangeRequiresRepaint): Drive-by fix. Added supportedColorSchemes. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setHasExplicitlySetSupportedColorSchemes): Added. (WebCore::RenderStyle::hasExplicitlySetSupportedColorSchemes const): Added. (WebCore::RenderStyle::NonInheritedFlags::operator== const): Added supportedColorSchemes. * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Use FrameView's useDarkAppearance(). * testing/Internals.cpp: (WebCore::Internals::setViewIsTransparent): Added. (WebCore::Internals::scrollbarOverlayStyle const): Added. * testing/Internals.h: * testing/Internals.idl: Added setViewIsTransparent and scrollbarOverlayStyle. 2018-11-13 Ross Kirsling <ross.kirsling@sony.com> [AppleWin] Unreviewed build fix after r238108. * platform/graphics/ca/win/PlatformCALayerWin.cpp: (printLayer): (PlatformCALayerWin::embeddedViewID const): * platform/graphics/ca/win/PlatformCALayerWin.h: 2018-11-13 Youenn Fablet <youenn@apple.com> RTCPeerConnection.getTransceivers is not always exposing all transceivers https://bugs.webkit.org/show_bug.cgi?id=191589 Reviewed by Eric Carlson. Implement the collect transceiver algorithm using libwebrtc backend. Call this algorithm everytime transceivers are retrieved from JS. For Plan B, make this a no-op as this is not supported. Introduce senders/receivers/transceivers getters where we just look at already created transceivers. Covered by existing and rebased tests. * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::collectTransceivers): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::getSenders const): (WebCore::RTCPeerConnection::getReceivers const): (WebCore::RTCPeerConnection::getTransceivers const): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::collectTransceivers): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::collectTransceivers): (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources): (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: 2018-11-13 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Do not show selection UI for editable elements with opacity near zero https://bugs.webkit.org/show_bug.cgi?id=191442 <rdar://problem/45958625> Reviewed by Simon Fraser. Tests: editing/selection/ios/do-not-zoom-to-focused-hidden-contenteditable.html editing/selection/ios/hide-selection-after-hiding-contenteditable.html editing/selection/ios/hide-selection-in-contenteditable-nested-transparency.html editing/selection/ios/hide-selection-in-hidden-contenteditable-frame.html editing/selection/ios/hide-selection-in-hidden-contenteditable.html * rendering/RenderObject.cpp: (WebCore::RenderObject::isTransparentRespectingParentFrames const): Add a helper function to determine whether a RenderObject is contained within a transparent layer, taking parent frames into account. A layer is considered transparent if its opacity is less than a small threshold (i.e. 0.01). Opacity on ancestor elements is applied multiplicatively. * rendering/RenderObject.h: 2018-11-13 Eric Carlson <eric.carlson@apple.com> [MediaStream] Observer AVCaptureDevice "suspended" property https://bugs.webkit.org/show_bug.cgi?id=191587 <rdar://problem/46030598> Reviewed by Youenn Fablet. No new tests, AVCapture can only be tested manually. * platform/mediastream/mac/AVCaptureDeviceManager.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::AVCaptureDeviceManager::captureDevicesInternal): Don't notify of devices "changes" the first time the device list is scanned. (WebCore::deviceIsAvailable): Don't check for "isInUseByAnotherApplication", it doesn't change device availability. (WebCore::AVCaptureDeviceManager::beginObservingDevices): New, observe "suspended" on all devices and add them to the cached list. (WebCore::AVCaptureDeviceManager::stopObservingDevices): New, opposite of above. (WebCore::AVCaptureDeviceManager::refreshCaptureDevices): Watch for changes in the list of devices. (WebCore::AVCaptureDeviceManager::~AVCaptureDeviceManager): Stop observing all cached devices. (WebCore::AVCaptureDeviceManager::registerForDeviceNotifications): (-[WebCoreAVCaptureDeviceManagerObserver disconnect]): (-[WebCoreAVCaptureDeviceManagerObserver deviceConnectedDidChange:]): (-[WebCoreAVCaptureDeviceManagerObserver observeValueForKeyPath:ofObject:change:context:]): (WebCore::AVCaptureDeviceManager::refreshAVCaptureDevicesOfType): Deleted. (WebCore::AVCaptureDeviceManager::deviceConnected): Deleted. (WebCore::AVCaptureDeviceManager::deviceDisconnected): Deleted. (-[WebCoreAVCaptureDeviceManagerObserver deviceDisconnected:]): Deleted. (-[WebCoreAVCaptureDeviceManagerObserver deviceConnected:]): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): Stop observing "running" (not "rate") and "suspended". (WebCore::AVVideoCaptureSource::setupSession): Observe "running" (not "rate"), and "suspended". (WebCore::AVVideoCaptureSource::captureDeviceSuspendedDidChange): (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]): 2018-11-13 Devin Rousso <drousso@apple.com> Web Inspector: REGRESSION(r238122): fetching the CertificateInfo triggers an ASSERT in workers https://bugs.webkit.org/show_bug.cgi?id=191597 Reviewed by Joseph Pecoraro. When WebInspector is open, the `CertificateInfo` for every `ResourceResponse` is now fetched, meaning that we may try to fetch in situations previously unexpected. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): 2018-11-13 Timothy Hatcher <timothy@apple.com> Treat supported-color-schemes as the second highest priority property. https://bugs.webkit.org/show_bug.cgi?id=191556 rdar://problem/46000076 Reviewed by Dean Jackson. Test: css-dark-mode/supported-color-schemes-priority.html * css/CSSProperties.json: Make supported-color-schemes high-priority and add a comment. * css/StyleResolver.cpp: (WebCore::StyleResolver::applyMatchedProperties): Manually handle supported-color-schemes after -webkit-ruby-position, before other properties, so it can affect resolved colors. 2018-11-13 Charlie Turner <cturner@igalia.com> [EME][GStreamer] Make CDMInstance's available in decryptors, and factor out some EME utility classes. https://bugs.webkit.org/show_bug.cgi?id=191316 Reviewed by Xabier Rodriguez-Calvar. Another preparation in patch getting ready to move the decryption logic behind the CDMInstance and out of the GStreamer decryptors themselves. The first step taken here is to arrange for the instances to always be available in the decryptors when they need to decrypt content. In doing so, there were a number of hairy bits of code that could use some abstraction, so the opportunity was taken to do that as well. Covered by tests in media/encrypted-media and imported/w3c/web-platform-tests/encrypted-media. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Remove drm-key-needed since it was not being used anywhere. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage): Factor out the parsing of decryption system information from GStreamer, since it was not clear what that code was doing unless you squinted pretty hard. Also remove the duplicated initialization-data-encountered posting. (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Refactored to make it a more general method and usable in more situations. It now has an optional to stop it from eliding init datas for a different key system. This is required the first time we post them, since if a CDM instance has already been set, and if the stream init datas are for different systems, we ended up never posting an encrypted event. (WebCore::MediaPlayerPrivateGStreamerBase::attemptToDecryptWithLocalInstance): Actually send a CDMInstance now when in regular playback mode. (WebCore::MediaPlayerPrivateGStreamerBase::dispatchDecryptionKey): Remove m_needToSendCredentials, it was not being used. (WebCore::MediaPlayerPrivateGStreamerBase::handleProtectionEvent): Refactored to use the new initializationDataEncountered. (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey): Log the waiting state, since it was currently not clear what that logging message was even telling you! (WebCore::extractEventsAndSystemsFromMessage): Deleted. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: (WebCore::InitData::InitData): New class that encapsulates both single instantiation and streaming instantiation. (WebCore::InitData::append): Used for the streaming mode, when you are concatenating init datas together. (WebCore::InitData::payload const): (WebCore::InitData::systemId const): (WebCore::InitData::payloadContainerType const): (WebCore::InitData::isFromDifferentContainer): (WebCore::ProtectionSystemEvents::ProtectionSystemEvents): (WebCore::ProtectionSystemEvents::events const): (WebCore::ProtectionSystemEvents::availableSystems const): * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): If you post waiting-for-key after requesting a CDM instance, it will flap back to not waiting for a key almost immediately, didn't make sense positing after requesting an instance. Also post key-received when we receive the key. (webkitMediaCommonEncryptionDecryptSinkEventHandler): It has now been arranged that a CDMInstance will always be present in an OOB message, so parse it out here. * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::attemptToDecryptWithInstance): As above, make sure when posting the OOB that a CDMInstance is present. 2018-11-13 Charlie Turner <cturner@igalia.com> Various compiler warnings/errors fixes. https://bugs.webkit.org/show_bug.cgi?id=191583 Reviewed by Frédéric Wang. * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::clearObjectStore): ASSERT is only compiled in DEBUG mode, so guarding with !LOG_DISABLED is wrong. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): showPaintOrderTree is only compiled in ENABLE(TREE_DEBUGGING) mode, so guarding with !LOG_DISABLED was wrong. (WebCore::RenderLayerCompositor::computeCompositingRequirements): Ditto, this time with member .depth. (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): Ditto. * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::styleChanged): Add another unused parameter. 2018-11-12 Antoine Quint <graouts@apple.com> [Web Animations] Don't schedule animation frames or update style while an accelerated animation is running https://bugs.webkit.org/show_bug.cgi?id=191542 <rdar://problem/45356027> Reviewed by Simon Fraser. Test: animations/no-style-recalc-during-accelerated-animation.html In order to be more power-efficient, we stop scheduling calls to updateAnimationsAndSendEvents() when running only accelerated animations. To do that, we prevent scheduling further animation resolution if we're in the process of updating animations, and when we are done, call the new DocumentTimeline::scheduleNextTick() method that will check whether we have only accelerated animations running, and in that case check which of those animations needs an update the soonest and starts a timer scheduled for that time when we'll schedule animation resolution. By default, animations compute the time until their natural completion but in the case of CSS Animations, we want to make sure we also update animations in-flight to dispatch "animationiteration" events. * animation/AnimationEffect.h: Make the simpleIterationProgress() public so it can be called by WebAnimation::timeToNextTick(). * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): Create the m_tickScheduleTimer and set it up to call scheduleAnimationResolutionIfNeeded(). (WebCore::DocumentTimeline::suspendAnimations): If we don't already have a cached current time, cache the current time. (WebCore::DocumentTimeline::resumeAnimations): Reset the cached current time to ensure we'll get a fresh one when updating animations next. (WebCore::DocumentTimeline::liveCurrentTime const): Factor the code to compute the current time out of currentTime() so that we can cache the current time in suspendAnimations() without also automatically clearing the current time. (WebCore::DocumentTimeline::currentTime): Use liveCurrentTime() and cacheCurrentTime() since much of the code from this function has been factored out into those. Additionally, we were failing to clear the current time if called inside an animation frame, which we now do correctly by virtue of using cacheCurrentTime(). This fixes some flakiness. (WebCore::DocumentTimeline::cacheCurrentTime): Factor the code to cache the current time out of currentTime(). (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): No need to clear the current time if we get suspended. (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Prevent scheduling an animation update if we're in the middle of one already, scheduleNextTick() will be called after animations are updated to see if we should schedule an animation update instead. (WebCore::DocumentTimeline::unscheduleAnimationResolution): Cancel the m_tickScheduleTimer if we need to unschedule animation resolution. (WebCore::DocumentTimeline::animationResolutionTimerFired): Factor the call to applyPendingAcceleratedAnimations() out of updateAnimationsAndSendEvents() and call scheduleNextTick(). (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Set the new m_isUpdatingAnimations member variable to true while this function is running. (WebCore::DocumentTimeline::scheduleNextTick): Schedule an animation update immediately if we have any relevant animation that is not accelerated. Otherwise, iterate through all animations to figure out the earliest moment at which we need to update animations. (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Use the new WebAnimation::isRunningAccelerated() function. * animation/DocumentTimeline.h: * animation/WebAnimation.cpp: (WebCore::WebAnimation::isRunningAccelerated const): Since we end up checking if an animation is running with an accelerated effect, we introduce a new function to get that information directly through the WebAnimation object without bothering about its effect. (WebCore::WebAnimation::resolve): We should only call updateFinishedState() here since timingDidChange() would also notify the timeline about a potential change in relevance, which is not necessary and which would schedule an animation frame even for animations that are accelerated. (WebCore::WebAnimation::timeToNextTick const): Compute the time until our animation completion or, in the case of CSS animations, the next iteration. * animation/WebAnimation.h: 2018-11-13 Miguel Gomez <magomez@igalia.com> [GTK][WPE] Incorrect tile coverage when resizing a layer out of the visible area https://bugs.webkit.org/show_bug.cgi?id=191545 Reviewed by Žan Doberšek. Keep track of layer size changes even if they happen when the layer is not in the visible area, so we can update edge tiles when the layer gets visible. * platform/graphics/texmap/coordinated/TiledBackingStore.cpp: (WebCore::TiledBackingStore::createTiles): * platform/graphics/texmap/coordinated/TiledBackingStore.h: 2018-11-12 Rob Buis <rbuis@igalia.com> Content-Type parameter values should allow empty quoted strings https://bugs.webkit.org/show_bug.cgi?id=191388 Reviewed by Dean Jackson. According to RFC 2045 and https://mimesniff.spec.whatwg.org/#parsing-a-mime-type empty quoted strings are acceptable for Content-Type parameter values. They are accepted by Firefox and Chrome implementations as well. Test: web-platform-tests/xhr/overridemimetype-blob.html * platform/network/ParsedContentType.cpp: (WebCore::parseToken): (WebCore::parseQuotedString): (WebCore::parseContentType): * platform/network/ParsedContentType.h: 2018-11-12 Christopher Reid <chris.reid@sony.com> [Curl] Reject entire cookie if the domain fails a tailmatch. https://bugs.webkit.org/show_bug.cgi?id=191406 Reviewed by Youenn Fablet. Currently we don't put domain attribute of cookie when it fails a tailmatch. As Firefox and Chrome do, we are going to reject the entire cookie if the domain fails a tailmatch instead. Also cleanup Cookie database implementation to make them testable better. Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::canAcceptCookie): Added. (WebCore::CookieJarDB::setCookie): * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieAttributes): (WebCore::CookieUtil::parseCookieHeader): * platform/network/curl/CookieUtil.h: 2018-11-12 Devin Rousso <drousso@apple.com> Web Inspector: Network: show secure certificate details per-request https://bugs.webkit.org/show_bug.cgi?id=191447 <rdar://problem/30019476> Reviewed by Joseph Pecoraro. Test: http/tests/inspector/network/resource-response-security.html * loader/ResourceLoader.h: (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::shouldIncludeCertificateInfo const): Added. Always save certificate information when WebInspector is open. * platform/network/CertificateInfoBase.h: Added. (WebCore::CertificateInfoBase::containsNonRootSHA1SignedCertificate const): (WebCore::CertificateInfoBase::summaryInfo const): (WebCore::CertificateInfoBase::isEmpty const): * platform/network/cf/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. * platform/network/cf/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. (WebCore::CertificateInfo::containsNonRootSHA1SignedCertificate): (WebCore::CertificateInfo::summaryInfo const): Added. * platform/network/curl/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. (WebCore::CertificateInfo::isEmpty const): Added. * platform/network/soup/CertificateInfo.h: (WebCore::CertificateInfo::summaryInfo const): Added. (WebCore::CertificateInfo::isEmpty const): Added. Create base class for `CertificateInfo` so that `InspectorNetworkAgent` doesn't need to have platform-specific code in its implementation. * platform/network/cocoa/CertificateInfoCocoa.mm: Renamed from Source/WebCore/platform/network/mac/CertificateInfoMac.mm. * platform/network/curl/CertificateInfoCFNet.cpp: Renamed from Source/WebCore/platform/network/curl/CertificateInfo.cpp. * platform/network/soup/CertificateInfoSoup.cpp: Renamed from Source/WebCore/platform/network/soup/CertificateInfo.cpp. * inspector/NetworkResourcesData.h: (WebCore::NetworkResourcesData::ResourceData::certificateInfo const): Added. (WebCore::NetworkResourcesData::ResourceData::setCertificateInfo): Added. * inspector/NetworkResourcesData.cpp: (WebCore::NetworkResourcesData::responseReceived): * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForResourceResponse): * PlatformAppleWin.cmake: * PlatformMac.cmake: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/Curl.cmake: * platform/SourcesSoup.txt: 2018-11-12 Zalan Bujtas <zalan@apple.com> Do not collapse the soon-to-be-parent anon block when we shuffle around the marker item renderer. https://bugs.webkit.org/show_bug.cgi?id=191554 <rdar://problem/45825265> Reviewed by Antti Koivisto. While moving the marker item renderer to its correct subtree, we accidentally remove the soon-to-be parent anonymous block. Moving a renderer is a 2 step process: 1. Detach the renderer from its current parent 2. Attach it to its new parent. During step #1, we check if there is a chance to collapse anonymous blocks. In this case the soon-to-be-parent is a sibling anonymous block which, after detaching the marker sibling is not needed anymore (except we use it as the new parent). Test: fast/inline/marker-list-item-move-should-not-crash.html * rendering/updating/RenderTreeBuilder.cpp: (WebCore::RenderTreeBuilder::detach): * rendering/updating/RenderTreeBuilder.h: * rendering/updating/RenderTreeBuilderBlock.cpp: (WebCore::RenderTreeBuilder::Block::detach): * rendering/updating/RenderTreeBuilderBlock.h: * rendering/updating/RenderTreeBuilderList.cpp: (WebCore::RenderTreeBuilder::List::updateItemMarker): 2018-11-12 Javier Fernandez <jfernandez@igalia.com> [css-grid] Refactoring to make more explicit the orthogonal items' pre-layout logic https://bugs.webkit.org/show_bug.cgi?id=191358 Reviewed by Manuel Rego Casasnovas. These changes are just a refactoring to ease the integration of the new Baseline Alignment logic in a follow up patch. We need to properly estimate the grid area size of orthogonal items so that we can perform an accurate pre-layout. This is important because orthogonal items will synthesize their baseline if they participate in any baseline alignment context. No new tests, since no behavior change has been introduced in this patch. * rendering/Grid.cpp: (WebCore::Grid::setNeedsItemsPlacement): * rendering/Grid.h: * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::estimatedGridAreaBreadthForChild const): (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const): (WebCore::GridTrackSizingAlgorithm::isRelativeGridLengthAsAuto const): (WebCore::GridTrackSizingAlgorithm::isRelativeSizedTrackAsAuto const): (WebCore::GridTrackSizingAlgorithm::gridTrackSize const): (WebCore::IndefiniteSizeStrategy::findUsedFlexFraction const): (WebCore::GridTrackSizingAlgorithm::run): (WebCore::GridTrackSizingAlgorithm::reset): * rendering/GridTrackSizingAlgorithm.h: (WebCore::GridTrackSizingAlgorithmStrategy::gridTrackSize const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::repeatTracksSizingIfNeeded): (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::computeIntrinsicLogicalWidths const): (WebCore::RenderGrid::computeTrackSizesForIndefiniteSize const): (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::performGridItemsPreLayout const): (WebCore::overrideSizeChanged): (WebCore::hasRelativeBlockAxisSize): (WebCore::RenderGrid::updateGridAreaLogicalSize const): (WebCore::RenderGrid::layoutGridItems): * rendering/RenderGrid.h: 2018-11-12 Sihui Liu <sihui_liu@apple.com> imported/w3c/web-platform-tests/IndexedDB/keygenerator-explicit.html crashing on iOS device https://bugs.webkit.org/show_bug.cgi?id=191500 Reviewed by Dean Jackson. When double value is bigger than maximum unsigned int, converting double to unsigned int has different behaviors on macOS and iOS. On macOS, the result would be 0 while on iOS it would be maximum unsigned int. Covered by existing test. * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber): (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber): 2018-11-12 Basuke Suzuki <basuke.suzuki@sony.com> [Curl] Add API Test for Curl cookie backend. https://bugs.webkit.org/show_bug.cgi?id=191493 Reviewed by Youenn Fablet. Refactoring for cookie backend interface. Tests: TestWebKitAPI/Tests/WebCore/curl/Cookies.cpp * platform/FileSystem.h: * platform/network/curl/CookieJarCurlDatabase.cpp: (WebCore::cookiesForSession): (WebCore::CookieJarCurlDatabase::setCookiesFromDOM const): (WebCore::CookieJarCurlDatabase::setCookiesFromHTTPResponse const): (WebCore::CookieJarCurlDatabase::getRawCookies const): * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::openDatabase): (WebCore::CookieJarDB::checkSQLiteReturnCode): (WebCore::CookieJarDB::isEnabled const): (WebCore::CookieJarDB::searchCookies): (WebCore::CookieJarDB::setCookie): (WebCore::CookieJarDB::deleteCookie): (WebCore::CookieJarDB::deleteCookieInternal): (WebCore::CookieJarDB::deleteCookies): (WebCore::CookieJarDB::deleteAllCookies): (WebCore::CookieJarDB::executeSimpleSql): (WebCore::CookieJarDB::isEnabled): Deleted. * platform/network/curl/CookieJarDB.h: * platform/network/curl/CookieUtil.cpp: (WebCore::CookieUtil::parseCookieHeader): * platform/network/curl/CookieUtil.h: * platform/win/FileSystemWin.cpp: (WebCore::FileSystem::generateTemporaryPath): (WebCore::FileSystem::openTemporaryFile): (WebCore::FileSystem::createTemporaryDirectory): (WebCore::FileSystem::deleteNonEmptyDirectory): 2018-11-12 Tim Horton <timothy_horton@apple.com> Make it possible to edit images inline https://bugs.webkit.org/show_bug.cgi?id=191352 <rdar://problem/30107985> Reviewed by Dean Jackson. Tests: editing/images/basic-editable-image.html editing/images/reparent-editable-image-maintains-strokes.html Add the beginnings of a mechanism to replace images with a special attribute with a native drawing view in the UI process. * page/Settings.yaml: Add a setting to control whether images become natively editable when they have the x-apple-editable-image attribute. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::editableImageViewID const): Lazily generate an EmbeddedViewID and persist it on the <img> element. * html/HTMLImageElement.h: Rearrange the service controls methods to sit before the members. Add m_editableImageViewID and editableImageViewID(). * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::nextEmbeddedViewID): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setContentsToEmbeddedView): Add a new ContentsLayerPurpose, EmbeddedView, which is only supported on Cocoa platforms and when using RemoteLayerTree. Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type. Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType and an EmbeddedViewID to uniquely identify and communicate about the embedded view (which may move between layers, since it is tied to an element). * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView): (WebCore::GraphicsLayerCA::setContentsToEmbeddedView): When setting GraphicsLayer's contents to an embedded view, we use a special PlatformCALayer factory that takes the EmbeddedViewID and type. GraphicsLayerCARemote will override this and make a correctly-initialized PlatformCALayerRemote that keeps track of the EmbeddedViewID. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::operator<<): * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): (WebCore::PlatformCALayerCocoa::embeddedViewID const): Add stubs and logging for EmbeddedViewID on PlatformCALayer. These will be overridden by PlatformCALayerRemote to do more interesting things. * rendering/RenderImage.cpp: (WebCore::RenderImage::isEditableImage const): Add a getter that return true if the setting is enabled and x-apple-editable-image is empty or true. (WebCore::RenderImage::requiresLayer const): RenderImage requires a layer either if RenderReplaced does, or we are an editable image. * rendering/RenderImage.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::shouldBeNormalFlowOnly const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): Push the EmbeddedViewID and type down to GraphicsLayer for editable images. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const): * rendering/RenderLayerCompositor.h: Make editable images require compositing implicitly. 2018-11-12 Don Olmstead <don.olmstead@sony.com> Shipped PNGs include bad profiles: iCCP: known incorrect sRGB profile https://bugs.webkit.org/show_bug.cgi?id=189230 <rdar://problem/44050379> Reviewed by Joseph Pecoraro. Runs all png images through zopflipng. This results in a smaller file size and takes care of this issue as a byproduct. * Modules/modern-media-controls/images/iOS/airplay-placard@1x.png: * Modules/modern-media-controls/images/iOS/airplay-placard@2x.png: * Modules/modern-media-controls/images/iOS/airplay-placard@3x.png: * Modules/modern-media-controls/images/iOS/invalid-placard@1x.png: * Modules/modern-media-controls/images/iOS/invalid-placard@2x.png: * Modules/modern-media-controls/images/iOS/invalid-placard@3x.png: * Modules/modern-media-controls/images/iOS/pip-placard@1x.png: * Modules/modern-media-controls/images/iOS/pip-placard@2x.png: * Modules/modern-media-controls/images/iOS/pip-placard@3x.png: * Modules/modern-media-controls/images/macOS/airplay-placard@1x.png: * Modules/modern-media-controls/images/macOS/airplay-placard@2x.png: * Modules/modern-media-controls/images/macOS/invalid-placard@1x.png: * Modules/modern-media-controls/images/macOS/invalid-placard@2x.png: * Modules/modern-media-controls/images/macOS/pip-placard@1x.png: * Modules/modern-media-controls/images/macOS/pip-placard@2x.png: * Resources/AttachmentPlaceholder.png: * Resources/AttachmentPlaceholder@2x.png: * Resources/ListButtonArrow.png: * Resources/ListButtonArrow@2x.png: * Resources/missingImage.png: * Resources/missingImage@2x.png: * Resources/missingImage@3x.png: * Resources/moveCursor.png: * Resources/northEastSouthWestResizeCursor.png: * Resources/northSouthResizeCursor.png: * Resources/northWestSouthEastResizeCursor.png: * Resources/nullPlugin.png: * Resources/nullPlugin@2x.png: * Resources/panIcon.png: * Resources/textAreaResizeCorner.png: * Resources/textAreaResizeCorner@2x.png: * Resources/urlIcon.png: 2018-11-12 Youenn Fablet <youenn@apple.com> RealtimeOutgoing A/V sources should observe their sources only if having a sink https://bugs.webkit.org/show_bug.cgi?id=191490 Reviewed by Eric Carlson. Observe the source that generates media based on the sinks: - Do not observe at creation time - For first sink, start observing - When no more sink, stop observing Apply this principle for both outgoing audio and video sources. Add locks for the sinks to ensure thread-safety. Make sinks HashSet which is more robust. Do some refactoring to better isolate generic outgoing sources from Cocoa/GTK implementations. Covered by existing tests and updated webrtc/remove-track.html. * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::~RealtimeOutgoingAudioSource): (WebCore::RealtimeOutgoingAudioSource::stop): (WebCore::RealtimeOutgoingAudioSource::AddSink): (WebCore::RealtimeOutgoingAudioSource::RemoveSink): (WebCore::RealtimeOutgoingAudioSource::sendAudioFrames): * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::~RealtimeOutgoingVideoSource): (WebCore::RealtimeOutgoingVideoSource::observeSource): (WebCore::RealtimeOutgoingVideoSource::setSource): (WebCore::RealtimeOutgoingVideoSource::stop): (WebCore::RealtimeOutgoingVideoSource::AddOrUpdateSink): (WebCore::RealtimeOutgoingVideoSource::RemoveSink): * platform/mediastream/RealtimeOutgoingVideoSource.h: (WebCore::RealtimeOutgoingVideoSource::isSilenced const): * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp: (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa): (WebCore::RealtimeOutgoingAudioSourceCocoa::audioSamplesAvailable): (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData): * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): 2018-11-12 Youenn Fablet <youenn@apple.com> Support setting stream ids when adding a transceiver https://bugs.webkit.org/show_bug.cgi?id=191307 Reviewed by Eric Carlson. Add support for streams in RTCTransceiverInit. Add plumbing down to libwebrtc. Covered by rebased tests. * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::fromRtpTransceiverInit): 2018-11-12 Antti Koivisto <antti@apple.com> Support dynamic pseudo-classes on elements with display: contents https://bugs.webkit.org/show_bug.cgi?id=181640 <rdar://problem/36605415> Reviewed by Dean Jackson. The code for :hover and :active style invalidation assumes that only elements with renderer need invalidation. This patch fixes '.display-content-element:hover span' case but not '.display-content-element:hover' case but includes tests for both. The latter is not super useful anyway (as it only affects rendering with inherited text properties). Test: fast/css/display-contents-hover-active.html * dom/Document.cpp: (WebCore::Document::updateHoverActiveState): Traverse up in composed tree instead of render tree when invalidating. This has the same order as render tree but also includes display:content elements. This also allows removing the special display:none case. * dom/Element.cpp: (WebCore::Element::setActive): (WebCore::Element::setHovered): Also look into display:contents style for invalidation checks. (WebCore::Element::renderOrDisplayContentsStyle const): Make this helper an Element member. * dom/Element.h: * dom/Node.cpp: (WebCore::Node::parentElementInComposedTree const): Support starting from a PseudoElement. This is consistent with ComposedTreeAncestorIterator. * rendering/updating/RenderTreePosition.cpp: (WebCore::RenderTreePosition::nextSiblingRenderer const): * style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveElement): (WebCore::Style::TreeResolver::createAnimatedElementUpdate): (WebCore::Style::shouldResolveElement): (WebCore::Style::TreeResolver::resolveComposedTree): (WebCore::Style::renderOrDisplayContentsStyle): Deleted. Use the Element::renderOrDisplayContentsStyle() instead. 2018-11-12 Antoine Quint <graouts@apple.com> [Web Animations] Turn Web Animations experimental https://bugs.webkit.org/show_bug.cgi?id=191543 Reviewed by Dean Jackson. * page/RuntimeEnabledFeatures.h: 2018-11-12 Simon Fraser <simon.fraser@apple.com> feFlood with alpha color doesn't work correctly https://bugs.webkit.org/show_bug.cgi?id=163666 Reviewed by Zalan Bujtas. FEFlood::platformApplySoftware() erroneously used colorWithOverrideAlpha() rather than multiplying the flood color with the flood opacity as other browsers do. Test: svg/filters/feFlood-with-alpha-color.html * platform/graphics/Color.cpp: (WebCore::Color::colorWithAlpha const): I tried using colorWithAlphaMultipliedBy() elsewhere, and it triggered a behavior change, so add a comment. * platform/graphics/filters/FEFlood.cpp: (WebCore::FEFlood::platformApplySoftware): * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): 2018-11-12 Eric Carlson <eric.carlson@apple.com> Require <iframe allow="display"> for an iframe to use getDisplayMedia https://bugs.webkit.org/show_bug.cgi?id=191505 <rdar://problem/45968811> Reviewed by Jer Noble. Test: http/tests/media/media-stream/get-display-media-iframe-allow-attribute.html * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): * Modules/mediastream/UserMediaController.cpp: (WebCore::isAllowedToUse): (WebCore::UserMediaController::canCallGetUserMedia): (WebCore::UserMediaController::logGetUserMediaDenial): * Modules/mediastream/UserMediaController.h: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::start): 2018-11-12 Simon Fraser <simon.fraser@apple.com> Make compositing updates incremental https://bugs.webkit.org/show_bug.cgi?id=90342 Reviewed by Antti Koivisto. Previously, updating compositing layers required two full RenderLayer tree traversals, and all the work was done for every RenderLayer on each composting update. This could be expensive on pages with lots of RenderLayers. These changes make compositing updates more incremental. Compositing updates still require two tree traversals. The first determines which RenderLayers need to be composited (of those which weren't already made composited at style-change time), because of reasons that can only be determined post-layout, and indirect reasons including overlap. The second traversal updates the configuration, geometry and GraphicsLayer tree for the composited layers. Dependencies on both descendant and ancestor state make it hard to fold these two traversals together. In order to minimize the work done during these traversals, dirty bits are stored on RenderLayers, and propagated to ancestor layers in paint order. There are two sets of bits: those related to the first "compositing requirements" traversal, and those related to the second "update backing and hierarchy" traversal. When a RenderLayer gets a dirty bit set, bits are propagated to ancestors to indicate that children need to be visited. Sadly entire subtrees can't be skipped during the "compositing requirements" traversal because we still have to accumulate overlap rects, but RenderLayerCompositor::traverseUnchangedSubtree() is used to minimize work in that case. Subtrees can be skipped in the "update backing and hierarchy" traversal. Entire traversals can be skipped if no change has triggered the need for that traversal. These changes fix a correctness issue where transform changes now trigger overlap re-evaluation, which causes more layer geometry updates than before. This regressed the MotionMark "Focus" test, when geometry updates triggered layer resizes as the filter blur radius changed, which then triggered repaints. This is fixed by excluding composited filters from the composited bounds (but still taking them into account for overlap). Care is taken to avoid triggering traversals in non-composited documents (tested by no-updates-in-non-composited-iframe.html). Code to set the dirty bits is added in various places that change properties that compositing depends on. These changes also subsume the patch in 176196; we now never consult properties that rely on layout from the style change code path, and the only call stack for geometry updates is from the "update backing and hierarchy" traversal, which is always a pre-order traversal. Tests: compositing/geometry/stacking-context-change-layer-reparent.html compositing/layer-creation/change-to-overlap.html compositing/updates/no-updates-in-non-composited-iframe.html * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::markContextChanged): Need to differentiate between a canvas becoming composited for the first time, and its pixels changing with a new 'CanvasPixelsChanged' value. * page/FrameView.cpp: (WebCore::FrameView::setViewportConstrainedObjectsNeedLayout): * page/Page.cpp: (WebCore::Page::setPageScaleFactor): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::updateBackdropFilters): If we just made a layer for backdrops, we need to update sublayers. * rendering/RenderBox.cpp: (WebCore::RenderBox::styleWillChange): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::~RenderLayer): (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::shouldBeStackingContext const): (WebCore::RenderLayer::stackingContext const): (WebCore::RenderLayer::dirtyZOrderLists): (WebCore::RenderLayer::dirtyNormalFlowList): (WebCore::RenderLayer::updateNormalFlowList): (WebCore::RenderLayer::rebuildZOrderLists): (WebCore::RenderLayer::setAncestorsHaveCompositingDirtyFlag): (WebCore::RenderLayer::contentChanged): (WebCore::RenderLayer::updateLayerPositions): (WebCore::RenderLayer::updateTransform): (WebCore::RenderLayer::updateLayerPosition): (WebCore::RenderLayer::enclosingCompositingLayer const): (WebCore::RenderLayer::enclosingCompositingLayerForRepaint const): (WebCore::RenderLayer::clippingRootForPainting const): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::RenderLayer::updateScrollInfoAfterLayout): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::hitTest): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::calculateClipRects const): (WebCore::outputPaintOrderTreeLegend): (WebCore::outputPaintOrderTreeRecursive): (WebCore::compositingContainer): Deleted. * rendering/RenderLayer.h: (WebCore::RenderLayer::clearZOrderLists): (WebCore::RenderLayer::paintOrderParent const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateCompositedBounds): (WebCore::RenderLayerBacking::updateAfterWidgetResize): (WebCore::RenderLayerBacking::updateAfterLayout): (WebCore::RenderLayerBacking::updateConfigurationAfterStyleChange): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::setRequiresBackgroundLayer): (WebCore::RenderLayerBacking::updateMaskingLayer): (WebCore::RenderLayerBacking::paintsContent const): (WebCore::RenderLayerBacking::contentChanged): (WebCore::RenderLayerBacking::setContentsNeedDisplay): (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): (WebCore::RenderLayerBacking::startAnimation): (WebCore::RenderLayerBacking::animationFinished): (WebCore::RenderLayerBacking::startTransition): (WebCore::RenderLayerBacking::transitionFinished): (WebCore::RenderLayerBacking::setCompositedBounds): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::CompositingState::CompositingState): (WebCore::RenderLayerCompositor::enableCompositingMode): (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags): (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlagsAfterLayout): (WebCore::RenderLayerCompositor::willRecalcStyle): (WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout): (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::traverseUnchangedSubtree): (WebCore::RenderLayerCompositor::updateBackingAndHierarchy): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::layerBecameNonComposited): (WebCore::RenderLayerCompositor::logLayerInfo): (WebCore::clippingChanged): (WebCore::styleAffectsLayerGeometry): (WebCore::RenderLayerCompositor::layerStyleChanged): (WebCore::RenderLayerCompositor::needsCompositingUpdateForStyleChangeOnNonCompositedLayer const): (WebCore::RenderLayerCompositor::updateBacking): (WebCore::RenderLayerCompositor::updateLayerCompositingState): (WebCore::RenderLayerCompositor::layerWasAdded): (WebCore::RenderLayerCompositor::layerWillBeRemoved): (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const): (WebCore::RenderLayerCompositor::computeExtent const): (WebCore::RenderLayerCompositor::addToOverlapMap): (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): (WebCore::RenderLayerCompositor::rootLayerConfigurationChanged): (WebCore::RenderLayerCompositor::parentFrameContentLayers): (WebCore::RenderLayerCompositor::updateRootLayerPosition): (WebCore::RenderLayerCompositor::needsToBeComposited const): (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::clippedByAncestor const): (WebCore::RenderLayerCompositor::requiresCompositingForAnimation const): (WebCore::RenderLayerCompositor::requiresCompositingForTransform const): (WebCore::RenderLayerCompositor::requiresCompositingForVideo const): (WebCore::RenderLayerCompositor::requiresCompositingForFilters const): (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const): (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const): (WebCore::RenderLayerCompositor::requiresCompositingForFrame const): (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const): (WebCore::RenderLayerCompositor::requiresCompositingForPosition const): (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const): (WebCore::RenderLayerCompositor::styleChangeMayAffectIndirectCompositingReasons): (WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const): (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged): (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged): (WebCore::operator<<): (WebCore::RenderLayerCompositor::setCompositingLayersNeedRebuild): Deleted. (WebCore::checkIfDescendantClippingContextNeedsUpdate): Deleted. (WebCore::isScrollableOverflow): Deleted. (WebCore::styleHasTouchScrolling): Deleted. (WebCore::styleChangeRequiresLayerRebuild): Deleted. (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Deleted. (WebCore::RenderLayerCompositor::rootFixedBackgroundsChanged): Deleted. (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): Deleted. (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): Deleted. * rendering/RenderLayerCompositor.h: * rendering/RenderTreeAsText.cpp: (WebCore::writeLayers): 2018-11-12 Rob Buis <rbuis@igalia.com> CSSCalcOperation constructor wastes 6KB of Vector capacity on cnn.com https://bugs.webkit.org/show_bug.cgi?id=190839 Reviewed by Frédéric Wang. The CSSCalcOperation ctor that takes a leftSide and rightSide parameter wastes memory since it will always have size 2 but claims the default Vector size. So make sure to reserve an initial capacity of 2. * css/CSSCalculationValue.cpp: 2018-11-12 Yusuke Suzuki <yusukesuzuki@slowstart.org> WTFMove(xxx) is used in arguments while other arguments touch xxx https://bugs.webkit.org/show_bug.cgi?id=191544 Reviewed by Alex Christensen. The order of the evaluation of C++ arguments is undefined. If we use WTFMove(xxx), xxx should not be touched in the other arguments. This patch fixes such uses in IDB code. * Modules/indexeddb/IDBObjectStore.cpp: (WebCore::IDBObjectStore::deleteIndex): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::scheduleOperation): * Modules/indexeddb/server/MemoryIDBBackingStore.cpp: (WebCore::IDBServer::MemoryIDBBackingStore::registerObjectStore): * Modules/indexeddb/server/MemoryObjectStore.cpp: (WebCore::IDBServer::MemoryObjectStore::registerIndex): 2018-11-12 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Construct dedicated runs when the inline element requires it. https://bugs.webkit.org/show_bug.cgi?id=191509 Reviewed by Antti Koivisto. In certain cases, a run can overlap multiple inline elements like this: <span>normal text content</span><span style="position: relative; left: 10px;">but this one needs a dedicated run</span><span>end of text</span> The content above generates one long run <normal text contentbut this one needs dedicated runend of text> <- input to line breaking. However, since the middle run is positioned, it needs to be moved independently from the rest of the content, hence it needs a dedicated inline run. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::contentRequiresSeparateRun): (WebCore::Layout::InlineFormattingContext::splitInlineRunIfNeeded const): (WebCore::Layout::InlineFormattingContext::postProcessInlineRuns const): (WebCore::Layout::InlineFormattingContext::closeLine const): (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::inlineFormattingState const): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::nextRun): mid-word breaking is not implemented yet. * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::overlapsMultipleInlineItems const): * layout/inlineformatting/InlineRunProvider.cpp: (WebCore::Layout::InlineRunProvider::processInlineTextItem): * layout/inlineformatting/InlineRunProvider.h: (WebCore::Layout::InlineRunProvider::Run::TextContext::expand): (WebCore::Layout::InlineRunProvider::Run::textContext): (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): Deleted. (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): Deleted. 2018-11-12 Jer Noble <jer.noble@apple.com> [MSE] Frame re-ordering can cause iframes to never be enqueued https://bugs.webkit.org/show_bug.cgi?id=191485 Reviewed by Eric Carlson. Test: media/media-source/media-source-dropped-iframe.html Some frame re-ordering techniques result in files where the first frame has a decode timestamp < 0, but a presentation timestamp >= 0. When appending these samples to existing content, we can fail to enqueue the first frame because its DTS overlaps an existing sample, but the presentation timestamp does not. Rather than try to only enqueue samples whose decode timestamps are > than the greatest decode end timestamp (minus some fudge factor), allow all frames to be added to the decode queue if they are strictly ordered greater than the last enqueued frame. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::TrackBuffer::TrackBuffer): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): (WebCore::SourceBuffer::provideMediaData): (WebCore::SourceBuffer::reenqueueMediaForTime): 2018-11-12 Yusuke Suzuki <yusukesuzuki@slowstart.org> IDBTransaction does not use "RefPtr<IDBTransaction> self" https://bugs.webkit.org/show_bug.cgi?id=190436 Reviewed by Alex Christensen. It seems that `RefPtr<IDBTransaction> self;` is not effective since it does not capture anything. Use `protectedThis = makeRef(*this)` instead. No behavior change. * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): 2018-11-12 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Introduce AbortableTaskQueue https://bugs.webkit.org/show_bug.cgi?id=190902 Reviewed by Xabier Rodriguez-Calvar. A new synchronization primitive is introduced: AbortableTaskQueue, which allows to send work to the main thread from a background thread with the option to perform two-phase cancellation (startAborting() and finishAborting()). This new primitive has been used to overhaul GstBus messaging in AppendPipeline. A lot of code made redundant has been deleted in the process and lots of internal functions were now able to be made private. As part of the refactor all glib signals in AppendPipeline now use lambdas. All usages of WTF::isMainThread() in AppendPipeline have been replaced by isMainThread() for consistency with the rest of WebKit. Two-phase cancellation is still not used in AppendPipeline as of this patch, but it will be used in a future patch that makes use of GStreamer flushes to implement correct MSE abort semantics. There are unit tests to ensure it works correctly, even if it's still not used. * WebCore.xcodeproj/project.pbxproj: * platform/AbortableTaskQueue.h: Added. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::dumpAppendState): (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe): (WebCore::AppendPipeline::handleAppsinkNewSampleFromAnyThread): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread): * platform/graphics/gstreamer/mse/AppendPipeline.h: (WebCore::AppendPipeline::sourceBufferPrivate): (WebCore::AppendPipeline::appsinkCaps): (WebCore::AppendPipeline::track): (WebCore::AppendPipeline::demuxerSrcPadCaps): (WebCore::AppendPipeline::playerPrivate): 2018-11-12 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME] waitingforkey event should consider decryptors' waiting status https://bugs.webkit.org/show_bug.cgi?id=191459 Reviewed by Carlos Garcia Campos. The new cross platform architecture to report waitingforkey and recover from it requires a more accurate knowledge of what is going on with the decryptors because events are reported only once (per key exchange run) and crossplatform only continues if we are actually ready to continue, meaning that no decryptors are waiting. * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GstIterator deleter. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): Bail out if we are requested to not wait anymore but there are still waiting decryptors. (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const): Query the pipeline, just a query after pipeline is built and manual inspection during build. The query is optimal but sometimes we can get this request when the pipeline is under construction so queries do not arrive at the decryptors and we have to deliver it by ourselves. (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey: Deleted because it is now inlined. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webKitMediaClearKeyDecryptorDecrypt): Fixed small compiler warning. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkit_media_common_encryption_decrypt_class_init): Override query method. (webkitMediaCommonEncryptionDecryptTransformInPlace): When the decryptor is going to block to wait, report before. When the decryptor receives the key, report it got it. (webkitMediaCommonEncryptionDecryptSinkEventHandler): Do not handle waitingforkey here. (webkitMediaCommonEncryptionDecryptorQueryHandler): Report if the decryptor is waiting. 2018-11-12 Michael Catanzaro <mcatanzaro@igalia.com> [GTK] Silence ATK_XY_PARENT warnings https://bugs.webkit.org/show_bug.cgi?id=191504 Reviewed by Carlos Garcia Campos. * accessibility/atk/WebKitAccessibleInterfaceComponent.cpp: (atkToContents): * accessibility/atk/WebKitAccessibleInterfaceText.cpp: (textExtents): * accessibility/atk/WebKitAccessibleUtil.cpp: (contentsRelativeToAtkCoordinateType): 2018-11-11 Wenson Hsieh <wenson_hsieh@apple.com> Implement a new edit command to change the enclosing list type https://bugs.webkit.org/show_bug.cgi?id=191487 <rdar://problem/45955922> Reviewed by Ryosuke Niwa. Add support for a new edit command that changes the type of the enclosing list element around the selection from unordered to ordered list and vice versa. This new edit command is exposed only to internal WebKit2 clients, via SPI on WKWebView (`-_changeListType:`). This is currently intended for use in Mail compose, but may also be adopted by legacy Notes in the future. As such, the behavior of this editing command mostly matches shipping behavior in Mail compose (which is currently implemented entirely by Mail). See below for more details. Test: editing/execCommand/change-list-type.html WKWebViewEditActions.ChangeListType * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * editing/ChangeListTypeCommand.cpp: Added. (WebCore::listConversionTypeForSelection): (WebCore::ChangeListTypeCommand::listConversionType): Helper that returns a potential list conversion command that may be executed at the given document's selection, if any exists. We also use existing logic from Mail here to determine which list to change, by walking up the DOM from the lowest common ancestor container of the current selection until we hit the first list element. (WebCore::ChangeListTypeCommand::createNewList): Helper method to create a new list element to replace the given list, and then clone element data from the given list to the new list. This addresses an existing bug in Mail, wherein changing list type for an enclosing list which contains inline style properties drops the inline styles, because existing logic in Mail that implements this editing command only copies the `class` attribute of the old list to the new list. (WebCore::ChangeListTypeCommand::doApply): Apply the edit command by running the following steps: - Find the enclosing list element, if any (see above). - Create a new list element of the opposite type as the enclosing list, and clone over element data from the list element being replaced. - Insert the new list next to the original list. - Move all children of the original list to the new list. - Remove the original list. - Set the selection to the end of the new list. * editing/ChangeListTypeCommand.h: Added. * editing/EditAction.h: Add a pair of new edit actions for conversion from unordered list to ordered list and vice versa. * editing/Editor.cpp: (WebCore::Editor::changeSelectionListType): Implement this by creating and applying a new ChangeListTypeCommand. (WebCore::Editor::canChangeSelectionListType): Deleted. Remove this for now, since there's no need for it until full support for edit command validation is implemented. * editing/Editor.h: * testing/Internals.cpp: (WebCore::Internals::changeSelectionListType): * testing/Internals.h: * testing/Internals.idl: Add internal hooks to change list type from layout tests. 2018-11-11 Daniel Bates <dabates@apple.com> [iOS] Draw caps lock indicator in password fields https://bugs.webkit.org/show_bug.cgi?id=190565 <rdar://problem/45262343> Reviewed by Dean Jackson. Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password fields on iOS more closely match the behavior of password fields on Mac. The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS. In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult the store in the WebProcess. A smaller part of this patch is having both the legacy and modern web views listen for keyboard availability changes so as to update the the caps lock state when a hardware keyboard is detached or attached. * WebCore.xcodeproj/project.pbxproj: * page/EventHandler.cpp: (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent() so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code. (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged(). * page/EventHandler.h: * platform/cocoa/KeyEventCocoa.mm: (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm. (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm. * platform/ios/KeyEventIOS.mm: (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state. (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation. (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation. * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: (+[WebEvent modifierFlags]): Added. * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared by both Mac and iOS. (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared by both Mac and iOS. * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be shared by both Mac and iOS. 2018-11-11 Zalan Bujtas <zalan@apple.com> [LFC][BFC] In-flow positioned logic is really formatting context dependent. https://bugs.webkit.org/show_bug.cgi?id=191512 Reviewed by Simon Fraser. Move block formatting context specific code from FormattingContext to BlockFormattingContext. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): Deleted. * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::inFlowPositionedPositionOffset): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): Deleted. * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: 2018-11-11 Myles C. Maxfield <mmaxfield@apple.com> Address post-review comments after r237955 https://bugs.webkit.org/show_bug.cgi?id=191496 Reviewed by Darin Adler. * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintTextDecoration): * style/InlineTextBoxStyle.cpp: (WebCore::computeUnderlineOffset): * style/InlineTextBoxStyle.h: 2018-11-11 Benjamin Poulain <benjamin@webkit.org> Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend https://bugs.webkit.org/show_bug.cgi?id=191492 Reviewed by Alex Christensen. Rename file. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * page/mac/EventHandlerMac.mm: * platform/mac/URLMac.mm: * platform/mac/WebCoreNSURLExtras.mm: * platform/mac/WebCoreObjCExtras.mm: * rendering/RenderThemeMac.mm: 2018-11-10 Benjamin Poulain <benjamin@webkit.org> Fix a fixme: rename wtfObjcMsgSend to wtfObjCMsgSend https://bugs.webkit.org/show_bug.cgi?id=191492 Reviewed by Alex Christensen. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: * page/mac/EventHandlerMac.mm: * platform/mac/URLMac.mm: * platform/mac/WebCoreNSURLExtras.mm: * platform/mac/WebCoreObjCExtras.mm: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): 2018-11-10 Megan Gardner <megan_gardner@apple.com> Fix build for 32bit Mac https://bugs.webkit.org/show_bug.cgi?id=191511 Unreviewed Build Fix. Build fix, not tests needed. Make the apporiate delecrations for 32-bit mac support. * editing/mac/DictionaryLookup.mm: 2018-11-10 Simon Fraser <simon.fraser@apple.com> Remove support for -webkit-svg-shadow https://bugs.webkit.org/show_bug.cgi?id=187429 <rdar://problem/41920735> Reviewed by Dean Jackson. -webkit-svg-shadow was a non-standard hack for online iWork, and they no longer use it, so remove it. No other browser supports it, and chromestatus say it's used on less than 0.000001% of pages. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/SVGCSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::svgPropertyValue): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialWebkitSvgShadow): Deleted. (WebCore::StyleBuilderCustom::applyInheritWebkitSvgShadow): Deleted. (WebCore::StyleBuilderCustom::applyValueWebkitSvgShadow): Deleted. * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * rendering/RenderElement.cpp: (WebCore::RenderElement::didAttachChild): * rendering/svg/RenderSVGImage.cpp: (WebCore::RenderSVGImage::layout): * rendering/svg/RenderSVGImage.h: * rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::RenderSVGModelObject): * rendering/svg/RenderSVGModelObject.h: (WebCore::RenderSVGModelObject::repaintRectInLocalCoordinatesExcludingSVGShadow const): Deleted. (WebCore::RenderSVGModelObject::hasSVGShadow const): Deleted. (WebCore::RenderSVGModelObject::setHasSVGShadow): Deleted. * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::RenderSVGRoot): (WebCore::RenderSVGRoot::updateCachedBoundaries): * rendering/svg/RenderSVGRoot.h: * rendering/svg/RenderSVGShape.cpp: (WebCore::RenderSVGShape::updateRepaintBoundingBox): * rendering/svg/RenderSVGShape.h: * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint): (WebCore::SVGRenderSupport::layoutChildren): (WebCore::SVGRenderSupport::styleChanged): (WebCore::SVGRenderSupport::repaintRectForRendererInLocalCoordinatesExcludingSVGShadow): Deleted. (WebCore::SVGRenderSupport::rendererHasSVGShadow): Deleted. (WebCore::SVGRenderSupport::setRendererHasSVGShadow): Deleted. (WebCore::SVGRenderSupport::intersectRepaintRectWithShadows): Deleted. (WebCore::SVGRenderSupport::childAdded): Deleted. * rendering/svg/SVGRenderSupport.h: 2018-11-10 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238065. Breaks internal builds. Reverted changeset: "Make it possible to edit images inline" https://bugs.webkit.org/show_bug.cgi?id=191352 https://trac.webkit.org/changeset/238065 2018-11-10 Tim Horton <timothy_horton@apple.com> Make it possible to edit images inline https://bugs.webkit.org/show_bug.cgi?id=191352 <rdar://problem/30107985> Reviewed by Dean Jackson. Tests: editing/images/basic-editable-image.html editing/images/reparent-editable-image-maintains-strokes.html Add the beginnings of a mechanism to replace images with a special attribute with a native drawing view in the UI process. * page/Settings.yaml: Add a setting to control whether images become natively editable when they have the x-apple-editable-image attribute. * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::editableImageViewID const): Lazily generate an EmbeddedViewID and persist it on the <img> element. * html/HTMLImageElement.h: Rearrange the service controls methods to sit before the members. Add m_editableImageViewID and editableImageViewID(). * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::nextEmbeddedViewID): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::setContentsToEmbeddedView): Add a new ContentsLayerPurpose, EmbeddedView, which is only supported on Cocoa platforms and when using RemoteLayerTree. Add ContentsLayerEmbeddedViewType, which currently only has the EditableImage type. Add setContentsToEmbeddedView, which takes a ContentsLayerEmbeddedViewType and an EmbeddedViewID to uniquely identify and communicate about the embedded view (which may move between layers, since it is tied to an element). * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createPlatformCALayerForEmbeddedView): (WebCore::GraphicsLayerCA::setContentsToEmbeddedView): When setting GraphicsLayer's contents to an embedded view, we use a special PlatformCALayer factory that takes the EmbeddedViewID and type. GraphicsLayerCARemote will override this and make a correctly-initialized PlatformCALayerRemote that keeps track of the EmbeddedViewID. * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.cpp: (WebCore::operator<<): * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): (WebCore::PlatformCALayerCocoa::embeddedViewID const): Add stubs and logging for EmbeddedViewID on PlatformCALayer. These will be overridden by PlatformCALayerRemote to do more interesting things. * rendering/RenderImage.cpp: (WebCore::RenderImage::isEditableImage const): Add a getter that return true if the setting is enabled and x-apple-editable-image is empty or true. (WebCore::RenderImage::requiresLayer const): RenderImage requires a layer either if RenderReplaced does, or we are an editable image. * rendering/RenderImage.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::shouldBeNormalFlowOnly const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateConfiguration): Push the EmbeddedViewID and type down to GraphicsLayer for editable images. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForEditableImage const): * rendering/RenderLayerCompositor.h: Make editable images require compositing implicitly. 2018-11-09 Zalan Bujtas <zalan@apple.com> [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired. https://bugs.webkit.org/show_bug.cgi?id=191078 <rdar://problem/45736178> Reviewed by Antti Koivisto. 1. Improve visuallyNonEmpty milestone confidence level. Ignore whitespace and non visible text content. Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading. Check if the html/body is actually visible. 2. Issue initial paint soon after the milestone fires. Use a 0ms timer to flush the initial paint. Throttle additional flushes for 500ms and 1.5s (original behaviour). 3. Suspend optional style recalcs and layouts while painting is being throttled. When parsing yields we initiate a 0ms style recalc/layout timer. These optional layouts produce content that we have no intention to paint. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::shouldScheduleLayout): * page/ChromeClient.h: * page/FrameView.cpp: (WebCore::FrameView::resetLayoutMilestones): (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): (WebCore::FrameView::updateIsVisuallyNonEmpty): * page/FrameView.h: (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content. * platform/graphics/FontCascade.h: * rendering/RenderText.cpp: Check whether the text is actually visible at this point. (WebCore::RenderText::RenderText): 2018-11-09 John Wilander <wilander@apple.com> Add ability to configure document.cookie lifetime cap through user defaults https://bugs.webkit.org/show_bug.cgi?id=191480 <rdar://problem/45240871> Reviewed by Chris Dumez. No new tests. Existing test makes sure we don't regress. This change makes the capped lifetime in seconds configurable through user defaults. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::setAgeCapForClientSideCookies): (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): Deleted. Renamed setAgeCapForClientSideCookies(). * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::filterCookies): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2018-11-09 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r238047. Introduced layout test failures on iOS simulator. Reverted changeset: "[iOS] Draw caps lock indicator in password fields" https://bugs.webkit.org/show_bug.cgi?id=190565 https://trac.webkit.org/changeset/238047 2018-11-09 Tim Horton <timothy_horton@apple.com> Normal-flow-only flex items don't correctly respect z-index https://bugs.webkit.org/show_bug.cgi?id=191486 Reviewed by Simon Fraser. Test: css3/flexbox/z-index-with-normal-flow-only.html * rendering/RenderLayer.cpp: (WebCore::canCreateStackingContext): r125693 did not ensure that flex items which would otherwise be normal-flow-only would be put into the z-order tree when necessary. Fix by respecting the same trigger we use to make layers for flex items; namely, not having auto z-index. 2018-11-09 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] Implement SPI on WKWebView to increase and decrease list levels https://bugs.webkit.org/show_bug.cgi?id=191471 <rdar://problem/45952472> Reviewed by Tim Horton. Add new method stubs for changing the list type for the current selection (to be implemented in a future patch). * editing/Editor.cpp: (WebCore::Editor::canChangeSelectionListType): (WebCore::Editor::changeSelectionListType): * editing/Editor.h: 2018-11-09 Keith Rollin <krollin@apple.com> Unreviewed build fix after https://bugs.webkit.org/show_bug.cgi?id=191324 Remove the use of .xcfilelists until their side-effects are better understood. * WebCore.xcodeproj/project.pbxproj: 2018-11-09 Jer Noble <jer.noble@apple.com> SourceBuffer throws an error when appending a second init segment after changeType(). https://bugs.webkit.org/show_bug.cgi?id=191474 Reviewed by Eric Carlson. Test: media/media-source/media-source-changetype-second-init.html When encountering an initialization segment after changeType(), add the parsed codec types to the list of allowed codecs. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::validateInitializationSegment): * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp: (WebCore::MockMediaPlayerMediaSource::supportsType): * platform/mock/mediasource/MockSourceBufferPrivate.cpp: (WebCore::MockSourceBufferPrivate::canSwitchToType): * platform/mock/mediasource/MockSourceBufferPrivate.h: 2018-11-09 Eric Carlson <eric.carlson@apple.com> [MediaStream] AVVideoCaptureSource reports incorrect size when frames are scaled https://bugs.webkit.org/show_bug.cgi?id=191479 <rdar://problem/45952201> Reviewed by Jer Noble. No new tests, tested manually. * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::standardVideoSizes): Drive-by fix: add a few more standard video frame sizes, correct a typo. (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): Drive-by fix: don't consider rescaled sized when we already have an exact or aspect ratio match because it won't be used. * platform/mediastream/mac/AVVideoCaptureSource.h: (WebCore::AVVideoCaptureSource::width const): Deleted. (WebCore::AVVideoCaptureSource::height const): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): Delete m_requestedSize. (WebCore::AVVideoCaptureSource::shutdownCaptureSession): Delete m_width and m_height. (WebCore::AVVideoCaptureSource::processNewFrame): Don't call setSize with captured size, the frame may be resized before deliver. 2018-11-09 Ross Kirsling <ross.kirsling@sony.com> Unreviewed MSVC build fix after r238039 (and r238046). * bindings/js/JSWorkerGlobalScopeBase.cpp: * bindings/js/JSWorkerGlobalScopeBase.h: 2018-11-09 Basuke Suzuki <basuke.suzuki@sony.com> [Curl][WebKit] Implement Proxy configuration API. https://bugs.webkit.org/show_bug.cgi?id=189053 Reviewed by Youenn Fablet. Added API to set proxy from the app. No new tests because there's no behaviour change in WebCore. * platform/network/NetworkStorageSession.h: * platform/network/curl/CurlContext.h: (WebCore::CurlContext::setProxySettings): * platform/network/curl/CurlProxySettings.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::NetworkStorageSession::setProxySettings const): 2018-11-09 Antti Koivisto <antti@apple.com> Use OptionSet for layout milestones https://bugs.webkit.org/show_bug.cgi?id=191470 Reviewed by Dean Jackson. * WebCore.xcodeproj/project.pbxproj: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::didReachLayoutMilestone): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * page/FrameView.cpp: (WebCore::FrameView::FrameView): (WebCore::FrameView::addPaintPendingMilestones): (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded): (WebCore::FrameView::firePaintRelatedMilestonesIfNeeded): * page/FrameView.h: * page/LayoutMilestone.h: Copied from Source/WebCore/page/LayoutMilestones.h. Renamed to appease WK2 IPC code generation. * page/LayoutMilestones.h: Removed. * page/Page.cpp: (WebCore::Page::addLayoutMilestones): (WebCore::Page::removeLayoutMilestones): (WebCore::Page::isCountingRelevantRepaintedObjects const): * page/Page.h: (WebCore::Page::requestedLayoutMilestones const): 2018-11-09 Daniel Bates <dabates@apple.com> [iOS] Draw caps lock indicator in password fields https://bugs.webkit.org/show_bug.cgi?id=190565 <rdar://problem/45262343> Reviewed by Dean Jackson. Draw the caps lock indicator in a focused password field on iOS. This makes the behavior of password fields on iOS more closely match the behavior of password fields on Mac. For now, we only draw the indicator when caps locks is enabled via the hardware keyboard. We will look to support the software keyboard in a subsequent commit (see <https://bugs.webkit.org/show_bug.cgi?id=191475>). The majority of this patch is implementing PlatformKeyboardEvent::currentCapsLockState() for iOS. In Legacy WebKit, the implementation boils down to calling call -[::WebEvent modifierFlags]. In Modern WebKit the UIProcess is responsible for -[::WebEvent modifierFlags] and passing it the WebProcess to store such that invocations of PlatformKeyboardEvent::currentCapsLockState() consult the store in the WebProcess. A smaller part of this patch is having both the legacy and modern web views listen for keyboard availability changes so as to update the the caps lock state when a hardware keyboard is detached or attached. * WebCore.xcodeproj/project.pbxproj: * page/EventHandler.cpp: (WebCore::EventHandler::capsLockStateMayHaveChanged const): Extracted from EventHandler::internalKeyEvent() so that it can shared between WebCore, Modern WebKit, and Legacy WebKit code. (WebCore::EventHandler::internalKeyEvent): Modified to call capsLockStateMayHaveChanged(). * page/EventHandler.h: * platform/cocoa/KeyEventCocoa.mm: (WebCore::PlatformKeyboardEvent::currentCapsLockState): Moved from KeyEventMac.mm. (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Moved from KeyEventMac.mm. * platform/ios/KeyEventIOS.mm: (WebCore::PlatformKeyboardEvent::currentStateOfModifierKeys): Fetch the current modifier state. (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; we now use the Cocoa implementation. (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; we now use the Cocoa implementation. * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: (+[WebEvent modifierFlags]): Added. * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::currentCapsLockState): Deleted; moved to KeyEventCocoa.mm to be shared by both Mac and iOS. (WebCore::PlatformKeyboardEvent::getCurrentModifierState): Deleted; moved to KeyEventCocoa.mm to be shared by both Mac and iOS. * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::shouldHaveCapsLockIndicator const): Moved from RenderThemeMac.mm. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::shouldHaveCapsLockIndicator const): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::shouldHaveCapsLockIndicator const): Deleted; moved to RenderThemeCocoa.mm to be shared by both Mac and iOS. 2018-11-09 Chris Dumez <cdumez@apple.com> Unreviewed attempt to fix WinCairo build after r238039. * bindings/js/JSWorkerGlobalScopeBase.h: 2018-11-09 Fujii Hironori <Hironori.Fujii@sony.com> Extensions3DOpenGLES.h: warning: 'blitFramebuffer' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] https://bugs.webkit.org/show_bug.cgi?id=191451 Reviewed by Dean Jackson. No new tests because there is no behavior change. * platform/graphics/opengl/Extensions3DOpenGLES.cpp: (WebCore::Extensions3DOpenGLES::setEXTContextLostCallback): Deleted unused method. * platform/graphics/opengl/Extensions3DOpenGLES.h: Marked 'override'. 2018-11-09 Andy Estes <aestes@apple.com> [Payment Request] canMakePayment() should not consider serialized payment method data https://bugs.webkit.org/show_bug.cgi?id=191432 Reviewed by Dean Jackson. In https://github.com/w3c/payment-request/pull/806, we're changing the specification of canMakePayment() to not consider serialized payment method data when deciding if a payment method is supported. For Apple Pay, this means we resolve to true for "https://apple.com/apple-pay", even if an ApplePayRequest is omitted or is missing required fields. Added test cases to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html and http/tests/paymentrequest/payment-request-show-method.https.html. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::canMakePayment): 2018-11-09 Andy Estes <aestes@apple.com> [Payment Request] PaymentResponse.details should be updated when the user accepts a retried payment https://bugs.webkit.org/show_bug.cgi?id=191440 Reviewed by Dean Jackson. PaymentResponse.details was being initialized in the PaymentResponse constructor and never updated when the user accepts a retried payment. We need to update it. Added a test case to http/tests/paymentrequest/payment-response-retry-method.https.html. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::accept): * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::PaymentResponse): (WebCore::PaymentResponse::setDetailsFunction): * Modules/paymentrequest/PaymentResponse.h: 2018-11-09 Fujii Hironori <Hironori.Fujii@sony.com> MediaPlayerPrivateMediaFoundation.h: warning: 'GetService' overrides a member function but is not marked 'override' [-Winconsistent-missing-override] https://bugs.webkit.org/show_bug.cgi?id=191453 Reviewed by Per Arne Vollan. No new tests because there is no behavior change. * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h: Marked with 'override' and removed 'virtual'. 2018-11-09 Chris Dumez <cdumez@apple.com> Unreviewed attempt to fix internal build on macOS. 'Export' is defined in several headers. * bindings/js/JSDOMGlobalObject.cpp: * bindings/js/JSDOMGlobalObject.h: * bridge/jsc/BridgeJSC.cpp: * bridge/jsc/BridgeJSC.h: 2018-11-09 Chris Dumez <cdumez@apple.com> HTML form validation bubble disappears https://bugs.webkit.org/show_bug.cgi?id=191418 Reviewed by Simon Fraser. If we validate a form and find an invalid form control, we'll scroll it into view and show the validation bubble. However, scrolling the element into view may be an asynchronous operation, in which case it would discard the validation bubble prematurely because scrolling hides the validation bubble. To address the issue, we now show the validation message asynchronously after focusing the element (and potentially scrolling it into view). Test: fast/forms/scroll-into-view-and-show-validation-message.html * html/HTMLFormControlElement.cpp: (WebCore::HTMLFormControlElement::focusAndShowValidationMessage): 2018-11-09 Brent Fulgham <bfulgham@apple.com> [Windows][DirectX] Be more rigors about BeginFigure/EndFigure and Close operations. https://bugs.webkit.org/show_bug.cgi?id=191452 <rdar://problem/45933964> Reviewed by Zalan Bujtas. Do a better job of balancing the BeginFigure/EndFigure calls in the PathDirect2D implementation. Failure to do so puts the Geometry sink into an error state that prevents it from producing drawing output. * platform/graphics/Path.h: * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::drawPath): Flush is needed here. (WebCore::GraphicsContext::fillPath): Ditto. (WebCore::GraphicsContext::strokePath): Ditto. * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::drawDidComplete): (WebCore::Path::closeAnyOpenGeometries): (WebCore::Path::transform): (WebCore::Path::openFigureAtCurrentPointIfNecessary): (WebCore::Path::moveTo): (WebCore::Path::closeSubpath): 2018-11-09 Jer Noble <jer.noble@apple.com> [Cocoa] Fix failing imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html test https://bugs.webkit.org/show_bug.cgi?id=191396 Reviewed by Eric Carlson. When changeType() is called, exempt video and text tracks (in addition to just audio tracks) from "same codec" requirements. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::validateInitializationSegment): 2018-11-09 Carlos Garcia Campos <cgarcia@igalia.com> REGRESSION(r236365): [GTK] Many form-related tests are failing https://bugs.webkit.org/show_bug.cgi?id=189993 Reviewed by Michael Catanzaro. Only the first form data element is added to the message body due to a return added by mistake in r236365. * platform/network/soup/ResourceRequestSoup.cpp: (WebCore::ResourceRequest::updateSoupMessageBody const): Remove return. 2018-11-09 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Move some code from InlineFormattingContext::Line to InlineFormattingContext/Geometry https://bugs.webkit.org/show_bug.cgi?id=191445 Reviewed by Antti Koivisto. The idea here is that Line should not have to deal with all the post processig tasks like the runs final aligments. (The line class would eventually turn into a collection of random things). * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::closeLine const): (WebCore::Layout::InlineFormattingContext::appendContentToLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): (WebCore::Layout::InlineFormattingContext::Line::lastRunType const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::adjustedLineLogicalLeft): (WebCore::Layout::InlineFormattingContext::Geometry::justifyRuns): (WebCore::Layout::InlineFormattingContext::Geometry::computeExpansionOpportunities): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::Line): (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight const): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): (WebCore::Layout::adjustedLineLogicalLeft): Deleted. (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): Deleted. (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): Deleted. (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): Deleted. 2018-11-09 Philippe Normand <pnormand@igalia.com> Unreviewed, GStreamer build warning fix * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::newSampleCallback): Timesamp() returns a uint32_t, fix format string accordingly. 2018-11-08 Said Abou-Hallawa <sabouhallawa@apple.com> Add an SPI to allow WebView clients to add additional supported image formats https://bugs.webkit.org/show_bug.cgi?id=190454 Reviewed by Simon Fraser. Add an SPI to allow additional supported image formats in WebView. These additional formats can be set in the WKWebViewConfiguration as an NSArray of NStrings. Each string represents an image source type aka UTI. The ImageSourceType in the functions' names will be replaced by ImageType. ImageType in this context is the image UTI (Uniform Type Identifier). * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::supportedImageMIMETypes): (WebCore::MIMETypeRegistry::additionalSupportedImageMIMETypes): (WebCore::supportedImageMIMETypesForEncoding): (WebCore::MIMETypeRegistry::isSupportedImageMIMEType): * platform/MIMETypeRegistry.h: * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::filenameExtension const): (WebCore::ImageDecoderCG::encodedDataStatus const): * platform/graphics/cg/ImageSourceCG.h: * platform/graphics/cg/ImageSourceCGMac.mm: (WebCore::MIMETypeForImageType): (WebCore::preferredExtensionForImageType): (WebCore::MIMETypeForImageSourceType): Deleted. (WebCore::preferredExtensionForImageSourceType): Deleted. * platform/graphics/cg/ImageSourceCGWin.cpp: (WebCore::MIMETypeForImageType): (WebCore::preferredExtensionForImageType): (WebCore::MIMETypeForImageSourceType): Deleted. (WebCore::preferredExtensionForImageSourceType): Deleted. * platform/graphics/cg/UTIRegistry.cpp: (WebCore::defaultSupportedImageTypes): (WebCore::additionalSupportedImageTypes): (WebCore::setAdditionalSupportedImageTypes): (WebCore::isSupportedImageType): (WebCore::supportedDefaultImageSourceTypes): Deleted. (WebCore::isSupportImageSourceType): Deleted. * platform/graphics/cg/UTIRegistry.h: 2018-11-08 Megan Gardner <megan_gardner@apple.com> Adopt Reveal Framework to replace Lookup https://bugs.webkit.org/show_bug.cgi?id=191097 Reviewed by Tim Horton. Reveal is not currently testable. The Reveal framework does the same job as Lookup and DataDectors. In this patch we switch from using Lookup to determine what text to select and define to using Reveal and RVItems. Since this code needs to work on older systems, and Reveal is newer, we also need to keep around the old code for old systems so that they can also continue to work. Eventually we will remove this code and also likly switch to passing RVItems across from the web process rather than making them on each side. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/mac/DictionaryLookup.h: * editing/mac/DictionaryLookup.mm: Create a delegate to respond to Reveal and help draw the string or highlight. (-[WebRevealHighlight initWithHighlightRect:useDefaultHighlight:attributedString:]): (-[WebRevealHighlight setClearTextIndicator:]): (-[WebRevealHighlight revealContext:rectsForItem:]): (-[WebRevealHighlight revealContext:drawRectsForItem:]): (-[WebRevealHighlight revealContext:shouldUseDefaultHighlightForItem:]): (-[WebRevealHighlight revealContext:stopHighlightingItem:]): (WebCore::showPopupOrCreateAnimationController): Unify the code paths and utalize the Reveal framework to create and/or display the popovers. (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::animationControllerForPopup): Pipe the new callback through. (WebCore::tokenRange): Deleted. Only used with Lookup (WebCore::selectionContainsPosition): Deleted. Only used with Lookup. * editing/mac/DictionaryLookupLegacy.mm: Copied from Source/WebCore/editing/mac/DictionaryLookup.mm. Keep a copy of the previous implementation of DictionaryLookup, because Reveal not available on older system. (WebCore::tokenRange): (WebCore::selectionContainsPosition): (WebCore::expandSelectionByCharacters): (WebCore::showPopupOrCreateAnimationController): (WebCore::DictionaryLookup::showPopup): (WebCore::DictionaryLookup::hidePopup): (WebCore::DictionaryLookup::animationControllerForPopup): 2018-11-08 Keith Rollin <krollin@apple.com> Create .xcfilelist files https://bugs.webkit.org/show_bug.cgi?id=191324 <rdar://problem/45852819> Reviewed by Alex Christensen. As part of preparing for enabling XCBuild, create and use .xcfilelist files. These files are using during Run Script build phases in an Xcode project. If a Run Script build phase produces new files that are used later as inputs to subsequent build phases, XCBuild needs to know about these files. These files can be either specified in an "output files" section of the Run Script phase editor, or in .xcfilelist files that are associated with the Run Script build phase. This patch takes the second approach. It consists of three sets of changes: - Modify the DerivedSources.make files to have a 'print_all_generated_files" target that produces a list of the files they create. - Create a shell script that produces .xcfilelist files from the output of the previous step, as well as for the files created in the Generate Unified Sources build steps. - Add the new .xcfilelist files to the associated projects. Note that, with these changes, the Xcode workspace and projects can no longer be fully loaded into Xcode 9. Xcode will attempt to load the projects that have .xcfilelist files associated with them, but will fail and display a placeholder for those projects instead. It's expected that all developers are using Xcode 10 by now and that not being able to load into Xcode 9 is not a practical issue. Keep in mind that this is strictly an IDE issue, and that the projects can still be built with `xcodebuild`. Also note that the shell script that creates the .xcfilelist files can also be used to verify that the set of files that's currently checked in is up-to-date. This checking can be used as part of a check-in hook or part of check-webkit-style to sooner catch cases where the .xcfilelist files need to be regenerated. No new tests -- no changed functionality. * DerivedSources.make: * DerivedSources.xcfilelist: Added. * UnifiedSources.xcfilelist: Added. * WebCore.xcodeproj/project.pbxproj: 2018-11-08 Don Olmstead <don.olmstead@sony.com> Provide generic implementation of SSLKeyGenerator functions https://bugs.webkit.org/show_bug.cgi?id=191428 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Both SSLKeyGeneratorGLib and SSLKeyGeneratorIOS were stub implementations. Since <keygen> is deprecated it looks unlikely that an implementation is actually needed, however an implementation is needed until support is reomved. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/SSLKeyGenerator.cpp: Added. (WebCore::getSupportedKeySizes): (WebCore::signedPublicKeyAndChallengeString): * platform/SourcesGLib.txt: * platform/glib/SSLKeyGeneratorGLib.cpp: Removed. * platform/ios/SSLKeyGeneratorIOS.cpp: Removed. 2018-11-07 Myles C. Maxfield <mmaxfield@apple.com> Unprefix text-decoration CSS3 properties https://bugs.webkit.org/show_bug.cgi?id=127193 Reviewed by Dean Jackson. The properties are stable, and there is interop. Test: fast/css3-text/css3-text-decoration/unprefix.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/StyleResolver.cpp: (WebCore::shouldApplyPropertyInParseOrder): (WebCore::isValidVisitedLinkProperty): * css/parser/CSSParserFastPaths.cpp: (WebCore::isColorPropertyID): (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): * editing/cocoa/DataDetection.mm: (WebCore::DataDetection::detectContentInRange): * rendering/TextDecorationPainter.cpp: (WebCore::decorationColor): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::colorIncludingFallback const): (WebCore::RenderStyle::visitedDependentColor const): 2018-11-08 Timothy Hatcher <timothy@apple.com> Add experimental support for a `supported-color-schemes` CSS property. https://bugs.webkit.org/show_bug.cgi?id=191319 rdar://problem/45852261 Reviewed by Dean Jackson. Tests: css-dark-mode/parse-supported-color-schemes.html css-dark-mode/supported-color-schemes-css.html * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::updateSupportedColorSchemes): (WebCore::StyleBuilderConverter::convertSupportedColorSchemes): * css/StyleResolver.cpp: (WebCore::StyleResolver::colorFromPrimitiveValue const): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeSupportedColorSchemes): (WebCore::CSSPropertyParser::parseSingleValue): * dom/Document.cpp: (WebCore::Document::resetLinkColor): (WebCore::Document::resetVisitedLinkColor): (WebCore::Document::resetActiveLinkColor): (WebCore::Document::processSupportedColorSchemes): (WebCore::Document::useDarkAppearance const): (WebCore::Document::styleColorOptions const): * dom/Document.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragment): * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::drawFocusIfNeededInternal): * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): * page/FrameView.cpp: (WebCore::FrameView::useDarkAppearance const): (WebCore::FrameView::paintScrollCorner): * platform/mac/DragImageMac.mm: (WebCore::createDragImageForLink): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::paintBoxDecorations): * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintPlatformDocumentMarker): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintRootBoxFillLayers): (WebCore::RenderBox::paintBackground): * rendering/RenderElement.cpp: (WebCore::RenderElement::selectionColor const): (WebCore::RenderElement::selectionBackgroundColor const): (WebCore::RenderElement::paintFocusRing): * rendering/RenderImage.cpp: (WebCore::RenderImage::paintAreaElementFocusRing): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintContents): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::paintContents): * rendering/RenderListBox.cpp: (WebCore::RenderListBox::paintItemForeground): (WebCore::RenderListBox::paintItemBackground): * rendering/RenderObject.cpp: (WebCore::RenderObject::useDarkAppearance const): (WebCore::RenderObject::styleColorOptions const): * rendering/RenderObject.h: * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::paintBackgroundsBehindCell): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): * rendering/RenderTheme.h: (WebCore::RenderTheme::usingDarkAppearance const): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::documentViewFor const): (WebCore::RenderThemeMac::adjustMenuListStyle const): (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): (WebCore::RenderThemeMac::paintSliderThumb): (WebCore::RenderThemeMac::usingDarkAppearance const): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::supportedColorSchemes const): (WebCore::RenderStyle::setSupportedColorSchemes): (WebCore::RenderStyle::initialSupportedColorSchemes): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * rendering/style/StyleSupportedColorSchemes.h: Added. (WebCore::StyleSupportedColorSchemes::StyleSupportedColorSchemes): (WebCore::StyleSupportedColorSchemes::operator== const): (WebCore::StyleSupportedColorSchemes::operator!= const): (WebCore::StyleSupportedColorSchemes::isAuto const): (WebCore::StyleSupportedColorSchemes::isOnly const): (WebCore::StyleSupportedColorSchemes::colorSchemes const): (WebCore::StyleSupportedColorSchemes::add): (WebCore::StyleSupportedColorSchemes::contains const): (WebCore::StyleSupportedColorSchemes::setAllowsTransformations): (WebCore::StyleSupportedColorSchemes::allowsTransformations const): * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): 2018-11-08 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Restrict domains at the target level instead of only at the window level https://bugs.webkit.org/show_bug.cgi?id=191344 Reviewed by Devin Rousso. * inspector/WorkerInspectorController.cpp: (WebCore::WorkerInspectorController::WorkerInspectorController): Remove Inspector domain from workers. It was unused anyways. 2018-11-08 Dean Jackson <dino@apple.com> Add a String literal that returns a String https://bugs.webkit.org/show_bug.cgi?id=191425 <rdar://problem/45914556> Reviewed by Sam Weinig. Use _str where possible. API Test in WPT. * Modules/fetch/FetchRequest.cpp: (WebCore::computeReferrer): * Modules/indexeddb/IDBKeyPath.cpp: (WebCore::loggingString): * Modules/webdatabase/OriginLock.cpp: (WebCore::OriginLock::lockFileNameForPath): * css/CSSBasicShapes.cpp: (WebCore::updateCornerRadiusWidthAndHeight): * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getParameter): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getParameter): * loader/LinkHeader.cpp: (WebCore::parseParameterValue): * loader/LinkLoader.cpp: (WebCore::LinkLoader::preloadIfNeeded): * page/NavigatorBase.cpp: (WebCore::NavigatorBase::platform): * platform/DateComponents.cpp: (WebCore::DateComponents::toString const): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::keyIdentifierForKeyEvent): * rendering/RenderListMarker.cpp: (WebCore::RenderListMarker::suffix const): * rendering/RenderMenuList.cpp: (RenderMenuList::setText): * testing/InternalSettings.cpp: (WebCore::InternalSettings::userInterfaceDirectionPolicy): (WebCore::InternalSettings::systemLayoutDirection): * testing/Internals.cpp: (WebCore::Internals::shadowRootType const): (WebCore::Internals::getCurrentCursorInfo): 2018-11-08 Jonathan Hammer <jonathan@e3software.com> Plain text drag in contenteditable is always DragOperationCopy, never DragOperationMove https://bugs.webkit.org/show_bug.cgi?id=191228 <rdar://problem/45786830> Reviewed by Wenson Hsieh. DragController::beginDrag should not call cleanupAfterSystemDrag because the drag is still in progress even after the call to m_client.beginDrag() returns. This is in contrast to DragController::doSystemDrag, where the call to cleanupAfterSystemDrag is appropriate because the drag has concluded by the time m_client.startDrag() returns. Test: fast/events/drag-and-drop-move-not-copy.html * page/DragController.cpp: (WebCore::DragController::beginDrag): 2018-11-08 Zalan Bujtas <zalan@apple.com> [BFC][IFC] InlineFormattingContext::Line::alignRuns() should take care of all the alignments. https://bugs.webkit.org/show_bug.cgi?id=191414 Reviewed by Antti Koivisto. * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::close): 2018-11-08 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Import CTAP device request/response converters from Chromium https://bugs.webkit.org/show_bug.cgi?id=190784 <rdar://problem/45460333> Reviewed by Brent Fulgham. This patch imports Chromium's CTAP device request/response converters: https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-encoding 1. It directly imports the following files and suit them to WebKit's coding style: https://cs.chromium.org/chromium/src/device/fido/device_response_converter.cc?l=20&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/device_response_converter.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/authenticator_get_info_response.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/authenticator_supported_options.h?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/ctap_request_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/ctap_response_unittest.cc?rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 https://cs.chromium.org/chromium/src/device/fido/fido_test_data.h?l=1&rcl=098dfd90850ffa84c27a884ab75edd2d99c4ec45 2. It gathers the following methods into DeviceRequestConverter: CtapGetAssertionRequest::EncodeAsCBOR() CtapMakeCredentialRequest::EncodeAsCBOR() PublicKeyCredentialDescriptor::ConvertToCBOR() PublicKeyCredentialParams::ConvertToCBOR() PublicKeyCredentialRpEntity::ConvertToCBOR() PublicKeyCredentialUserEntity::ConvertToCBOR() 3. It also apply a patch from Chromium to CBORValue: https://chromium.googlesource.com/chromium/src/+/7b6fbff35cd8e4d508f08e1cd93b4aa0a0dc402c%5E%21/ Besides importing things from Chromium, it also implements UserVerificationRequirement for both PublicKeyCredentialCreationOptions and PublicKeyCredentialRequestOptions such that both options can specify more dimensions of a desired authenticator. Covered by API tests. * CMakeLists.txt: * DerivedSources.make: * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::encode const): (WebCore::PublicKeyCredentialCreationOptions::AuthenticatorSelectionCriteria::decode): * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: * Modules/webauthn/PublicKeyCredentialRequestOptions.h: (WebCore::PublicKeyCredentialRequestOptions::encode const): (WebCore::PublicKeyCredentialRequestOptions::decode): * Modules/webauthn/PublicKeyCredentialRequestOptions.idl: * Modules/webauthn/UserVerificationRequirement.h: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl. * Modules/webauthn/UserVerificationRequirement.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialRequestOptions.idl. * Modules/webauthn/cbor/CBORValue.cpp: (cbor::CBORValue::CBORValue): (cbor::CBORValue::getBool const): * Modules/webauthn/cbor/CBORValue.h: * Modules/webauthn/fido/AuthenticatorGetInfoResponse.cpp: Added. (fido::toArrayValue): (fido::AuthenticatorGetInfoResponse::AuthenticatorGetInfoResponse): (fido::AuthenticatorGetInfoResponse::setMaxMsgSize): (fido::AuthenticatorGetInfoResponse::setPinProtocols): (fido::AuthenticatorGetInfoResponse::setExtensions): (fido::AuthenticatorGetInfoResponse::setOptions): (fido::encodeAsCBOR): * Modules/webauthn/fido/AuthenticatorGetInfoResponse.h: Added. * Modules/webauthn/fido/AuthenticatorSupportedOptions.cpp: Added. (fido::AuthenticatorSupportedOptions::setSupportsResidentKey): (fido::AuthenticatorSupportedOptions::setUserVerificationAvailability): (fido::AuthenticatorSupportedOptions::setUserPresenceRequired): (fido::AuthenticatorSupportedOptions::setClientPinAvailability): (fido::AuthenticatorSupportedOptions::setIsPlatformDevice): (fido::convertToCBOR): * Modules/webauthn/fido/AuthenticatorSupportedOptions.h: Added. * Modules/webauthn/fido/DeviceRequestConverter.cpp: Added. (fido::convertRpEntityToCBOR): (fido::convertUserEntityToCBOR): (fido::convertParametersToCBOR): (fido::convertDescriptorToCBOR): (fido::encodeMakeCredenitalRequestAsCBOR): (fido::encodeGetAssertionRequestAsCBOR): (fido::encodeEmptyAuthenticatorRequest): * Modules/webauthn/fido/DeviceRequestConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.h. * Modules/webauthn/fido/DeviceResponseConverter.cpp: Added. (fido::convertStringToProtocolVersion): (fido::getResponseCode): (fido::getCredentialId): (fido::readCTAPMakeCredentialResponse): (fido::readCTAPGetAssertionResponse): (fido::readCTAPGetInfoResponse): * Modules/webauthn/fido/DeviceResponseConverter.h: Copied from Source/WebCore/Modules/webauthn/fido/FidoConstants.cpp. * Modules/webauthn/fido/FidoConstants.cpp: (fido::isCtapDeviceResponseCode): (fido::publicKeyCredentialTypeToString): * Modules/webauthn/fido/FidoConstants.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-11-07 Justin Michaud <justin_michaud@apple.com> CSS Painting API should pass size, arguments and input properties to paint callback https://bugs.webkit.org/show_bug.cgi?id=191309 Reviewed by Chris Dumez. Call paint() callback with input properties and arguments. This patch adds a stub for the CSS Typed OM StylePropertyMapReadOnly, and passes all the arguments as strings without any syntax checking to the paint callback. Test: fast/css-custom-paint/properties.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSStyleValueCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * css/CSSPaintSize.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSPaintSize::create): (WebCore::CSSPaintSize::width const): (WebCore::CSSPaintSize::height const): (WebCore::CSSPaintSize::CSSPaintSize): * css/CSSPaintSize.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): * css/typedom/CSSNumericValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSNumericValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSStyleValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::CSSStyleValue::isUnitValue): (WebCore::CSSStyleValue::isUnparsedValue): * css/typedom/CSSStyleValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnitValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnitValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/CSSUnparsedValue.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * css/typedom/CSSUnparsedValue.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * css/typedom/StylePropertyMapReadOnly.h: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::StylePropertyMapReadOnly::create): (WebCore::StylePropertyMapReadOnly::get): (WebCore::StylePropertyMapReadOnly::StylePropertyMapReadOnly): * css/typedom/StylePropertyMapReadOnly.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: 2018-11-07 Brent Fulgham <bfulgham@apple.com> Provide better Font fallbacks for DirectX backend https://bugs.webkit.org/show_bug.cgi?id=191412 <rdar://problem/45899207> Reviewed by Zalan Bujtas. Registration of custom fonts through GDI are not always visible through the DirectWrite/GDI bridging layer. If a font is not located, locate the closest matching avialable font rather than failing. * platform/graphics/FontPlatformData.h: * platform/graphics/win/FontCustomPlatformData.cpp: (WebCore::FontCustomPlatformData::fontPlatformData): Use new font fallback logic. * platform/graphics/win/FontPlatformDataDirect2D.cpp: (WebCore::FontPlatformData::platformDataInit): (WebCore::FontPlatformData::platformIsEqual const): (WebCore::FontPlatformData::createFallbackFont): Added. 2018-11-07 Zalan Bujtas <zalan@apple.com> Click and touch event listeners on the body don't work https://bugs.webkit.org/show_bug.cgi?id=191392 <rdar://problem/5844416> Reviewed by Simon Fraser. Remove the old quirk of ignoring onclick handlers on the body and beyond. Test: fast/events/click-handler-on-body-simple.html * page/ios/FrameIOS.mm: (WebCore::Frame::nodeRespondingToClickEvents): 2018-11-07 Brent Fulgham <bfulgham@apple.com> [Windows][DirectX] Update canvas code to pass more tests https://bugs.webkit.org/show_bug.cgi?id=191337 <rdar://problem/45878801> Reviewed by Dean Jackson. Update the Direct2D code paths to comply with our canvas tests, improving the the test results scores to 579/770. PathDirect2D was updated with an implementation of 'addArcTo' based on work by Dirk Schulze <vbs85@gmx.de> (see https://hg.mozilla.org/mozilla-central/rev/b116b49459f8). Tests: canvas/philip/tests * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::createCompatibleBuffer): Direct2D needs access to the graphics context to create the buffer. * platform/graphics/ImageBuffer.h: * platform/graphics/Path.h: * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::drawPattern): Flush needed. (WebCore::GraphicsContext::drawRect): Ditto. (WebCore::GraphicsContextPlatformPrivate::setMiterLimit): Correct for Direct2D definition of miter limit. (WebCore::GraphicsContextPlatformPrivate::strokeStyleProperties const): Added helper function. (WebCore::GraphicsContextPlatformPrivate::recomputeStrokeStyle): Update for new helper. (WebCore::GraphicsContext::drawLine): Ditto. (WebCore::drawWithShadowHelper): Ditto. (WebCore::GraphicsContext::fillRect): Add flush. (WebCore::GraphicsContext::platformFillRoundedRect): Update for helper. (WebCore::GraphicsContext::clipPath): Add flush. (WebCore::GraphicsContext::strokeRect): Ditto. (WebCore::GraphicsContext::drawLineForText): Update for upstream changes. (WebCore::GraphicsContext::drawLinesForText): Ditto. * platform/graphics/win/GraphicsContextPlatformPrivateDirect2D.h: * platform/graphics/win/ImageBufferDirect2D.cpp: (WebCore::createCroppedImageIfNecessary): Add missing implementations. (WebCore::createBitmapImageAfterScalingIfNeeded): Ditto. (WebCore::ImageBuffer::copyImage const): Ditto. (WebCore::ImageBuffer::sinkIntoImage): Ditto. (WebCore::ImageBuffer::fastCopyImageMode): Ditto. (WebCore::ImageBuffer::sinkIntoNativeImage): Ditto. (WebCore::ImageBuffer::copyNativeImage const): Ditto. * platform/graphics/win/PathDirect2D.cpp: (WebCore::Path::operator=): (WebCore::Path::drawDidComplete): This should never have been const. It manipulates the path! (WebCore::Path::transform): Properly transform existing geometries. (WebCore::Path::openFigureAtCurrentPointIfNecessary): Added. (WebCore::Path::moveTo): (WebCore::Path::addLineTo): Make sure figure starts at a valid point. (WebCore::Path::addQuadCurveTo): Ditto. (WebCore::Path::addBezierCurveTo): Ditto. (WebCore::Path::addArcTo): Add implementation. (WebCore::Path::closeSubpath): (WebCore::drawArcSection): (WebCore::Path::addArc): Update to build large arcs out of small arc segments. If the arc is effectively a complete circle, use the ellipse drawing routines. (WebCore::Path::addRect): Make sure we start at a valid starting point. (WebCore::Path::addEllipse): Correct for definition of D2D ellipse. (WebCore::Path::drawDidComplete const): Deleted. * platform/graphics/win/SimpleFontDataDirect2D.cpp: (WebCore::Font::platformWidthForGlyph const): * rendering/svg/RenderSVGResourceClipper.cpp: (WebCore::RenderSVGResourceClipper::applyClippingToContext): * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): * rendering/svg/RenderSVGResourceMasker.cpp: (WebCore::RenderSVGResourceMasker::applyResource): * rendering/svg/SVGRenderingContext.cpp: (WebCore::SVGRenderingContext::createImageBuffer): * rendering/svg/SVGRenderingContext.h: 2018-11-07 Wenson Hsieh <wenson_hsieh@apple.com> Add an editing command for creating and inserting child lists https://bugs.webkit.org/show_bug.cgi?id=191335 <rdar://problem/45814050> Reviewed by Ryosuke Niwa. Currently, insertOrderedList and insertUnorderedList only toggle or change list state (i.e. if the selection is in an ordered or unordered list, reinserting the same list type removes the current list, and inserting a different list type changes the enclosing list). However, for certain internal clients (e.g. Mail), if the start of the selection is enclosed by a list item, we instead create a new list item and insert it after the enclosing list item, and then create a new list within that list item. Currently, this logic is implemented in Mail for legacy-WebKit-based Mail compose. This patch brings this logic into WebKit in the form of a new editing command. Tests: editing/execCommand/insert-nested-lists-in-table.html editing/execCommand/insert-nested-lists-with-pre.html editing/execCommand/insert-nested-lists.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::insertOrderedList): (WebCore::Editor::insertUnorderedList): * editing/EditorCommand.cpp: (WebCore::executeInsertOrderedList): (WebCore::executeInsertUnorderedList): (WebCore::executeInsertNestedUnorderedList): (WebCore::executeInsertNestedOrderedList): (WebCore::createCommandMap): * editing/IndentOutdentCommand.cpp: (WebCore::IndentOutdentCommand::outdentParagraph): * editing/InsertListCommand.cpp: (WebCore::InsertListCommand::doApply): (WebCore::InsertListCommand::editingAction const): * editing/InsertListCommand.h: Change a couple of `enum`s into `enum class`es. * editing/InsertNestedListCommand.cpp: Added. (WebCore::InsertNestedListCommand::insertUnorderedList): (WebCore::InsertNestedListCommand::insertOrderedList): (WebCore::InsertNestedListCommand::doApply): * editing/InsertNestedListCommand.h: Added. Add a new edit command to insert a new list (as a child of any containing list). If the start of the selection is in a list item, we create a new list item, move the selection into the list item, and increment its list level; otherwise, simply fall back to inserting a list. * editing/ModifySelectionListLevel.cpp: (WebCore::IncreaseSelectionListLevelCommand::doApply): (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevel): (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelOrdered): (WebCore::IncreaseSelectionListLevelCommand::increaseSelectionListLevelUnordered): * editing/ModifySelectionListLevel.h: Expose this constructor, allowing other edit commands to change selection list level as a composite edit command. Also, change an `enum` into an `enum class`. (WebCore::IncreaseSelectionListLevelCommand::create): 2018-11-07 Chris Dumez <cdumez@apple.com> ASSERT(renderer()) under HTMLTextAreaElement::updateValue() https://bugs.webkit.org/show_bug.cgi?id=191391 <rdar://problem/34219633> Reviewed by Geoffrey Garen. Update HTMLTextFormControlElement::didEditInnerTextValue() to not call subtreeHasChanged() if the element has no renderer, similarly to what is already done in HTMLTextFormControlElement::setRangeText() and HTMLInputElement::setEditingValue(). Test: editing/inserting/inset-html-textarea-without-renderer.html * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::didEditInnerTextValue): 2018-11-07 Youenn Fablet <youenn@apple.com> Allow setting RTCRtpTransceiver.direction https://bugs.webkit.org/show_bug.cgi?id=191346 Reviewed by Eric Carlson. Remove readonly from the direction attribute. Keep setDirection for now as it is in use, with an intent to remove it. Driven-by fix as in some cases, the rtc source track might be changed and current implementation is not expecting that. In such a case, stop observing the old track (which should no longer call us) before observing the new one. Covered by rebased tests. * Modules/mediastream/RTCRtpTransceiver.idl: * platform/mediastream/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::setSourceTrack): * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::setSourceTrack): 2018-11-07 Sihui Liu <sihui_liu@apple.com> RELEASE_ASSERT(!m_hardClosedForUserDelete) fails in WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer https://bugs.webkit.org/show_bug.cgi?id=191326 <rdar://problem/45769269> Reviewed by Geoffrey Garen. UniqueIDBDatabase should ignore incoming requests or operations when it is already marked as hardClosedForUserDelete. Test: IndexedDB.IndexedDBUserDelete. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::didPerformActivateTransactionInBackingStore): (WebCore::IDBServer::UniqueIDBDatabase::immediateCloseForUserDelete): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp: (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction): (WebCore::IDBServer::UniqueIDBDatabaseConnection::deleteTransaction): * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h: * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp: (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit): 2018-11-07 Myles C. Maxfield <mmaxfield@apple.com> Positioned text underline can look like a strike-through https://bugs.webkit.org/show_bug.cgi?id=191341 Reviewed by Simon Fraser. We should just clamp the value so it can't go above the baseline. We shouldn't do this at parse time because it's totally reasonable for text-underline-position: under to want a negative text-underline-offset. Instead, we just do it at used value time. Test: fast/css3-text/css3-text-decoration/text-underline-negative.html * style/InlineTextBoxStyle.cpp: (WebCore::computeUnderlineOffset): 2018-11-07 Chris Dumez <cdumez@apple.com> Unreviewed, fix iOS build with recent SDKs. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): 2018-11-07 Chris Dumez <cdumez@apple.com> Unreviewed, fix iOS build with recent SDKs. * platform/network/cocoa/ResourceResponseCocoa.mm: (WebCore::ResourceResponse::platformCertificateInfo const): 2018-11-07 Myles C. Maxfield <mmaxfield@apple.com> Dotted underlines that skip descenders are invisible https://bugs.webkit.org/show_bug.cgi?id=191403 Reviewed by Simon Fraser. Turns out our underline bounding boxes had negative width. When drawing the full underline that was fine because it was handled by the 2D graphics engine, but when we try to split up the box into dots, our "for" loop was taking 0 iterations (because the end was before the start). Test: fast/css3-text/css3-text-decoration/text-underline-style.html * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawLineForText): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawLineForText): * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::drawLineForText): 2018-11-07 Andy Estes <aestes@apple.com> Crash in WebCore::PaymentRequest::canMakePayment when Apple Pay payment method data is missing https://bugs.webkit.org/show_bug.cgi?id=191331 Reviewed by Alexey Proskuryakov. Apple Pay requires merchants specify an ApplePayRequest (which contains several required fields) as payment method data when constructing a new PaymentRequest. If the ApplePayRequest is missing required fields, or is missing entirely, canMakePayment() should resolve to false. We would properly resolve to false when an ApplePayRequest was specified with missing required fields, but we would crash when the ApplePayRequest was missing entirely. This patch fixes the crash by checking for an empty JSValue before trying to convert it to an ApplePayRequest struct. Because we stringify ApplePayRequests in the PaymentRequest constructor then parse them again in canMakePayments, an undefined or null payment method data stringifies to a null String, which then parses to an empty JSValue. Added test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::convertData): * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::canMakePayment): 2018-11-07 Simon Fraser <simon.fraser@apple.com> Revert 237849: it breaks MotionMark https://bugs.webkit.org/show_bug.cgi?id=191398 Reviewed by Simon Fraser. This change broke painting while the test is running. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): 2018-11-07 Don Olmstead <don.olmstead@sony.com> Simplify macros in platform https://bugs.webkit.org/show_bug.cgi?id=191378 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Modifies a few cases where a platform macro could be simplified. * page/EventHandler.cpp: * platform/network/DNS.h: * platform/network/NetworkStateNotifier.h: 2018-11-07 Simon Fraser <simon.fraser@apple.com> Some WK1 repaint tests are flakey https://bugs.webkit.org/show_bug.cgi?id=190627 Reviewed by Zalan Bujtas. Repaint tracking in GraphicsLayerCA was sensitive to whether there were already dirty rects on the layer, since tracking happened after checks against existing dirty rects. This caused some WK1 repaint tests to be flakey, since there's no guarantee that no repaints happen between the last layer flush and a test calling startTrackingRepaints(). Fix by moving the repaint tracking to before the checks against existing dirty rects. This is more similar to how repaint tracking on FrameView works. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::setNeedsDisplayInRect): 2018-11-07 Dean Jackson <dino@apple.com> [iOS] WebGL leaks exact GPU type https://bugs.webkit.org/show_bug.cgi?id=191393 Reviewed by Tim Horton. The fully exposed renderer info shouldn't be necessary on iOS, where the GPUs and drivers are consistent enough that people shouldn't need to write code specifically for them. Reduce the ability to fingerprint by simply returning "Apple GPU". The other option would have been to disable the extension, but I think it might still be useful to know you're on an iOS device. Test: fast/canvas/webgl/hide-some-renderer-info.html * html/canvas/WebGL2RenderingContext.cpp: Return "Apple GPU" on iOS. (WebCore::WebGL2RenderingContext::getParameter): * html/canvas/WebGLRenderingContext.cpp: Ditto. (WebCore::WebGLRenderingContext::getParameter): 2018-11-07 Daniel Bates <dabates@apple.com> Override +[UIKeyboard isInHardwareKeyboardMode] in WebKitTestRunner and DumpRenderTree https://bugs.webkit.org/show_bug.cgi?id=190141 Reviewed by Darin Adler. Remove the runtime application check for WebKitTestRunner as we no longer need this now that WebKitTestRunner and DumpRenderTree override +[UIKeyboard isInHardwareKeyboardMode]. * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isWebKitTestRunner): Deleted. 2018-11-07 Joseph Pecoraro <pecoraro@apple.com> Web Inspector: Fix "Javascript" => "JavaScript" enum in protocol generated objects https://bugs.webkit.org/show_bug.cgi?id=191340 Reviewed by Devin Rousso. * inspector/agents/InspectorMemoryAgent.cpp: (WebCore::InspectorMemoryAgent::collectSample): Use new enum name. 2018-11-07 Dan Bernstein <mitz@apple.com> Add a pseudoclass that matches img elements that are backed by an attachment https://bugs.webkit.org/show_bug.cgi?id=191286 <rdar://problem/45823554> Reviewed by Dean Jackson. Test: fast/css/has-attachment.html Added a :has-attachment pseudoclass, enabled only when the attachment element is enabled at runtime, that matches elements (currently only img elements qualify) that have an attachment element in their shadow DOM. * css/CSSSelector.cpp: (WebCore::CSSSelector::selectorText const): Handle the new PseudoClassHasAttachment value. * css/CSSSelector.h: Added a new value to the PseudoClassType enum. * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): Check the new PseudoClassHasAttachment value using the new hasAttachment test function. * css/SelectorCheckerTestFunctions.h: (WebCore::hasAttachment): Added. Tests if the element is an img element that has an attachment. * css/SelectorPseudoClassAndCompatibilityElementMap.in: Added has-attachment. * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): Initialize new attachmentEnabled member based on RuntimeEnabledFeatures. (WebCore::operator==): Compare new attachmentEnabled member. * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): Include new attachmentEnabled member. * css/parser/CSSSelectorParser.cpp: (WebCore::CSSSelectorParser::consumePseudo): Reject :has-attachment if the attachment element is not enabled. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::addPseudoClassType): Handle PseudoClassHasAttachment. 2018-11-07 Don Olmstead <don.olmstead@sony.com> Make generic MainThreadSharedTimer implementation https://bugs.webkit.org/show_bug.cgi?id=191327 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Moves generic implementation for MainThreadSharedTimerGlib.cpp into MainThreadSharedTimer.cpp. * platform/MainThreadSharedTimer.cpp: (WebCore::MainThreadSharedTimer::MainThreadSharedTimer): (WebCore::MainThreadSharedTimer::setFireInterval): (WebCore::MainThreadSharedTimer::stop): (WebCore::MainThreadSharedTimer::invalidate): * platform/MainThreadSharedTimer.h: * platform/SourcesGLib.txt: * platform/glib/MainThreadSharedTimerGLib.cpp: Removed. 2018-11-07 Ali Juma <ajuma@chromium.org> IntersectionObserverEntry doesn't keep JS wrappers of rects alive https://bugs.webkit.org/show_bug.cgi?id=191330 Reviewed by Chris Dumez. Retain wrappers of each rect in an IntersectionObserverEntry as long as the entry's wrapper is alive, by adding these wrappers as opaque roots. Test: intersection-observer/intersection-observer-entry-keeps-js-wrappers-of-rects-alive.html * bindings/js/JSIntersectionObserverEntryCustom.cpp: (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): * dom/DOMRectReadOnly.idl: * page/IntersectionObserverEntry.h: (WebCore::IntersectionObserverEntry::rootBounds const): Make this return a raw pointer instead of a RefPtr so that it can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which can be called from non-main threads. (WebCore::IntersectionObserverEntry::boundingClientRect const): Ditto. (WebCore::IntersectionObserverEntry::intersectionRect const): Ditto. 2018-11-07 Simon Fraser <simon.fraser@apple.com> TileController::tileSize() should not have side effects https://bugs.webkit.org/show_bug.cgi?id=191349 Reviewed by Zalan Bujtas. Calling TileController::tileSize() would recompute a new tile size and set m_tileSizeLocked, which caused test failures if logging was enabled when running tests. * platform/graphics/ca/TileController.cpp: (WebCore::TileController::tileSize const): (WebCore::TileController::computeTileSize): * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::revalidateTiles): 2018-11-07 Charlie Turner <cturner@igalia.com> [EME][GStreamer] Ensure key id buffers are present and simplify lifetime management of ClearKey class. https://bugs.webkit.org/show_bug.cgi?id=191157 Reviewed by Xabier Rodriguez-Calvar. This is in preparation for moving the clearkey decryptor behind a new decrypt API in CDMInstance, which will be sent into the pipeline to handle key management and decryption. This is for a later patch. Covered by existing clear key tests in media/encrypted-media. * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::data const): Add a const data accessor, since we are now providing operator=='s on const objects of this class that need const access to the data pointer. (WebCore::GstMappedBuffer::operator==): Add a swap of the new equality operator so you don't have to remember to have the GstBuffer on the RHS of the equality all the time. (WebCore::operator==): Define an equality operator between Gst buffers and WebCore's mapped buffers. Gst creates a ref and a separate read view under the covers in the memcmp call, so we do not need to map the buffer ourselves. * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: (webkit_media_clear_key_decrypt_class_init): Remove setup/release bindings. (webkit_media_clear_key_decrypt_init): Initialize gcrypt cipher here once instead of for every buffer to be decrypted. (webKitMediaClearKeyDecryptorFinalize): And destroy the cipher context when the decryptor is destroyed. (webKitMediaClearKeyDecryptorFindAndSetKey): Factor out the key retrieval and context setting in this method, call it for each sample. (webKitMediaClearKeyDecryptorDecrypt): Base key id buffer into this function, and remove cipher creation / destroy methods. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkit_media_common_encryption_decrypt_class_init): Remove setup/release bindings. (webkitMediaCommonEncryptionDecryptTransformInPlace): Ensure a key id is present and pass it to the decrypt class method. (webKitMediaCommonEncryptionDecryptDefaultSetupCipher): Deleted. (webKitMediaCommonEncryptionDecryptDefaultReleaseCipher): Deleted. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.h: 2018-11-07 Frederic Wang <fwang@igalia.com> [Cairo] Move state change operations from GraphicsContextCairo to CairoOperations https://bugs.webkit.org/show_bug.cgi?id=179610 Unreviewed build fix. * platform/graphics/cairo/GraphicsContextCairo.cpp: Add missing include. 2018-11-06 Joseph Pecoraro <pecoraro@apple.com> ServiceWorker Inspector: Uncaught Exception: null is not an object (evaluating 'resource.target.addResource') https://bugs.webkit.org/show_bug.cgi?id=191339 Reviewed by Matt Baker. * workers/service/ServiceWorkerJob.cpp: (WebCore::ServiceWorkerJob::fetchScriptWithContext): Use the Service Worker's identifier, not this static but otherwise unknown identifier. 2018-11-06 Youenn Fablet <youenn@apple.com> sender.replaceTrack() fails with InvalidStateError if the transceiver.direction is "inactive" https://bugs.webkit.org/show_bug.cgi?id=191202 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::removeTrack): Update as per spec, in particular make sure to not stop the sender when removing the track. 2018-11-06 Justin Fan <justin_fan@apple.com> [WebGPU] Experimental prototype for WebGPURenderPipeline and WebGPUSwapChain https://bugs.webkit.org/show_bug.cgi?id=191291 Reviewed by Myles Maxfield. Test: webgpu/render-pipelines.html Also update test webgpu/webgpu-basics.html to create a WebGPURenderPipeline. Begin implementation of WebGPURenderPipeline and WebGPUSwapChain. A WebGPURenderPipeline is backed by a GPURenderPipeline, created lazily using the properties of the passed-in WebGPURenderPipelineDescriptor. On Metal-supported systems, GPURenderPipeline is an interface to a MTLRenderPipelineState. The MTLRenderPipelineState is created with the WebGPUDevice currently configured on the WebGPURenderingContext. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * Modules/webgpu/GPUDevice.cpp: (WebCore::GPUDevice::createRenderPipeline const): * Modules/webgpu/GPUDevice.h: * Modules/webgpu/GPUPipelineDescriptorBase.h: * Modules/webgpu/GPUPipelineStageDescriptor.h: * Modules/webgpu/GPURenderPipelineDescriptor.h: (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): (WebCore::GPURenderPipelineDescriptor::primitiveTopology): * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::createRenderPipeline const): * Modules/webgpu/WebGPUDevice.h: (WebCore::WebGPUDevice::adapter const): (WebCore::WebGPUDevice::device const): * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUPipelineDescriptorBase.h: * Modules/webgpu/WebGPUPipelineDescriptorBase.idl: * Modules/webgpu/WebGPUPipelineStageDescriptor.h: * Modules/webgpu/WebGPUPipelineStageDescriptor.idl: * Modules/webgpu/WebGPURenderPipeline.cpp: (WebCore::WebGPURenderPipeline::create): (WebCore::WebGPURenderPipeline::WebGPURenderPipeline): * Modules/webgpu/WebGPURenderPipeline.h: * Modules/webgpu/WebGPURenderPipeline.idl: * Modules/webgpu/WebGPURenderPipelineDescriptor.h: * Modules/webgpu/WebGPURenderPipelineDescriptor.idl: * Modules/webgpu/WebGPURenderingContext.cpp: (WebCore::WebGPURenderingContext::create): (WebCore::WebGPURenderingContext::WebGPURenderingContext): * Modules/webgpu/WebGPURenderingContext.h: * Modules/webgpu/WebGPUShaderModule.h: (WebCore::WebGPUShaderModule::module const): * Modules/webgpu/WebGPUShaderStage.h: * Modules/webgpu/WebGPUShaderStage.idl: * Modules/webgpu/WebGPUSwapChain.cpp: (WebCore::WebGPUSwapChain::configure): (WebCore::WebGPUSwapChain::reshape): (WebCore::WebGPUSwapChain::markLayerComposited): * Modules/webgpu/WebGPUSwapChain.h: (WebCore::WebGPUSwapChain::WebGPUSwapChain): * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/cocoa/GPURenderPipeline.h: (WebCore::GPURenderPipeline::platformRenderPipeline const): * Modules/webgpu/cocoa/GPURenderPipelineMetal.mm: Added. (WebCore::setFunctionsForPipelineDescriptor): (WebCore::GPURenderPipeline::create): (WebCore::GPURenderPipeline::GPURenderPipeline): * Modules/webgpu/cocoa/GPUSwapChain.h: (WebCore::GPUSwapChain::platformLayer const): * Modules/webgpu/cocoa/GPUSwapChainMetal.mm: (WebCore::GPUSwapChain::create): (WebCore::GPUSwapChain::GPUSwapChain): (WebCore::GPUSwapChain::setDevice): (WebCore::GPUSwapChain::reshape): (WebCore::GPUSwapChain::present): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2018-11-06 Youenn Fablet <youenn@apple.com> Add support for sender/receiver getCapabilities https://bugs.webkit.org/show_bug.cgi?id=191192 Reviewed by Eric Carlson. Expose sender/receiver RTCRtpCapabilities to JS. Add corresponding IDL and plumbing down to libwebrtc peer connection factory. Covered by rebased tests. * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::receiverCapabilities): (WebCore::PeerConnectionBackend::senderCapabilities): * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCRtpCapabilities.idl: Added. * Modules/mediastream/RTCRtpReceiver.cpp: (WebCore::RTCRtpReceiver::getCapabilities): * Modules/mediastream/RTCRtpReceiver.h: * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::getCapabilities): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::receiverCapabilities): (WebCore::PeerConnectionBackend::senderCapabilities): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RTCPMuxPolicy.h: * platform/mediastream/RTCRtpCapabilities.h: Added. * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::typeFromKind): (WebCore::fromStdString): (WebCore::toChannels): (WebCore::toRTCRtpCapabilities): (WebCore::LibWebRTCProvider::receiverCapabilities): (WebCore::LibWebRTCProvider::senderCapabilities): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2018-11-06 Youenn Fablet <youenn@apple.com> Calling sender.replaceTrack() twice produces a new transceiver and its corresponding m= section https://bugs.webkit.org/show_bug.cgi?id=191261 Reviewed by Eric Carlson. Handle the case of replacing a track in a sender that has no track. In particular, do not create a new m-section as was implied by plan B implementation. Instead, set the track directly on the rtc sender. Covered by webrtc/video-addTransceiver.html. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::createSourceAndRTCTrack): (WebCore::LibWebRTCMediaEndpoint::addTransceiver): (WebCore::LibWebRTCMediaEndpoint::setSenderSourceFromTrack): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::setSenderSourceFromTrack): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::replaceTrack): 2018-11-06 Chris Dumez <cdumez@apple.com> Post too much text to iFrame could crash webkit https://bugs.webkit.org/show_bug.cgi?id=190947 <rdar://problem/45678231> Reviewed by Geoffrey Garen. Optimize SuffixTree (Which is used by XSSAuditor) to stop storing each Node's children as a static array of 128 pointers and use a dynamic array (vector) instead. This uses way less memory. Also make SuffixTree and SuffixTree::Node as fast allocated for performance. This part of the change is based on the following Blink change: - https://chromium.googlesource.com/chromium/src.git/+/6ca590e1c7edaa7c56cac9e3e3c39cf398ca8d4d Also update the XSSAuditor to construct the SuffixTree lazily since there are many cases (including the one in this bug) where we were spending a significant amount of time building the SuffixTree and then never querying it. * html/parser/XSSAuditor.cpp: (WebCore::XSSAuditor::init): (WebCore::XSSAuditor::decodedHTTPBodySuffixTree): (WebCore::XSSAuditor::isContainedInRequest): * html/parser/XSSAuditor.h: * platform/text/SuffixTree.h: (WebCore::SuffixTree::mightContain): (WebCore::SuffixTree::Node::Node): (WebCore::SuffixTree::Node::~Node): (WebCore::SuffixTree::Node::find): (WebCore::SuffixTree::Node::end): (WebCore::SuffixTree::build): (WebCore::SuffixTree<Codebook>::Node::childAt): (WebCore::SuffixTree::Node::at): Deleted. 2018-11-06 Youenn Fablet <youenn@apple.com> Support onremovetrack for RTCPeerConnection removed tracks https://bugs.webkit.org/show_bug.cgi?id=191299 Reviewed by Eric Carlson. When applying SDP, LibWebRTCMediaEndpoint gets notified of a removed track. In that case, make sure to remove it from its remote stream(s) so as to notify the application of the changes. Work around the receiver missing the list of streams by storing in a map the list of the remote streams for a given remote track. Covered by rebased test. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream): (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack): (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream): (WebCore::LibWebRTCMediaEndpoint::stop): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: 2018-11-06 Timothy Hatcher <timothy@apple.com> REGRESSION (r237878): css-dark-mode/supported-color-schemes.html is failing on Mojave https://bugs.webkit.org/show_bug.cgi?id=191338 Reviewed by Dean Jackson. * page/Page.cpp: (WebCore::Page::appearanceDidChange): Add back call to didChangeStyleSheetEnvironment(). It was dropped by mistake when I moved code to appearanceDidChange(). This is needed to update styles for semantic colors and from controls when the media prefers-color-scheme media query is not used on the page. 2018-11-06 Youenn Fablet <youenn@apple.com> Make mDNS ICE Candidate an experimental flag again https://bugs.webkit.org/show_bug.cgi?id=191262 Reviewed by Dean Jackson. Rename mdnsICECandidatesEnabled to webRTCICECandidatesEnabled. This allows grouping the WebRTC runtime flags. No change of behavior. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::newICECandidate): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCMDNSICECandidatesEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCMDNSICECandidatesEnabled): (WebCore::RuntimeEnabledFeatures::mdnsICECandidatesEnabled const): Deleted. (WebCore::RuntimeEnabledFeatures::setMDNSICECandidatesEnabled): Deleted. 2018-11-06 Myles C. Maxfield <mmaxfield@apple.com> Implement text-underline-offset and text-decoration-thickness https://bugs.webkit.org/show_bug.cgi?id=190774 Reviewed by Dean Jackson. Because of our existing infrastructure for text decorations, adding support for these is fairly simple. This patch updates our existing functions to handle thick & placed underlines, as well as updating our repaint code to correcly handle repainting them. It also handles animations. Tests: animations/text-decoration-thickness.html animations/text-underline-offset.html fast/css3-text/css3-text-decoration/text-decoration-offset-2.html fast/css3-text/css3-text-decoration/text-decoration-offset-3.html fast/css3-text/css3-text-decoration/text-decoration-offset-auto-length.html fast/css3-text/css3-text-decoration/text-decoration-offset-baseline.html fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-auto.html fast/css3-text/css3-text-decoration/text-decoration-offset-from-font-length.html fast/css3-text/css3-text-decoration/text-decoration-offset-repaint.html fast/css3-text/css3-text-decoration/text-decoration-offset-under-auto.html fast/css3-text/css3-text-decoration/text-decoration-offset-under-length.html fast/css3-text/css3-text-decoration/text-decoration-offset.html fast/css3-text/css3-text-decoration/text-decoration-thickness-length.html fast/css3-text/css3-text-decoration/text-decoration-thickness-repaint.html * page/animation/CSSPropertyAnimation.cpp: (WebCore::blendFunc): (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): * platform/graphics/FontMetrics.h: (WebCore::FontMetrics::underlinePosition const): (WebCore::FontMetrics::setUnderlinePosition): (WebCore::FontMetrics::underlineThickness const): (WebCore::FontMetrics::setUnderlineThickness): * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::platformInit): * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addToLine): * rendering/SimpleLineLayout.cpp: (WebCore::SimpleLineLayout::canUseForStyle): * rendering/TextDecorationPainter.cpp: (WebCore::TextDecorationPainter::paintTextDecoration): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeAffectsVisualOverflow const): * rendering/style/TextDecorationThickness.h: (WebCore::TextDecorationThickness::resolve const): * style/InlineTextBoxStyle.cpp: (WebCore::computeUnderlineOffset): (WebCore::visualOverflowForDecorations): * style/InlineTextBoxStyle.h: (WebCore::textDecorationStrokeThickness): Deleted. 2018-11-06 John Wilander <wilander@apple.com> Resource Load Statistics: Remove cap on partitioned cache max age if it matches a network reload (redirect-only) https://bugs.webkit.org/show_bug.cgi?id=189760 <rdar://problem/44612242> Reviewed by Youenn Fablet and Antti Koivisto. No new tests. Existing test fleshed out. * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::isRedirection const): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::isRedirection const): Deleted. Moved to the implementation file so that I can export it without warning. 2018-11-06 Myles C. Maxfield <mmaxfield@apple.com> Spelling dots are drawn in the wrong place https://bugs.webkit.org/show_bug.cgi?id=190764 Reviewed by Dean Jackson. - Dots should not be clipped. - Dots should be horizontally centered. - Dots should be drawn behind the text. - Distance from the baseline to the top of the dot should be 11.035% of font size. - Dot diameter should be 13.247% of the font size. - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size. - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px. Tests: editing/spelling/spelling-dots-position-2.html editing/spelling/spelling-dots-position-3.html editing/spelling/spelling-dots-position.html editing/spelling/spelling-dots-repaint.html * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations. (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots, because there is no guarantee the spelling dots will lie inside the layout rect of the element. (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions. * rendering/InlineFlowBox.h: Comments should explain why, not say what. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Draw the dots behind the text. (WebCore::InlineTextBox::hasMarkers const): Convenience. (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function. (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation. (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly. (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method. (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const): (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted. * rendering/InlineTextBox.h: Declare the helper methods. * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of spelling dots opt us out of SLL. (WebCore::SimpleLineLayout::canUseForWithReason): * rendering/SimpleLineLayoutCoverage.cpp: (WebCore::SimpleLineLayout::printReason): * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason. 2018-11-06 Per Arne Vollan <pvollan@apple.com> REGRESSION (r230523): Caps lock indicator not shown in password field https://bugs.webkit.org/show_bug.cgi?id=190056 Reviewed by Ryosuke Niwa. When WindowServer access is blocked, GetCurrentModifiers() always returns 0. Instead of calling GetCurrentModifiers(), store the current modifiers from the key event argument in the method WebKit::WebPage::keyEvent, and use the stored value to detect if Caps lock is on. Additionally, the modifiers needs to be updated when the window becomes active. Test: fast/events/detect-caps-lock.html * Sources.txt: * platform/PlatformKeyboardEvent.h: * platform/graphics/FontTaggedSettings.cpp: * platform/mac/KeyEventMac.mm: (WebCore::PlatformKeyboardEvent::currentCapsLockState): (WebCore::PlatformKeyboardEvent::getCurrentModifierState): * testing/Internals.cpp: (WebCore::Internals::capsLockIsOn): * testing/Internals.h: * testing/Internals.idl: 2018-11-06 Javier Fernandez <jfernandez@igalia.com> CSS grid elements with justify-content: space-around have extra whitespace, sometimes a lot https://bugs.webkit.org/show_bug.cgi?id=191308 Reviewed by Dean Jackson. The CSS WG resolved [1] that Content Alignment should account to the track sizing algorithm. The sizing algorithm has been modified so that two new steps (1.5 and 2.5) were added to compute the Content Alignment offsets after resolving the columns' and rows' sizes respectively. This change decouples the Content Alignment logic from the tracks position, so that we can use it as part of the track sizing algorithm. I also had to store the whole ContentAlignmentData structure in two class attributes. We need both, position and distribution offsets, to be used in different parts of the layout logic. [1] https://github.com/w3c/csswg-drafts/issues/2557 Tests: imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-001.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-002.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-003.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-content-distribution-must-account-for-track-sizing-004.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-filled-shrinkwrap-001.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-cols-spanned-shrinkwrap-001.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-filled-shrinkwrap-001.html imported/w3c/web-platform-tests/css/css-grid/layout-algorithm/grid-percent-rows-spanned-shrinkwrap-001.html * rendering/GridTrackSizingAlgorithm.cpp: (WebCore::GridTrackSizingAlgorithm::gridAreaBreadthForChild const): * rendering/RenderGrid.cpp: (WebCore::RenderGrid::repeatTracksSizingIfNeeded): (WebCore::RenderGrid::layoutBlock): (WebCore::RenderGrid::gridItemOffset const): (WebCore::RenderGrid::trackSizesForComputedStyle const): (WebCore::RenderGrid::populateGridPositionsForDirection): (WebCore::RenderGrid::gridAreaBreadthForOutOfFlowChild): (WebCore::contentDistributionOffset): (WebCore::RenderGrid::computeContentPositionAndDistributionOffset): (WebCore::RenderGrid::nonCollapsedTracks const): * rendering/RenderGrid.h: (WebCore::ContentAlignmentData::isValid): (WebCore::ContentAlignmentData::defaultOffsets): 2018-11-06 Sihui Liu <sihui_liu@apple.com> IndexedDB: WAL file keeps growing https://bugs.webkit.org/show_bug.cgi?id=191294 <rdar://problem/41333493> Reviewed by Chris Dumez. When we quit apps, the database connection may not be shut down properly, and WAL file will be retained on disk. On the next open of database connection, new logs will be appended to the original WAL file, which keeps increasing size of the WAL file. We should do a manual checkpoint when we open a IndexedDB to make sure previous log is written to database and truncate WAL file. Test: IndexedDB.IndexedDBTempFileSize * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::open): 2018-11-06 Ali Juma <ajuma@chromium.org> IntersectionObserver doesn't keep target's JS wrapper alive https://bugs.webkit.org/show_bug.cgi?id=190235 Reviewed by Ryosuke Niwa. Retain JS wrappers of targets in queued entries using a vector of GCReachableRef owned by IntersectionObserver, which gets cleared after the entries have been delivered. Make IntersectionObserver::takeRecords return a struct which has both the vector of GCReachableRefs for targets and the vector of intersection observer entries, so that the GCReachableRefs survive until the creation of JS wrappers for the entries. Modify IntersectionObserver::hasPendingActivity to keep the observer alive while it has entries to deliver. Tests: intersection-observer/intersection-observer-entry-keeps-js-wrapper-of-target-alive.html intersection-observer/intersection-observer-keeps-js-wrapper-of-target-alive.html intersection-observer/target-deleted.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSIntersectionObserverEntryCustom.cpp: (WebCore::JSIntersectionObserverEntry::visitAdditionalChildren): Keep the target element's wrapper alive while the IntersectionObserverEntry's wrapper is alive. * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::takeRecords): Change return type to include GCReachableRefs for each record's target, so that each target can be kept until a JS wrapper is constructed for its IntersectionObserverEntry. (WebCore::IntersectionObserver::appendQueuedEntry): (WebCore::IntersectionObserver::notify): Erase GCReachableRefs for targets after delivering the corresponding records. (WebCore::IntersectionObserver::hasPendingActivity const): Keep the IntersectionObserver alive until queued entries are delivered. (WebCore::IntersectionObserver::stop): * page/IntersectionObserver.h: * page/IntersectionObserver.idl: * page/IntersectionObserverEntry.h: (WebCore::IntersectionObserverEntry::target const): Make this return a raw pointer instead of a RefPtr so that it can be called in JSIntersectionObserverEntry::visitAdditionalChildren, which runs on the GC thread (it's illegal to ref a Node on a non-main thread). * page/IntersectionObserverEntry.idl: 2018-11-06 Timothy Hatcher <timothy@apple.com> <picture> container doesn't update when prefers-color-scheme media query changes https://bugs.webkit.org/show_bug.cgi?id=190913 rdar://problem/45608456 Reviewed by Dean Jackson. Test: css-dark-mode/prefers-color-scheme-picture-element.html * css/MediaQueryEvaluator.cpp: (WebCore::isAppearanceDependent): Added. (WebCore::MediaQueryEvaluator::evaluate const): Keep track of appearanceDependentResults. * css/MediaQueryEvaluator.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::addAppearanceDependentMediaQueryResult): Added. (WebCore::StyleResolver::hasMediaQueriesAffectedByAppearanceChange const): Added. * css/StyleResolver.h: (WebCore::StyleResolver::hasAppearanceDependentMediaQueries const): Added. * dom/Document.cpp: (WebCore::Document::evaluateMediaQueryList): Call checkAppearanceDependentPictures. (WebCore::Document::checkAppearanceDependentPictures): Added. (WebCore::Document::addAppearanceDependentPicture): Added. (WebCore::Document::removeAppearanceDependentPicture): Added. * dom/Document.h: * html/HTMLImageElement.cpp: (WebCore::HTMLImageElement::bestFitSourceFromPictureElement): Call addAppearanceDependentPicture. * html/HTMLPictureElement.cpp: (WebCore::HTMLPictureElement::~HTMLPictureElement): Call removeAppearanceDependentPicture. (WebCore::HTMLPictureElement::didMoveToNewDocument): Ditto. (WebCore::HTMLPictureElement::appearanceChangeAffectedPicture const): Added. * html/HTMLPictureElement.h: * page/Page.cpp: (WebCore::Page::appearanceDidChange): Added. (WebCore::Page::setUseSystemAppearance): Call appearanceDidChange. (WebCore::Page::setUseDarkAppearance): Call appearanceDidChange. * page/Page.h: * style/StyleScope.cpp: (WebCore::Style::Scope::evaluateMediaQueriesForAppearanceChange): Added. * style/StyleScope.h: 2018-11-06 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r237834. Tests for this change crash on iOS Simulator Reverted changeset: "Spelling dots are drawn in the wrong place" https://bugs.webkit.org/show_bug.cgi?id=190764 https://trac.webkit.org/changeset/237834 2018-11-06 Antoine Quint <graouts@apple.com> [Web Animations] transitions/remove-transition-style.html crashes with GuardMalloc on https://bugs.webkit.org/show_bug.cgi?id=191304 <rdar://problem/45819476> Reviewed by Dean Jackson. Ensure we remove animations from the m_allAnimations ListHashSet upon destruction. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::forgetAnimation): (WebCore::AnimationTimeline::cancelDeclarativeAnimation): * animation/AnimationTimeline.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): * animation/WebAnimation.cpp: (WebCore::WebAnimation::~WebAnimation): 2018-11-06 Youenn Fablet <youenn@apple.com> RealtimeOutgoingAudioSourceCocoa should unobserve its source at destruction time https://bugs.webkit.org/show_bug.cgi?id=191295 Reviewed by Eric Carlson. Make RealtimeOutgoingAudioSource subclasses unobserve their source inside their destructor instead of RealtimeOutgoingAudioSource. This is consistent with how starting to observe works. Covered by existing tests. * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::unobserveSource): * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::~RealtimeOutgoingAudioSourceLibWebRTC): * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp: (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa): (WebCore::RealtimeOutgoingAudioSourceCocoa::~RealtimeOutgoingAudioSourceCocoa): * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h: 2018-11-06 Youenn Fablet <youenn@apple.com> Make sure RTCIceCandidateStats address is undefined for host and peer reflexive case https://bugs.webkit.org/show_bug.cgi?id=191263 Reviewed by Eric Carlson. Test: webrtc/datachannel/getStats-no-prflx-remote-candidate.html * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCIceCandidateStats): 2018-11-06 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Handle setting max number of frame between keyframes https://bugs.webkit.org/show_bug.cgi?id=190682 Reviewed by Philippe Normand. That has been manually checked. * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: (gst_webrtc_video_encoder_get_property): (gst_webrtc_video_encoder_set_property): (register_known_encoder): (gst_webrtc_video_encoder_class_init): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::InitEncode): 2018-11-03 Alex Christensen <achristensen@webkit.org> [Mac] Implement safe browsing in WebKit https://bugs.webkit.org/show_bug.cgi?id=188871 Reviewed by Tim Horton. * en.lproj/Localizable.strings: 2018-11-06 Ali Juma <ajuma@chromium.org> [IntersectionObserver] Account for CSS zoom when computing client rects https://bugs.webkit.org/show_bug.cgi?id=191282 Reviewed by Simon Fraser. When computing rects for an IntersectionObserverEntry, account for the effective zoom when converting from absolute to client coordinates. Test: web-platform-tests/intersection-observer/bounding-box.html * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): 2018-11-06 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Implement black frame generation https://bugs.webkit.org/show_bug.cgi?id=190684 Reviewed by Xabier Rodriguez-Calvar. Avoiding webrtc/video-mute-vp8.html to crash but it still fails because we are missing the canvas bridging code. * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingVideoSourceLibWebRTC::createBlackFrame): * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h: 2018-11-06 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Do not try to handle framerate modulation in the encoder https://bugs.webkit.org/show_bug.cgi?id=190683 Reviewed by Philippe Normand. This has to already be handled in capturing pipeline or in libwebrtc itself. No other encoder implementation do that, and libwebrtc is not happy with encoder that do not output the exact number of frames that have been passed in. No regressions detected and libwebrtc is happier this way, less warning output and no more frame corruption in H264 streams found. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::InitEncode): 2018-11-06 Frederic Wang <fwang@igalia.com> Unreviewed, follow-up of previous commit. Actually move OptionSet in the header since it's used there too. * page/WindowFeatures.cpp: * page/WindowFeatures.h: 2018-11-06 Frederic Wang <fwang@igalia.com> Unreviewed build fix. * page/WindowFeatures.cpp: Add missing header for OptionSet. * platform/graphics/FontTaggedSettings.cpp: Add missing header for IntegerHash. 2018-11-06 Antoine Quint <graouts@apple.com> [Web Animations] Don't reset pending tasks when setting a null effect https://bugs.webkit.org/show_bug.cgi?id=191301 <rdar://problem/45838422> Reviewed by Dean Jackson. The issue https://github.com/w3c/csswg-drafts/issues/2077 has changed the Web Animations API such that we no longer reset pending tasks when setting a null effect on an animation. * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): 2018-11-06 Antoine Quint <graouts@apple.com> [Web Animations] Update the API to allow the "auto" composite value https://bugs.webkit.org/show_bug.cgi?id=191300 <rdar://problem/45838373> Reviewed by Dean Jackson. The Web Animations API has been changed such that the various "composite" properties are no longer optional and instead allow an "auto" value in their enumeration. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/CompositeOperationOrAuto.h: Copied from Source/WebCore/animation/KeyframeEffect.idl. * animation/CompositeOperationOrAuto.idl: Copied from Source/WebCore/animation/KeyframeEffect.idl. * animation/KeyframeEffect.cpp: (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::getKeyframes): * animation/KeyframeEffect.h: * animation/KeyframeEffect.idl: 2018-11-06 Antoine Quint <graouts@apple.com> [Web Animations] Update the API to implement Animation.updatePlaybackRate() https://bugs.webkit.org/show_bug.cgi?id=186510 <rdar://problem/41000641> Reviewed by Dean Jackson. The Web Animations API has been changed to allow for changes to an animation's playback rate both synchronously, with the existing "playbackRate" property, and asynchronously, with the new updatePlaybackRate() method. In this patch we update the various procedures to account for pending playback rate changes and the notion of an "effective playback rate". * animation/WebAnimation.cpp: (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::setStartTime): (WebCore::WebAnimation::setCurrentTime): (WebCore::WebAnimation::effectivePlaybackRate const): (WebCore::WebAnimation::setPlaybackRate): (WebCore::WebAnimation::updatePlaybackRate): (WebCore::WebAnimation::applyPendingPlaybackRate): (WebCore::WebAnimation::playState const): (WebCore::WebAnimation::resetPendingTasks): (WebCore::WebAnimation::finish): (WebCore::WebAnimation::play): (WebCore::WebAnimation::runPendingPlayTask): (WebCore::WebAnimation::reverse): (WebCore::WebAnimation::runPendingPauseTask): * animation/WebAnimation.h: (WebCore::WebAnimation::playbackRate const): * animation/WebAnimation.idl: 2018-11-06 Antoine Quint <graouts@apple.com> [Web Animations] Implement getTiming() and updateTiming() https://bugs.webkit.org/show_bug.cgi?id=186511 <rdar://problem/41000677> Reviewed by Dean Jackson. The Web Animations API has been further simplified by removing the AnimationEffectTiming and AnimationEffectTimingReadOnly interfaces, removing the "timing" property on AnimationEffect replacing it with getTiming() and updateTiming() methods. This does not change the features of the API but simply how they are exposed. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: (WebCore::AnimationEffect::AnimationEffect): (WebCore::AnimationEffect::~AnimationEffect): (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::transformedProgress const): (WebCore::AnimationEffect::getTiming): (WebCore::AnimationEffect::getComputedTiming): (WebCore::AnimationEffect::updateTiming): (WebCore::AnimationEffect::setIterationStart): (WebCore::AnimationEffect::setIterations): (WebCore::AnimationEffect::endTime const): (WebCore::AnimationEffect::setDelay): (WebCore::AnimationEffect::setEndDelay): (WebCore::AnimationEffect::setFill): (WebCore::AnimationEffect::setIterationDuration): (WebCore::AnimationEffect::setDirection): (WebCore::AnimationEffect::setTimingFunction): (WebCore::AnimationEffect::activeDuration const): * animation/AnimationEffect.h: (WebCore::AnimationEffect::delay const): (WebCore::AnimationEffect::endDelay const): (WebCore::AnimationEffect::fill const): (WebCore::AnimationEffect::iterationStart const): (WebCore::AnimationEffect::iterations const): (WebCore::AnimationEffect::iterationDuration const): (WebCore::AnimationEffect::direction const): (WebCore::AnimationEffect::timingFunction const): * animation/AnimationEffect.idl: * animation/AnimationEffectTiming.idl: Removed. * animation/AnimationEffectTimingReadOnly.cpp: Removed. * animation/AnimationEffectTimingReadOnly.h: Removed. * animation/AnimationEffectTimingReadOnly.idl: Removed. * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): * animation/CSSTransition.cpp: (WebCore::CSSTransition::setTimingProperties): * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DocumentTimeline.cpp: * animation/EffectTiming.idl: * animation/KeyframeEffect.cpp: (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): * animation/KeyframeEffect.h: * animation/OptionalEffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTiming.h. * animation/OptionalEffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTiming.cpp. * animation/WebAnimation.cpp: (WebCore::WebAnimation::effectTimingDidChange): (WebCore::WebAnimation::updatePlaybackRate): * animation/WebAnimation.h: (WebCore::WebAnimation::isRelevant const): * bindings/js/JSAnimationEffectTimingReadOnlyCustom.cpp: Removed. * bindings/js/WebCoreBuiltinNames.h: 2018-11-06 Antoine Quint <graouts@apple.com> [Web Animations] Update the Web Animations API to remove all the ReadOnly interfaces https://bugs.webkit.org/show_bug.cgi?id=186512 <rdar://problem/41000691> Reviewed by Dean Jackson. The Web Animations API has been simplified by removing its various ReadOnly interfaces. In this patch, we make the following changes, not adding code but merely merging and renaming files: - AnimationEffectReadOnly and AnimationEffect are now a single AnimationEffect interface - KeyframeEffectReadOnly and KeyframeEffect are now a single KeyframeEffect interface - ComputedTimingProperties is now named ComputedEffectTiming - AnimationEffectTimingProperties is now named EffectTiming * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * animation/AnimationEffect.cpp: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.cpp. (WebCore::AnimationEffect::~AnimationEffect): (WebCore::AnimationEffect::timingDidChange): (WebCore::AnimationEffect::localTime const): (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::transformedProgress const): (WebCore::AnimationEffect::iterationProgress const): (WebCore::AnimationEffect::getComputedTiming): * animation/AnimationEffect.h: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.h. (WebCore::AnimationEffect::isKeyframeEffect const): * animation/AnimationEffect.idl: Renamed from Source/WebCore/animation/AnimationEffectReadOnly.idl. * animation/AnimationEffectTimingReadOnly.cpp: * animation/AnimationEffectTimingReadOnly.h: (WebCore::AnimationEffectTimingReadOnly::setEffect): * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::removeAnimation): (WebCore::AnimationTimeline::cssAnimationForElementAndProperty): * animation/CSSTransition.cpp: * animation/ComputedEffectTiming.h: Renamed from Source/WebCore/animation/ComputedTimingProperties.h. * animation/ComputedEffectTiming.idl: Renamed from Source/WebCore/animation/ComputedTimingProperties.idl. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): (WebCore::DeclarativeAnimation::phaseWithoutEffect const): (WebCore::DeclarativeAnimation::invalidateDOMEvents): * animation/DeclarativeAnimation.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): (WebCore::DocumentTimeline::transitionDidComplete): (WebCore::DocumentTimeline::computeExtentOfAnimation const): (WebCore::DocumentTimeline::isRunningAnimationOnRenderer const): (WebCore::DocumentTimeline::isRunningAcceleratedAnimationOnRenderer const): (WebCore::DocumentTimeline::animatedStyleForRenderer): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations): (WebCore::DocumentTimeline::resolveAnimationsForElement): * animation/EffectTiming.h: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.h. * animation/EffectTiming.idl: Renamed from Source/WebCore/animation/AnimationEffectTimingProperties.idl. * animation/KeyframeEffect.cpp: (WebCore::invalidateElement): (WebCore::CSSPropertyIDToIDLAttributeName): (WebCore::IDLAttributeNameToAnimationPropertyName): (WebCore::computeMissingKeyframeOffsets): (WebCore::processKeyframeLikeObject): (WebCore::processIterableKeyframes): (WebCore::processPropertyIndexedKeyframes): (WebCore::KeyframeEffect::create): (WebCore::KeyframeEffect::KeyframeEffect): (WebCore::KeyframeEffect::copyPropertiesFromSource): (WebCore::KeyframeEffect::getKeyframes): (WebCore::KeyframeEffect::processKeyframes): (WebCore::KeyframeEffect::updateBlendingKeyframes): (WebCore::KeyframeEffect::forceLayoutIfNeeded): (WebCore::KeyframeEffect::setBlendingKeyframes): (WebCore::KeyframeEffect::checkForMatchingTransformFunctionLists): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists const): (WebCore::KeyframeEffect::checkForMatchingFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingBackdropFilterFunctionLists): (WebCore::KeyframeEffect::checkForMatchingColorFilterFunctionLists): (WebCore::KeyframeEffect::computeDeclarativeAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSAnimationBlendingKeyframes): (WebCore::KeyframeEffect::computeCSSTransitionBlendingKeyframes): (WebCore::KeyframeEffect::computedNeedsForcedLayout): (WebCore::KeyframeEffect::computeStackingContextImpact): (WebCore::KeyframeEffect::setTarget): (WebCore::KeyframeEffect::apply): (WebCore::KeyframeEffect::invalidate): (WebCore::KeyframeEffect::computeShouldRunAccelerated): (WebCore::KeyframeEffect::getAnimatedStyle): (WebCore::KeyframeEffect::setAnimatedPropertiesInStyle): (WebCore::KeyframeEffect::timingFunctionForKeyframeAtIndex): (WebCore::KeyframeEffect::updateAcceleratedAnimationState): (WebCore::KeyframeEffect::addPendingAcceleratedAction): (WebCore::KeyframeEffect::animationDidSeek): (WebCore::KeyframeEffect::animationSuspensionStateDidChange): (WebCore::KeyframeEffect::applyPendingAcceleratedActions): (WebCore::KeyframeEffect::backingAnimationForCompositedRenderer const): (WebCore::KeyframeEffect::renderer const): (WebCore::KeyframeEffect::currentStyle const): (WebCore::KeyframeEffect::computeExtentOfTransformAnimation const): (WebCore::containsRotation): (WebCore::KeyframeEffect::computeTransformedExtentViaTransformList const): (WebCore::KeyframeEffect::computeTransformedExtentViaMatrix const): * animation/KeyframeEffect.h: (WebCore::KeyframeEffect::ParsedKeyframe::ParsedKeyframe): (WebCore::KeyframeEffect::target const): (WebCore::KeyframeEffect::iterationComposite const): (WebCore::KeyframeEffect::composite const): (WebCore::KeyframeEffect::isRunningAccelerated const): (WebCore::KeyframeEffect::hasPendingAcceleratedAction const): (WebCore::KeyframeEffect::hasBlendingKeyframes const): (WebCore::KeyframeEffect::animatedProperties const): * animation/KeyframeEffect.idl: * animation/KeyframeEffectOptions.h: * animation/KeyframeEffectOptions.idl: * animation/KeyframeEffectReadOnly.cpp: Removed. * animation/KeyframeEffectReadOnly.h: Removed. * animation/KeyframeEffectReadOnly.idl: Removed. * animation/WebAnimation.cpp: (WebCore::WebAnimation::create): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::applyPendingAcceleratedActions): (WebCore::WebAnimation::computeRelevance): * animation/WebAnimation.h: (WebCore::WebAnimation::effect const): * animation/WebAnimation.idl: * bindings/js/JSAnimationEffectCustom.cpp: Renamed from Source/WebCore/bindings/js/JSAnimationEffectReadOnlyCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebAnimationCustom.cpp: (WebCore::constructJSWebAnimation): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: 2018-11-06 Rob Buis <rbuis@igalia.com> Some minor X-Content-Type-Options parsing issues https://bugs.webkit.org/show_bug.cgi?id=191107 Reviewed by Darin Adler. Implement new parsing rules for X-Content-Type-Options [1]: https://github.com/whatwg/fetch/pull/818 [1] https://fetch.spec.whatwg.org/#x-content-type-options-header Test: web-platform-tests/fetch/nosniff/parsing-nosniff.html * platform/network/HTTPParsers.cpp: (WebCore::isHTTPTabOrSpace): (WebCore::parseContentTypeOptionsHeader): 2018-11-06 Frederic Wang <fwang@igalia.com> Overlay with -webkit-overflow-scrolling:touch doesn't become scrollable after added text makes it taller https://bugs.webkit.org/show_bug.cgi?id=158342 Reviewed by Simon Fraser. Resizing the content of a -webkit-overflow-scrolling:touch overflow node on iOS may make it scrollable. However, the RenderLayerBacking's scrolling layer is not properly created when RenderLayerCompositor::updateScrollCoordinatedLayer is called and hence the UIProcess receives a null UIScrollView pointer when ScrollingTreeScrollingNodeDelegateIOS performs the associated update. In debug mode this hits an ASSERT and in release mode the overflow node remains unscrollable from the user's point of view. This patch fixes this issue by ensuring the RenderLayerBacking's scrolling layer is created during updateScrollCoordinatedStatus. Test: fast/scrolling/ios/update-scroll-coordinated-status.html * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus): Call updateConfiguration() to ensure the scrolling layer is present and indicate whether a rebuild is necessary. 2018-11-05 Zan Dobersek <zdobersek@igalia.com> Place Fontconfig-specific RefPtr specializations in RefPtrFontconfig.h https://bugs.webkit.org/show_bug.cgi?id=191267 Reviewed by Michael Catanzaro. Move the Fontconfig-specific RefPtr specialization declarations from RefPtrCairo.h to RefPtrFontconfig.h, with definitions moved to the new RefPtrFontconfig.cpp implementation file. These specializations are not tied to Cairo in any way. * platform/FreeType.cmake: * platform/graphics/FontPlatformData.h: * platform/graphics/cairo/RefPtrCairo.cpp: * platform/graphics/cairo/RefPtrCairo.h: * platform/graphics/freetype/FontCacheFreeType.cpp: * platform/graphics/freetype/RefPtrFontconfig.cpp: Added. (WTF::refIfNotNull): (WTF::derefIfNotNull): * platform/graphics/freetype/RefPtrFontconfig.h: Copied from Source/WebCore/platform/graphics/cairo/RefPtrCairo.h. 2018-11-05 Don Olmstead <don.olmstead@sony.com> [CMake] Fix WebCore/Modules includes https://bugs.webkit.org/show_bug.cgi?id=191287 Reviewed by Fujii Hironori. No new tests. No change in behavior. Add in applicationmanifest to the list of includes and sort the modules directory. * CMakeLists.txt: 2018-11-05 Myles C. Maxfield <mmaxfield@apple.com> Cache glyph paths and share underline skipping code between all the ports https://bugs.webkit.org/show_bug.cgi?id=191239 Reviewed by Alex Christensen. I was hoping that caching the glyph paths was going to be a performance progression, but it turns out that the additional overhead of WebCore::Path compensated for it. In total, the performance is the same (my testing says that this patch is a 1% progression, but that's within the noise). Because the ink skipping logic is now shared among all ports, Windows now gets it for free. Test: PerformanceTests/Layout/underline.html * platform/graphics/Font.cpp: (WebCore::Font::pathForGlyph const): * platform/graphics/Font.h: * platform/graphics/FontCascade.cpp: (WebCore::computeUnderlineType): (WebCore::GlyphIterationState::GlyphIterationState): (WebCore::findIntersectionPoint): (WebCore::updateX): (WebCore::findPathIntersections): (WebCore::GlyphToPathTranslator::GlyphToPathTranslator): (WebCore::GlyphToPathTranslator::containsMorePaths): (WebCore::GlyphToPathTranslator::path): (WebCore::GlyphToPathTranslator::extents): (WebCore::GlyphToPathTranslator::underlineType): (WebCore::GlyphToPathTranslator::advance): (WebCore::FontCascade::dashesForIntersectionsWithRect const): * platform/graphics/FontCascade.h: * platform/graphics/GlyphMetricsMap.h: (WebCore::GlyphMetricsMap::existingMetricsForGlyph): (WebCore::GlyphMetricsMap::GlyphMetricsPage::existingMetricsForGlyph const): (WebCore::GlyphMetricsMap<std::optional<Path>>::unknownMetrics): * platform/graphics/TextRun.h: * platform/graphics/cairo/FontCairo.cpp: (WebCore::Font::platformPathForGlyph const): (WebCore::GlyphIterationState::GlyphIterationState): Deleted. (WebCore::findIntersectionPoint): Deleted. (WebCore::updateX): Deleted. (WebCore::findPathIntersections): Deleted. (): Deleted. (WebCore::CairoGlyphToPathTranslator::path): Deleted. (WebCore::CairoGlyphToPathTranslator::extents): Deleted. (WebCore::CairoGlyphToPathTranslator::underlineType): Deleted. (WebCore::CairoGlyphToPathTranslator::advance): Deleted. (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted. * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::GlyphIterationState::GlyphIterationState): Deleted. (WebCore::findIntersectionPoint): Deleted. (WebCore::updateX): Deleted. (WebCore::findPathIntersections): Deleted. (): Deleted. (WebCore::MacGlyphToPathTranslator::path): Deleted. (WebCore::MacGlyphToPathTranslator::extents): Deleted. (WebCore::MacGlyphToPathTranslator::underlineType): Deleted. (WebCore::MacGlyphToPathTranslator::advance): Deleted. (WebCore::FontCascade::dashesForIntersectionsWithRect const): Deleted. * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::platformPathForGlyph const): * rendering/TextDecorationPainter.cpp: (WebCore::drawSkipInkUnderline): (WebCore::TextDecorationPainter::paintTextDecoration): 2018-11-05 Myles C. Maxfield <mmaxfield@apple.com> Clean up text decoration drawing code https://bugs.webkit.org/show_bug.cgi?id=191245 Reviewed by Zalan Bujtas. This is some general clean up of the text decorations code. There is no behavior change. This patch modifies GraphicsContext::drawLineForText() & friends to accept a FloatRect instead of a FloatPoint + float width. This is helpful because it allows for easier bounding box calculations. This patch also removes some redundant computations that the skip:ink codepath was performing. This patch also refactors the wavy decoration parameters to not use out params. No new tests because there is no behavior change. * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::computeUnderlineBoundsForText): (WebCore::GraphicsContext::computeLineBoundsAndAntialiasingModeForText): * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::GraphicsContext::drawLineForText): (WebCore::GraphicsContext::drawLinesForText): * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::DrawLinesForText::apply const): (WebCore::DisplayList::DrawLinesForText::localBounds const): (WebCore::DisplayList::operator<<): * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawLinesForText::create): (WebCore::DisplayList::DrawLinesForText::thickness const): (WebCore::DisplayList::DrawLinesForText::DrawLinesForText): * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawLinesForText): * platform/graphics/displaylists/DisplayListRecorder.h: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintMarkedTextDecoration): (WebCore::InlineTextBox::paintCompositionUnderline const): * rendering/SimpleLineLayoutFunctions.cpp: (WebCore::SimpleLineLayout::paintFlow): * rendering/TextDecorationPainter.cpp: (WebCore::strokeWavyTextDecoration): (WebCore::translateIntersectionPointsToSkipInkBoundaries): (WebCore::TextDecorationPainter::TextDecorationPainter): (WebCore::TextDecorationPainter::paintTextDecoration): (WebCore::drawSkipInkUnderline): Deleted. * rendering/TextDecorationPainter.h: (WebCore::TextDecorationPainter::setInlineTextBox): (WebCore::TextDecorationPainter::setWidth): (WebCore::TextDecorationPainter::setFont): Deleted. (WebCore::TextDecorationPainter::setBaseline): Deleted. * style/InlineTextBoxStyle.cpp: (WebCore::getWavyStrokeParameters): (WebCore::visualOverflowForDecorations): * style/InlineTextBoxStyle.h: 2018-11-05 Myles C. Maxfield <mmaxfield@apple.com> Fix the Windows build after r237835 https://bugs.webkit.org/show_bug.cgi?id=191242 Reviewed by Simon Fraser. * rendering/style/TextDecorationThickness.h: (WebCore::TextDecorationThickness::operator== const): 2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Swatch appears squished and off-center in inputs of type color https://bugs.webkit.org/show_bug.cgi?id=191279 <rdar://problem/45816319> Reviewed by Tim Horton. This patch makes some small adjustments to color inputs on iOS to bring them closer to the intended design. See comments below for more details. Tests: fast/forms/color/color-input-uses-color-well-appearance.html fast/forms/color/input-appearance-color.html * css/html.css: Adjust the UA stylesheet for color inputs on iOS. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paintDecorations): When painting decorations for `ColorWellPart`, treat it as a standard button instead of the square button appearance. (WebCore::RenderTheme::colorInputStyleSheet const): Add `-webkit-appearance: color-well;` to the stylesheet for color inputs. Previously, this was special-cased on iOS, where color input elements had appearances of `textfield`; however, this patch makes some adjustments to RenderThemeIOS, allowing us to use `color-well` on iOS. * rendering/RenderTheme.h: (WebCore::RenderTheme::platformUsesColorWellAppearance const): Deleted. Remove this from RenderTheme. This is no longer necessary, since all platforms now use `-webkit-appearance: color-well;`. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::adjustButtonStyle const): When painting buttons for color inputs, don't add rounded corners that are present by default for regular buttons. 2018-11-05 Eric Carlson <eric.carlson@apple.com> [MediaStream] An audio track should be muted when capture is interrupted by the OS. https://bugs.webkit.org/show_bug.cgi?id= 191283 <rdar://problem/45773103> Reviewed by Jon Lee. Test: fast/mediastream/media-stream-track-interrupted.html * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::setInterruptedForTesting): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::beginInterruption): (WebCore::CoreAudioCaptureSource::endInterruption): * testing/Internals.cpp: (WebCore::Internals::setMediaStreamSourceInterrupted): * testing/Internals.h: * testing/Internals.idl: 2018-11-05 Myles C. Maxfield <mmaxfield@apple.com> Parsing support for text-underline-offset and text-decoration-thickness https://bugs.webkit.org/show_bug.cgi?id=191242 Reviewed by Simon Fraser. Before we can implement the properties properly, we have to parse them. https://github.com/w3c/csswg-drafts/issues/3118#issuecomment-432297480 describes the grammar: text-underline-position: auto | [ [ under | from-font] || [ left | right ] ] text-underline-offset: auto | <length> text-decoration-thickness: auto | from-font | <length> This patch also takes the opportunity to update the grammar of text-underline-position to match the spec, and to add an alias to the unprefixed version. We still don't support the left and right values on text-underline-position. We should add those eventually. Tests: fast/css3-text/css3-text-decoration/text-decoration-thickness-parse.html fast/css3-text/css3-text-decoration/text-underline-offset-parse.html * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::textUnderlineOffsetToCSSValue): (WebCore::textDecorationThicknessToCSSValue): (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator TextUnderlinePosition const): (WebCore::CSSPrimitiveValue::operator OptionSet<TextUnderlinePosition> const): Deleted. * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertTextUnderlinePosition): (WebCore::StyleBuilderConverter::convertTextUnderlineOffset): (WebCore::StyleBuilderConverter::convertTextDecorationThickness): * css/StyleResolver.cpp: (WebCore::shouldApplyPropertyInParseOrder): * css/parser/CSSPropertyParser.cpp: (WebCore::consumeTextUnderlineOffset): (WebCore::consumeTextDecorationThickness): (WebCore::CSSPropertyParser::parseSingleValue): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::textUnderlinePosition const): (WebCore::RenderStyle::textUnderlineOffset const): (WebCore::RenderStyle::textDecorationThickness const): (WebCore::RenderStyle::setTextUnderlinePosition): (WebCore::RenderStyle::setTextUnderlineOffset): (WebCore::RenderStyle::setTextDecorationThickness): (WebCore::RenderStyle::initialTextUnderlinePosition): (WebCore::RenderStyle::initialTextUnderlineOffset): (WebCore::RenderStyle::initialTextDecorationThickness): * rendering/style/RenderStyleConstants.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * rendering/style/TextDecorationThickness.h: Added. (WebCore::TextDecorationThickness::createWithAuto): (WebCore::TextDecorationThickness::createFromFont): (WebCore::TextDecorationThickness::createWithLength): (WebCore::TextDecorationThickness::isAuto const): (WebCore::TextDecorationThickness::isFromFont const): (WebCore::TextDecorationThickness::isLength const): (WebCore::TextDecorationThickness::setLengthValue): (WebCore::TextDecorationThickness::lengthValue const): (WebCore::TextDecorationThickness::operator== const): (WebCore::TextDecorationThickness::operator!= const): (WebCore::TextDecorationThickness::TextDecorationThickness): (WebCore::operator<<): * rendering/style/TextUnderlineOffset.h: Added. (WebCore::TextUnderlineOffset::createWithAuto): (WebCore::TextUnderlineOffset::createWithLength): (WebCore::TextUnderlineOffset::isAuto const): (WebCore::TextUnderlineOffset::isLength const): (WebCore::TextUnderlineOffset::setLengthValue): (WebCore::TextUnderlineOffset::lengthValue const): (WebCore::TextUnderlineOffset::lengthOr const): (WebCore::TextUnderlineOffset::operator== const): (WebCore::TextUnderlineOffset::operator!= const): (WebCore::TextUnderlineOffset::TextUnderlineOffset): (WebCore::operator<<): * style/InlineTextBoxStyle.cpp: (WebCore::computeUnderlineOffset): * style/InlineTextBoxStyle.h: 2018-11-05 Myles C. Maxfield <mmaxfield@apple.com> Spelling dots are drawn in the wrong place https://bugs.webkit.org/show_bug.cgi?id=190764 Reviewed by Dean Jackson. - Dots should not be clipped. - Dots should be horizontally centered. - Dots should be drawn behind the text. - Distance from the baseline to the top of the dot should be 11.035% of font size. - Dot diameter should be 13.247% of the font size. - Distance between the dots (right side of the left dot to left side of the right dot) should be 9.457% of the font size. - The "font size" used in these calculations should be clamped so it's 10px <= font size <= 40px. Tests: editing/spelling/spelling-dots-position-2.html editing/spelling/spelling-dots-position-3.html editing/spelling/spelling-dots-position.html editing/spelling/spelling-dots-repaint.html * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): Align iOS and macOS implementations. (WebCore::GraphicsContext::drawDotsForDocumentMarker): Place the dots correctly. * rendering/InlineFlowBox.cpp: (WebCore::InlineFlowBox::addToLine): The KnownToHaveNoOverflow flag should be cleared if the element has spelling dots, because there is no guarantee the spelling dots will lie inside the layout rect of the element. (WebCore::InlineFlowBox::addTextBoxVisualOverflow): Update the repaint rects to include splling dot positions. * rendering/InlineFlowBox.h: Comments should explain why, not say what. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paint): Draw the dots behind the text. (WebCore::InlineTextBox::hasMarkers const): Convenience. (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Refactor bounds information into a helper function. (WebCore::InlineTextBox::calculateUnionOfAllDocumentMarkerBounds const): Use for repaint rect calculation. (WebCore::InlineTextBox::calculateDocumentMarkerBounds const): Place the dots correctly. (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call the helper method. (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers const): (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Deleted. * rendering/InlineTextBox.h: Declare the helper methods. * rendering/SimpleLineLayout.cpp: Simple line layout doesn't know how to paint spelling dots, so make the presence of spelling dots opt us out of SLL. (WebCore::SimpleLineLayout::canUseForWithReason): * rendering/SimpleLineLayoutCoverage.cpp: (WebCore::SimpleLineLayout::printReason): * rendering/SimpleLineLayoutCoverage.h: Add a new opt-out reason. 2018-11-05 Dean Jackson <dino@apple.com> Attempted build fix. * dom/messageports/MessagePortChannelRegistry.cpp: 2018-11-05 Chris Dumez <cdumez@apple.com> Crash under DOMWindow::postMessageTimerFired() https://bugs.webkit.org/show_bug.cgi?id=191217 <rdar://problem/40888466> Reviewed by Geoffrey Garen. Protect the frame in DOMWindow::postMessageTimerFired() before calling dispatchEvent() as dispatching the event may cause JS to run and this JS may cause the frame to be destroyed, in which case we will crash when trying to use the frame on the next line. Test: fast/dom/Window/remove-frame-in-message-event-handler.html * page/DOMWindow.cpp: (WebCore::DOMWindow::postMessageTimerFired): 2018-11-05 Thibault Saunier <tsaunier@igalia.com> [GStreamer] Fix EncodedImage timestamps to match what libWebRTC expects https://bugs.webkit.org/show_bug.cgi?id=190035 Reviewed by Philippe Normand. We can't rely on GStreamer timestamps to pass to EncodedImages after encoding because libWebRTC doesn't use the timestamp we fed it but does some computation on the input timestamp in the images we pass in before it passes them back to the encoder. Then internally LibWebRTC relies on those exact timestamps passed into the encoder to do checks and compute RTP timestamps so we need to carefully pass the exact timestamps to LibWebRTC (in practice we still use GStreamer timestamps in all the GStreamer processing pipelines as the WebRTC object basically wraps the "same" `GstSample` all around, but we are not synced on the clock anyway). * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: (WebCore::LibWebRTCVideoFrameFromGStreamerSample): * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: (WebCore::GStreamerVideoDecoder::newSampleCallback): * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder): (WebCore::GStreamerVideoEncoder::newSampleCallback): 2018-11-05 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Changing view scale sometimes does not zoom the page to the new initial scale when the page is zoomed in when ignoring meta viewport https://bugs.webkit.org/show_bug.cgi?id=191226 <rdar://problem/45781765> Reviewed by Tim Horton. When `_setViewScale:` SPI is used to adjust the layout scale factor of the page, we multiply minimum, initial and maximum scales by the given layout scale factor to adjust for a larger or smaller minimum layout size. However, in the case where the layout size scale factor is greater than 1 and we're also forcing the viewport to be scalable, we override the default minimum scale with 1 (i.e. `forceAlwaysUserScalableMinimumScale`). This means that the might be off by a small margin due to rounding error when computing the content width and view width (see: r237743). This means that in the case where (1) the viewport is forced to be user-scalable, and (2) we're ignoring meta viewport parameters, and (3) `_viewScale` exceeds 1, we may end up computing a slightly different minimum scale than the default minimum scale multiplied by the layout size scale factor; subsequently, the page scale factor will be slightly different from initial scale, such that we'll no longer zoom to the new initial scale when changing view scale. This patch adjusts `forceAlwaysUserScalableMinimumScale` and `forceAlwaysUserScalableMaximumScale` to take the current layout scale factor into account when computing min and max scales when the viewport is forced to be always scalable. Test: fast/viewport/ios/minimum-scale-after-changing-view-scale.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::minimumScale const): * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::maximumScale const): (WebCore::ViewportConfiguration::forceAlwaysUserScalableMaximumScale const): (WebCore::ViewportConfiguration::forceAlwaysUserScalableMinimumScale const): Turn these from constant values to const functions on ViewportConfiguration, which factor in the current viewport layout size scale factor. 2018-11-05 Dean Jackson <dino@apple.com> Expose a constructor for PointerEvent from PlatformTouchEvent https://bugs.webkit.org/show_bug.cgi?id=191238 <rdar://problem/45795682> Reviewed by Antoine Quint. Implement a constructor that takes a PlatformTouchEvent to create a PointerEvent. At the moment the code to call this constructor will live in WebKitAdditions, so no new tests yet. * SourcesCocoa.txt: Add PointerEventIOS.cpp. * WebCore.xcodeproj/project.pbxproj: Ditto. * dom/EventNames.h: Add macros for pointerdown, pointermove, pointerup, pointercancel. * dom/PointerEvent.cpp: Remove JSC namespace. * dom/PointerEvent.h: Add create and constructor that takes a PlatformTouchEvent. * dom/ios/PointerEventIOS.cpp: Added. 2018-11-05 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r237785. Introduced layout test and API test failures on macOS and iOS. Reverted changeset: "[iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired." https://bugs.webkit.org/show_bug.cgi?id=191078 https://trac.webkit.org/changeset/237785 2018-11-05 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Error out when simulcast is activated https://bugs.webkit.org/show_bug.cgi?id=190678 Reviewed by Philippe Normand. Implementing it is not for now yet. Tests for simulcast have been disabled as they now fail (instead of crashing). * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::InitEncode): 2018-11-05 Youenn Fablet <youenn@apple.com> RealtimeOutgoingAudioSource subclasses should observe its source when fully constructed https://bugs.webkit.org/show_bug.cgi?id=191241 Reviewed by Eric Carlson. Moving the logic to observe the audio source to the point where the RealtimeOutgoingAudioSource subclass is fully initialized. Covered by existing tests. * platform/mediastream/RealtimeOutgoingAudioSource.cpp: (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource): (WebCore::RealtimeOutgoingAudioSource::observeSource): * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: (WebCore::RealtimeOutgoingAudioSourceLibWebRTC::RealtimeOutgoingAudioSourceLibWebRTC): * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp: (WebCore::RealtimeOutgoingAudioSourceCocoa::RealtimeOutgoingAudioSourceCocoa): 2018-11-05 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] Add webrtcencoder bin to cleanup and refactor the way we set encoders https://bugs.webkit.org/show_bug.cgi?id=190674 Reviewed by Philippe Normand. webrtcencoder is a simple GstBin with a set of well known GStreamer encoders which it can use to implement encoding for different formats exposing a trimmed down unified API. It also adds proper handling of H264 profiles. The added files follow GStreamer coding style as we aim at upstreaming the element in the future. This is a refactoring so current tests already cover it. * platform/GStreamer.cmake: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements): * platform/mediastream/libwebrtc/GStreamerVideoEncoder.cpp: Added. (gst_webrtc_video_encoder_get_property): (gst_webrtc_video_encoder_set_bitrate): (gst_webrtc_video_encoder_set_format): (gst_webrtc_video_encoder_set_property): (register_known_encoder): (setup_x264enc): (setup_vp8enc): (setup_openh264enc): (set_bitrate_kbit_per_sec): (set_bitrate_bit_per_sec): (gst_webrtc_video_encoder_class_init): (gst_webrtc_video_encoder_init): * platform/mediastream/libwebrtc/GStreamerVideoEncoder.h: Added. * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder): (WebCore::GStreamerVideoEncoder::InitEncode): (WebCore::GStreamerVideoEncoder::createEncoder): (WebCore::GStreamerVideoEncoder::AddCodecIfSupported): (WebCore::GStreamerVideoEncoder::ImplementationName const): (WebCore::GStreamerVideoEncoder::SetRestrictionCaps): 2018-11-05 Thibault Saunier <tsaunier@igalia.com> [GStreamer][WebRTC] properly mark H.264 stream type in the "decoder" https://bugs.webkit.org/show_bug.cgi?id=190676 Reviewed by Philippe Normand. Avoiding to have h264parse make assumption (which might be wrong at some point). * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: (WebCore::GStreamerVideoDecoder::GetCapsForFrame): 2018-11-05 Thibault Saunier <tsaunier@igalia.com> [GStreamer] Do not sync libwerbtc stream on the clock https://bugs.webkit.org/show_bug.cgi?id=190677 The approach here is basically to let libwebrtc do all the synchronisation for us, and the same way as it is done in apple ports, we basically try to display what libwebrtc outputs as fast as possible. Reviewed by Philippe Normand. Manually tested * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::setSyncOnSink): (WebCore::MediaPlayerPrivateGStreamer::syncOnClock): (WebCore::MediaPlayerPrivateGStreamer::loadFull): (WebCore::MediaPlayerPrivateGStreamer::load): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: 2018-11-05 Ali Juma <ajuma@chromium.org> [IntersectionObserver] Fix isIntersecting computation when 0 is not a threshold https://bugs.webkit.org/show_bug.cgi?id=191210 Reviewed by Simon Fraser. isIntersecting should be false if the intersection ratio is smaller than the smallest threshold value. Update the computation of isIntersecting to depend on the current thresholdIndex. Test: imported/w3c/web-platform-tests/intersection-observer/initial-observation-with-threshold-expected.html * dom/Document.cpp: (WebCore::Document::updateIntersectionObservations): 2018-11-05 Rob Buis <rbuis@igalia.com> Remove some virtual methods in CachedRawResource https://bugs.webkit.org/show_bug.cgi?id=191251 Reviewed by Frédéric Wang. Since CachedRawResource is final no need to introduce new virtual methods in CachedRawResource. This patch also removes an outdated comment and forward declaration. No new tests since no change in functionality. * loader/cache/CachedRawResource.h: 2018-11-05 Philippe Normand <pnormand@igalia.com> [GStreamer] Move elements registration to GStreamerCommon https://bugs.webkit.org/show_bug.cgi?id=191189 Reviewed by Xabier Rodriguez-Calvar. It was a bit odd to have this in the base player class and to have sub-classes calling a static function of the super-class. Covered by existing tests. * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::initializeGStreamerAndRegisterWebKitElements): * platform/graphics/gstreamer/GStreamerCommon.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::isAvailable): (WebCore::MediaPlayerPrivateGStreamer::loadFull): (WebCore::MediaPlayerPrivateGStreamer::getSupportedTypes): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp: (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine): (WebCore::MediaPlayerPrivateGStreamerMSE::load): (WebCore::MediaPlayerPrivateGStreamerMSE::trackDetected): (WebCore::MediaPlayerPrivateGStreamerMSE::supportsType): 2018-11-04 Rob Buis <rbuis@igalia.com> Remove ENABLE_OPENCL fully https://bugs.webkit.org/show_bug.cgi?id=191172 Reviewed by Yusuke Suzuki. Forgot to simplify this, no need for applyAll anymore since it just calls apply. No new tests since no change in functionality. * platform/graphics/filters/FilterEffect.h: (WebCore::FilterEffect::applyAll): Deleted. * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::postApplyResource): 2018-11-04 Zalan Bujtas <zalan@apple.com> [iOS] Issue initial paint soon after the visuallyNonEmpty milestone is fired. https://bugs.webkit.org/show_bug.cgi?id=191078 <rdar://problem/45736178> Reviewed by Antti Koivisto. 1. Improve visuallyNonEmpty milestone confidence level. Ignore whitespace and non visible text content. Parsing the main document should not necessarily fire the milestone. Check if there's any pending scripts/css/font loading. Check if the html/body is actually visible. 2. Issue initial paint soon after the milestone fires. Use a 0ms timer to flush the initial paint. Throttle additional flushes for 500ms (remove the non-initial 1.5 throttling) 3. Suspend optional style recalcs and layouts while painting is being throttled. When parsing yields we initiate a 0ms style recalc/layout timer. These optional layouts produce content that we have no intention to paint. * dom/Document.cpp: (WebCore::Document::scheduleStyleRecalc): (WebCore::Document::shouldScheduleLayout): * page/ChromeClient.h: * page/FrameView.cpp: (WebCore::FrameView::resetLayoutMilestones): (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const): (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded): (WebCore::FrameView::updateIsVisuallyNonEmpty): * page/FrameView.h: (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount): Ignore whitespace characters. Some pages start with plenty of whitespace only content. * platform/graphics/FontCascade.h: * rendering/RenderText.cpp: Check whether the text is actually visible at this point. (WebCore::RenderText::RenderText): 2018-11-04 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Add support for percentage height in quirks mode. https://bugs.webkit.org/show_bug.cgi?id=191232 Reviewed by Antti Koivisto. In quirks mode, we go and travers the containing block chain to find a block level box with fixed height value to resolve the percentage value. Test: fast/block/basic/quirk-mode-percent-height.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): * layout/Verification.cpp: (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): 2018-11-04 Zalan Bujtas <zalan@apple.com> [LFC][BCF] Add support for block level non-replaced inflow height percentage https://bugs.webkit.org/show_bug.cgi?id=191229 Reviewed by Antti Koivisto. Test: fast/block/basic/child-block-level-box-with-height-percent.html * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::computedHeightValue): (WebCore::Layout::computedHeightValue): Deleted. * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): 2018-11-04 Youenn Fablet <youenn@apple.com> RealtimeOutgoingAudioSource should use DestructionThread::Main https://bugs.webkit.org/show_bug.cgi?id=191230 Reviewed by Eric Carlson. Covered by imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-setRemoteDescription-replaceTrack.https.html that should no longer crash in debug. * platform/mediastream/RealtimeOutgoingAudioSource.h: 2018-11-04 Youenn Fablet <youenn@apple.com> IDB should allow storing RTCCertificate https://bugs.webkit.org/show_bug.cgi?id=191077 Reviewed by Chris Dumez. Add support for serialization/deserialization of RTCCertificate. Store the origin in RTCCertificate and make sure that a certificate with a different origin cannot be used to create a RTCPeerConnection. Test: imported/w3c/web-platform-tests/webrtc/RTCCertificate-postMessage.html * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::generateCertificate): * Modules/mediastream/RTCCertificate.cpp: (WebCore::RTCCertificate::create): (WebCore::RTCCertificate::RTCCertificate): * Modules/mediastream/RTCCertificate.h: (WebCore::RTCCertificate::origin const): * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::certificatesFromConfiguration): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback): (WebCore::LibWebRTCCertificateGenerator::generateCertificate): * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h: * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneSerializer::dumpIfTerminal): (WebCore::CloneDeserializer::CachedString::takeString): (WebCore::CloneDeserializer::readRTCCertificate): (WebCore::CloneDeserializer::readTerminal): 2018-11-04 Youenn Fablet <youenn@apple.com> Add support for RTCMuxPolicy https://bugs.webkit.org/show_bug.cgi?id=191188 Reviewed by Eric Carlson. Add support for RTCMuxPolicy dictionary option for both constructor and setConfiguration. Make sure setConfiguration throws if trying to change this policy. Pipe this parameter up to libwebrtc. Covered by rebased test. * Modules/mediastream/RTCConfiguration.h: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::iceServersFromConfiguration): (WebCore::RTCPeerConnection::initializeConfiguration): (WebCore::RTCPeerConnection::setConfiguration): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::rtcpMuxPolicyfromConfiguration): (WebCore::configurationFromMediaEndpointConfiguration): * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/MediaEndpointConfiguration.cpp: (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration): * platform/mediastream/MediaEndpointConfiguration.h: * platform/mediastream/RTCPMuxPolicy.h: Added. 2018-11-03 Devin Rousso <drousso@apple.com> Web Inspector: Canvas: capture changes to <canvas> that would affect the recorded context https://bugs.webkit.org/show_bug.cgi?id=190854 Reviewed by Matt Baker. Updated existing tests: inspector/canvas/recording-2d.html inspector/canvas/recording-bitmaprenderer.html inspector/canvas/recording-webgl.html * html/HTMLCanvasElement.idl: Apply `CallTracingCallback=recordCanvasAction` to the `width` and `height` attributes so that they are recorded through the same path as `CanvasRenderingContext`. * html/CanvasBase.h: * html/CanvasBase.cpp: (WebCore::CanvasBase::callTracingActive const): Added. * bindings/js/CallTracer.h: * bindings/js/CallTracer.cpp: (WebCore::CallTracer::recordCanvasAction): 2018-11-03 Andy Estes <aestes@apple.com> [Payment Request] PaymentResponse.retry()'s errorFields should be optional https://bugs.webkit.org/show_bug.cgi?id=191212 Reviewed by Youenn Fablet. Per WebIDL, the errorFields argument to PaymentResponse.retry() should be optional. See <https://github.com/w3c/payment-request/issues/804> for details. Added test case to http/tests/paymentrequest/payment-response-retry-method.https.html. * Modules/paymentrequest/PaymentResponse.idl: 2018-11-02 Zalan Bujtas <zalan@apple.com> [LFC][BFC] Resolve percentage height values. https://bugs.webkit.org/show_bug.cgi?id=191224 Reviewed by Antti Koivisto. 10.5 Content height: the 'height' property The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the used height is calculated as if 'auto' was specified. https://www.w3.org/TR/CSS22/visudet.html#propdef-height Test: fast/block/basic/height-percentage-simple.html * layout/FormattingContextGeometry.cpp: (WebCore::Layout::isHeightAuto): (WebCore::Layout::computedHeightValue): (WebCore::Layout::contentHeightForFormattingContextRoot): (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight): (WebCore::Layout::FormattingContext::Geometry::computedMinHeight): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): 2018-11-03 Eric Carlson <eric.carlson@apple.com> [MediaStream] enumerateDevices should not expose devices that are not available to getUserMedia https://bugs.webkit.org/show_bug.cgi?id=191177 <rdar://problem/45747873> Reviewed by Jer Noble. Test: http/tests/media/media-stream/enumerate-devices-iframe-allow-attribute.html * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): Only expose devices that are available to gUM. * Modules/mediastream/UserMediaController.cpp: (WebCore::isSecure): Moved from UserMediaRequest.cpp. (WebCore::isAllowedToUse): Ditto. (WebCore::UserMediaController::canCallGetUserMedia): Modified from UserMediaRequest.cpp. (WebCore::UserMediaController::logGetUserMediaDenial): Log reason for denial. * Modules/mediastream/UserMediaController.h: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::start): Use UserMediaController::canCallGetUserMedia. (WebCore::isSecure): Deleted. (WebCore::isAllowedToUse): Deleted. (WebCore::canCallGetUserMedia): Deleted. 2018-11-02 Justin Michaud <justin_michaud@apple.com> Add new global object and preliminary Worklets support for CSS painting api https://bugs.webkit.org/show_bug.cgi?id=190979 Reviewed by Chris Dumez. Test: fast/css-custom-paint/worklet.html Add a new ScriptExecutionContext and global object to run worklets in. This is mostly copy+paste from Workers, but without any of the threading. Worklet.addModule does not yet support loading scripts or doing cross origin checking. There are quite a few parts of the ScriptExecutionContext api that are left as ASSERT_NOT_REACHED(). * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSDOMGlobalObject.cpp: (WebCore::JSDOMGlobalObject::scriptExecutionContext const): * bindings/js/JSPaintWorkletGlobalScopeCustom.cpp: Renamed from Source/WebCore/bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp. (WebCore::JSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSPaintWorkletGlobalScope::registerPaint): * bindings/js/JSWorkletGlobalScopeBase.cpp: Added. (WebCore::JSWorkletGlobalScopeBase::JSWorkletGlobalScopeBase): (WebCore::JSWorkletGlobalScopeBase::finishCreation): (WebCore::JSWorkletGlobalScopeBase::clearDOMGuardedObjects): (WebCore::JSWorkletGlobalScopeBase::visitChildren): (WebCore::JSWorkletGlobalScopeBase::destroy): (WebCore::JSWorkletGlobalScopeBase::scriptExecutionContext const): (WebCore::JSWorkletGlobalScopeBase::supportsRichSourceInfo): (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScript): (WebCore::JSWorkletGlobalScopeBase::shouldInterruptScriptBeforeTimeout): (WebCore::JSWorkletGlobalScopeBase::javaScriptRuntimeFlags): (WebCore::toJS): (WebCore::toJSWorkletGlobalScope): * bindings/js/JSWorkletGlobalScopeBase.h: Added. (WebCore::JSWorkletGlobalScopeBase::wrapped const): (WebCore::JSWorkletGlobalScopeBase::proxy const): (WebCore::JSWorkletGlobalScopeBase::createStructure): (WebCore::toJS): * bindings/js/ScriptState.cpp: (WebCore::execStateFromWorkerGlobalScope): (WebCore::execStateFromWorkletGlobalScope): * bindings/js/ScriptState.h: * bindings/js/WebCoreBuiltinNames.h: * bindings/scripts/CodeGeneratorJS.pm: (IsDOMGlobalObject): (ShouldUseGlobalObjectPrototype): (GenerateHeader): (GenerateRuntimeEnableConditionalStringForExposed): (GenerateImplementation): * bindings/scripts/preprocess-idls.pl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/DOMCSSPaintWorklet.cpp: (WebCore::DOMCSSPaintWorklet::ensurePaintWorklet): (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): Deleted. * css/DOMCSSPaintWorklet.h: * css/DOMCSSPaintWorklet.idl: * dom/Document.cpp: (WebCore::Document::ensureCSSPaintWorklet): (WebCore::Document::setCSSPaintWorkletGlobalScope): (WebCore::Document::ensureCSSPaintWorkletGlobalScope): Deleted. * dom/Document.h: (WebCore::Document::getCSSPaintWorkletGlobalScope): * dom/EventTargetFactory.in: * dom/ScriptExecutionContext.cpp: (WebCore::ScriptExecutionContext::vm): (WebCore::ScriptExecutionContext::execState): * dom/ScriptExecutionContext.h: (WebCore::ScriptExecutionContext::isWorkletGlobalScope const): * inspector/agents/worker/WorkerDebuggerAgent.cpp: (WebCore::WorkerDebuggerAgent::injectedScriptForEval): * inspector/agents/worker/WorkerRuntimeAgent.cpp: (WebCore::WorkerRuntimeAgent::injectedScriptForEval): * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): * platform/graphics/CustomPaintImage.h: * worklets/PaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp. (WebCore::PaintWorkletGlobalScope::create): (WebCore::PaintWorkletGlobalScope::PaintWorkletGlobalScope): (WebCore::PaintWorkletGlobalScope::devicePixelRatio): (WebCore::PaintWorkletGlobalScope::addRegisteredPaint): * worklets/PaintWorkletGlobalScope.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.h. * worklets/PaintWorkletGlobalScope.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl. * worklets/Worklet.cpp: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp. (WebCore::Worklet::create): (WebCore::Worklet::Worklet): (WebCore::Worklet::addModule): * worklets/Worklet.h: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.cpp. * worklets/Worklet.idl: Copied from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl. * worklets/WorkletConsoleClient.cpp: Copied from Source/WebCore/inspector/agents/worker/WorkerDebuggerAgent.cpp. (WebCore::WorkletConsoleClient::WorkletConsoleClient): (WebCore::WorkletConsoleClient::messageWithTypeAndLevel): (WebCore::WorkletConsoleClient::count): (WebCore::WorkletConsoleClient::time): (WebCore::WorkletConsoleClient::timeEnd): (WebCore::WorkletConsoleClient::profile): (WebCore::WorkletConsoleClient::profileEnd): (WebCore::WorkletConsoleClient::takeHeapSnapshot): (WebCore::WorkletConsoleClient::timeStamp): (WebCore::WorkletConsoleClient::record): (WebCore::WorkletConsoleClient::recordEnd): * worklets/WorkletConsoleClient.h: Added. * worklets/WorkletGlobalScope.cpp: Added. (WebCore::WorkletGlobalScope::WorkletGlobalScope): (WebCore::WorkletGlobalScope::~WorkletGlobalScope): (WebCore::WorkletGlobalScope::evaluate): (WebCore::WorkletGlobalScope::isJSExecutionForbidden const): (WebCore::WorkletGlobalScope::disableEval): (WebCore::WorkletGlobalScope::disableWebAssembly): (WebCore::WorkletGlobalScope::completeURL const): (WebCore::WorkletGlobalScope::logExceptionToConsole): (WebCore::WorkletGlobalScope::addConsoleMessage): (WebCore::WorkletGlobalScope::addMessage): * worklets/WorkletGlobalScope.h: Added. (WebCore::WorkletGlobalScope::isPaintWorkletGlobalScope const): (WebCore::WorkletGlobalScope::identifier const): (WebCore::WorkletGlobalScope::script): (WebCore::WorkletGlobalScope::jsRuntimeFlags const): (isType): * worklets/WorkletGlobalScope.idl: Renamed from Source/WebCore/css/CSSPaintWorkletGlobalScope.idl. * worklets/WorkletScriptController.cpp: Added. (WebCore::WorkletScriptController::WorkletScriptController): (WebCore::WorkletScriptController::~WorkletScriptController): (WebCore::WorkletScriptController::forbidExecution): (WebCore::WorkletScriptController::isExecutionForbidden const): (WebCore::WorkletScriptController::disableEval): (WebCore::WorkletScriptController::disableWebAssembly): (WebCore::WorkletScriptController::initScriptWithSubclass): (WebCore::WorkletScriptController::initScript): (WebCore::WorkletScriptController::evaluate): (WebCore::WorkletScriptController::setException): * worklets/WorkletScriptController.h: Added. (WebCore::WorkletScriptController::workletGlobalScopeWrapper): (WebCore::WorkletScriptController::vm): (WebCore::WorkletScriptController::initScriptIfNeeded): 2018-11-02 Myles C. Maxfield <mmaxfield@apple.com> Clean up drawLineForDocumentMarker() https://bugs.webkit.org/show_bug.cgi?id=191215 Reviewed by Zalan Bujtas. In preparation for https://bugs.webkit.org/show_bug.cgi?id=190764, I need to do a little bit of refactoring. This patch has no behavior change; it just does the following: 1. Renames drawLineForDocumentMarker() to drawDotsForDocumentMarker(), because 2 of the 3 implementations draw dots 2. Moves our implementation back into GraphicsContext, because it's simpler and GraphicsContext is already platform- specific. 3. The signature used to accept a location and a width, but without a height, it's difficult to know what the bounding box is. In particular, knowing the bounding box must be possible without a GraphicsContext. So, I've modified the signature to accept a rectangle instead. The GraphicsContext draws only within this rectangle. No new tests because there is no behavior change. * platform/graphics/GraphicsContext.h: * platform/graphics/GraphicsContextImpl.h: * platform/graphics/cairo/CairoOperations.cpp: (WebCore::Cairo::drawDotsForDocumentMarker): (WebCore::Cairo::drawLineForDocumentMarker): Deleted. * platform/graphics/cairo/CairoOperations.h: * platform/graphics/cairo/GraphicsContextCairo.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted. * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::drawDotsForDocumentMarker): (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker): Deleted. * platform/graphics/cairo/GraphicsContextImplCairo.h: * platform/graphics/cocoa/FontCascadeCocoa.mm: * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::colorForMarkerLineStyle): (WebCore::GraphicsContext::drawDotsForDocumentMarker): (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted. * platform/graphics/displaylists/DisplayListItems.cpp: (WebCore::DisplayList::Item::sizeInBytes): (WebCore::DisplayList::DrawDotsForDocumentMarker::apply const): (WebCore::DisplayList::DrawDotsForDocumentMarker::localBounds const): (WebCore::DisplayList::operator<<): (WebCore::DisplayList::DrawLineForDocumentMarker::apply const): Deleted. (WebCore::DisplayList::DrawLineForDocumentMarker::localBounds const): Deleted. * platform/graphics/displaylists/DisplayListItems.h: (WebCore::DisplayList::DrawDotsForDocumentMarker::create): (WebCore::DisplayList::DrawDotsForDocumentMarker::rect const): (WebCore::DisplayList::DrawDotsForDocumentMarker::DrawDotsForDocumentMarker): (WebCore::DisplayList::DrawLineForDocumentMarker::create): Deleted. (WebCore::DisplayList::DrawLineForDocumentMarker::point const): Deleted. (WebCore::DisplayList::DrawLineForDocumentMarker::width const): Deleted. (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker): Deleted. * platform/graphics/displaylists/DisplayListRecorder.cpp: (WebCore::DisplayList::Recorder::drawDotsForDocumentMarker): (WebCore::DisplayList::Recorder::drawLineForDocumentMarker): Deleted. * platform/graphics/displaylists/DisplayListRecorder.h: * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp: (Nicosia::CairoOperationRecorder::drawDotsForDocumentMarker): (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker): Deleted. * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h: * platform/graphics/win/GraphicsContextCGWin.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted. * platform/graphics/win/GraphicsContextDirect2D.cpp: (WebCore::GraphicsContext::drawDotsForDocumentMarker): (WebCore::GraphicsContext::drawLineForDocumentMarker): Deleted. * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintPlatformDocumentMarker): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::drawLineForDocumentMarker): Deleted. * rendering/RenderTheme.h: * rendering/RenderThemeCocoa.h: * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Deleted. * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Deleted. * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::colorForMarkerLineStyle): Deleted. 2018-11-02 Ali Juma <ajuma@chromium.org> requestAnimationFrame causes bad location of position:fixed inside overflow:auto and iframe https://bugs.webkit.org/show_bug.cgi?id=176243 Reviewed by Simon Fraser. When a new layer tree is committed to the UIProcess, the positions of layers for fixed or sticky nodes in the newly-committed tree can be stale, because of scrolling that has happened in the UIProcess since the tree was updated in the WebProcess. To handle this, RemoteLayerTreeDrawingAreaProxy::commitLayerTree updates the positions of these layers by calling RemoteScrollingCoordinatorProxy::viewportChangedViaDelegatedScrolling, which leads to a recursive traversal of the ScrollingTree to update each such layer. However, since ScrollingTreeFrameScrollingNodeIOS didn't implement updateLayersAfterAncestorChange, this traversal never descended into scrolling nodes within an iframe, so the layers for these nodes were left with stale positions. Implement ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange so that fixed and sticky layers within an iframe do get their positions updated when a new layer tree is committed. * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: (WebCore::ScrollingTreeFrameScrollingNodeIOS::updateLayersAfterAncestorChange): 2018-11-02 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Changing view scale sometimes does not zoom the page to the new initial scale, when the page is at initial scale https://bugs.webkit.org/show_bug.cgi?id=191180 <rdar://problem/45744786> Reviewed by Simon Fraser. When computing the minimum scale in ViewportConfiguration::minimumScale, if our content width or height is shorter than the view width or height, then we recompute the minimum scale such that the content dimensions will fill the bounds of the view by setting the minimum scale to the view width or height divided by the content width or height. Suppose the minimum scale is equal to some value `s`; additionally, let `w_c` denote the content width and `w_v` denote the view width (as integers). If `w_v / s` is not an integral value, the computed content width `w_c` may be rounded, such that `w_v / w_c` is not precisely equal to `s`. In the case that `w_v / w_c` is ever so slightly larger than `s`, we will end up overriding the minimum scale `s` with `w_v / w_c`. As a result, specifying a viewport with a decimal `minimum-scale` will sometimes cause the computed minimum scale of the viewport (and platform view) to be very slightly different from the minimum scale. The new layout test below exercises this scenario, specifying a viewport with minimum and initial scales of 0.94 that results in `ViewportConfiguration::minimumScale` returning 0.94158. With the `WebPage::setViewportConfigurationViewLayoutSize` check added in r237127, this means setting `_viewScale:` when the page is at initial scale sometimes doesn't zoom the page to the new initial scale when it should, since the page scale factor and the initial scale are different enough such that `areEssentiallyEqualAsFloat` returns false. This patch addresses these issues by snapping to the minimum scale if the computed scale that fits content dimensions to view dimensions results in a minimum scale that is close enough to the configuration's minimum scale, such that the difference can be attributed to rounding error when computing content or view dimensions. Test: fast/viewport/ios/viewport-minimum-and-initial-scale.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::minimumScale const): 2018-11-02 Philippe Normand <pnormand@igalia.com> [GTK][WPE] Unreviewed, another --no-video --no-web-audio build fix following r237677 * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::addEventListenersToNode): 2018-11-02 Daniel Bates <dabates@apple.com> [iOS] Normalize character string based on key code https://bugs.webkit.org/show_bug.cgi?id=191120 Reviewed by Tim Horton. Following r236417 (https://bugs.webkit.org/show_bug.cgi?id=189604) we always have a valid key code for a special key (e.g. page up) and can simplify the character string normalization code. No functionality changed. So, no new tests. * platform/ios/WebEvent.mm: (normalizedStringWithAppKitCompatibilityMapping): Modified to take a key code and wrote algorithm in terms of it. (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): Pass the key code for the event to normalizedStringWithAppKitCompatibilityMapping(). 2018-11-02 Daniel Bates <dabates@apple.com> [iOS] WebKit should dispatch DOM events when a modifier key is pressed https://bugs.webkit.org/show_bug.cgi?id=190487 Reviewed by Tim Horton. Add support for modifier flags change events. * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::modifiersForEvent): Modifier keys do not have an associated character and do not participate in key repeat. (WebCore::keyIdentifierForKeyEvent): Identify modifier keys, returning "Unidentified" if the modifier key is unidentified. This matches the behavior on Mac. (WebCore::keyForKeyEvent): Identify modifier keys, returning the empty string if the modifier key is unidentified. This matches the behavior on Mac. (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): Modifier keys do not have an associated character and do not participate in key repeat. (-[WebEvent _eventDescription]): Modified to print a description for a keydown or keyup event that represents a modifier flags change. (-[WebEvent characters]): Modifier keys do not have an associated character. Assert this invariant as it is a programming error. On Mac, the same operation would result in a NSInternalInconsistencyException exception being raised. (-[WebEvent charactersIgnoringModifiers]): Ditto. 2018-11-02 Ali Juma <ajuma@chromium.org> Allow cross-document intersection observing https://bugs.webkit.org/show_bug.cgi?id=165746 Reviewed by Simon Fraser. Add logic to compute the intersection between the viewport and an element in a subframe. Add a FloatRect version of ScrollView::rootViewToContents, and FloatRect versions of the methods it calls. Test: http/tests/intersection-observer/intermediate-frame-changes.html Also covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer. * dom/Document.cpp: (WebCore::computeClippedRectInRootContentsSpace): (WebCore::computeIntersectionState): (WebCore::Document::updateIntersectionObservations): * page/FrameView.cpp: (WebCore::FrameView::viewportContentsChanged): (WebCore::FrameView::convertFromContainingViewToRenderer const): (WebCore::FrameView::convertFromContainingView const): * page/FrameView.h: * platform/ScrollView.cpp: (WebCore::ScrollView::viewToContents const): (WebCore::ScrollView::contentsToView const): (WebCore::ScrollView::rootViewToContents const): * platform/ScrollView.h: * platform/Widget.cpp: (WebCore::Widget::convertFromRootView const): (WebCore::Widget::convertFromContainingView const): * platform/Widget.h: 2018-11-02 Rob Buis <rbuis@igalia.com> Remove ENABLE_OPENCL fully https://bugs.webkit.org/show_bug.cgi?id=191172 Reviewed by Yusuke Suzuki. No new tests since no change in functionality. * platform/graphics/filters/FilterEffect.h: (WebCore::FilterEffect::hasResult const): (WebCore::FilterEffect::applyAll): (WebCore::FilterEffect::openCLImage): Deleted. (WebCore::FilterEffect::setOpenCLImage): Deleted. 2018-11-02 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for intrinsic width calculation https://bugs.webkit.org/show_bug.cgi?id=191144 Reviewed by Antti Koivisto. This is the inline formatting version of the shrink-to-fit computation. It generates inline runs and uses InlineLineBreaker to compute min/max width. This is very similar to ::layout. Test: fast/inline/simple-shrink-to-fit-inline-block.html * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::InlineFormattingContext::computeWidthAndMargin const): (WebCore::Layout::InlineFormattingContext::computeHeightAndMargin const): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForReplacedInlineBox const): (WebCore::Layout::InlineFormattingContext::collectInlineContent const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: 2018-11-02 Zalan Bujtas <zalan@apple.com> [LFC][BFC] BlockFormattingContext::instrinsicWidthConstraints logic should look similar to ::layout https://bugs.webkit.org/show_bug.cgi?id=191181 Reviewed by Antti Koivisto. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): 2018-11-02 Zalan Bujtas <zalan@apple.com> [LFC] Align shrink-to-fit width computation with the layout implementation. https://bugs.webkit.org/show_bug.cgi?id=191179 Reviewed by Antti Koivisto. There are many similarities between layout and shrink-to-fit. They both operate on formatting roots only (shrink-to-fit -> float, out-of-flow, inline-block) and in both cases the algoritm depends on what type of formatting context the element establishes. This patch is in preparation for transforming the "shrink-to-fit" width computation to make it behave more like layout. With this change the instrinsicWidthConstraints() computation happens in the formatting context that the element establishes (similar to layout). * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/blockformatting/BlockFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): 2018-11-01 Antoine Quint <graouts@apple.com> [Web Animations] Make document.getAnimations() return declarative animations in the correct order https://bugs.webkit.org/show_bug.cgi?id=191153 Reviewed by Dean Jackson. The Web Animations spec has the notion of "composite order" which determines the order in which animations should be returned when document.getAnimations() is called. The CSS Transitions and CSS Animations specifications also determine the composite order of their respective animation classes, as well as the notion of "owning element", the element that was the animation target when specified through style, prior to any manipulation via the Web Animations API. We implement these two notions so that we can pass the document.getAnimations() tests for declarative animations. It is important that we have the notion of an "owning element" since when a CSS Transition or CSS Animation is modified via the Web Animations API in a way that an animation created through CSS we must consider no longer as a declarative animation but as a regular Web Animation. In this patch, we remove the DeclarativeAnimation's target(), which returned a reference, to owningElement(), which returns a pointer and return nullptr once the declarative animation has been modified. In order to also keep a correct count of declarative animations applied to elements, we correctly add transitions that have completed to a list of completed transitions, as specified by the CSS Transitions spec. We have had this list declared in AnimationTimeline.h for a while but never actually did the work to add items to it. Thanks to that, AnimationTimeline::updateCSSTransitionsForElement() now correctly accounts for completed transitions so that they may be canceled if overridden with a new animation, correctly removing their "owning element". Finally, now that we have saner lists of animations per classes, we can apply the right sorting routines to match the composite order for CSS Transitions, CSS Animations and Web Animations, keeping a list of all animations created in order as the final criterion for sorting. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::animationTimingDidChange): Make sure this animation is tracked on the list of all animations created for this timeline in the order in which they were created, which is needed to sort animations correctly when document.getAnimations() is called. (WebCore::AnimationTimeline::animationWasAddedToElement): We've removed the relevantMapForAnimation() method which we used to determine which map we should add an animation to based on its class and instead have code that accounts for not just the animation's class, but also whether it has an owning element since a valid owning element is required to qualify as a CSS Transition or CSS Animation, regardless of the animation's original class. (WebCore::removeAnimationFromMapForElement): Adding this helper to remove an animation from the provided animation map so that animationWasRemovedFromElement() can call this with all of the various animation maps. (WebCore::AnimationTimeline::animationWasRemovedFromElement): Check all of the various animation maps to see which may contain the animation we're trying to remove as the owning element might have been cleared by the time this function is called and looking at the animation's class would not be sufficient to determine which animation map the animation was in. (WebCore::AnimationTimeline::removeDeclarativeAnimationFromListsForOwningElement): New function in which the logic from animationWasRemovedFromElement() that dealt with removing animations from the list of running CSS Animations/Transitions as well as completed CSS Transitions was factored out. This allowed us to also call this function from DeclarativeAnimation::disassociateFromOwningElement(). (WebCore::AnimationTimeline::elementWasRemoved): We no longer need to remove an animation as canceling it will remove it correctly when DocumentTimeline::updateAnimationsAndSendEvents() is called. (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Call cancelDeclarativeAnimation() instead of the removed cancelOrRemoveDeclarativeAnimation() when a CSS Animation should be canceled. (WebCore::AnimationTimeline::ensureRunningTransitionsByProperty): Now that we correctly remove transitions from the list of running transitions once they've completed or have been canceled, we need a helper to always get a valid map of running transitions for a given element as that map can be cleared while updateCSSTransitionsForElement() is running. (WebCore::AnimationTimeline::updateCSSTransitionsForElement): Call cancelDeclarativeAnimation() instead of the removed cancelOrRemoveDeclarativeAnimation() when a CSS Transition should be canceled. Additionally we always get the list of running transitions for a given element as it can be cleared by a prior cancelation. (WebCore::AnimationTimeline::cancelDeclarativeAnimation): New function replacing cancelOrRemoveDeclarativeAnimation() in which we call the new DeclarativeAnimation::cancelFromStyle() function on the provided animation and then remove the animation from all known lists, including the new list of all animations. We do this final part so that the animation gets re-added as if it were a new animation since canceling a declarative animation via a style change removes its declarative-ness. This guarantees that a declarative animation that is canceled through style but then resumed through the Web Animations API sorts after any declarative animation with an owning element. (WebCore::AnimationTimeline::relevantMapForAnimation): Deleted. (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): Deleted. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::timingModelDidChange): Deleted. This was left over in the patch where we implemented the "update animations and send events" procedure. (WebCore::AnimationTimeline::animations const): Deleted. * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::create): Some refactoring to make the handling of a declarative animation's owning element part of the DeclarativeAnimation constructor. * animation/CSSTransition.cpp: (WebCore::CSSTransition::create): Some refactoring to make the handling of a declarative animation's owning element part of the DeclarativeAnimation constructor. * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::DeclarativeAnimation): (WebCore::DeclarativeAnimation::tick): Make sure we disassociate from the animation's owning element once we transition from a relevant state to an idle state. This will catch any changes made via the Web Animations API to a declarative animation when the "update animations and send events" procedure is run. (WebCore::DeclarativeAnimation::disassociateFromOwningElement): Remove this animation from the list of declarative animations on the associated timeline and make owningElement() nullptr so that document.getAnimations() will know to sort this animation with other Web Animations created via the Web Animations API. (WebCore::DeclarativeAnimation::initialize): (WebCore::DeclarativeAnimation::cancelFromStyle): New method called from AnimationTimeline::cancelDeclarativeAnimation() which cancels the animation but also disassociates it from its owning element. (WebCore::DeclarativeAnimation::invalidateDOMEvents): (WebCore::DeclarativeAnimation::enqueueDOMEvent): * animation/DeclarativeAnimation.h: (WebCore::DeclarativeAnimation::owningElement const): (WebCore::DeclarativeAnimation::target const): Deleted. * animation/DocumentTimeline.cpp: (WebCore::compareDeclarativeAnimationOwningElementPositionsInDocumentTreeOrder): Adding a new utility used when sorting both CSS Transitions and CSS Animations by tree order when their owning element differ, with special logic for pseudo-elements. (WebCore::DocumentTimeline::getAnimations const): Filter and sort animations according to their composite order. (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Compile a list of transitions that move to a finished state to the list of completed transitions so that they may be canceled correctly in AnimationTimeline::updateCSSTransitionsForElement(). (WebCore::DocumentTimeline::transitionDidComplete): * animation/DocumentTimeline.h: 2018-11-02 Zan Dobersek <zdobersek@igalia.com> PNGImageDecoder: report no repetition for non-animated images https://bugs.webkit.org/show_bug.cgi?id=191068 Reviewed by Michael Catanzaro. When building with APNG support enabled, the PNGImageDecoder::repetitionCount() method until now reported infinite repetition count for all PNG images, even the ones that were not animated. This is now changed so that no repetition is reported for non-animated images. * platform/image-decoders/png/PNGImageDecoder.cpp: (WebCore::PNGImageDecoder::repetitionCount const): 2018-11-02 Justin Fan <justin_fan@apple.com> [WebGPU] Experimental prototype for MSL shaders https://bugs.webkit.org/show_bug.cgi?id=191084 Reviewed by Dean Jackson. Begin implementation for WebGPUDevice and WebGPUShaderModule and associated descriptor objects. Test: webgpu/webgpu-basics.html Test: webgpu/shader-modules.html * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/GPUDevice.cpp: (WebCore::GPUDevice::createShaderModule const): * Modules/webgpu/GPUDevice.h: (WebCore::GPUDevice::platformDevice const): * Modules/webgpu/GPUShaderModule.h: (WebCore::GPUShaderModule::platformShaderModule const): * Modules/webgpu/GPUShaderModuleDescriptor.h: * Modules/webgpu/WebGPU.cpp: (WebCore::WebGPU::requestAdapter const): * Modules/webgpu/WebGPUAdapter.cpp: (WebCore::WebGPUAdapter::create): (WebCore::WebGPUAdapter::createDevice): * Modules/webgpu/WebGPUAdapter.h: * Modules/webgpu/WebGPUAdapter.idl: * Modules/webgpu/WebGPUDevice.cpp: (WebCore::WebGPUDevice::create): (WebCore::WebGPUDevice::WebGPUDevice): (WebCore::WebGPUDevice::createShaderModule const): * Modules/webgpu/WebGPUDevice.h: * Modules/webgpu/WebGPUDevice.idl: * Modules/webgpu/WebGPUShaderModule.cpp: (WebCore::WebGPUShaderModule::create): (WebCore::WebGPUShaderModule::WebGPUShaderModule): * Modules/webgpu/WebGPUShaderModule.h: * Modules/webgpu/WebGPUShaderModule.idl: * Modules/webgpu/WebGPUShaderModuleDescriptor.h: * Modules/webgpu/WebGPUShaderModuleDescriptor.idl: * Modules/webgpu/WebGPUSwapChain.cpp: (WebCore::WebGPUSwapChain::configure): * Modules/webgpu/WebGPUSwapChain.h: * Modules/webgpu/WebGPUSwapChain.idl: * Modules/webgpu/cocoa/GPUDeviceMetal.mm: (WebCore::GPUDevice::create): (WebCore::GPUDevice::GPUDevice): * Modules/webgpu/cocoa/GPUShaderModuleMetal.mm: (WebCore::GPUShaderModule::create): (WebCore::GPUShaderModule::GPUShaderModule): * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * platform/Logging.h: 2018-11-01 Jiewen Tan <jiewen_tan@apple.com> Replace CommonRandom SPI with API https://bugs.webkit.org/show_bug.cgi?id=191178 <rdar://problem/45722391> Reviewed by Brent Fulgham. The API is available since macOS 10.10 and iOS 10, and therefore it is safe to replace all SPI usages with API. No change of behaviors. * crypto/CommonCryptoUtilities.h: * crypto/mac/CryptoKeyMac.cpp: (WebCore::CryptoKey::randomData): * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::createAndStoreMasterKey): (WebCore::wrapSerializedCryptoKey): * page/Crypto.cpp: (WebCore::Crypto::getRandomValues): 2018-11-01 Chris Dumez <cdumez@apple.com> [WebIDL] Rename CallWith=ScriptState to CallWith=ExecState https://bugs.webkit.org/show_bug.cgi?id=191162 Reviewed by Alex Christensen. Rename CallWith=ScriptState to CallWith=ExecState in our Web IDL as ScriptState is no longer a thing in modern WebKit. The implementation is actually passed an ExecState nowadays. * Modules/applepay/ApplePaySession.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/fetch/FetchBody.idl: * Modules/indexeddb/IDBCursor.idl: * Modules/indexeddb/IDBFactory.idl: * Modules/indexeddb/IDBIndex.idl: * Modules/indexeddb/IDBKeyRange.idl: * Modules/indexeddb/IDBObjectStore.idl: * Modules/mediastream/RTCPeerConnection.idl: * animation/Animatable.idl: * animation/KeyframeEffect.idl: * animation/KeyframeEffectReadOnly.idl: * bindings/scripts/CodeGeneratorJS.pm: (GenerateCallWith): (GenerateConstructorDefinition): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjWithExecStateAttributeGetter): (WebCore::jsTestObjWithExecStateAttribute): (WebCore::setJSTestObjWithExecStateAttributeSetter): (WebCore::setJSTestObjWithExecStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttributeGetter): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateAttribute): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttributeSetter): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateAttribute): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeGetter): (WebCore::jsTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttributeSetter): (WebCore::setJSTestObjWithScriptExecutionContextAndExecStateWithSpacesAttribute): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoid): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateObj): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateVoidException): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithExecStateObjException): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecState): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjExceptionBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateObjException): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpacesBody): (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndExecStateWithSpaces): (WebCore::jsTestObjWithScriptStateAttributeGetter): Deleted. (WebCore::jsTestObjWithScriptStateAttribute): Deleted. (WebCore::setJSTestObjWithScriptStateAttributeSetter): Deleted. (WebCore::setJSTestObjWithScriptStateAttribute): Deleted. (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttributeGetter): Deleted. (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted. (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttributeSetter): Deleted. (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateAttribute): Deleted. (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeGetter): Deleted. (WebCore::jsTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted. (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttributeSetter): Deleted. (WebCore::setJSTestObjWithScriptExecutionContextAndScriptStateWithSpacesAttribute): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoid): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateObj): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidExceptionBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateVoidException): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjExceptionBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptStateObjException): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptState): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjExceptionBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateObjException): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpacesBody): Deleted. (WebCore::jsTestObjPrototypeFunctionWithScriptExecutionContextAndScriptStateWithSpaces): Deleted. * bindings/scripts/test/TestObj.idl: * bindings/scripts/test/TestPromiseRejectionEvent.idl: * crypto/SubtleCrypto.idl: * dom/Element.idl: * dom/ErrorEvent.idl: * dom/MessagePort.idl: * dom/MouseEvent.idl: * html/HTMLCanvasElement.idl: * html/HTMLFrameElement.idl: * html/OffscreenCanvas.idl: * html/track/DataCue.idl: * inspector/CommandLineAPIHost.idl: * page/DOMWindow.idl: * page/RemoteDOMWindow.idl: * page/WindowOrWorkerGlobalScope.idl: * testing/Internals.idl: * workers/DedicatedWorkerGlobalScope.idl: * workers/Worker.idl: 2018-11-01 Fujii Hironori <Hironori.Fujii@sony.com> Rename <wtf/unicode/UTF8.h> to <wtf/unicode/UTF8Conversion.h> in order to avoid conflicting with ICU's unicode/utf8.h https://bugs.webkit.org/show_bug.cgi?id=189693 Reviewed by Yusuke Suzuki. No new tests because there's no behaviro changes. * platform/SharedBuffer.cpp: Replaced <wtf/unicode/UTF8.h> with <wtf/unicode/UTF8Conversion.h>. * xml/XSLTProcessorLibxslt.cpp: Ditto. * xml/parser/XMLDocumentParserLibxml2.cpp: Ditto. 2018-11-01 John Wilander <wilander@apple.com> In WebCore::ResourceLoadObserver, use document.sessionID().isEphemeral() when possible and check for page existence when not https://bugs.webkit.org/show_bug.cgi?id=191119 <rdar://problem/44176965> Reviewed by Chris Dumez. New API test added. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logSubresourceLoading): (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): 2018-11-01 Devin Rousso <drousso@apple.com> Web Inspector: Network: remove unnecessary media event tracking https://bugs.webkit.org/show_bug.cgi?id=191174 Reviewed by Joseph Pecoraro. No new tests, as this simply removes some event listeners for the WebInspector frontend. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::addEventListenersToNode): 2018-11-01 Chris Dumez <cdumez@apple.com> Location object sans browsing context https://bugs.webkit.org/show_bug.cgi?id=191060 Reviewed by Geoffrey Garen. As per https://github.com/whatwg/html/pull/4076, a Location object's URL should be "about:blank" when it does not have a browsing context (Frame), not "". No new tests, rebaselined existing tests. * page/Location.cpp: (WebCore::Location::url const): (WebCore::Location::href const): (WebCore::Location::protocol const): (WebCore::Location::host const): (WebCore::Location::hostname const): (WebCore::Location::port const): (WebCore::Location::pathname const): (WebCore::Location::search const): (WebCore::Location::origin const): (WebCore::Location::hash const): 2018-11-01 Sihui Liu <sihui_liu@apple.com> Add a storage limit for IndexedDB https://bugs.webkit.org/show_bug.cgi?id=190598 <rdar://problem/44654715> Reviewed by Chris Dumez. Set a storage limit in IndexedDB for each pair of mainFrameOrigin and openingOrigin. IndexedDB will return a QuotaExceededError if limit is reached. If the size of free disk space is over 1 GB, the default limit is 500 MB; otherwise it is half the free disk space. Test: storage/indexeddb/storage-limit.html * Modules/indexeddb/server/IDBBackingStore.h: * Modules/indexeddb/server/IDBServer.cpp: (WebCore::IDBServer::IDBServer::createBackingStore): (WebCore::IDBServer::IDBServer::setPerOriginQuota): * Modules/indexeddb/server/IDBServer.h: (WebCore::IDBServer::IDBServer::perOriginQuota const): * Modules/indexeddb/server/MemoryIDBBackingStore.h: * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::SQLiteIDBBackingStore): (WebCore::IDBServer::SQLiteIDBBackingStore::quotaForOrigin const): (WebCore::IDBServer::SQLiteIDBBackingStore::maximumSize const): (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction): (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore): (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex): (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord): (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue): * Modules/indexeddb/server/SQLiteIDBBackingStore.h: * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::setQuota): * Modules/indexeddb/server/UniqueIDBDatabase.h: 2018-11-01 Justin Michaud <justin_michaud@apple.com> CSS Custom Properties API Should Support syntax="*" and "<length>", and handle cycles properly https://bugs.webkit.org/show_bug.cgi?id=191042 Reviewed by Antti Koivisto. Refactor code so that: - All properties applied in StyleResolver::applyMatchedProperties are only applied once. - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved every time they were referenced, and again in RenderStyle. - The font-size property is applied after its variable references, but before custom properties that depend on it. - Cycles are detected at the same time as resolution. - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type. If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty. This behaviour matches chrome, but is not documented in the spec. - Custom property values have more explicit resolved/unresolved state. - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties. Tests: css-custom-properties-api/crash.html css-custom-properties-api/cycles.html css-custom-properties-api/inline.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted. (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted. (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted. * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): * css/CSSRegisteredCustomProperty.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::CSSVariableData): (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted. (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted. (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted. (WebCore::CSSVariableData::resolveVariableFallback const): Deleted. (WebCore::CSSVariableData::resolveVariableReference const): Deleted. (WebCore::CSSVariableData::resolveVariableReferences const): Deleted. (WebCore::CSSVariableData::resolveTokenRange const): Deleted. * css/CSSVariableData.h: (WebCore::CSSVariableData::create): (WebCore::CSSVariableData::createResolved): Deleted. (WebCore::CSSVariableData::needsVariableResolution const): Deleted. (WebCore::CSSVariableData::CSSVariableData): Deleted. * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableFallback): (WebCore::resolveVariableReference): (WebCore::resolveTokenRange): (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted. * css/CSSVariableReferenceValue.h: (WebCore::CSSVariableReferenceValue::create): (WebCore::CSSVariableReferenceValue::equals const): (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted. * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::setProperty): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleProperties.cpp: (WebCore::MutableStyleProperties::setCustomProperty): * css/StyleProperties.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::setStyle): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::applyPropertyToCurrentStyle): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties): (WebCore::StyleResolver::CascadedProperties::Property::apply): (WebCore::StyleResolver::applyCascadedCustomProperty): (WebCore::StyleResolver::applyCascadedProperties): * css/StyleResolver.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::CSSPropertyParser): (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): (WebCore::CSSPropertyParser::parseValueStart): (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParser.h: * css/parser/CSSVariableParser.cpp: (WebCore::CSSVariableParser::parseDeclarationValue): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::variableDataForPositivePixelLength): (WebCore::variableDataForPositiveDuration): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): * rendering/style/StyleCustomPropertyData.h: (WebCore::StyleCustomPropertyData::operator== const): (WebCore::StyleCustomPropertyData::setCustomPropertyValue): (WebCore::StyleCustomPropertyData::StyleCustomPropertyData): (): Deleted. 2018-11-01 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Adopt CG SPI for non-even cornered rounded rects https://bugs.webkit.org/show_bug.cgi?id=190155 Reviewed by Simon Fraser. Instead of creating bezier curves for the non-even corners of the rounded rects, we should use the optimized SPI provided by CG. * platform/graphics/cg/PathCG.cpp: (WebCore::Path::platformAddPathForRoundedRect): 2018-11-01 Youenn Fablet <youenn@apple.com> RTCTrackEvent.streams should be SameObject https://bugs.webkit.org/show_bug.cgi?id=191130 Reviewed by Eric Carlson. Mimick SameObject using CachedAttribute. Covered by rebased test. * Modules/mediastream/RTCTrackEvent.idl: 2018-10-31 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for inline-block elements. https://bugs.webkit.org/show_bug.cgi?id=191143 Reviewed by Antti Koivisto. This patch add support for laying out non-shrink-to-width inline-block elements. Test: fast/inline/simple-inline-block.html * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin): * layout/layouttree/LayoutInlineContainer.cpp: (WebCore::Layout::InlineContainer::establishesInlineFormattingContext const): * layout/layouttree/LayoutInlineContainer.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-11-01 Claudio Saavedra <csaavedra@igalia.com> Fix build with VIDEO and WEB_AUDIO disabled https://bugs.webkit.org/show_bug.cgi?id=191147 Reviewed by Philippe Normand. Supported or not, there were a few build fixes needed to be able to build WebKit with media disabled. Mostly low-hanging fruits. * Modules/mediasource/VideoPlaybackQuality.cpp: * Modules/mediasource/VideoPlaybackQuality.h: * Modules/mediasource/VideoPlaybackQuality.idl: * dom/Document.cpp: (WebCore::Document::dispatchFullScreenChangeOrErrorEvent): * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::InspectorDOMAgent): (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): * inspector/agents/InspectorDOMAgent.h: * rendering/RenderThemeGtk.cpp: 2018-10-31 Devin Rousso <drousso@apple.com> Web Inspector: Canvas: create a setting for auto-recording newly created contexts https://bugs.webkit.org/show_bug.cgi?id=190856 Reviewed by Brian Burg. Test: inspector/canvas/setRecordingAutoCaptureFrameCount.html * inspector/agents/InspectorCanvasAgent.h: (WebCore::InspectorCanvasAgent::RecordingOptions): Added. * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::disable): (WebCore::InspectorCanvasAgent::setRecordingAutoCaptureFrameCount): Added. (WebCore::InspectorCanvasAgent::startRecording): (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext): (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame): (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas): (WebCore::InspectorCanvasAgent::startRecording): Added. Unify the different functions that are able to start a recording to use a single path. * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::resetRecordingData): (WebCore::InspectorCanvas::recordAction): (WebCore::InspectorCanvas::setFrameCount): Added. (WebCore::InspectorCanvas::overFrameCount const): Added. 2018-10-31 Devin Rousso <drousso@apple.com> Web Inspector: display low-power enter/exit events in Timelines and Network node waterfalls https://bugs.webkit.org/show_bug.cgi?id=190641 <rdar://problem/45319049> Reviewed by Joseph Pecoraro. No new tests, as low power mode is indeterminate. Should not affect functionality. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::InspectorDOMAgent): (WebCore::InspectorDOMAgent::addEventListenersToNode): (WebCore::InspectorDOMAgent::mediaMetricsTimerFired): Added. 2018-10-31 Alicia Boya García <aboya@igalia.com> [MSE] Use tolerance when growing the coded frame group https://bugs.webkit.org/show_bug.cgi?id=190085 Reviewed by Jer Noble. Test: media/media-source/media-source-append-acb-tolerance.html This patch introduces a millisecond tolerance in the range of potential frames that should be erased frame from the track buffer when the coded frame group is growing. This is necessary because some files have imprecise overlapping timestamps (especially WebM files). This fixes a stall when seeking back and forth in YouTube with WebM video. A test case simulating the problem with video/mock using timestamps similar to those of a typical 30 fps WebM video is also added. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-10-31 Jer Noble <jer.noble@apple.com> MediaSource.isTypeSupported('video/mp4; codecs="hvc1.1.6.L60.B0') is inproperly rejected https://bugs.webkit.org/show_bug.cgi?id=191129 Reviewed by Eric Carlson. Test: media/media-source/media-source-istypesupported-case-sensitive.html According to RFC 2045: "All media type values, subtype values, and parameter names as defined are case-insensitive. However, parameter values are case-sensitive unless otherwise specified for the specific parameter." So rather than fold the entire ContentType into lower- case, leave the original string intact and require clients to enforce case-insensitivity. * Modules/mediasource/MediaSource.cpp: (WebCore::MediaSource::isTypeSupported): 2018-10-31 Jer Noble <jer.noble@apple.com> Unreivewed build fix; fix the non-HAVE_AVCONTENTKEYSESSION builds by adding guards around access of m_cdmInstance. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance): 2018-10-31 YUHAN WU <yuhan_wu@apple.com> MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called https://bugs.webkit.org/show_bug.cgi?id=190778 <rdar://problem/45703574> Reviewed by Youenn Fablet. Add a include to fix the unified build error. No tests since no new functionality. * Modules/webgpu/WebGPUDevice.cpp: 2018-10-26 Jer Noble <jer.noble@apple.com> [EME][Cocoa] Cannot play unmuxed video and audio fMP4 streams encrypted with different keys via MSE https://bugs.webkit.org/show_bug.cgi?id=190946 Reviewed by Eric Carlson. Use separate AVContentKeySessions per CDMInstanceSession (rather than one AVContentKeySession per CDMInstance). - Add a mechanism for sending a message out from platform/CDMInstance to MediaKeySession without requiring MediaKeySession to send a callback first. - Move all the AVContentKeySession delegate methods from CDMInstanceFairPlayStreamingAVFObjC to CDMInstanceSessionFairPlayStreamingAVFObjC. - Add a mechanism for requesting the correct CDMInstanceSession for a given KeyID. - Support key renewal through a "renew" message. - Remember the keyID in SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID() and ask for the correct CDMInstanceSession for that keyID in attemptToDecrypt(). - Pass the CDMInstance down from MediaPlayerPrivateMediaSourceAVFObjC -> SourceBufferPrivateAVFObjC. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::sendMessage): * Modules/encryptedmedia/MediaKeySession.h: * platform/encryptedmedia/CDMInstanceSession.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (-[WebCoreFPSContentKeySessionDelegate initWithParent:]): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionForKeyIDs const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::~CDMInstanceSessionFairPlayStreamingAVFObjC): (WebCore::keyIDsForRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::nextRequest): (WebCore::requestStatusToCDMStatus): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyStatuses const): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::ensureSession): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateAVFoundationObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceAttached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::cdmInstanceDetached): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const): * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.h: * platform/graphics/avfoundation/objc/MediaSourcePrivateAVFObjC.mm: (WebCore::MediaSourcePrivateAVFObjC::addSourceBuffer): (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceAttached): (WebCore::MediaSourcePrivateAVFObjC::cdmInstanceDetached): (WebCore::MediaSourcePrivateAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaSourcePrivateAVFObjC::waitingForKey const): (WebCore::MediaSourcePrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::destroyParser): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): 2018-10-31 Zach Li <zacharyli323@gmail.com> Add credit card autofill button https://bugs.webkit.org/show_bug.cgi?id=191051 <rdar://problem/45657011> Reviewed by Wenson Hsieh. Test: fast/forms/auto-fill-button/input-credit-card-auto-fill-button.html * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]): * css/html.css: (input::-webkit-credit-card-auto-fill-button): Add credit card autofill button. (input::-webkit-credit-card-auto-fill-button:hover): (input::-webkit-credit-card-auto-fill-button:active): * html/HTMLTextFormControlElement.h: * html/TextFieldInputType.cpp: (WebCore::autoFillButtonTypeToAccessibilityLabel): (WebCore::autoFillButtonTypeToAutoFillButtonText): (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName): (WebCore::isAutoFillButtonTypeChanged): * platform/LocalizedStrings.cpp: (WebCore::AXAutoFillCreditCardLabel): * platform/LocalizedStrings.h: * testing/Internals.cpp: (WebCore::toAutoFillButtonType): (WebCore::toInternalsAutoFillButtonType): * testing/Internals.h: * testing/Internals.idl: 2018-10-31 Eric Carlson <eric.carlson@apple.com> [MediaStream] Don't reveal device IDs until the user has granted permission to capture https://bugs.webkit.org/show_bug.cgi?id=191112 <rdar://problem/45699932> Reviewed by Youenn Fablet. No new tests, existing tests updated. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): Don't reveal device ID or group ID until the user has granted permssion to capture. 2018-10-31 YUHAN WU <yuhan_wu@apple.com> MediaRecorder should fire dataavailable event when all tracks are ended and stop() is called https://bugs.webkit.org/show_bug.cgi?id=190778 Reviewed by Youenn Fablet. Implement JavaScript dispatch event dataavailable and JavaScript exposed method stop(). Implement a mock string as the output buffer of MediaRecorder. Remove the declaration of timecode in BlobEvent since it has not been implemented in MediaRecorder and MediaRecorderPrivate. Tests: http/wpt/mediarecorder/MediaRecorder-dataavailable.html http/wpt/mediarecorder/MediaRecorder-mock-dataavailable.html imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-destroy-script-execution.html imported/w3c/web-platform-tests/mediacapture-record/support/MediaRecorder-iframe.html * CMakeLists.txt: * Modules/mediarecorder/BlobEvent.cpp: Added. (WebCore::BlobEvent::create): (WebCore::BlobEvent::BlobEvent): (WebCore::BlobEvent::eventInterface const): * Modules/mediarecorder/BlobEvent.h: * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::~MediaRecorder): (WebCore::MediaRecorder::stop): (WebCore::MediaRecorder::startRecording): (WebCore::MediaRecorder::stopRecording): (WebCore::MediaRecorder::stopRecordingInternal): (WebCore::MediaRecorder::didAddOrRemoveTrack): (WebCore::MediaRecorder::trackEnded): (WebCore::MediaRecorder::sampleBufferUpdated): (WebCore::MediaRecorder::audioSamplesAvailable): (WebCore::MediaRecorder::scheduleDeferredTask): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/EventNames.h: * dom/EventNames.in: * platform/mediarecorder/MediaRecorderPrivate.h: Added. * platform/mediarecorder/MediaRecorderPrivateMock.cpp: Added. (WebCore::MediaRecorderPrivateMock::sampleBufferUpdated): (WebCore::MediaRecorderPrivateMock::audioSamplesAvailable): (WebCore::MediaRecorderPrivateMock::generateMockString): (WebCore::MediaRecorderPrivateMock::fetchData): * platform/mediarecorder/MediaRecorderPrivateMock.h: Added. 2018-10-31 Claudio Saavedra <csaavedra@igalia.com> [GTK][WPE] Remaining topPrivatelyControlledDomain() fixes https://bugs.webkit.org/show_bug.cgi?id=191110 Reviewed by Michael Catanzaro. Covered by existing tests. Turns out that this method is expected to reject domains that are not registrable. Also sync with the Mac implementation in that given domains that are not all ASCII should be returned back as is. This fixes the remaining Public Suffix API tests. * platform/soup/PublicSuffixSoup.cpp: (WebCore::topPrivatelyControlledDomain): 2018-10-31 Antti Koivisto <antti@apple.com> Remove LayerFlushScheduler https://bugs.webkit.org/show_bug.cgi?id=191103 Reviewed by Anders Carlsson. It is only used in WK1. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/ca/LayerFlushScheduler.cpp: Removed. * platform/graphics/ca/LayerFlushScheduler.h: Removed. * platform/graphics/ca/LayerFlushSchedulerClient.h: Removed. * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: Removed. 2018-10-31 Zalan Bujtas <zalan@apple.com> Missing from r237634 * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::formattingContext): 2018-10-31 Zalan Bujtas <zalan@apple.com> [LFC] Do not pass LayoutState& to compute* and layout* functions https://bugs.webkit.org/show_bug.cgi?id=191100 Reviewed by Antti Koivisto. Reduce noise by removing LayoutState& parameter where possible. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::computeBorderAndPadding const): (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContext.h: * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): * layout/LayoutFormattingState.cpp: (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeStaticPosition const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/blockformatting/BlockFormattingContext.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::InlineFormattingContext::initializeNewLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.h: 2018-10-31 Zalan Bujtas <zalan@apple.com> [LFC] FormattingContext class should take FormattingState& https://bugs.webkit.org/show_bug.cgi?id=191099 Reviewed by Antti Koivisto. This is in preparation for not passing LayoutState& into every layout functions. FormattingContext has FormattingState now and LayoutState can be acquired through FormattingState. LayoutState <- FormattingState <- FormattingContext * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::FormattingContext): (WebCore::Layout::FormattingContext::formattingState const): (WebCore::Layout::FormattingContext::layoutState const): * layout/FormattingContext.h: * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::FormattingState): * layout/FormattingState.h: (WebCore::Layout::FormattingState::layoutState const): * layout/LayoutFormattingState.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::BlockFormattingContext): * layout/blockformatting/BlockFormattingContext.h: * layout/blockformatting/BlockFormattingState.cpp: (WebCore::Layout::BlockFormattingState::BlockFormattingState): (WebCore::Layout::BlockFormattingState::formattingContext): (WebCore::Layout::BlockFormattingState::formattingContext const): Deleted. * layout/blockformatting/BlockFormattingState.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::InlineFormattingContext): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::InlineFormattingState): (WebCore::Layout::InlineFormattingState::formattingContext): (WebCore::Layout::InlineFormattingState::formattingContext const): Deleted. * layout/inlineformatting/InlineFormattingState.h: 2018-10-31 Zalan Bujtas <zalan@apple.com> [LFC] The *FormattingState class should provide the *FormattingContext. https://bugs.webkit.org/show_bug.cgi?id=191089 Reviewed by Antti Koivisto. BlockFormattingState provides the BlockFormattingContext object, while InlineFormattingState provides the InlineFormattingContext. * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): * layout/FormattingState.h: * layout/LayoutFormattingState.cpp: (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): (WebCore::Layout::LayoutState::formattingContext const): Deleted. * layout/LayoutFormattingState.h: * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/blockformatting/BlockFormattingState.cpp: (WebCore::Layout::BlockFormattingState::formattingContext const): * layout/blockformatting/BlockFormattingState.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::formattingContext const): * layout/inlineformatting/InlineFormattingState.h: 2018-10-31 Zalan Bujtas <zalan@apple.com> [LFC] Rename LayoutContext to LayoutState https://bugs.webkit.org/show_bug.cgi?id=191080 Reviewed by Antti Koivisto. LayoutContext naming was a bit misleading since none of the other *FormattingContext classes (BlockFormattingContext etc) hold states. (LayoutContext.cpp -> LayoutFormattingState.cpp because LayoutState.cpp name is already taken.) Now the current state is as follows: LayoutState has 1. Layout tree 2. State content for each formatting subtrees 3. Display tree * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/FormattingContext.cpp: (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const): (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const): (WebCore::Layout::FormattingContext::computeBorderAndPadding const): (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const): (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const): (WebCore::Layout::FormattingContext::mapBoxToAncestor): (WebCore::Layout::FormattingContext::mapTopLeftToAncestor): (WebCore::Layout::FormattingContext::mapCoordinateToAncestor): (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const): * layout/FormattingContext.h: (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): * layout/FormattingContextGeometry.cpp: (WebCore::Layout::contentHeightForFormattingContextRoot): (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight): (WebCore::Layout::FormattingContext::Geometry::computedMinHeight): (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned): (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned): (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::complicatedCases): (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry): (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry): (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin): (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): (WebCore::Layout::FormattingContext::Geometry::computedBorder): (WebCore::Layout::FormattingContext::Geometry::computedPadding): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue): (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue): * layout/FormattingState.cpp: (WebCore::Layout::FormattingState::FormattingState): * layout/FormattingState.h: (WebCore::Layout::FormattingState::setInstrinsicWidthConstraints): (WebCore::Layout::FormattingState::instrinsicWidthConstraints const): * layout/LayoutFormattingState.cpp: Renamed from Source/WebCore/layout/LayoutContext.cpp. (WebCore::Layout::LayoutState::LayoutState): (WebCore::Layout::LayoutState::initializeRoot): (WebCore::Layout::LayoutState::updateLayout): (WebCore::Layout::LayoutState::layoutFormattingContextSubtree): (WebCore::Layout::LayoutState::displayBoxForLayoutBox const): (WebCore::Layout::LayoutState::styleChanged): (WebCore::Layout::LayoutState::markNeedsUpdate): (WebCore::Layout::LayoutState::formattingStateForBox const): (WebCore::Layout::LayoutState::establishedFormattingState const): (WebCore::Layout::LayoutState::createFormattingStateForFormattingRootIfNeeded): (WebCore::Layout::LayoutState::formattingContext const): * layout/LayoutFormattingState.h: Renamed from Source/WebCore/layout/LayoutContext.h. (WebCore::Layout::LayoutState::setInQuirksMode): (WebCore::Layout::LayoutState::hasDisplayBox const): (WebCore::Layout::LayoutState::inQuirksMode const): * layout/Verification.cpp: (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded): (WebCore::Layout::verifyAndOutputSubtree): (WebCore::Layout::LayoutState::verifyAndOutputMismatchingLayoutTree const): (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const): Deleted. * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layout const): (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeStaticPosition const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): (WebCore::Layout::hasPrecomputedMarginTop): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const): (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const): (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const): (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const): * layout/blockformatting/BlockFormattingContext.h: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::isStretchedToInitialContainingBlock): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin): (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints): (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop): * layout/blockformatting/BlockFormattingState.cpp: (WebCore::Layout::BlockFormattingState::BlockFormattingState): * layout/blockformatting/BlockFormattingState.h: * layout/blockformatting/BlockInvalidation.cpp: (WebCore::Layout::computeUpdateType): (WebCore::Layout::computeUpdateTypeForAncestor): (WebCore::Layout::BlockInvalidation::invalidate): * layout/blockformatting/BlockInvalidation.h: * layout/blockformatting/BlockMarginCollapse.cpp: (WebCore::Layout::isMarginTopCollapsedWithParent): (WebCore::Layout::isMarginBottomCollapsedThrough): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild): (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom): * layout/displaytree/DisplayBox.h: * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): * layout/floats/FloatAvoider.h: * layout/floats/FloatBox.cpp: (WebCore::Layout::FloatBox::FloatBox): * layout/floats/FloatBox.h: * layout/floats/FloatingContext.cpp: (WebCore::Layout::FloatingContext::positionForFloat const): (WebCore::Layout::FloatingContext::positionForFloatAvoiding const): (WebCore::Layout::FloatingContext::verticalPositionWithClearance const): * layout/floats/FloatingContext.h: (WebCore::Layout::FloatingContext::layoutState const): (WebCore::Layout::FloatingContext::layoutContext const): Deleted. * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::FloatItem::FloatItem): (WebCore::Layout::FloatingState::FloatingState): (WebCore::Layout::FloatingState::constraints const): * layout/floats/FloatingState.h: (WebCore::Layout::FloatingState::create): (WebCore::Layout::FloatingState::layoutState const): (WebCore::Layout::FloatingState::layoutContext const): Deleted. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::InlineFormattingContext::initializeNewLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): (WebCore::Layout::InlineFormattingContext::computeStaticPosition const): (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const): (WebCore::Layout::InlineFormattingContext::instrinsicWidthConstraints const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin): * layout/inlineformatting/InlineFormattingState.cpp: (WebCore::Layout::InlineFormattingState::InlineFormattingState): * layout/inlineformatting/InlineFormattingState.h: * layout/inlineformatting/InlineInvalidation.cpp: (WebCore::Layout::InlineInvalidation::invalidate): * layout/inlineformatting/InlineInvalidation.h: * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): (WebCore::Layout::InlineLineBreaker::runWidth const): * layout/inlineformatting/InlineLineBreaker.h: * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): (WebCore::Layout::outputLayoutTree): (WebCore::Layout::showLayoutTree): * layout/layouttree/LayoutTreeBuilder.h: * page/FrameViewLayoutContext.cpp: (WebCore::layoutUsingFormattingContext): 2018-10-30 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] Attachment dropped from one web view to another is missing its file wrapper https://bugs.webkit.org/show_bug.cgi?id=190530 <rdar://problem/45232149> Reviewed by Tim Horton. Add support for copying and pasting attachment elements across web views by encoding and adding file wrapper data as subresources in the web archive when writing selected web content to the pasteboard, and then decoding and creating NSFileWrappers upon reading web content. Test: WKAttachmentTests.CopyAndPasteBetweenWebViews * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::registerAttachments): * editing/Editor.h: Add registerAttachments(), which registers _WKAttachments in the UI process given a list of SerializedAttachmentData. This behaves similarly to registerAttachmentIdentifiers(), but differs in that (1) it sends serialized file wrapper data, and (2) it sends a list of serialized attachments, rather than information about just a single attachment. * editing/SerializedAttachmentData.h: Introduce SerializedAttachmentData, a struct containing information needed to serialize and deserialize an attachment. These are used both when writing attachment data to the pasteboard, and when consuming attachment data upon paste. * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::replaceRichContentWithAttachments): Add a step when pasting rich content with attachments, to collect and send serialized attachments to the client. Also, drive-by fix: don't WTFMove() the Ref here if it's still going to be used below. * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::archiveResourceURL): * html/HTMLAttachmentElement.h: Add a static helper function to compute a URL that represents the data for the given attachment identifier, for use in a web archive resource. * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::addSubresourcesForAttachmentElementsIfNecessary): Add a helper function to create and append ArchiveResources representing attachment element data when writing attachments to the pasteboard via web archive data. (WebCore::LegacyWebArchive::create): * page/EditorClient.h: (WebCore::EditorClient::registerAttachments): (WebCore::EditorClient::serializedAttachmentDataForIdentifiers): 2018-10-30 David Kilzer <ddkilzer@apple.com> XSLTProcessor should limit max transform depth <https://webkit.org/b/191075> <rdar://problem/45531453> Reviewed by Alex Christensen. Test: fast/xsl/xslt-max-depth.html * xml/SoftLinkLibxslt.cpp: Add macro for `xsltMaxDepth` global. * xml/SoftLinkLibxslt.h: Ditto. * xml/XSLTProcessorLibxslt.cpp: (WebCore::XSLTProcessor::transformToString): Set `xsltMaxDepth` to 1000. Default in libxslt.dylib is 3000. 2018-10-30 Jim Mason <jmason@ibinx.com> [GTK] Scrollbars not following gtk-primary-button-warps-slider setting https://bugs.webkit.org/show_bug.cgi?id=191067 Reviewed by Michael Catanzaro. * platform/gtk/ScrollbarThemeGtk.cpp: (WebCore::ScrollbarThemeGtk::handleMousePressEvent): 2018-10-30 Alexey Proskuryakov <ap@apple.com> Clean up some obsolete MAX_ALLOWED macros https://bugs.webkit.org/show_bug.cgi?id=190916 Reviewed by Tim Horton. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::exernalDeviceDisplayNameForPlayer): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::globalPointForEvent): (WebCore::pointForEvent): (WebCore::mouseButtonForEvent): (WebCore::PlatformMouseEventBuilder::PlatformMouseEventBuilder): 2018-10-30 Ali Juma <ajuma@chromium.org> Calling window.open("", "_self") allows working around restrictions on window.close() https://bugs.webkit.org/show_bug.cgi?id=191073 Reviewed by Chris Dumez. Do not treat a re-used frame in DOMWindow::createWindow as having been opened by DOM. Test: fast/dom/Window/window-open-self-disallow-close.html * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): 2018-10-30 Andy Estes <aestes@apple.com> [Payment Request] Implement PaymentResponse.retry() https://bugs.webkit.org/show_bug.cgi?id=190985 Reviewed by Daniel Bates. Implemented the retry() method on PaymentResponse as specified in the Payment Request API W3C Editor's Draft of 24 October 2018. See https://w3c.github.io/payment-request/#retry-method for details. Tests: http/tests/paymentrequest/payment-response-rejects-if-not-active.https.html http/tests/paymentrequest/payment-response-retry-method.https.html * Modules/applepay/PaymentCoordinator.h: (WebCore::PaymentCoordinator::client): Added. Returns m_client. * Modules/applepay/PaymentCoordinatorClient.h: (WebCore::PaymentCoordinatorClient::isMockPaymentCoordinator const): Added. Used to downcast a PaymentCoordinatorClient to a MockPaymentCoordinator. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computeTotalAndLineItems const): Made const. (WebCore::ApplePayPaymentHandler::computeErrors const): Broke this function into computeAddressErrors, computePayerErrors, and computePaymentMethodErrors, then modified this function to call those functions. Exceptions thrown by computePaymentMethodErrors are ignored. (WebCore::ApplePayPaymentHandler::computeAddressErrors const): Added. (WebCore::ApplePayPaymentHandler::computePayerErrors const): Added. (WebCore::ApplePayPaymentHandler::computePaymentMethodErrors const): Added. (WebCore::ApplePayPaymentHandler::complete): Added ASSERTs to verify whether result is a final result. (WebCore::ApplePayPaymentHandler::retry): Computed PaymentErrors from PaymentValidationErrors, ensured the PaymentAuthorizationResult was non-final by adding an unknown error if necessary, and called PaymentCoordinator::completePaymentSession. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/paymentrequest/PaymentHandler.h: * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): Changed to call settleShowPromise. (WebCore::PaymentRequest::abortWithException): Changed to abort PaymentResponse's retry promise, if present, instead of PaymentResponse's show promise. (WebCore::PaymentRequest::settleShowPromise): Added. Settles m_showPromise then sets it to std::nullopt. (WebCore::PaymentRequest::closeActivePaymentHandler): Added. Hides the active payment handler then sets it to std::nullopt. (WebCore::PaymentRequest::stop): Stopped calling abortWithException, since that function might settle PaymentResponse's retry promise. PaymentResponse is now an ActiveDOMObject and will settle its own promise in its implementation of stop. (WebCore::PaymentRequest::abort): Changed to throw an InvalidStateError if there is a pending retry promise and to call abortWithException instead of stop. (WebCore::PaymentRequest::completeMerchantValidation): Changed to call abortWithException instead of stop. (WebCore::PaymentRequest::settleDetailsPromise): Ditto. (WebCore::PaymentRequest::accept): Updated the existing PaymentResponse, if present, rather than creating a new one. Settled the existing PaymentResponse's retry promise, if present, rather than the show promise. (WebCore::PaymentRequest::complete): Changed to throw an AbortError if there is no longer an active payment handler. (WebCore::PaymentRequest::retry): Changed to throw an AbortError if there is no longer an active payment handler, and to call PaymentHandler::retry if there is. (WebCore::PaymentRequest::cancel): Changed to call abortWithException instead of stop. * Modules/paymentrequest/PaymentRequest.h: * Modules/paymentrequest/PaymentRequest.idl: * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::PaymentResponse): (WebCore::PaymentResponse::finishConstruction): Pending activities create strong references to |this|, so they cannot be created in constructors without relaxing adoption requirements. Added this function so that the pending activity can be created after the PaymentResponse is created and adopted. (WebCore::PaymentResponse::~PaymentResponse): (WebCore::PaymentResponse::complete): Updated to throw an AbortError or InvalidStateError when necessary. (WebCore::PaymentResponse::retry): Implemented. Throws an AbortError or InvalidStateError when necessary, otherwise calls PaymentRequest::retry and stores the retry promise in m_retryPromise. (WebCore::PaymentResponse::abortWithException): Added. Rejects the retry promise with |exception|, clears the pending activity, and sets m_state to Completed. (WebCore::PaymentResponse::settleRetryPromise): Added. Settles the retry promise and sets it to std::nullopt. (WebCore::PaymentResponse::canSuspendForDocumentSuspension const): Added. Returns true if there is no pending activity. (WebCore::PaymentResponse::stop): Added. Rejects the retry promise with AbortError, clears the pending activity, and sets m_state to Stopped. * Modules/paymentrequest/PaymentResponse.h: Changed create to call finishConstruction and made PaymentResponse an ActiveDOMObject instead of a ContextDestructionObserver. * testing/Internals.cpp: (WebCore::Internals::Internals): Changed to only create a MockPaymentCoordinator for main frames. (WebCore::Internals::mockPaymentCoordinator): Changed to get the MockPaymentCoordinator by downcasting the page's payment coordinator client. * testing/Internals.h: * testing/Internals.idl: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completePaymentSession): Changed to only increment hideCount for final results. * testing/MockPaymentCoordinator.h: (isType): Added so that PaymentCoordinatorClients can be downcasted to MockPaymentCoordinators. 2018-10-30 Zalan Bujtas <zalan@apple.com> [iOS] Use the mainframe view size to compute window.outerWidth/height. https://bugs.webkit.org/show_bug.cgi?id=191070 <rdar://problem/42368377> Reviewed by Tim Horton. Use a more reasonable value for window.outerWidth and height. (WKWebView's frame rect -> drawing area sizing -> WebPage's view size -> FrameView size) * page/DOMWindow.cpp: (WebCore::DOMWindow::outerHeight const): (WebCore::DOMWindow::outerWidth const): 2018-10-30 Andy Estes <aestes@apple.com> [Apple Pay] PaymentRequest.canMakePayment() should resolve to true whenever Apple Pay is available https://bugs.webkit.org/show_bug.cgi?id=191039 Reviewed by Megan Gardner. During a recent Web Payments WG F2F, we decided that canMakePayment() should return true whenever the user agent supports one or more of the specified payment methods, even if those payment methods do not have active instruments. Change WebKit's implementation of canMakePayment() for Apple Pay to resolve with the value of ApplePaySession.canMakePayments() rather than ApplePaySession.canMakePaymentsWithActiveCard(). Added a test case to http/tests/paymentrequest/payment-request-canmakepayment-method.https.html. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::canMakePayment): (WebCore::shouldDiscloseApplePayCapability): Deleted. * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::canMakePayments): (WebCore::MockPaymentCoordinator::canMakePaymentsWithActiveCard): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2018-10-30 Sihui Liu <sihui_liu@apple.com> Add a deprecation warning to console for Web SQL https://bugs.webkit.org/show_bug.cgi?id=190936 Reviewed by Ryosuke Niwa. No new tests. Just adding a console message. * Modules/webdatabase/DOMWindowWebDatabase.cpp: (WebCore::DOMWindowWebDatabase::openDatabase): 2018-10-30 Sihui Liu <sihui_liu@apple.com> IndexedDB: iteration of cursors skip records if updated or deleted https://bugs.webkit.org/show_bug.cgi?id=190917 <rdar://problem/35250410> Reviewed by Chris Dumez. When object store has changes, we cleared cached records and reset the SQLite statement, updating the boundary to the next key in cursor's direction. Therefore, the cursor could jump to the next key after update or deletion. We should cache those records before changing the statement. Test: storage/indexeddb/cursor-update-while-iterating.html * Modules/indexeddb/server/SQLiteIDBCursor.cpp: (WebCore::IDBServer::SQLiteIDBCursor::objectStoreRecordsChanged): (WebCore::IDBServer::SQLiteIDBCursor::fetch): * Modules/indexeddb/server/SQLiteIDBCursor.h: 2018-10-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Introduce InlineFormattingContextGeometry class https://bugs.webkit.org/show_bug.cgi?id=191054 Reviewed by Antti Koivisto. This is in preparation for inline-block support. Move float and inline-block elements layout to layoutFormattingContextRoot(). computeWidthAndHeightForInlineBox takes care of replaced elements. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::InlineFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeightForInlineBox const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): Deleted. * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineFormattingContextGeometry.cpp: Added. (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockWidthAndMargin): (WebCore::Layout::InlineFormattingContext::Geometry::inlineBlockHeightAndMargin): 2018-10-28 Antoine Quint <graouts@apple.com> [Web Animations] Implement the update animations and send events procedure https://bugs.webkit.org/show_bug.cgi?id=191013 <rdar://problem/45620495> Reviewed by Dean Jackson. While we implemented the various parts of what the Web Animations specification refers to as the "update animations and send events" procedure, we did not implement it as one function and in the correct order, specifically updating animations and sending events in two separate tasks. We now have a single method on DocumentTimeline which runs as the DisplayRefreshMonitor fires to update each "relevant" animation with the current time, perform a microtask checkpoint and dispatch events. Implementing this procedure allowed us to make several enhancements: 1. We introduce the concept of a "relevant" animation, which is essentially an animation that is either pending or playing. All animations in a different state are no longer owned by the DocumentTimeline and can thus be destroyed if the developer doesn't hold references in JS. Maintaining such a list guarantees that we're only updating animations that would have changed state since the last time the "update animations and send events" procedure was run. Note that DeclarativeAnimation instances are also considered to be relevant if they have queued DOM events to dispatch as they could otherwise be destroyed before they can fully dispatch them. 2. We no longer conflate the timing model and effects. Until now the way we would update animations was to go through all elements for which we had a registered animation, invalidate their style and finally forcing a style update on the document. We had a separate data structure where we help animations without targets so we update these as well in a separate pass, in order to make sure that promises and events would fire for them as expected. We now let the "update animations and send events" procedure update the timing of all relevant animations and let individual animation effects invalidate their style as needed, the document style invalidation happening naturally without DocumentTimeline forcing it. 3. We use a single step to schedule the update of animations, which is to register for a display refresh monitor update provided a "relevant" animation is known since the previous update. Until now we first had an "timing model invalidation" task scheduled upon any change of an animation's timing model, which would then create a timer to the earliest moment any listed animation would require an update, finally registering a display refresh monitor update, which used at least GenericTaskQueue<Timer> and potentially two, whereas we use none right now. 4. We allow for a display refresh monitor update to be canceled should the number of "relevant" animations since the last update goes back to 0. To facilitate all of this, we have changed the m_animations ListHashSet to contain only the "relevant" animations, and no longer every animation created that has this DocumentTimeline set as their "timeline" property. To keep this list current, every single change that changes a given animation's timing ends up calling AnimationTimeline::animationTimingDidChange() passing the animation as the sole parameter and adding this animation to m_animations. We immediately schedule a display refresh monitor update if one wasn't already scheduled. Then, when running the "update animations and send events" procedure, we call a new WebAnimation::tick() method on each of those animations, which updates this animation's effect and relevance, using the newly computed relevance to identify whether this animation should be kept in the m_animations ListHashSet. This is only the first step towards a more efficient update and ownership model of animations by the document timeline since animations created as CSS Animations and CSS Transitions are committed through CSS have dedicated data structures that are not updated in this particular patch, but this will be addressed in a followup to keep this already significant patch smaller. Another issue that will be addressed later is the ability to not schedule display refresh monitor udpates when only accelerated animations are running. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::animationTimingDidChange): Called by animations when any aspect of their timing model changes. The provided animation is then added to the m_animations list unless its timeline is no longer this timeline. (WebCore::AnimationTimeline::removeAnimation): Remove the provided animation from m_animations and remove any animation registered on the element-specific animation lists if this animation has an effect with a target. (WebCore::AnimationTimeline::animationWasAddedToElement): We no longer need to worry about the m_animationsWithoutTarget data structure since we removed it. (WebCore::removeCSSTransitionFromMap): Fix a bug where we would remove any CSSTransition in the provided map that had a matching transition-property instead of checking the CSSTransition registered for this transition-property was indeed the provided CSSTransition. The other code changes in this patch made this code now cause regressions in the Web Platform Tests. (WebCore::AnimationTimeline::animationWasRemovedFromElement): Stop updating m_animationsWithoutTarget since it no longer exists. (WebCore::AnimationTimeline::elementWasRemoved): (WebCore::AnimationTimeline::updateCSSAnimationsForElement): Fix a small error that caused a regression in the Web Platform Tests where we could attempt to call setBackingAnimation() on a nullptr instead of a valid CSSAnimation. (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): (WebCore::AnimationTimeline::addAnimation): Deleted. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::hasElementAnimations const): Deleted. (WebCore::AnimationTimeline:: const): Deleted. (WebCore::AnimationTimeline::elementToAnimationsMap): Deleted. (WebCore::AnimationTimeline::elementToCSSAnimationsMap): Deleted. (WebCore::AnimationTimeline::elementToCSSTransitionsMap): Deleted. * animation/CSSTransition.cpp: (WebCore::CSSTransition::canBeListed const): Deleted. * animation/CSSTransition.h: * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::tick): Call the superclass's method and queue any necessary DOM events reflecting the timing model changes. (WebCore::DeclarativeAnimation::needsTick const): Call the superclass's method and return true also if we have pending events since otherwise this animation could be removed from m_animations on its AnimationTimeline and potentially destroyed before the GenericEventQueue had a chance to dispatch all events. (WebCore::DeclarativeAnimation::startTime const): We removed the custom binding for this IDL property and renamed the method from bindingsStartTime to startTime. (WebCore::DeclarativeAnimation::setStartTime): We removed the custom binding for this IDL property and renamed the method from setBindingsStartTime to setStartTime. (WebCore::DeclarativeAnimation::bindingsStartTime const): Deleted. (WebCore::DeclarativeAnimation::setBindingsStartTime): Deleted. * animation/DeclarativeAnimation.h: * animation/DocumentAnimationScheduler.cpp: (WebCore::DocumentAnimationScheduler::unscheduleWebAnimationsResolution): Add a method to mark that we no longer need a display refresh monitor update for this document's animation timeline. This is called when m_animations becomes empty. * animation/DocumentAnimationScheduler.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): (WebCore::DocumentTimeline::detachFromDocument): Stop clearing two task queues and a timer that no longer exist and instead only clear the task queue to clear the cached current time, which we queue any time we generate a new one (see DocumentTimeline::currentTime). (WebCore::DocumentTimeline::getAnimations const): Use isRelevant() instead of canBeListed(). (WebCore::DocumentTimeline::updateThrottlingState): (WebCore::DocumentTimeline::suspendAnimations): (WebCore::DocumentTimeline::resumeAnimations): (WebCore::DocumentTimeline::numberOfActiveAnimationsForTesting const): (WebCore::DocumentTimeline::currentTime): Queue a task in the new m_currentTimeClearingTaskQueue task queue to clear the current time that we've generated and cached in the next run loop (provided all pending JS execution has also completed). (WebCore::DocumentTimeline::maybeClearCachedCurrentTime): (WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Schedule a display refresh monitor update if we are not suspended and have "relevant" animations. (WebCore::DocumentTimeline::animationTimingDidChange): Call scheduleAnimationResolutionIfNeeded() after calling the superclass's implementation. (WebCore::DocumentTimeline::removeAnimation): Call unscheduleAnimationResolution() if the list of "relevant" animations is now empty. (WebCore::DocumentTimeline::unscheduleAnimationResolution): Unschedule a pending display refresh monitor update. (WebCore::DocumentTimeline::animationResolutionTimerFired): (WebCore::DocumentTimeline::updateAnimationsAndSendEvents): Implement the "update animations and send events" procedure as specified by the Web Animations spec. During this procedure, we call tick() on all animations listed in m_animations and create a list of animations to remove from that list if this animation is no longer relevant following the call to tick(). (WebCore::DocumentTimeline::enqueueAnimationPlaybackEvent): (WebCore::DocumentTimeline::timingModelDidChange): Deleted. (WebCore::DocumentTimeline::scheduleInvalidationTaskIfNeeded): Deleted. (WebCore::DocumentTimeline::performInvalidationTask): Deleted. (WebCore::DocumentTimeline::updateAnimationSchedule): Deleted. (WebCore::DocumentTimeline::animationScheduleTimerFired): Deleted. (WebCore::DocumentTimeline::updateAnimations): Deleted. (WebCore::compareAnimationPlaybackEvents): Deleted. (WebCore::DocumentTimeline::performEventDispatchTask): Deleted. * animation/DocumentTimeline.h: * animation/WebAnimation.cpp: The majority of the changes to this class is that we call the new timingDidChange() method when any code that modifies the timing model is run. We also remove methods to set the pending play and pause tasks as well as the animation's start time and hold time since any time we're changing these instance variables, we later already have a call to update the timing model and we were doing more work than needed. As a result we no longer need an internal method to set the start time and can stop requiring a custom IDL binding for the "startTime" property. (WebCore::WebAnimation::effectTimingPropertiesDidChange): (WebCore::WebAnimation::setEffect): (WebCore::WebAnimation::setEffectInternal): (WebCore::WebAnimation::setTimeline): (WebCore::WebAnimation::setTimelineInternal): (WebCore::WebAnimation::startTime const): (WebCore::WebAnimation::setStartTime): (WebCore::WebAnimation::silentlySetCurrentTime): (WebCore::WebAnimation::setCurrentTime): (WebCore::WebAnimation::setPlaybackRate): (WebCore::WebAnimation::cancel): (WebCore::WebAnimation::resetPendingTasks): (WebCore::WebAnimation::finish): (WebCore::WebAnimation::timingDidChange): New method called any time a timing property changed where we run the "update the finished state" procedure and notify the animation's timeline that its timing changed so that it can be considered the next time the "update animations and send events" procedure runs. (WebCore::WebAnimation::invalidateEffect): (WebCore::WebAnimation::updateFinishedState): Update the animation's relevance after running the procedure as specified. (WebCore::WebAnimation::play): (WebCore::WebAnimation::runPendingPlayTask): (WebCore::WebAnimation::pause): (WebCore::WebAnimation::runPendingPauseTask): (WebCore::WebAnimation::needsTick const): (WebCore::WebAnimation::tick): New method called during the "update animations and send events" procedure where we run the "update the finished state" procedure and run the pending play and pause tasks. (WebCore::WebAnimation::resolve): (WebCore::WebAnimation::updateRelevance): (WebCore::WebAnimation::computeRelevance): (WebCore::WebAnimation::timingModelDidChange): Deleted. (WebCore::WebAnimation::setHoldTime): Deleted. (WebCore::WebAnimation::bindingsStartTime const): Deleted. (WebCore::WebAnimation::setBindingsStartTime): Deleted. (WebCore::WebAnimation::setTimeToRunPendingPlayTask): Deleted. (WebCore::WebAnimation::setTimeToRunPendingPauseTask): Deleted. (WebCore::WebAnimation::updatePendingTasks): Deleted. (WebCore::WebAnimation::timeToNextRequiredTick const): Deleted. (WebCore::WebAnimation::runPendingTasks): Deleted. (WebCore::WebAnimation::canBeListed const): Deleted. * animation/WebAnimation.h: (WebCore::WebAnimation::isRelevant const): (WebCore::WebAnimation::hasPendingPlayTask const): (WebCore::WebAnimation::isEffectInvalidationSuspended): * animation/WebAnimation.idl: * dom/Element.cpp: (WebCore::Element::getAnimations): Use isRelevant() instead of canBeListed(). 2018-10-30 Youenn Fablet <youenn@apple.com> LibWebRTCRtpReceiverBackend::getSynchronizationSources should use Vector::append https://bugs.webkit.org/show_bug.cgi?id=191026 Reviewed by Eric Carlson. Covered by updated test. * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const): 2018-10-30 Claudio Saavedra <csaavedra@igalia.com> [GTK][WPE] Fixes to the PublicSuffix implementation https://bugs.webkit.org/show_bug.cgi?id=191031 Reviewed by Michael Catanzaro. Covered by existing tests. Downcase hostnames before passing it on to the underlying libsoup API. Special case localhost and fix a mixed-up libsoup GError checks. This fixes most of the failures. * platform/soup/PublicSuffixSoup.cpp: (WebCore::isPublicSuffix): (WebCore::topPrivatelyControlledDomain): 2018-10-29 Zalan Bujtas <zalan@apple.com> Missing from r237549 * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): (WebCore::Layout::hasPrecomputedMarginTop): 2018-10-29 Ross Kirsling <ross.kirsling@sony.com> Unreviewed speculative build fix for AppleWin after r237559. * PlatformAppleWin.cmake: 2018-10-29 Justin Michaud <justin_michaud@apple.com> Revert r237347 registered custom properties... https://bugs.webkit.org/show_bug.cgi?id=190039 https://bugs.webkit.org/show_bug.cgi?id=190919 Reviewed by Michael Saboff. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): (WebCore::CSSCustomPropertyValue::equals const): Deleted. * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): * css/CSSRegisteredCustomProperty.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::consumeAndUpdateTokens): (WebCore::CSSVariableData::CSSVariableData): (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: (WebCore::CSSVariableData::create): (WebCore::CSSVariableData::createResolved): (WebCore::CSSVariableData::needsVariableResolution const): (WebCore::CSSVariableData::CSSVariableData): * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): (WebCore::resolveVariableFallback): Deleted. (WebCore::resolveVariableReference): Deleted. (WebCore::resolveTokenRange): Deleted. (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): Deleted. * css/CSSVariableReferenceValue.h: (WebCore::CSSVariableReferenceValue::create): (WebCore::CSSVariableReferenceValue::variableDataValue const): (WebCore::CSSVariableReferenceValue::equals const): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::setProperty): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleProperties.cpp: (WebCore::MutableStyleProperties::setCustomProperty): * css/StyleProperties.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::setStyle): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::applyPropertyToCurrentStyle): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties): (WebCore::StyleResolver::CascadedProperties::Property::apply): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::applyCascadedCustomProperty): Deleted. * css/StyleResolver.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::CSSPropertyParser): (WebCore::CSSPropertyParser::parseValueStart): (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): Deleted. (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): Deleted. (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): Deleted. * css/parser/CSSPropertyParser.h: * css/parser/CSSVariableParser.cpp: (WebCore::CSSVariableParser::parseDeclarationValue): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::variableDataForPositivePixelLength): (WebCore::variableDataForPositiveDuration): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): * rendering/style/StyleCustomPropertyData.h: (WebCore::StyleCustomPropertyData::operator== const): (WebCore::StyleCustomPropertyData::setCustomPropertyValue): (WebCore::StyleCustomPropertyData::StyleCustomPropertyData): 2018-10-29 Youenn Fablet <youenn@apple.com> Handle MDNS resolution of candidates through libwebrtc directly https://bugs.webkit.org/show_bug.cgi?id=190681 Reviewed by Eric Carlson. Remove the previous MDNS resolution mechanism. Instead, add support for the AsyncResolver mechanism added to libwebrtc. Covered by current mdns webrtc test that is unflaked. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addIceCandidate): * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::createPeerConnection): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection): * testing/MockLibWebRTCPeerConnection.h: 2018-10-29 Devin Rousso <drousso@apple.com> Web Inspector: increase size limits for NetworkResourceData https://bugs.webkit.org/show_bug.cgi?id=191034 <rdar://problem/45529852> Reviewed by Joseph Pecoraro. No tests since no new functionality. * inspector/NetworkResourcesData.cpp: All resources: 100MB => 200MB Each resource: 10MB => 50MB 2018-10-29 Tim Horton <timothy_horton@apple.com> Modernize WebKit nibs and lprojs for localization's sake https://bugs.webkit.org/show_bug.cgi?id=190911 <rdar://problem/45349466> Reviewed by Dan Bernstein. * PlatformGTK.cmake: * PlatformWPE.cmake: * PlatformWin.cmake: * WebCore.xcodeproj/project.pbxproj: * en.lproj/Localizable.strings: Renamed from Source/WebCore/English.lproj/Localizable.strings. * en.lproj/Localizable.stringsdict: Renamed from Source/WebCore/English.lproj/Localizable.stringsdict. * en.lproj/mediaControlsLocalizedStrings.js: Renamed from Source/WebCore/English.lproj/mediaControlsLocalizedStrings.js. * en.lproj/modern-media-controls-localized-strings.js: Renamed from Source/WebCore/English.lproj/modern-media-controls-localized-strings.js. English->en 2018-10-29 Tim Horton <timothy_horton@apple.com> Make FindOptionsShowOverlay work on iOS https://bugs.webkit.org/show_bug.cgi?id=190551 Reviewed by Andy Estes. * platform/graphics/GraphicsContext.h: Export some more GraphicsContext methods. 2018-10-29 Youenn Fablet <youenn@apple.com> Invalid ssrc value in the stats of type 'inbound-rtp' https://bugs.webkit.org/show_bug.cgi?id=190826 <rdar://problem/45487435> Reviewed by Eric Carlson. Value was not initialized in WebCore if missing from libwebrtc. Change value to an optional so that it will not appear if libwebrtc does not expose it. Move integer/boolean values from being initialized to be optional so that we do not expose them to JS if not exposed by libwebrtc. Covered by updated tests. * Modules/mediastream/RTCStatsReport.h: 2018-10-29 Jer Noble <jer.noble@apple.com> CRASH in CoreGraphics: ERROR_CGDataProvider_BufferIsNotBigEnough https://bugs.webkit.org/show_bug.cgi?id=190954 Reviewed by Simon Fraser. Crash analyitics show that WebProcess will crash in ERROR_CGDataProvider_BufferIsNotBigEnough, which attempts to fetch the last byte in the image buffer in order to verify that the entire buffer is readable. Unfortunately, the stack trace generated by this crash does not identify what CGDataProvider is responsible for the not-big-enough buffer. In order to identify which CGDataProvider created by WebKit is responsible (if any), we will add our own version of ERROR_CGDataProvider_BufferIsNotBigEnough, called at CGDataProvider creation time, which should generate a crash within the responsible stack frame. (This assumes that the issue is the wrong sized buffer at CGDataProvider creation time, and not that the buffer itself is reclaimed between creation time and access.) * WebCore.xcodeproj/project.pbxproj: * platform/graphics/cg/GraphicsContext3DCG.cpp: (WebCore::GraphicsContext3D::paintToCanvas): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::ImageBuffer::ImageBuffer): (WebCore::ImageBuffer::toCFData const): (WebCore::cfData): * platform/graphics/cocoa/WebGLLayer.mm: (-[WebGLLayer copyImageSnapshotWithColorSpace:]): * platform/graphics/cv/PixelBufferConformerCV.cpp: (WebCore::CVPixelBufferGetBytePointerCallback): (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer): * platform/graphics/cg/ImageUtilitiesCG.h: Added. (WebCore::verifyImageBufferIsBigEnough): 2018-10-29 David Kilzer <ddkilzer@apple.com> Fix clang static analyzer warning in StyleBuilderConverter.h <https://webkit.org/b/190907> Reviewed by Antti Koivisto. Fix the following clang static warning in StyleBuilderConverter.h: Value stored to 'autoFlow' during its initialization is never read * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertGridAutoFlow): Move assignment of RenderStyle::initialGridAutoFlow() to `default` case. Make `CSSValueDense` consistent with other cases by assigning value to `autoFlow` instead of returning early. 2018-10-29 Youenn Fablet <youenn@apple.com> Guard H264 simulcast with a runtime flag https://bugs.webkit.org/show_bug.cgi?id=191025 Reviewed by Eric Carlson. Add a runtime flag for H264 simulcast and enable libwebrtc field trial based on it. Covered by existing test. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCH264SimulcastEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCH264SimulcastEnabled): 2018-10-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Compute estimated margin top for inline formatting root's ancestors https://bugs.webkit.org/show_bug.cgi?id=191018 Reviewed by Antti Koivisto. <div><img style="float: left"></div> This inline formatting context (root -> div) inherits the floating context from the parent block formatting context. Floats are added to the floating context relative to the floating context's root. In order to position this float properly we need to precompute the ancestor's margin top (stop at the block formatting root boundary). Test: fast/inline/simple-intruding-floats3.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): 2018-10-29 Zalan Bujtas <zalan@apple.com> [LFC] Add support for inflow non replaced content height when the box is an inline formatting root. https://bugs.webkit.org/show_bug.cgi?id=191011 Reviewed by Antti Koivisto. // 10.6.3 Block-level non-replaced elements in normal flow when 'overflow' computes to 'visible' // Height is the bottom edge of the last line box, if the box establishes a inline formatting context with one or more lines This is temporary until after inline runs transition to the display tree. Test: fast/inline/simple-intruding-floats2.html * layout/blockformatting/BlockFormattingContextGeometry.cpp: (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin): * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::logicalLeft const): (WebCore::Layout::InlineRun::logicalRight const): (WebCore::Layout::InlineRun::logicalTop const): (WebCore::Layout::InlineRun::logicalBottom const): (WebCore::Layout::InlineRun::width const): (WebCore::Layout::InlineRun::height const): (WebCore::Layout::InlineRun::setWidth): (WebCore::Layout::InlineRun::setLogicalLeft): (WebCore::Layout::InlineRun::setLogicalRight): (WebCore::Layout::InlineRun::moveHorizontally): (WebCore::Layout::InlineRun::InlineRun): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::appendContent): 2018-10-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add support for simple intruding floats. https://bugs.webkit.org/show_bug.cgi?id=190998 Reviewed by Antti Koivisto. In order to be able to figure out whether a float is intruding on a line, we need to provide the line's final vertical position. This vertical position must be in the same coordinate system as the float's position is. In case of intruding float, it is the parent block formatting root's coordinate system (that's where the float lives.) Test: fast/inline/simple-intruding-float1.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const): (WebCore::Layout::BlockFormattingContext::precomputeVerticalPositionForFormattingRootIfNeeded const): (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const): (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const): (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const): * layout/blockformatting/BlockFormattingContext.h: * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): 2018-10-29 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Inline layout produces separate runs when float is present. https://bugs.webkit.org/show_bug.cgi?id=190980 Reviewed by Antti Koivisto. <div>foo<img src="foobar.jpg" style="float: left">bar</div> produces 2 inline boxes (foo) and (bar) -> current inline code while it is really just one continuous run (foobar) -> LFC Adjust verification code to check for such runs. * layout/Verification.cpp: (WebCore::Layout::checkForMatchingNonTextRuns): (WebCore::Layout::checkForMatchingTextRuns): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::textContext const): 2018-10-29 Youenn Fablet <youenn@apple.com> [WebRTC] Enable VP8 by default https://bugs.webkit.org/show_bug.cgi?id=190672 <rdar://problem/43663785> Reviewed by Eric Carlson. No change of behavior. * page/RuntimeEnabledFeatures.h: Set default value to true. 2018-10-28 Andy Estes <aestes@apple.com> [Payment Request] Implement MerchantValidationEvent.methodName https://bugs.webkit.org/show_bug.cgi?id=190058 Reviewed by Darin Adler. Implemented MerchantValidationEvent's methodName attribute and MerchantValidationEventInit's methodName property as specified in the Payment Request API W3C Editor's Draft of 27 September 2018. Covered by web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::validateMerchant): Passed the payment method identifier (as a string) to MerchantValidationEvent::create() * Modules/paymentrequest/MerchantValidationEvent.cpp: (WebCore::MerchantValidationEvent::create): Validated the methodName before constructing the event, throwing a RangeError on failure. (WebCore::MerchantValidationEvent::MerchantValidationEvent): * Modules/paymentrequest/MerchantValidationEvent.h: * Modules/paymentrequest/MerchantValidationEvent.idl: 2018-10-27 Antoine Quint <graouts@apple.com> [Web Animations] Remove WebAnimation::description() https://bugs.webkit.org/show_bug.cgi?id=190995 Reviewed by Dean Jackson. This method is never used. * animation/WebAnimation.cpp: (WebCore::WebAnimation::description): Deleted. * animation/WebAnimation.h: 2018-10-27 Antoine Quint <graouts@apple.com> [Web Animations] Move the logic of Document::getAnimations() to DocumentTimeline https://bugs.webkit.org/show_bug.cgi?id=190994 Reviewed by Dean Jackson. It would be cleaner to have the logic of document.getAnimations() on the DocumentTimeline instead of the Document, keep more animation-related code compartmentalized in the animation directory. No change in behavior, so no test update. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::getAnimations const): * animation/DocumentTimeline.h: * dom/Document.cpp: (WebCore::Document::getAnimations): 2018-10-27 Antoine Quint <graouts@apple.com> [Web Animations] Move bindings methods requiring style flush from CSSAnimation to DeclarativeAnimation https://bugs.webkit.org/show_bug.cgi?id=190996 Reviewed by Dean Jackson. Moving all of the IDL bindings methods that require flushing style from CSSAnimation to its superclass DeclarativeAnimation so we follow the same route in CSSTransition. Note that there was code in CSSAnimation::bindingsCurrentTime() that was not moved as it proved to not be necessary. * animation/CSSAnimation.cpp: (WebCore::CSSAnimation::bindingsPlay): (WebCore::CSSAnimation::bindingsPause): (WebCore::CSSAnimation::bindingsStartTime const): Deleted. (WebCore::CSSAnimation::setBindingsStartTime): Deleted. (WebCore::CSSAnimation::bindingsCurrentTime const): Deleted. (WebCore::CSSAnimation::setBindingsCurrentTime): Deleted. (WebCore::CSSAnimation::bindingsPlayState const): Deleted. (WebCore::CSSAnimation::bindingsPending const): Deleted. (WebCore::CSSAnimation::bindingsReady): Deleted. (WebCore::CSSAnimation::bindingsFinished): Deleted. (WebCore::CSSAnimation::flushPendingStyleChanges const): Deleted. * animation/CSSAnimation.h: * animation/DeclarativeAnimation.cpp: (WebCore::DeclarativeAnimation::bindingsStartTime const): (WebCore::DeclarativeAnimation::setBindingsStartTime): (WebCore::DeclarativeAnimation::bindingsCurrentTime const): (WebCore::DeclarativeAnimation::setBindingsCurrentTime): (WebCore::DeclarativeAnimation::bindingsPlayState const): (WebCore::DeclarativeAnimation::bindingsPending const): (WebCore::DeclarativeAnimation::bindingsReady): (WebCore::DeclarativeAnimation::bindingsFinished): (WebCore::DeclarativeAnimation::bindingsPlay): (WebCore::DeclarativeAnimation::bindingsPause): (WebCore::DeclarativeAnimation::flushPendingStyleChanges const): * animation/DeclarativeAnimation.h: 2018-10-27 Charlie Turner <cturner@igalia.com> [EME] Add a logging macro https://bugs.webkit.org/show_bug.cgi?id=190984 Reviewed by Xabier Rodriguez-Calvar. No tests since no new functionality. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): (WebCore::MediaKeySession::generateRequest): (WebCore::MediaKeySession::update): (WebCore::MediaKeySession::close): (WebCore::MediaKeySession::remove): (WebCore::MediaKeySession::sessionClosed): * Modules/encryptedmedia/MediaKeys.cpp: (WebCore::MediaKeys::createSession): * Modules/encryptedmedia/NavigatorEME.cpp: (WebCore::NavigatorEME::requestMediaKeySystemAccess): * platform/Logging.h: 2018-10-27 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME] Post key received to bus should be done before waking up other threads https://bugs.webkit.org/show_bug.cgi?id=190822 Reviewed by Philippe Normand. Notify after posting message to bus. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptSinkEventHandler): 2018-10-27 Charlie Turner <cturner@igalia.com> Fix release build with -DLOG_DISABLED=0 https://bugs.webkit.org/show_bug.cgi?id=190866 Reviewed by Xabier Rodriguez-Calvar. No new tests since no functionality changed. * platform/graphics/Font.cpp: * platform/graphics/Font.h: * platform/graphics/FontPlatformData.h: * platform/graphics/cocoa/FontPlatformDataCocoa.mm: * platform/graphics/freetype/FontPlatformDataFreeType.cpp: * platform/graphics/win/FontPlatformDataWin.cpp: 2018-10-26 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r237458. https://bugs.webkit.org/show_bug.cgi?id=190973 broke internal iOS builds (Requested by zalan on #webkit). Reverted changeset: "Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI" https://bugs.webkit.org/show_bug.cgi?id=190951 https://trac.webkit.org/changeset/237458 2018-10-26 Antoine Quint <graouts@apple.com> [Web Animations] Remove useless internals methods https://bugs.webkit.org/show_bug.cgi?id=190968 Reviewed by Dean Jackson. We had a few internals methods added early on in the Web Animations implementation that are no longer relevant now that the full API is implemented. We can safely remove them now. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::setCurrentTime): Deleted. (WebCore::AnimationTimeline::description): Deleted. * animation/AnimationTimeline.h: (WebCore::AnimationTimeline::currentTime): (WebCore::AnimationTimeline::pause): Deleted. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::currentTime): (WebCore::DocumentTimeline::pause): Deleted. * animation/DocumentTimeline.h: * testing/Internals.cpp: (WebCore::Internals::timelineDescription): Deleted. (WebCore::Internals::pauseTimeline): Deleted. (WebCore::Internals::setTimelineCurrentTime): Deleted. * testing/Internals.h: * testing/Internals.idl: 2018-10-26 Antoine Quint <graouts@apple.com> Web Inspector: Crash in http/tests/inspector/network/resource-response-source-memory-cache-revalidate-expired-only.html https://bugs.webkit.org/show_bug.cgi?id=190955 Reviewed by Dean Jackson. We can get in situations when running tests where runtime flags are not consistent throughout the time a test is run since showing the Web Inspector can cause flags to be re-set after the initial test was loaded. As such, to avoid crashes due to the ASSERT(!frame().animation().hasAnimations()) in FrameView::didDestroyRenderTree(), we now cancel animations upon teardown no matter what the value of the runtime flag for the Web Animations CSS Integration on both the DocumentTimeline (if it exists) and the CSSAnimationController. * dom/Element.cpp: (WebCore::Element::removedFromAncestor): * dom/PseudoElement.cpp: (WebCore::PseudoElement::clearHostElement): * page/FrameView.cpp: (WebCore::FrameView::didDestroyRenderTree): * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::tearDownRenderers): 2018-10-26 Timothy Hatcher <timothy@apple.com> Use dark appearance scrollbar when page background is dark or document supports dark mode. https://bugs.webkit.org/show_bug.cgi?id=190937 rdar://problem/41225839 Reviewed by Beth Dakin. * page/FrameView.cpp: (WebCore::FrameView::useDarkAppearance const): Added. Ask the document. (WebCore::FrameView::paintScrollCorner): Set LocalDefaultSystemAppearance based on the scrollbar overlay style too. * page/FrameView.h: * platform/ScrollableArea.h: (WebCore::ScrollableArea::useDarkAppearance const): Added. Default to false. * platform/mac/ScrollAnimatorMac.mm: (-[WebScrollerImpDelegate effectiveAppearanceForScrollerImp:]): Added. Ask the ScrollableArea if a dark appearance is desired. 2018-10-26 Antti Koivisto <antti@apple.com> Use random() instead of begin() to limit cache sizes https://bugs.webkit.org/show_bug.cgi?id=190957 Reviewed by Chris Dumez. We currently use cache.remove(cache.begin()) pattern to limit sized of various caches. This is a bad pattern for tables that never rehash (because they have fixed maximum size) as most of the keys get permanently stuck in the table. * css/CSSValuePool.cpp: (WebCore::CSSValuePool::createColorValue): (WebCore::CSSValuePool::createFontFamilyValue): (WebCore::CSSValuePool::createFontFaceValue): * dom/InlineStyleSheetOwner.cpp: (WebCore::InlineStyleSheetOwner::createSheet): * dom/SelectorQuery.cpp: * platform/graphics/FontCascade.cpp: (WebCore::retrieveOrAddCachedFonts): * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::shouldAutoActivateFontIfNeeded): * platform/mac/PublicSuffixMac.mm: (WebCore::topPrivatelyControlledDomain): 2018-10-26 Jer Noble <jer.noble@apple.com> Adopt -setOverrideRouteSharingPolicy:routingContextUID: SPI https://bugs.webkit.org/show_bug.cgi?id=190951 <rdar://problem/45213065> Reviewed by Alex Christensen. Request the correct route policy and context from the VideoFullscreenModel. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModel::requestRouteSharingPolicyAndContextUID): * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::requestRouteSharingPolicyAndContextUID): * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewController setWebKitOverrideRouteSharingPolicy:routingContextUID:]): (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): (VideoFullscreenInterfaceAVKit::doSetup): 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add more inline information to outputLayoutTree https://bugs.webkit.org/show_bug.cgi?id=190945 Reviewed by Antti Koivisto. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): (WebCore::Layout::outputLayoutBox): 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Layout floats as part of the inline content https://bugs.webkit.org/show_bug.cgi?id=190942 Reviewed by Antti Koivisto. Add float handling to InlineFormattingContext::layoutInlineContent. Note that floats don't actually generate inline runs. Test: fast/block/basic/inline-content-with-floating-image.html * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): * layout/floats/FloatAvoider.cpp: (WebCore::Layout::FloatAvoider::FloatAvoider): Check if any mapping is needed. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::isTrimmableContent): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::trimLeadingRun): Deleted. * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::isClosed const): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Adjust current line with float constraints. https://bugs.webkit.org/show_bug.cgi?id=190940 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::initializeNewLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::moveHorizontally): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalLeft): (WebCore::Layout::InlineFormattingContext::Line::adjustLogicalRight): 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Compute float box size and position https://bugs.webkit.org/show_bug.cgi?id=190938 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): (WebCore::Layout::InlineFormattingContext::computeFloatPosition const): * layout/inlineformatting/InlineFormattingContext.h: 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add line logical top and bottom https://bugs.webkit.org/show_bug.cgi?id=190934 Reviewed by Antti Koivisto. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::initializeNewLine const): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::isFirstLine const): (WebCore::Layout::InlineFormattingContext::Line::logicalTop const): (WebCore::Layout::InlineFormattingContext::Line::logicalBottom const): * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): (WebCore::Layout::InlineFormattingContext::Line::close): 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Find floating constraints for a given vertical position https://bugs.webkit.org/show_bug.cgi?id=190928 Reviewed by Antti Koivisto. https://www.w3.org/TR/CSS22/visuren.html#inline-formatting "In general, the left edge of a line box touches the left edge of its containing block and the right edge touches the right edge of its containing block. However, floating boxes may come between the containing block edge and the line box edge. Thus, although line boxes in the same inline formatting context generally have the same width (that of the containing block), they may vary in width if available horizontal space is reduced due to floats." This patch adds support for retrieving left/right constraints for a given line (vertical position). * layout/floats/FloatingState.cpp: (WebCore::Layout::FloatingState::constraints const): * layout/floats/FloatingState.h: 2018-10-26 Zalan Bujtas <zalan@apple.com> [LFC] Inline formatting context has higher priority than block https://bugs.webkit.org/show_bug.cgi?id=190924 Reviewed by Antti Koivisto. When an element establishes both inline and block formatting contexts, we need to pick one to create (and we choose the content driven formatting type (inline)). See example below: <div style="overflow: hidden">This text should be inside an inlines formatting context.</div> * layout/LayoutContext.cpp: (WebCore::Layout::LayoutContext::formattingContext const): 2018-10-26 Ali Juma <ajuma@chromium.org> REGRESSION (r237255): Text selection is broken in form fields https://bugs.webkit.org/show_bug.cgi?id=190899 Reviewed by Ryosuke Niwa. Fix missing negation when checking for a fully-clipped-out rect. This was causing RenderObject::computeVisibleRectInContainer to incorrectly early-out. Test: fast/repaint/text-selection-overflow-hidden.html * rendering/RenderObject.cpp: (WebCore::RenderObject::computeVisibleRectInContainer const): 2018-10-25 Chris Dumez <cdumez@apple.com> [PSON] Navigating cross-site with locked history but unlocked back/forward list fails to create a new BackForwardListItem https://bugs.webkit.org/show_bug.cgi?id=190915 <rdar://problem/45059069> Reviewed by Geoffrey Garen. * history/PageCache.cpp: (WebCore::canCacheFrame): Make sure we do not put into PageCache a page whose main frame is showing the initial empty document. We usually do not try to put those into PageCache because we do not have a HistoryItem to save the PageCache entry on. However, when we process-swap on a navigation with the history locked, the new process has a HistoryItem and is initially showing the initial empty document before continuing the load from the previous process. Note that saving the initial empty document in PageCache would lead to crashes later on previous the initial empty document's Window is taken and reused for the next load. * loader/FrameLoader.cpp: (WebCore::FrameLoader::load): Stop assuming that we're continuing a client-side redirect when lockHistory is Yes. It is lockBackForwardList that is actually Yes when we're doing a client-side redirect. * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): Stop using calling the completion handler with an invalid URL when the policy decision is 'Suspend' and use 'about:blank' instead. Without this change, FrameLoader::continueLoadAfterNavigationPolicy() would not load 'about:blank' when its AllowNavigationToInvalidURL parameter is No. 2018-10-25 Devin Rousso <drousso@apple.com> Fix build after r237431 for platforms that don't support FULLSCREEN_API Reviewed by Joseph Pecoraro. No new tests. No change in behavior. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::addEventListenersToNode): 2018-10-25 Devin Rousso <drousso@apple.com> Web Inspector: display fullscreen enter/exit events in Timelines and Network node waterfalls https://bugs.webkit.org/show_bug.cgi?id=189874 <rdar://problem/44700000> Reviewed by Joseph Pecoraro. Updated existing test: http/tests/inspector/dom/didFireEvent.html * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::EventFiredCallback::handleEvent): (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMAgent::addEventListenersToNode): (WebCore::InspectorDOMAgent::discardBindings): (WebCore::InspectorDOMAgent::eventDidResetAfterDispatch): Added. Prevent the same event from being sent to the frontend more than once. * dom/Event.cpp: (WebCore::Event::resetAfterDispatch): * dom/Document.cpp: (WebCore::Document::Document): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::eventDidResetAfterDispatch): Added. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::eventDidResetAfterDispatchImpl): Added. 2018-10-25 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, silence a -Wreturn-type warning When every return is supposed to be covered by a switch statement, a release assert or CRASH is required by GCC. * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType): 2018-10-25 Antoine Quint <graouts@apple.com> [Web Animations] Turn Web Animations CSS Integration off by default https://bugs.webkit.org/show_bug.cgi?id=190901 Reviewed by Dean Jackson. * page/RuntimeEnabledFeatures.h: 2018-10-25 Jon Davis <jond@apple.com> Changed "Under Development" status to use "In Development" instead https://bugs.webkit.org/show_bug.cgi?id=187615 Reviewed by Joseph Pecoraro. * features.json: Updated CSS Painting API Level 1 and CSS Properties and Values API Level 1. 2018-10-25 Chris Dumez <cdumez@apple.com> REGRESSION (236779) scandinaviandesigns.com product pages auto redirect to product image https://bugs.webkit.org/show_bug.cgi?id=190891 <rdar://problem/45296796> Reviewed by Antti Koivisto. When a radio element gets clicked, we should only fire the 'input' and 'change' if the checked state of the radio element has changed. Test: fast/dom/HTMLInputElement/radio-element-fires-change-event-only-when-checked-state-changes.html * html/RadioInputType.cpp: (WebCore::RadioInputType::didDispatchClick): 2018-10-25 Joseph Pecoraro <pecoraro@apple.com> InspectorCanvas is not getting cleared properly for OffscreenCanvas https://bugs.webkit.org/show_bug.cgi?id=190894 <rdar://problem/45498435> Reviewed by Simon Fraser. Covered by existing tests not crashing with guard malloc. InspectorCanvasAgents tracks all CanvasRenderingContexts and needs to remove its reference when the containing CanvasBase goes away. It does this by registering as a notification observer, but if it can't map from the CanvasBase back to the rendering context we were failing to remove our reference. Enforce CanvasBase classes to notify observers of destruction while they still have their CanvasRenderingContext. * html/CanvasBase.cpp: (WebCore::CanvasBase::~CanvasBase): (WebCore::CanvasBase::notifyObserversCanvasDestroyed): * html/CanvasBase.h: Assert that subclasses notify observers of the canvas being destroyed, since they will need to do this before m_context is cleared. * html/CustomPaintCanvas.cpp: (WebCore::CustomPaintCanvas::~CustomPaintCanvas): * html/OffscreenCanvas.cpp: (WebCore::OffscreenCanvas::~OffscreenCanvas): Follow the new expected pattern of notifying observers before clearing the context. HTMLCanvasElement already followed this pattern. * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::canvasDestroyed): Add an assertion that would catch this earlier. 2018-10-24 Alexey Proskuryakov <ap@apple.com> Clean up some obsolete macOS version guards https://bugs.webkit.org/show_bug.cgi?id=190887 Reviewed by Dan Bernstein. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const): (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const): 2018-10-24 Tim Horton <timothy_horton@apple.com> Attachment filenames with RTL characters should format similar to Finder https://bugs.webkit.org/show_bug.cgi?id=190736 <rdar://problem/44735946> Reviewed by Dan Bernstein. Test: fast/attachment/attachment-title-with-rtl.html * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::attachmentTitleForDisplay const): * html/HTMLAttachmentElement.h: Add attachmentTitleForDisplay(), which wraps the non-extension part of attachmentTitle in BiDi isolates, matching Finder's behavior. * rendering/RenderThemeIOS.mm: (WebCore::RenderAttachmentInfo::buildWrappedLines): (WebCore::RenderAttachmentInfo::RenderAttachmentInfo): * rendering/RenderThemeMac.mm: (WebCore::AttachmentLayout::layOutTitle): Adopt attachmentTitleForDisplay, and ask CoreText to use a subrange of the original string for the last line, instead of splitting the string ourselves. This ensures that BiDi control characters are respected even in the last line of the string. 2018-10-24 Megan Gardner <megan_gardner@apple.com> Turn on Conic Gradients https://bugs.webkit.org/show_bug.cgi?id=190810 Reviewed by Tim Horton. Added tests previously, only switching feature from experimental to always avaiable. * Configurations/FeatureDefines.xcconfig: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): (WebCore::operator==): * css/parser/CSSParserContext.h: (WebCore::CSSParserContextHash::hash): * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeConicGradient): * page/Settings.yaml: 2018-10-11 Jiewen Tan <jiewen_tan@apple.com> Only report resource timing to parent frame for the first iframe load https://bugs.webkit.org/show_bug.cgi?id=190498 <rdar://problem/44347398> Reviewed by Youenn Fablet. Only the first iframe navigation or the first iframe navigation after about:blank should be reported. https://www.w3.org/TR/resource-timing-2/#resources-included-in-the-performanceresourcetiming-interface Test: http/tests/misc/resource-timing-navigation-in-restored-iframe.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadWithDocumentLoader): * loader/FrameLoader.h: (WebCore::FrameLoader::shouldReportResourceTimingToParentFrame): (WebCore::FrameLoader::setShouldReportResourceTimingToParentFrame): Deleted. * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::addResourceTiming): 2018-10-24 Brent Fulgham <bfulgham@apple.com> Cure Windows Direct2D Backend of a nasty case of bitrot https://bugs.webkit.org/show_bug.cgi?id=190875 <rdar://problem/45523268> Reviewed by Zalan Bujtas. The Direct2D backend has drifted out of date with the rest of WebKit. This patch updates things so we can get a runnable build. * platform/graphics/FontPlatformData.h: * platform/graphics/ImageBuffer.cpp: (WebCore::ImageBuffer::create): * platform/graphics/ImageBuffer.h: * platform/graphics/ImageDecoder.h: * platform/graphics/ImageSource.cpp: (WebCore::ImageSource::setTargetContext): * platform/graphics/opentype/OpenTypeMathData.cpp: (WebCore::OpenTypeMathData::OpenTypeMathData): Need non-default constructor to make Visual Studio happy. * platform/graphics/win/GradientDirect2D.cpp: (WebCore::Gradient::generateGradient): * platform/graphics/win/GraphicsContextDirect2D.cpp: Update for new display list implementation. (WebCore::GraphicsContextPlatformPrivate::setAlpha): (WebCore::GraphicsContext::savePlatformState): (WebCore::GraphicsContext::restorePlatformState): (WebCore::GraphicsContext::drawNativeImage): (WebCore::GraphicsContext::drawPattern): (WebCore::GraphicsContext::drawRect): (WebCore::GraphicsContext::drawLine): (WebCore::GraphicsContext::drawEllipse): (WebCore::GraphicsContext::drawPath): (WebCore::GraphicsContext::fillPath): (WebCore::GraphicsContext::strokePath): (WebCore::GraphicsContext::fillRect): (WebCore::GraphicsContext::platformFillRoundedRect): (WebCore::GraphicsContext::fillRectWithRoundedHole): (WebCore::GraphicsContext::clip): (WebCore::GraphicsContext::clipOut): (WebCore::GraphicsContext::clipPath): (WebCore::GraphicsContext::clipBounds const): (WebCore::GraphicsContext::beginPlatformTransparencyLayer): (WebCore::GraphicsContext::endPlatformTransparencyLayer): (WebCore::GraphicsContext::setMiterLimit): (WebCore::GraphicsContext::clearRect): (WebCore::GraphicsContext::strokeRect): (WebCore::GraphicsContext::setLineCap): (WebCore::GraphicsContext::setLineDash): (WebCore::GraphicsContext::setLineJoin): (WebCore::GraphicsContext::scale): (WebCore::GraphicsContext::rotate): (WebCore::GraphicsContext::translate): (WebCore::GraphicsContext::concatCTM): (WebCore::GraphicsContext::setCTM): (WebCore::GraphicsContext::getCTM const): (WebCore::GraphicsContext::roundToDevicePixels): (WebCore::GraphicsContext::drawLinesForText): (WebCore::GraphicsContext::setURLForRect): (WebCore::GraphicsContext::setIsCALayerContext): (WebCore::GraphicsContext::isCALayerContext const): (WebCore::GraphicsContext::setIsAcceleratedContext): (WebCore::GraphicsContext::isAcceleratedContext const): (WebCore::GraphicsContext::setPlatformShouldAntialias): (WebCore::GraphicsContext::setPlatformShouldSmoothFonts): (WebCore::GraphicsContext::setPlatformCompositeOperation): (WebCore::GraphicsContext::platformFillEllipse): (WebCore::GraphicsContext::platformStrokeEllipse): * platform/graphics/win/GraphicsLayerDirect2D.cpp: (WebCore::GraphicsLayer::create): (): Deleted. * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::putData): * platform/graphics/win/ImageBufferDataDirect2D.h: * platform/graphics/win/ImageBufferDirect2D.cpp: (WebCore::ImageBuffer::createCompatibleBuffer): (WebCore::ImageBuffer::ImageBuffer): * platform/graphics/win/ImageDecoderDirect2D.cpp: (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties const): (WebCore::ImageDecoderDirect2D::encodedDataStatus const): (WebCore::ImageDecoderDirect2D::repetitionCount const): (WebCore::ImageDecoderDirect2D::frameOrientationAtIndex const): (WebCore::ImageDecoderDirect2D::frameDurationAtIndex const): (WebCore::ImageDecoderDirect2D::frameAllowSubsamplingAtIndex const): (WebCore::ImageDecoderDirect2D::frameHasAlphaAtIndex const): (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex): (WebCore::ImageDecoderDirect2D::setData): (WebCore::ImageDecoderDirect2D::bytesDecodedToDetermineProperties): Deleted. (WebCore::ImageDecoderDirect2D::createFrameImageAtIndex const): Deleted. * platform/graphics/win/ImageDecoderDirect2D.h: * platform/graphics/win/ImageDirect2D.cpp: (WebCore::BitmapImage::drawFrameMatchingSourceSize): * platform/graphics/win/PatternDirect2D.cpp: (WebCore::Pattern::createPlatformPattern const): 2018-10-24 Said Abou-Hallawa <sabouhallawa@apple.com> Cleanup: MIMETypeRegistry functions https://bugs.webkit.org/show_bug.cgi?id=190838 Reviewed by Simon Fraser. Modernize the initialization of the lists in MIMETypeRegistry. Make the functions that return these list be self-contained. Use NeverDestroy<> to allocate the local static variable. Use std::initializer_list() and makeNeverDestroyed() to initialize NeverDestroy<> variables only once. supportedImageResourceMIMETypes will be deleted and all the calls to it will be replaced by supportedImageMIMETypes because they are identical. * loader/archive/ArchiveFactory.cpp: (WebCore::ArchiveFactory::registerKnownArchiveMIMETypes): This function is called while initializing the supportedNonImageMIMETypes(). So it should not have a direct call to it. Instead, supportedNonImageMIMETypes is passed to it. * loader/archive/ArchiveFactory.h: * platform/MIMETypeRegistry.cpp: (WebCore::MIMETypeRegistry::supportedImageMIMETypes): (WebCore::supportedImageMIMETypesForEncoding): (WebCore::supportedJavaScriptMIMETypes): (WebCore::MIMETypeRegistry::supportedNonImageMIMETypes): (WebCore::MIMETypeRegistry::supportedMediaMIMETypes): (WebCore::pdfMIMETypes): (WebCore::MIMETypeRegistry::unsupportedTextMIMETypes): (WebCore::MIMETypeRegistry::isSupportedImageMIMEType): (WebCore::MIMETypeRegistry::isSupportedImageMIMETypeForEncoding): (WebCore::MIMETypeRegistry::isSupportedJavaScriptMIMEType): (WebCore::MIMETypeRegistry::isSupportedNonImageMIMEType): (WebCore::MIMETypeRegistry::isSupportedMediaMIMEType): (WebCore::MIMETypeRegistry::isUnsupportedTextMIMEType): (WebCore::MIMETypeRegistry::isPDFMIMEType): (WebCore::MIMETypeRegistry::systemPreviewMIMETypes): (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType): (WebCore::initializeSupportedImageMIMETypes): Deleted. (WebCore::initializeSupportedImageMIMETypesForEncoding): Deleted. (WebCore::initializeSupportedJavaScriptMIMETypes): Deleted. (WebCore::initializePDFMIMETypes): Deleted. (WebCore::initializeSupportedNonImageMimeTypes): Deleted. (WebCore::initializeSupportedMediaMIMETypes): Deleted. (WebCore::initializeUnsupportedTextMIMETypes): Deleted. (WebCore::MIMETypeRegistry::isSupportedImageResourceMIMEType): Deleted. (WebCore::MIMETypeRegistry::getSupportedImageMIMETypes): Deleted. (WebCore::MIMETypeRegistry::getSupportedImageResourceMIMETypes): Deleted. (WebCore::MIMETypeRegistry::getSupportedNonImageMIMETypes): Deleted. (WebCore::MIMETypeRegistry::getSupportedMediaMIMETypes): Deleted. (WebCore::MIMETypeRegistry::getPDFMIMETypes): Deleted. (WebCore::MIMETypeRegistry::getUnsupportedTextMIMETypes): Deleted. (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes): Deleted. * platform/MIMETypeRegistry.h: * platform/graphics/Image.cpp: (WebCore::Image::supportsType): * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::encodedDataStatus const): * platform/graphics/cg/UTIRegistry.cpp: (WebCore::supportedDefaultImageSourceTypes): (WebCore::isSupportImageSourceType): (WebCore::allowedImageUTIs): Deleted. (WebCore::isAllowedImageUTI): Deleted. * platform/graphics/cg/UTIRegistry.h: * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::write): 2018-10-24 Chris Dumez <cdumez@apple.com> [PSON] When navigating back and forth, 'about:blank' shows up in the back/forward list https://bugs.webkit.org/show_bug.cgi?id=190846 <rdar://problem/45058938> Reviewed by Antti Koivisto. When a page gets suspended after a process-swap, we navigate it to about:blank from inside the navigation policy handler, by overriding the request URL. This normally works fine because we usually process-swap on standard navigation. However, when we would process-swap on a back/forward navigation, we would end up using the back/forward navigation load type to do the about:blank load. This would have repercussions because history navigations update the current history item with the new URL (in this case 'about:blank'). To avoid the issue, switch to a standard load type whenever the client asks us to suspend and we load 'about:blank' as a result. * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): 2018-10-24 Andy Estes <aestes@apple.com> [macOS Debug WK2] Layout Test http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=190650 <rdar://problem/45341914> Reviewed by Alex Christensen. In computeErrors, we intend to ignore errors when computing paymentMethodErrors. But we weren't clearing exceptions generated from calling convert(), so they would end up being logged as unhandled promise rejections. Changed ApplePayPaymentHandler::computeErrors() to use a CatchScope to clear exceptions when decoding paymentMethodErrors. Also changed ApplePayShippingAddressChangeEventErrorsV3.https.html to catch promise rejections from calling PaymentRequest.abort(). Covered by existing test. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computeErrors const): 2018-10-22 Antti Koivisto <antti@apple.com> topPrivatelyControlledDomain is slow https://bugs.webkit.org/show_bug.cgi?id=190792 Reviewed by Alex Christensen and Chris Dumez. It calls into some slowish CFNetwork code and ends up showing up in profiles. * platform/mac/PublicSuffixMac.mm: (WebCore::topPrivatelyControlledDomain): Add a cache that avoids calls into frameworks. 2018-10-22 Jer Noble <jer.noble@apple.com> Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC https://bugs.webkit.org/show_bug.cgi?id=190790 Reviewed by Alex Christensen. Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making incrementing the pending task count atomic. * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::postTask): (WebCore::TaskDispatcher<Timer>::sharedLock): (WebCore::TaskDispatcher<Timer>::sharedTimerFired): (WebCore::TaskDispatcher<Timer>::dispatchOneTask): (WebCore::TaskDispatcher<Timer>::pendingDispatchers): * platform/GenericTaskQueue.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): (-[WebCoreAVFMovieObserver initWithPlayer:]): (-[WebCoreAVFMovieObserver disconnect]): (-[WebCoreAVFMovieObserver metadataLoaded]): (-[WebCoreAVFMovieObserver didEnd:]): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]): (-[WebCoreAVFLoaderDelegate initWithPlayer:]): (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (-[WebCoreAVFPullDelegate initWithPlayer:]): (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]): (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted. (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted. (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted. (-[WebCoreAVFPullDelegate setCallback:]): Deleted. 2018-10-23 Jer Noble <jer.noble@apple.com> TextTrack cues should be updated more often than every 250ms. https://bugs.webkit.org/show_bug.cgi?id=190827 Reviewed by Eric Carlson. Test: media/track/track-cue-timing.html TextTracks cues are recalculated on the playback timer, which fires at least every 250ms. In addition to this timer, add a method to MediaPlayer to provide a task which will be performed at a particular media time, and use this new method to request cues be updated at the next interesting media time. The next interesting time would be either when the soonest current cue will end, or when the next non-current cue will start, whichever is earlier. (Determining the "next non-current cue" requires new API on PODIntervalTree, as that class does not have iterators per-se.) * html/HTMLMediaElement.cpp: (WebCore::compareCueIntervalEndTime): (WebCore::HTMLMediaElement::updateActiveTextTrackCues): * platform/PODIntervalTree.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::performTaskAtMediaTime): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::performTaskAtMediaTime): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::performTaskAtMediaTime): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::performTaskAtMediaTime): 2018-10-23 Fujii Hironori <Hironori.Fujii@sony.com> [Win] Assertion fails while destructing local static AtomicString of FontCache::lastResortFallbackFont https://bugs.webkit.org/show_bug.cgi?id=190748 Reviewed by Myles C. Maxfield. FontCache::lastResortFallbackFont had local static AtomicString variables which are not capsuled by NeverDestroyed. Hence, those variables are destructed on IPC thread when WebProcess exits. Changed those AtomicString to NeverDestroyed<AtomicString> not to be destructed on exit. This change can't be tested automatically because WebKitTestRunner doesn't support Windows port yet. * platform/graphics/win/FontCacheWin.cpp: (WebCore::FontCache::lastResortFallbackFont): Changed fallbackFonts's type from AtomicString array to NeverDestroyed<AtomicString> array. 2018-10-23 Justin Fan <justin_fan@apple.com> [WebGPU] Rename old GPU* implementation files to GPULegacy* for WebMetal https://bugs.webkit.org/show_bug.cgi?id=190817 Reviewed by Dean Jackson. No new tests. No change in behavior. * [Large list of refactored classes and renamed files]: GPU* is now GPULegacy* 2018-10-23 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r237261. The layout test for this change crashes under GuardMalloc. Reverted changeset: "Handle MDNS resolution of candidates through libwebrtc directly" https://bugs.webkit.org/show_bug.cgi?id=190681 https://trac.webkit.org/changeset/237261 2018-10-23 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r237357. API test is now failing on all platforms. Reverted changeset: "topPrivatelyControlledDomain is slow" https://bugs.webkit.org/show_bug.cgi?id=190792 https://trac.webkit.org/changeset/237357 2018-10-23 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r237350. Caused several Crashes cross multiple tests and platforms. Reverted changeset: "Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC" https://bugs.webkit.org/show_bug.cgi?id=190790 https://trac.webkit.org/changeset/237350 2018-10-23 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r237280. Causes fast/box-shadow/box-shadow-with-zero-radius.html to fail on iOS Simulator. Reverted changeset: "[CG] Adopt CG SPI for non-even cornered rounded rects" https://bugs.webkit.org/show_bug.cgi?id=190155 https://trac.webkit.org/changeset/237280 2018-10-23 Antti Koivisto <antti@apple.com> topPrivatelyControlledDomain is slow https://bugs.webkit.org/show_bug.cgi?id=190792 Reviewed by Alex Christensen. It calls into some slowish CFNetwork code and ends up showing up in profiles. * platform/mac/PublicSuffixMac.mm: (WebCore::topPrivatelyControlledDomain): Add a cache that avoids calls into frameworks. 2018-10-23 Chris Dumez <cdumez@apple.com> [PSON] Add support for cross-site client-side redirects https://bugs.webkit.org/show_bug.cgi?id=190806 <rdar://problem/45047344> Reviewed by Geoffrey Garen. Add support for cross-site client-side redirects so that it swaps process and so that the back forward list looks as expected. To support this, the following changes had to be done: - The NavigationAction now provides additional information so that the WebProcess can communicate things about the client-side redirect to the UIProcess: lockHistory / lockBackForwardList and clientRedirectSourceForHistory. - If the UIProcess decides to process-swap on a client-side redirect, we pass the client-side redirect information to the new WebContent process via LoadRequest struct. WebCore then takes care of setting things up using this information so that it recognizes that it is continuing a load that is a client side redirect. - We also need to pass the current BackForwardListItem / HistoryItem to the new WebContent process so that the new process can truly lock history and keep updating the *current* HistoryItem, instead of creating a new HistoryItem. - After a process swap, when we re-construct the WebFrameProxy for the main frame in the new process, we now set the frame's URL in the UIProcess to the URL it had before we swapped. Clients such as Safari, rely on the main frame's URL being the expected value (the last committed load URL) until the next load is committed when receiving didPerformRedirect calls. Because we are destroying the main frame on process-swapping, we were losing the last committed URL and Safari would hit assertions. With this model, the willPerformClientRedirect IPC is still sent from the previous WebProcess and the didPerformClientRedirect IPC is now sent by the new WebProcess. No change should be observable from the client's point of view. * loader/FrameLoadRequest.h: (WebCore::FrameLoadRequest::setLockHistory): (WebCore::FrameLoadRequest::setlockBackForwardList): (WebCore::FrameLoadRequest::clientRedirectSourceForHistory const): (WebCore::FrameLoadRequest::setClientRedirectSourceForHistory): * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::load): * loader/HistoryController.cpp: (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList): * loader/HistoryController.h: * loader/NavigationAction.h: (WebCore::NavigationAction::lockHistory const): (WebCore::NavigationAction::setLockHistory): (WebCore::NavigationAction::lockBackForwardList const): (WebCore::NavigationAction::setLockBackForwardList): 2018-10-23 Jer Noble <jer.noble@apple.com> Use WeakPtr and GenericTaskQueue within ObjC classes used by MediaPlayerPrivateAVFoundationObjC https://bugs.webkit.org/show_bug.cgi?id=190790 Reviewed by Alex Christensen. Move towards using WeakPtr callbacks instead of raw pointers within the utility objects used by MediaPlayerPrivateAVFoundationObjC. Additionally, accessing WeakPtr off the thread which created the pointer is not allowed, so use a GenericTaskQueue to schedule callbacks instead. Make GenericTaskQueue<Timer> thread-safe by locking around access to m_pendingTasks, and by making incrementing the pending task count atomic. * platform/GenericTaskQueue.cpp: (WebCore::TaskDispatcher<Timer>::postTask): (WebCore::TaskDispatcher<Timer>::sharedLock): (WebCore::TaskDispatcher<Timer>::sharedTimerFired): (WebCore::TaskDispatcher<Timer>::dispatchOneTask): (WebCore::TaskDispatcher<Timer>::pendingDispatchers): * platform/GenericTaskQueue.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): (-[WebCoreAVFMovieObserver initWithPlayer:]): (-[WebCoreAVFMovieObserver disconnect]): (-[WebCoreAVFMovieObserver metadataLoaded]): (-[WebCoreAVFMovieObserver didEnd:]): (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]): (-[WebCoreAVFMovieObserver legibleOutput:didOutputAttributedStrings:nativeSampleBuffers:forItemTime:]): (-[WebCoreAVFMovieObserver outputSequenceWasFlushed:]): (-[WebCoreAVFLoaderDelegate initWithPlayer:]): (-[WebCoreAVFLoaderDelegate resourceLoader:shouldWaitForLoadingOfRequestedResource:]): (-[WebCoreAVFLoaderDelegate resourceLoader:didCancelLoadingRequest:]): (-[WebCoreAVFPullDelegate initWithPlayer:]): (-[WebCoreAVFPullDelegate outputMediaDataWillChange:]): (-[WebCoreAVFMovieObserver initWithCallback:]): Deleted. (-[WebCoreAVFLoaderDelegate initWithCallback:]): Deleted. (-[WebCoreAVFLoaderDelegate setCallback:]): Deleted. (-[WebCoreAVFPullDelegate initWithCallback:]): Deleted. (-[WebCoreAVFPullDelegate setCallback:]): Deleted. 2018-10-22 Justin Michaud <justin_michaud@apple.com> Registered custom properties should support syntax parameter for <length> and * https://bugs.webkit.org/show_bug.cgi?id=190039 Reviewed by Antti Koivisto. Refactor code so that: - All properties applied in StyleResolver::applyMatchedProperties are only applied once. - Custom properties are only resolved once, in StyleResolver, when they are applied to the RenderStyle. They were previously resolved every time they were referenced, and again in RenderStyle. - The font-size property is applied after its variable references, but before custom properties that depend on it. - Cycles are detected at the same time as resolution. - MutableStyleProperties' custom properties cannot be set from Javascript or WebKitLegacy if they do not parse for the property's type. If they contain var(--...) references, however, then they can be set because we cannot check if the references are valid from setProperty. This behaviour matches chrome, but is not documented in the spec. - Custom property values have more explicit resolved/unresolved state. - RenderStyle only ever holds resolved custom properties, and StyleResolver::CascadedProperties only holds unresolved properties. Tests: css-custom-properties-api/crash.html css-custom-properties-api/cycles.html css-custom-properties-api/inline.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::equals const): (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): Deleted. (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): Deleted. (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): Deleted. * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): * css/CSSRegisteredCustomProperty.h: * css/CSSStyleSheet.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::CSSVariableData): (WebCore::CSSVariableData::consumeAndUpdateTokens): Deleted. (WebCore::CSSVariableData::checkVariablesForCycles const): Deleted. (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): Deleted. (WebCore::CSSVariableData::resolveVariableFallback const): Deleted. (WebCore::CSSVariableData::resolveVariableReference const): Deleted. (WebCore::CSSVariableData::resolveVariableReferences const): Deleted. (WebCore::CSSVariableData::resolveTokenRange const): Deleted. * css/CSSVariableData.h: (WebCore::CSSVariableData::create): (WebCore::CSSVariableData::createResolved): Deleted. (WebCore::CSSVariableData::needsVariableResolution const): Deleted. (WebCore::CSSVariableData::CSSVariableData): Deleted. * css/CSSVariableReferenceValue.cpp: (WebCore::resolveVariableFallback): (WebCore::resolveVariableReference): (WebCore::resolveTokenRange): (WebCore::CSSVariableReferenceValue::resolveVariableReferences const): (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): Deleted. * css/CSSVariableReferenceValue.h: (WebCore::CSSVariableReferenceValue::create): (WebCore::CSSVariableReferenceValue::equals const): (WebCore::CSSVariableReferenceValue::variableDataValue const): Deleted. * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/PropertySetCSSStyleDeclaration.cpp: (WebCore::PropertySetCSSStyleDeclaration::setProperty): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleProperties.cpp: (WebCore::MutableStyleProperties::setCustomProperty): * css/StyleProperties.h: * css/StyleResolver.cpp: (WebCore::StyleResolver::State::setStyle): (WebCore::StyleResolver::styleForKeyframe): (WebCore::StyleResolver::styleForPage): (WebCore::StyleResolver::applyMatchedProperties): (WebCore::StyleResolver::applyPropertyToCurrentStyle): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::CascadedProperties::applyDeferredProperties): (WebCore::StyleResolver::CascadedProperties::Property::apply): (WebCore::StyleResolver::applyCascadedCustomProperty): (WebCore::StyleResolver::applyCascadedProperties): * css/StyleResolver.h: * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::CSSPropertyParser): (WebCore::CSSPropertyParser::canParseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::parseTypedCustomPropertyValue): (WebCore::CSSPropertyParser::collectParsedCustomPropertyValueDependencies): (WebCore::CSSPropertyParser::parseValueStart): (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParser.h: * css/parser/CSSVariableParser.cpp: (WebCore::CSSVariableParser::parseDeclarationValue): * dom/ConstantPropertyMap.cpp: (WebCore::ConstantPropertyMap::setValueForProperty): (WebCore::variableDataForPositivePixelLength): (WebCore::variableDataForPositiveDuration): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): Deleted. * rendering/style/RenderStyle.h: (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): * rendering/style/StyleCustomPropertyData.h: (WebCore::StyleCustomPropertyData::operator== const): (WebCore::StyleCustomPropertyData::setCustomPropertyValue): (WebCore::StyleCustomPropertyData::StyleCustomPropertyData): (): Deleted. 2018-10-22 Justin Michaud <justin_michaud@apple.com> CSS Paint API should give a 2d rendering context https://bugs.webkit.org/show_bug.cgi?id=190762 Reviewed by Dean Jackson. Add a new type of canvas and 2d rendering context to support the CSS Painting API. Make many of the methods from HTMLCanvasElement virtual functions on CanvasBase, and remove many of the downcasts in CanvasRenderingContext2DBase as a result. * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSPaintRenderingContext2DCustom.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::root): (WebCore::JSPaintRenderingContext2DOwner::isReachableFromOpaqueRoots): (WebCore::JSPaintRenderingContext2D::visitAdditionalChildren): * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * html/CanvasBase.cpp: (WebCore::CanvasBase::~CanvasBase): * html/CanvasBase.h: (WebCore::CanvasBase::isCustomPaintCanvas const): * html/CustomPaintCanvas.cpp: Added. (WebCore::CustomPaintCanvas::create): (WebCore::CustomPaintCanvas::CustomPaintCanvas): (WebCore::CustomPaintCanvas::~CustomPaintCanvas): (WebCore::CustomPaintCanvas::width const): (WebCore::CustomPaintCanvas::setWidth): (WebCore::CustomPaintCanvas::height const): (WebCore::CustomPaintCanvas::setHeight): (WebCore::CustomPaintCanvas::size const): (WebCore::CustomPaintCanvas::setSize): (WebCore::CustomPaintCanvas::getContext): (WebCore::CustomPaintCanvas::copiedImage const): (WebCore::CustomPaintCanvas::drawingContext const): (WebCore::CustomPaintCanvas::existingDrawingContext const): (WebCore::CustomPaintCanvas::makeRenderingResultsAvailable): * html/CustomPaintCanvas.h: Copied from Source/WebCore/html/OffscreenCanvas.h. * html/HTMLCanvasElement.h: * html/OffscreenCanvas.h: * html/canvas/CanvasRenderingContext.cpp: (WebCore::CanvasRenderingContext::wouldTaintOrigin): * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::isPaint const): * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::DisplayListDrawingContext::DisplayListDrawingContext): (WebCore::CanvasRenderingContext2DBase::unwindStateStack): (WebCore::CanvasRenderingContext2DBase::isAccelerated const): (WebCore::CanvasRenderingContext2DBase::setStrokeStyle): (WebCore::CanvasRenderingContext2DBase::setFillStyle): (WebCore::CanvasRenderingContext2DBase::resetTransform): (WebCore::CanvasRenderingContext2DBase::clearCanvas): (WebCore::CanvasRenderingContext2DBase::transformAreaToDevice const): (WebCore::CanvasRenderingContext2DBase::rectContainsCanvas const): (WebCore::CanvasRenderingContext2DBase::calculateCompositingBufferRect): (WebCore::CanvasRenderingContext2DBase::compositeBuffer): (WebCore::CanvasRenderingContext2DBase::createPattern): (WebCore::CanvasRenderingContext2DBase::didDrawEntireCanvas): (WebCore::CanvasRenderingContext2DBase::didDraw): (WebCore::CanvasRenderingContext2DBase::paintRenderingResultsToCanvas): (WebCore::CanvasRenderingContext2DBase::drawingContext const): * html/canvas/CanvasRenderingContext2DBase.h: * html/canvas/PaintRenderingContext2D.cpp: Copied from Source/WebCore/css/CSSPaintCallback.h. (WebCore::PaintRenderingContext2D::create): (WebCore::PaintRenderingContext2D::PaintRenderingContext2D): * html/canvas/PaintRenderingContext2D.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * html/canvas/PaintRenderingContext2D.idl: Copied from Source/WebCore/css/CSSPaintCallback.idl. * html/canvas/WebMetalRenderPassAttachmentDescriptor.h: * platform/graphics/CustomPaintImage.cpp: (WebCore::CustomPaintImage::doCustomPaint): 2018-10-22 Keith Rollin <krollin@apple.com> Use Location = "Relative to Build Products" rather than "Relative to Group" https://bugs.webkit.org/show_bug.cgi?id=190781 Reviewed by Alexey Proskuryakov. Almost all Derived Files are included in Xcode projects with the Location attribute set to "Relative to Group". While this currently works, the Derived Files can no longer be found when enabling XCBuild (which has stricter requirements). Fix this by setting the Location attribute to "Relative to Build Products". No new tests -- no changed functionality. * WebCore.xcodeproj/project.pbxproj: 2018-10-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add justify text-align support. https://bugs.webkit.org/show_bug.cgi?id=190779 Reviewed by Antti Koivisto. Collect expansion opportunities and adjust runs accordingly. * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::expansionOpportunity): (WebCore::Layout::InlineRun::TextContext::setStart): (WebCore::Layout::InlineRun::TextContext::setLength): (WebCore::Layout::InlineRun::setTextContext): (WebCore::Layout::InlineRun::createRun): Deleted. (WebCore::Layout::InlineRun::createTextRun): Deleted. * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::Line): (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::InlineFormattingContext::Line::computeExpansionOpportunities): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::justifyRuns): (WebCore::Layout::InlineFormattingContext::Line::close): (WebCore::Layout::isNonCollapsedText): Deleted. 2018-10-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add (right, center)text-align support. https://bugs.webkit.org/show_bug.cgi?id=190745 Reviewed by Antti Koivisto. Adjust the logical left of each run while closing the line. * layout/Verification.cpp: (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::trimLeadingRun): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::hasContent const): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): Deleted. * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::nextRun): (WebCore::Layout::InlineLineBreaker::splitRun): * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/InlineRun.h: (WebCore::Layout::InlineRun::setLogicalLeft): (WebCore::Layout::InlineRun::TextContext::start const): (WebCore::Layout::InlineRun::createRun): (WebCore::Layout::InlineRun::createTextRun): (WebCore::Layout::InlineRun::InlineRun): (WebCore::Layout::InlineRun::TextContext::TextContext): (WebCore::Layout::InlineRun::TextContext::position const): Deleted. * layout/inlineformatting/Line.cpp: (WebCore::Layout::InlineFormattingContext::Line::Line): (WebCore::Layout::InlineFormattingContext::Line::init): (WebCore::Layout::adjustedLineLogicalLeft): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalRight): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): (WebCore::Layout::InlineFormattingContext::Line::setConstraints): Deleted. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): 2018-10-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Implement Replaced helper class. https://bugs.webkit.org/show_bug.cgi?id=190719 Reviewed by Antti Koivisto. * layout/layouttree/LayoutBox.cpp: (WebCore::Layout::Box::Box): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::replaced const): * layout/layouttree/LayoutReplaced.cpp: (WebCore::Layout::Replaced::Replaced): (WebCore::Layout::Replaced::hasIntrinsicWidth const): (WebCore::Layout::Replaced::hasIntrinsicHeight const): (WebCore::Layout::Replaced::hasIntrinsicRatio const): (WebCore::Layout::Replaced::intrinsicWidth const): (WebCore::Layout::Replaced::intrinsicHeight const): (WebCore::Layout::Replaced::intrinsicRatio const): * layout/layouttree/LayoutReplaced.h: (WebCore::Layout::Replaced::hasIntrinsicWidth const): Deleted. (WebCore::Layout::Replaced::hasIntrinsicHeight const): Deleted. (WebCore::Layout::Replaced::hasIntrinsicRatio const): Deleted. (WebCore::Layout::Replaced::intrinsicWidth const): Deleted. (WebCore::Layout::Replaced::intrinsicHeight const): Deleted. (WebCore::Layout::Replaced::intrinsicRatio const): Deleted. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-10-22 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Block formatting context roots avoid floats. https://bugs.webkit.org/show_bug.cgi?id=190723 Reviewed by Antti Koivisto. Inline formatting context roots don't avoid floats (unless they also establish block formatting context). * layout/blockformatting/BlockFormattingContext.cpp: (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const): 2018-10-20 YUHAN WU <yuhan_wu@apple.com> MediaRecorder should fire a stop event when all tracks are ended https://bugs.webkit.org/show_bug.cgi?id=190642 Reviewed by Youenn Fablet. This patch only implements to fire the stop event when all tracks are ended. We will need to fire a dataavailable event when all tracks are ended. Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-stop.html * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::~MediaRecorder): (WebCore::MediaRecorder::trackEnded): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * WebCore.xcodeproj/project.pbxproj: * dom/EventNames.h: 2018-10-19 Stephan Szabo <stephan.szabo@sony.com> [WinCairo] Search terms are not saved for <input type="search"> https://bugs.webkit.org/show_bug.cgi?id=188174 Reviewed by Fujii Hironori. No new tests, should be covered by existing tests of search inputs. Add support for saving the search terms for <input type="search"> to a SQLite database, replacing the CF-based implementation for Windows and adding support for non-legacy WebKit. * PlatformWin.cmake: * platform/win/SearchPopupMenuDB.cpp: Added. (WebCore::SearchPopupMenuDB::singleton): (WebCore::SearchPopupMenuDB::SearchPopupMenuDB): (WebCore::SearchPopupMenuDB::~SearchPopupMenuDB): (WebCore::SearchPopupMenuDB::saveRecentSearches): (WebCore::SearchPopupMenuDB::loadRecentSearches): (WebCore::SearchPopupMenuDB::checkDatabaseValidity): Use quick_check pragma to test database status. (WebCore::SearchPopupMenuDB::deleteAllDatabaseFiles): (WebCore::SearchPopupMenuDB::openDatabase): (WebCore::SearchPopupMenuDB::closeDatabase): (WebCore::SearchPopupMenuDB::verifySchemaVersion): Check schema version and update for schema changes. (WebCore::SearchPopupMenuDB::checkSQLiteReturnCode): Check for error codes that indicate database errors and remove and recreate the database. (WebCore::SearchPopupMenuDB::executeSimpleSql): (WebCore::SearchPopupMenuDB::createPreparedStatement): * platform/win/SearchPopupMenuDB.h: Added. * platform/win/SearchPopupMenuWin.cpp: (WebCore::SearchPopupMenuWin::enabled): Always enable support for search term popup (WebCore::SearchPopupMenuWin::saveRecentSearches): Switch from CF implementation to SQLite database implementation (WebCore::SearchPopupMenuWin::loadRecentSearches): Switch from CF implementation to SQLite database implementation (WebCore::autosaveKey): Deleted. 2018-10-19 Justin Fan <justin_fan@apple.com> [WebGPU] Add stubs for WebGPUSwapChain and WebGPURenderingContext https://bugs.webkit.org/show_bug.cgi?id=190742 Reviewed by Dean Jackson. Test: updated webgpu-enabled.html to check for WebGPURenderingContext. Implement support for creating a "webgpu" context from an HTML canvas. * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/WebGPURenderingContext.cpp: Added. (WebCore::WebGPURenderingContext::create): (WebCore::WebGPURenderingContext::WebGPURenderingContext): * Modules/webgpu/WebGPURenderingContext.h: Added. * Modules/webgpu/WebGPURenderingContext.idl: Added. * Modules/webgpu/WebGPUSwapChain.cpp: Added. (WebCore::WebGPUSwapChain::configure): (WebCore::WebGPUSwapChain::present): (WebCore::WebGPUSwapChain::reshape): (WebCore::WebGPUSwapChain::markLayerComposited): * Modules/webgpu/WebGPUSwapChain.h: Added. (WebCore::WebGPUSwapChain::WebGPUSwapChain): * Modules/webgpu/WebGPUSwapChain.idl: Added. * Modules/webgpu/WebGPUSwapChainDescriptor.h: Added. * Modules/webgpu/WebGPUSwapChainDescriptor.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: (WebCore::Document::getCSSCanvasContext): * dom/Document.h: * dom/Document.idl: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): (WebCore::HTMLCanvasElement::isWebGPUType): (WebCore::HTMLCanvasElement::createContextWebGPU): (WebCore::HTMLCanvasElement::getContextWebGPU): * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::isWebGPU const): 2018-10-19 John Wilander <wilander@apple.com> Only cap lifetime of persistent cookies created client-side through document.cookie when resource load statistics is enabled https://bugs.webkit.org/show_bug.cgi?id=190687 <rdar://problem/45349024> Reviewed by Alex Christensen. Test: http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js.html NetworkStorageSession::setCookiesFromDOM() now consults the new m_shouldCapLifetimeForClientSideCookies member variable before capping the lifetime of cookies. * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::toString const): (WebCore::ResourceLoadStatistics::merge): Removal of the isMarkedForCookieBlocking member. * loader/ResourceLoadStatistics.h: Removal of the isMarkedForCookieBlocking member. * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::setShouldCapLifetimeForClientSideCookies): (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor): No longer takes the boolean clearFirst parameter and now always clears first. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::filterCookies): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] RenderReplaced renderer should create InlineBox https://bugs.webkit.org/show_bug.cgi?id=190720 Reviewed by Antti Koivisto. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::TreeBuilder::createSubTree): 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Inline replaced width should default to 300px only if width is auto. https://bugs.webkit.org/show_bug.cgi?id=190722 Reviewed by Antti Koivisto. See #5 // 5. Otherwise, if 'width' has a computed value of 'auto', but none of the conditions above are met, then the used value of 'width' becomes 300px. * layout/FormattingContextGeometry.cpp: (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin): 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add inline runs to showLayoutTree https://bugs.webkit.org/show_bug.cgi?id=190718 Reviewed by Antti Koivisto. * layout/layouttree/LayoutTreeBuilder.cpp: (WebCore::Layout::outputInlineRuns): (WebCore::Layout::outputLayoutBox): (WebCore::Layout::outputLayoutTree): 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Remove the previous version of inline content handling. https://bugs.webkit.org/show_bug.cgi?id=190716 Reviewed by Antti Koivisto. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/Verification.cpp: (WebCore::Layout::areEssentiallyEqual): (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded): (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::inlineContent): (WebCore::Layout::InlineFormattingState::addLayoutRuns): Deleted. (WebCore::Layout::InlineFormattingState::layoutRuns const): Deleted. * layout/inlineformatting/text/TextUtil.cpp: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.cpp. (WebCore::Layout::TextUtil::TextUtil): (WebCore::Layout::TextUtil::width const): (WebCore::Layout::TextUtil::hyphenPositionBefore const): (WebCore::Layout::TextUtil::textWidth const): (WebCore::Layout::TextUtil::fixedPitchWidth const): * layout/inlineformatting/text/TextUtil.h: Renamed from Source/WebCore/layout/inlineformatting/textlayout/TextUtil.h. * layout/inlineformatting/textlayout/Runs.h: Removed. * layout/inlineformatting/textlayout/TextContentProvider.cpp: Removed. * layout/inlineformatting/textlayout/TextContentProvider.h: Removed. * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Removed. * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Removed. * layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.cpp: Removed. * layout/inlineformatting/textlayout/simple/SimpleTextRunGenerator.h: Removed. 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add generic inline content handling. https://bugs.webkit.org/show_bug.cgi?id=190713 Reviewed by Antti Koivisto. layoutInlineContent turns InlineLineBreaker::Run objects into final inline runs by resolving heading/trailing whitespace, aligment, expansion opportunities etc. These inline runs are input to the display tree construction. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/displaytree/DisplayBox.h: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): (WebCore::Layout::trimLeadingRun): (WebCore::Layout::InlineFormattingContext::layoutInlineContent const): (WebCore::Layout::InlineFormattingContext::computeWidthAndHeight const): * layout/inlineformatting/InlineFormattingContext.h: (WebCore::Layout::InlineFormattingContext::Line::hasContent const): (WebCore::Layout::InlineFormattingContext::Line::contentLogicalLeft const): (WebCore::Layout::InlineFormattingContext::Line::availableWidth const): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::inlineRuns): (WebCore::Layout::InlineFormattingState::appendInlineRun): * layout/inlineformatting/InlineLineBreaker.cpp: (WebCore::Layout::InlineLineBreaker::nextRun): (WebCore::Layout::InlineLineBreaker::nextLayoutRun): Deleted. * layout/inlineformatting/InlineLineBreaker.h: * layout/inlineformatting/InlineRun.h: Added. (WebCore::Layout::InlineRun::logicalLeft const): (WebCore::Layout::InlineRun::logicalRight const): (WebCore::Layout::InlineRun::width const): (WebCore::Layout::InlineRun::setWidth): (WebCore::Layout::InlineRun::setLogicalRight): (WebCore::Layout::InlineRun::TextContext::position const): (WebCore::Layout::InlineRun::TextContext::length const): (WebCore::Layout::InlineRun::TextContext::setLength): (WebCore::Layout::InlineRun::textContext): (WebCore::Layout::InlineRun::inlineItem const): (WebCore::Layout::InlineRun::InlineRun): (WebCore::Layout::InlineRun::TextContext::TextContext): * layout/inlineformatting/Line.cpp: Added. (WebCore::Layout::InlineFormattingContext::Line::Line): (WebCore::Layout::InlineFormattingContext::Line::setConstraints): (WebCore::Layout::isNonCollapsedText): (WebCore::Layout::isTrimmableContent): (WebCore::Layout::InlineFormattingContext::Line::appendContent): (WebCore::Layout::InlineFormattingContext::Line::close): 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add generic inline line breaker https://bugs.webkit.org/show_bug.cgi?id=190698 Reviewed by Antti Koivisto. InlineLineBreaker takes the inline runs and applies the appropriate line breaking rules on them. InlineRunProvider::Run objects -> <foobar><image box><hello>< ><world> InlineLineBreaker::Run -> <foobar><image box><hello world> InlineLineBreaker::Run also contains information whether the run is at the beginning or at the end of the line. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/LayoutContext.h: (WebCore::Layout::LayoutContext::hasDisplayBox const): * layout/inlineformatting/InlineLineBreaker.cpp: Added. (WebCore::Layout::InlineLineBreaker::InlineLineBreaker): (WebCore::Layout::InlineLineBreaker::nextLayoutRun): (WebCore::Layout::InlineLineBreaker::isAtContentEnd const): (WebCore::Layout::InlineLineBreaker::lineBreakingBehavior): (WebCore::Layout::InlineLineBreaker::runWidth const): (WebCore::Layout::InlineLineBreaker::splitRun): (WebCore::Layout::InlineLineBreaker::adjustSplitPositionWithHyphenation const): * layout/inlineformatting/InlineLineBreaker.h: Added. * layout/inlineformatting/textlayout/TextUtil.cpp: Added. (WebCore::Layout::TextUtil::TextUtil): (WebCore::Layout::TextUtil::width const): (WebCore::Layout::TextUtil::hyphenPositionBefore const): (WebCore::Layout::TextUtil::textWidth const): (WebCore::Layout::TextUtil::fixedPitchWidth const): * layout/inlineformatting/textlayout/TextUtil.h: Added. * layout/layouttree/LayoutBox.cpp: 2018-10-19 Zalan Bujtas <zalan@apple.com> [LFC][IFC] Add generic inline run generator. https://bugs.webkit.org/show_bug.cgi?id=190696 Reviewed by Antti Koivisto. InlineRunProvider turns the following inline content -> <span>foo<span>bar</span></span> <img src="broken.jpg"><span>hello world</span> into a set of runs -> <foobar><image box><hello>< ><world> Note that a text run can overlap multiple inline elements. InlineRunProvider::Run only stores a reference to the first inline element (continuous content can be accessed by iterating through the InlineContent ListHashSet). These runs are the input to the line breaking algoritm. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * layout/inlineformatting/InlineFormattingContext.cpp: (WebCore::Layout::InlineFormattingContext::layout const): * layout/inlineformatting/InlineFormattingState.h: (WebCore::Layout::InlineFormattingState::inlineContent): * layout/inlineformatting/InlineItem.h: Added. (WebCore::Layout::InlineItem::layoutBox const): (WebCore::Layout::InlineItem::style const): (WebCore::Layout::InlineItemHashFunctions::hash): (WebCore::Layout::InlineItemHashFunctions::equal): (WebCore::Layout::InlineItemHashTranslator::hash): (WebCore::Layout::InlineItemHashTranslator::equal): (WebCore::Layout::InlineItem::InlineItem): (WebCore::Layout::InlineItem::type const): (WebCore::Layout::InlineItem::textContent const): * layout/inlineformatting/InlineRunProvider.cpp: Added. (WebCore::Layout::InlineRunProvider::InlineRunProvider): (WebCore::Layout::InlineRunProvider::append): (WebCore::Layout::InlineRunProvider::insertBefore): (WebCore::Layout::InlineRunProvider::remove): (WebCore::Layout::isWhitespace): (WebCore::Layout::isSoftLineBreak): (WebCore::Layout::InlineRunProvider::isContinousContent): (WebCore::Layout::InlineRunProvider::processInlineTextItem): (WebCore::Layout::InlineRunProvider::moveToNextNonWhitespacePosition): (WebCore::Layout::InlineRunProvider::moveToNextBreakablePosition): * layout/inlineformatting/InlineRunProvider.h: Added. (WebCore::Layout::InlineRunProvider::Run::type const): (WebCore::Layout::InlineRunProvider::Run::isText const): (WebCore::Layout::InlineRunProvider::Run::isWhitespace const): (WebCore::Layout::InlineRunProvider::Run::isNonWhitespace const): (WebCore::Layout::InlineRunProvider::Run::isLineBreak const): (WebCore::Layout::InlineRunProvider::Run::isBox const): (WebCore::Layout::InlineRunProvider::Run::isFloat const): (WebCore::Layout::InlineRunProvider::Run::TextContext::start const): (WebCore::Layout::InlineRunProvider::Run::TextContext::length const): (WebCore::Layout::InlineRunProvider::Run::TextContext::isCollapsed const): (WebCore::Layout::InlineRunProvider::Run::TextContext::setStart): (WebCore::Layout::InlineRunProvider::Run::TextContext::setLength): (WebCore::Layout::InlineRunProvider::Run::textContext const): (WebCore::Layout::InlineRunProvider::Run::style const): (WebCore::Layout::InlineRunProvider::Run::inlineItem const): (WebCore::Layout::InlineRunProvider::runs const): (WebCore::Layout::InlineRunProvider::Run::createBoxRun): (WebCore::Layout::InlineRunProvider::Run::createFloatRun): (WebCore::Layout::InlineRunProvider::Run::createSoftLineBreakRun): (WebCore::Layout::InlineRunProvider::Run::createHardLineBreakRun): (WebCore::Layout::InlineRunProvider::Run::createWhitespaceRun): (WebCore::Layout::InlineRunProvider::Run::createNonWhitespaceRun): (WebCore::Layout::InlineRunProvider::Run::Run): (WebCore::Layout::InlineRunProvider::Run::TextContext::TextContext): * layout/layouttree/LayoutBox.h: (WebCore::Layout::Box::isLineBreakBox const): * layout/layouttree/LayoutInlineBox.cpp: (WebCore::Layout::InlineBox::InlineBox): * layout/layouttree/LayoutInlineBox.h: (WebCore::Layout::InlineBox::hasTextContent const): (WebCore::Layout::InlineBox::textContent const): * layout/layouttree/LayoutLineBreakBox.cpp: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp. (WebCore::Layout::LineBreakBox::LineBreakBox): * layout/layouttree/LayoutLineBreakBox.h: Copied from Source/WebCore/layout/layouttree/LayoutInlineBox.cpp. 2018-10-19 Ali Juma <ajuma@chromium.org> [IntersectionObserver] Handle zero-area intersections https://bugs.webkit.org/show_bug.cgi?id=189624 Reviewed by Simon Fraser. Use edge-inclusive intersection when applying clips and intersecting with the root, so that two rects that touch each other are considered intersecting even if the area of their intersection is 0. Covered by rebased tests in imported/w3c/web-platform-tests/intersection-observer. * dom/Document.cpp: (WebCore::computeIntersectionState): (WebCore::Document::updateIntersectionObservations): (WebCore::computeIntersectionRects): Deleted. 2018-10-18 Eric Carlson <eric.carlson@apple.com> [MediaStream] Allow ports to optionally do screen capture in the UI process https://bugs.webkit.org/show_bug.cgi?id=190728 <rdar://problem/45376824> Reviewed by Jer Noble and Tim Horton. No new tests, covered by existing tests. * Sources.txt: Add RemoteVideoSample.cpp. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/MediaSample.h: (WebCore::MediaSample::videoPixelFormat const): * platform/graphics/RemoteVideoSample.cpp: Added. (WebCore::RemoteVideoSample::~RemoteVideoSample): (WebCore::RemoteVideoSample::create): (WebCore::RemoteVideoSample::RemoteVideoSample): (WebCore::RemoteVideoSample::surface): * platform/graphics/RemoteVideoSample.h: Added. (WebCore::RemoteVideoSample::time const): (WebCore::RemoteVideoSample::videoFormat const): (WebCore::RemoteVideoSample::size const): (WebCore::RemoteVideoSample::encode const): (WebCore::RemoteVideoSample::decode): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/cv/ImageTransferSessionVT.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without resizing, resize local samples if necessary. * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize samples, it will be done in the base class if necessary. * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI process, it will be done in the web process. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include. 2018-10-18 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Adopt CG SPI for non-even cornered rounded rects https://bugs.webkit.org/show_bug.cgi?id=190155 Reviewed by Simon Fraser. Instead of creating bezier curves for the non-even corners of the rounded rects, we should use the optimized SPI provided by CG. * platform/graphics/cg/PathCG.cpp: (WebCore::Path::platformAddPathForRoundedRect): 2018-10-18 Justin Michaud <justin_michaud@apple.com> Add new image type for CSS painting API https://bugs.webkit.org/show_bug.cgi?id=190697 Reviewed by Dean Jackson. Add a new image type for the CSS painting API, and hook it up so it can be drawn. For now, it uses a WebGL rendering context from OfflineCanvas because that was easy to hook up. The spec actually calls for a RenderingContext2D, which can be handled in another patch. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintCallback.h: * css/CSSPaintCallback.idl: * css/CSSPaintImageValue.cpp: (WebCore::CSSPaintImageValue::image): * css/CSSPaintImageValue.h: * platform/graphics/CustomPaintImage.cpp: Added. (WebCore::CustomPaintImage::CustomPaintImage): (WebCore::CustomPaintImage::doCustomPaint): (WebCore::CustomPaintImage::draw): (WebCore::CustomPaintImage::drawPattern): * platform/graphics/CustomPaintImage.h: Copied from Source/WebCore/css/CSSPaintCallback.h. * platform/graphics/Image.h: (WebCore::Image::isCustomPaintImage const): * platform/graphics/ImageBuffer.h: * platform/graphics/cairo/CairoOperations.cpp: 2018-10-18 Truitt Savell <tsavell@apple.com> Unreviewed, rolling out r237272. Broke on device iOS builds and Windows builds Reverted changeset: "[MediaStream] Allow ports to optionally do screen capture in the UI process" https://bugs.webkit.org/show_bug.cgi?id=190728 https://trac.webkit.org/changeset/237272 2018-10-18 Jer Noble <jer.noble@apple.com> [MSE] timestampOffset can introduce floating-point rounding errors to incoming samples https://bugs.webkit.org/show_bug.cgi?id=190590 <rdar://problem/45275626> Reviewed by Eric Carlson. Test: media/media-source/media-source-timestampoffset-rounding-error.html SourceBuffer.timestampOffset is a double property, which, when added to a MediaTime will result in a double-backed MediaTime as PTS & DTS. This can introduce rounding errors when these samples are appended as overlapping existing samples. Rather than converting a MediaTime to double-backed when adding the timestampOffset, convert the offset to a multiple of the sample's timeBase. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::setTimestampOffset): (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-10-18 Eric Carlson <eric.carlson@apple.com> [MediaStream] Allow ports to optionally do screen capture in the UI process https://bugs.webkit.org/show_bug.cgi?id=190728 <rdar://problem/45376824> Reviewed by Jer Noble and Tim Horton. No new tests, covered by existing tests. * Sources.txt: Add RemoteVideoSample.cpp. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/MediaSample.h: (WebCore::MediaSample::videoPixelFormat const): * platform/graphics/RemoteVideoSample.cpp: Added. (WebCore::RemoteVideoSample::~RemoteVideoSample): (WebCore::RemoteVideoSample::create): (WebCore::RemoteVideoSample::RemoteVideoSample): (WebCore::RemoteVideoSample::surface): * platform/graphics/RemoteVideoSample.h: Added. (WebCore::RemoteVideoSample::time const): (WebCore::RemoteVideoSample::videoFormat const): (WebCore::RemoteVideoSample::size const): (WebCore::RemoteVideoSample::encode const): (WebCore::RemoteVideoSample::decode): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: * platform/graphics/cv/ImageTransferSessionVT.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::remoteVideoSampleAvailable): Call observers. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::dispatchMediaSampleToObservers): Dispatch remote samples without resizing, resize local samples if necessary. * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Don't resize samples, it will be done in the base class if necessary. * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::emitFrame): Don't resize samples when running in the UI process, it will be done in the web process. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: Remove unneeded include. 2018-10-18 Jer Noble <jer.noble@apple.com> Safari is not able to adapt between H264 streams with EditList and without EditList https://bugs.webkit.org/show_bug.cgi?id=190638 <rdar://problem/45342208> Reviewed by Eric Carlson. Test: media/media-source/media-source-append-overlapping-dts.html The MSE frame replacement algorithm does not take decode timestamps into account; this can lead to situations where the replacement algorithm may leave in place frames where the presentationTimestamp is less than the replacement frame, but whose decodeTimestamp is after the replacement frame. When re-enqueuing these frames, they may cause a decode error if they break the group-of-pictures sequence of the replaced range. * Modules/mediasource/SampleMap.cpp: (WebCore::DecodeOrderSampleMap::findSamplesBetweenDecodeKeys): * Modules/mediasource/SampleMap.h: * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-10-18 Per Arne Vollan <pvollan@apple.com> [WebVTT] Region parameter and value should be separated by ':' https://bugs.webkit.org/show_bug.cgi?id=190735 Reviewed by Eric Carlson. This is specified in https://w3c.github.io/webvtt/#region-settings. No new tests. Modified existing tests. * html/track/VTTRegion.cpp: (WebCore::VTTRegion::setRegionSettings): 2018-10-18 Jer Noble <jer.noble@apple.com> Add support for MediaKeyEncryptionScheme https://bugs.webkit.org/show_bug.cgi?id=190173 Reviewed by Eric Carlson. Added sub-tests to: media/encrypted-media/mock-navigator-requestMediaKeySystemAccess.html Add support for the MediaKeyEncryptionScheme extension to EME, as detailed here: <https://github.com/WICG/encrypted-media-encryption-scheme/blob/master/explainer.md> As the strings "cenc" and "cbcs" are explicitly lower-case, add support to the bindings generator to keep those strings as lower-case when converting from IDL. * CMakeLists.txt: * DerivedSources.make: * Modules/encryptedmedia/MediaKeyEncryptionScheme.h: * Modules/encryptedmedia/MediaKeyEncryptionScheme.idl: * Modules/encryptedmedia/MediaKeySystemMediaCapability.h: * Modules/encryptedmedia/MediaKeySystemMediaCapability.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGenerator.pm: (WK_ucfirst): * platform/encryptedmedia/CDMEncryptionScheme.h: Copied from Source/WebCore/testing/MockCDMFactory.idl. * platform/encryptedmedia/CDMMediaCapability.h: * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp: (WebCore::CDMPrivateFairPlayStreaming::supportsConfiguration const): * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsMediaCapability): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::initializeWithConfiguration): * testing/MockCDMFactory.cpp: (WebCore::m_supportedEncryptionSchemes): (WebCore::MockCDM::supportsConfiguration const): * testing/MockCDMFactory.h: (WebCore::MockCDMFactory::supportedEncryptionSchemes const): (WebCore::MockCDMFactory::setSupportedEncryptionSchemes): * testing/MockCDMFactory.idl: 2018-10-18 Alexey Proskuryakov <ap@apple.com> Switch from PLATFORM(IOS) to PLATFORM(IOS_FAMILY) https://bugs.webkit.org/show_bug.cgi?id=190729 Reviewed by Tim Horton. * DerivedSources.make: * Modules/applepay/cocoa/PaymentContactCocoa.mm: (WebCore::subLocality): (WebCore::setSubLocality): (WebCore::subAdministrativeArea): (WebCore::setSubAdministrativeArea): * Modules/encryptedmedia/legacy/LegacyCDMPrivateMediaPlayer.cpp: * Modules/geolocation/Geolocation.cpp: (WebCore::isRequestFromIBooks): * Modules/geolocation/GeolocationPosition.h: * Modules/geolocation/NavigatorGeolocation.cpp: * Modules/geolocation/NavigatorGeolocation.h: * Modules/geolocation/ios/GeolocationPositionIOS.mm: * Modules/mediasession/WebMediaSessionManager.cpp: * Modules/mediasession/WebMediaSessionManager.h: * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::filterDeviceList): * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::JSQuickTimePluginReplacement::timedMetaData const): (WebCore::JSQuickTimePluginReplacement::accessLog const): (WebCore::JSQuickTimePluginReplacement::errorLog const): * Modules/speech/SpeechSynthesis.cpp: (WebCore::SpeechSynthesis::SpeechSynthesis): (WebCore::SpeechSynthesis::speak): * Modules/speech/SpeechSynthesis.h: * Modules/webaudio/AudioContext.cpp: * Modules/webaudio/AudioScheduledSourceNode.cpp: * Modules/webdatabase/Database.cpp: (WebCore::Database::performOpenAndVerify): * Modules/webdatabase/DatabaseContext.h: * Modules/webdatabase/DatabaseManagerClient.h: * Modules/webdatabase/DatabaseTracker.cpp: (WebCore::DatabaseTracker::deleteDatabaseFile): * Modules/webdatabase/DatabaseTracker.h: * WebCorePrefix.h: * accessibility/AXObjectCache.cpp: (WebCore::createFromRenderer): * accessibility/AccessibilityMediaObject.cpp: * accessibility/AccessibilityMediaObject.h: * accessibility/AccessibilityMenuList.cpp: (WebCore::AccessibilityMenuList::press): (WebCore::AccessibilityMenuList::isCollapsed const): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::isAccessibilityObjectSearchMatchAtIndex): (WebCore::AccessibilityObject::press): (WebCore::AccessibilityObject::actionVerb const): * accessibility/AccessibilityObject.h: * accessibility/AccessibilityRenderObject.cpp: (WebCore::AccessibilityRenderObject::stringValue const): (WebCore::AccessibilityRenderObject::determineAccessibilityRole): (WebCore::AccessibilityRenderObject::actionVerb const): * accessibility/AccessibilityTableColumn.cpp: (WebCore::AccessibilityTableColumn::computeAccessibilityIsIgnored const): * accessibility/AccessibilityTableHeaderContainer.cpp: (WebCore::AccessibilityTableHeaderContainer::computeAccessibilityIsIgnored const): * accessibility/ios/AXObjectCacheIOS.mm: * accessibility/ios/AccessibilityObjectIOS.mm: * accessibility/ios/WebAccessibilityObjectWrapperIOS.h: * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: * bindings/js/CommonVM.cpp: (WebCore::commonVMSlow): * bindings/js/JSCallbackData.h: (WebCore::JSCallbackData::~JSCallbackData): * bindings/js/JSDOMWindowBase.cpp: (WebCore::JSDOMWindowBase::shouldInterruptScriptBeforeTimeout): * bindings/js/ScriptController.cpp: (WebCore::ScriptController::initializeThreading): * bridge/objc/objc_class.mm: (JSC::Bindings::ObjcClass::fieldNamed const): * crypto/CommonCryptoUtilities.h: * crypto/mac/CryptoKeyRSAMac.cpp: * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::masterKeyAccountNameForCurrentApplication): (WebCore::createAndStoreMasterKey): * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): * css/CSSProperties.json: * css/CSSStyleDeclaration.cpp: * css/CSSValueKeywords.in: * css/MediaQueryEvaluator.cpp: (WebCore::prefersReducedMotionEvaluate): * css/StyleBuilderConverter.h: * css/html.css: (video): (input, textarea, keygen, select, button): (#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY): (#if defined(ENABLE_INPUT_TYPE_DATE) && ENABLE_INPUT_TYPE_DATE): (#endif): (#if defined(ENABLE_DATALIST_ELEMENT) && ENABLE_DATALIST_ELEMENT): (textarea): (input:matches([type="radio"], [type="checkbox"])): (input:matches([type="button"], [type="submit"], [type="reset"]), input[type="file"]::-webkit-file-upload-button, button): (input[type="range"]::-webkit-slider-thumb, input[type="range"]::-webkit-media-slider-thumb): (#if !(defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY)): (input[type="checkbox"]): (#endif // defined(ENABLE_INPUT_TYPE_COLOR) && ENABLE_INPUT_TYPE_COLOR): (#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted. (#if !(defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS)): Deleted. * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): (WebCore::CSSParserFastPaths::isKeywordPropertyID): * css/parser/CSSPropertyParser.cpp: (WebCore::cssPropertyID): (WebCore::CSSPropertyParser::parseSingleValue): * css/parser/CSSPropertyParser.h: * css/svg.css: (#if defined(WTF_PLATFORM_IOS_FAMILY) && WTF_PLATFORM_IOS_FAMILY): (#if defined(WTF_PLATFORM_IOS) && WTF_PLATFORM_IOS): Deleted. * dom/DeviceMotionController.cpp: * dom/DeviceMotionController.h: * dom/DeviceOrientationController.cpp: (WebCore::DeviceOrientationController::DeviceOrientationController): * dom/DeviceOrientationController.h: * dom/DeviceOrientationData.cpp: * dom/DeviceOrientationData.h: * dom/DeviceOrientationEvent.cpp: * dom/DeviceOrientationEvent.h: * dom/DeviceOrientationEvent.idl: * dom/Document.cpp: (WebCore::Document::~Document): (WebCore::Document::suspendDeviceMotionAndOrientationUpdates): (WebCore::Document::resumeDeviceMotionAndOrientationUpdates): (WebCore::Document::platformSuspendOrStopActiveDOMObjects): * dom/Document.h: * dom/DocumentMarker.h: (WebCore::DocumentMarker::allMarkers): * dom/DocumentMarkerController.cpp: (WebCore::shouldInsertAsSeparateMarker): (WebCore::DocumentMarkerController::shiftMarkers): * dom/DocumentMarkerController.h: * dom/Element.cpp: (WebCore::Element::focus): * dom/Node.cpp: (WebCore::Node::~Node): (WebCore::Node::willBeDeletedFrom): (WebCore::Node::moveNodeToNewDocument): (WebCore::tryAddEventListener): (WebCore::tryRemoveEventListener): (WebCore::Node::defaultEventHandler): (WebCore::Node::willRespondToMouseMoveEvents): (WebCore::Node::willRespondToMouseClickEvents): * dom/Range.cpp: * dom/Range.h: * dom/TreeScope.cpp: (WebCore::absolutePointIfNotClipped): * dom/ViewportArguments.cpp: (WebCore::setViewportFeature): * dom/ViewportArguments.h: * editing/CompositeEditCommand.cpp: (WebCore::EditCommandComposition::unapply): (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): (WebCore::CompositeEditCommand::moveParagraphs): * editing/Editor.cpp: (WebCore::TemporarySelectionChange::TemporarySelectionChange): (WebCore::TemporarySelectionChange::~TemporarySelectionChange): (WebCore::Editor::handleTextEvent): (WebCore::Editor::Editor): (WebCore::Editor::clear): (WebCore::Editor::insertTextWithoutSendingTextEvent): (WebCore::Editor::setBaseWritingDirection): (WebCore::Editor::setComposition): (WebCore::Editor::showSpellingGuessPanel): (WebCore::Editor::markMisspellingsAfterTypingToWord): (WebCore::Editor::markMisspellingsOrBadGrammar): (WebCore::Editor::changeBackToReplacedString): (WebCore::Editor::updateMarkersForWordsAffectedByEditing): (WebCore::Editor::revealSelectionAfterEditingOperation): (WebCore::Editor::setIgnoreSelectionChanges): (WebCore::Editor::changeSelectionAfterCommand): (WebCore::Editor::shouldChangeSelection const): (WebCore::Editor::respondToChangedSelection): (WebCore::Editor::editorUIUpdateTimerFired): (WebCore::Editor::resolveTextCheckingTypeMask): * editing/Editor.h: * editing/FontAttributes.h: * editing/FrameSelection.cpp: (WebCore::FrameSelection::FrameSelection): (WebCore::FrameSelection::updateDataDetectorsForSelection): (WebCore::FrameSelection::setSelectedRange): (WebCore::FrameSelection::updateAppearance): (WebCore::FrameSelection::shouldDeleteSelection const): (WebCore::FrameSelection::revealSelection): (WebCore::FrameSelection::setSelectionFromNone): (WebCore::FrameSelection::shouldChangeSelection const): * editing/FrameSelection.h: * editing/InsertIntoTextNodeCommand.cpp: * editing/InsertIntoTextNodeCommand.h: * editing/TypingCommand.cpp: (WebCore::TypingCommand::markMisspellingsAfterTyping): (WebCore::TypingCommand::deleteKeyPressed): (WebCore::TypingCommand::forwardDeleteKeyPressed): * editing/TypingCommand.h: * editing/cocoa/DataDetection.h: * editing/cocoa/DataDetection.mm: * editing/cocoa/FontAttributesCocoa.mm: * editing/cocoa/FontShadowCocoa.mm: (WebCore::FontShadow::createShadow const): * editing/cocoa/HTMLConverter.h: * editing/cocoa/HTMLConverter.mm: (_fontForNameAndSize): (_shadowForShadowStyle): (HTMLConverter::computedAttributesForElement): (HTMLConverter::_addAttachmentForElement): (HTMLConverter::_processMetaElementWithName): (HTMLConverter::_processElement): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::attributesForAttributedStringConversion): (WebCore::WebContentReader::readURL): * editing/ios/DictationCommandIOS.cpp: * editing/ios/DictationCommandIOS.h: * editing/ios/EditorIOS.mm: * editing/mac/FrameSelectionMac.mm: (WebCore::FrameSelection::notifyAccessibilityForSelectionChange): * fileapi/FileCocoa.mm: * history/CachedFrame.cpp: (WebCore::CachedFrameBase::restore): (WebCore::CachedFrame::CachedFrame): * history/CachedPage.cpp: (WebCore::CachedPage::restore): * history/HistoryItem.cpp: (WebCore::HistoryItem::HistoryItem): * history/HistoryItem.h: * history/PageCache.cpp: (WebCore::canCachePage): * html/BaseDateAndTimeInputType.cpp: * html/BaseDateAndTimeInputType.h: * html/ColorInputType.cpp: (WebCore::ColorInputType::isKeyboardFocusable const): * html/HTMLAppletElement.cpp: (WebCore::HTMLAppletElement::updateWidget): * html/HTMLAttachmentElement.h: * html/HTMLCanvasElement.cpp: (WebCore::maxActivePixelMemory): * html/HTMLElement.cpp: (WebCore::HTMLElement::collectStyleForPresentationAttribute): * html/HTMLIFrameElement.h: * html/HTMLImageElement.cpp: * html/HTMLImageElement.h: * html/HTMLInputElement.cpp: * html/HTMLInputElement.h: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::finishInitialization): (WebCore::HTMLMediaElement::registerWithDocument): (WebCore::HTMLMediaElement::unregisterWithDocument): (WebCore::HTMLMediaElement::setVolume): (WebCore::HTMLMediaElement::nextScanRate): (WebCore::HTMLMediaElement::sourceWasAdded): (WebCore::HTMLMediaElement::mediaEngineWasUpdated): (WebCore::HTMLMediaElement::updateVolume): (WebCore::HTMLMediaElement::userCancelledLoad): (WebCore::HTMLMediaElement::mediaSessionTitle const): (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible): * html/HTMLMediaElement.h: * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::process): * html/HTMLObjectElement.cpp: * html/HTMLPlugInElement.h: * html/HTMLSelectElement.cpp: (WebCore::HTMLSelectElement::usesMenuList const): (WebCore::HTMLSelectElement::createElementRenderer): (WebCore::HTMLSelectElement::childShouldCreateRenderer const): (WebCore::HTMLSelectElement::willRespondToMouseClickEvents): (WebCore::HTMLSelectElement::updateListBoxSelection): (WebCore::HTMLSelectElement::scrollToSelection): (WebCore::HTMLSelectElement::setOptionsChangedOnRenderer): (WebCore::HTMLSelectElement::menuListDefaultEventHandler): (WebCore::HTMLSelectElement::defaultEventHandler): * html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::createInnerTextStyle): * html/HTMLTextFormControlElement.cpp: (WebCore::HTMLTextFormControlElement::select): (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const): * html/HTMLTextFormControlElement.h: * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::parseAttribute): (WebCore::HTMLVideoElement::supportsFullscreen const): * html/HTMLVideoElement.h: * html/ImageDocument.cpp: (WebCore::ImageDocument::ImageDocument): (WebCore::ImageDocument::createDocumentStructure): (WebCore::ImageDocument::imageUpdated): * html/ImageDocument.h: * html/InputType.cpp: * html/InputType.h: * html/MediaDocument.cpp: (WebCore::MediaDocumentParser::createDocumentStructure): * html/MediaElementSession.cpp: (WebCore::MediaElementSession::clientDataBufferingTimerFired): (WebCore::MediaElementSession::showPlaybackTargetPicker): (WebCore::MediaElementSession::wirelessVideoPlaybackDisabled const): (WebCore::MediaElementSession::setHasPlaybackTargetAvailabilityListeners): (WebCore::MediaElementSession::isPlayingToWirelessPlaybackTarget const): (WebCore::MediaElementSession::requiresFullscreenForVideoPlayback const): * html/MediaElementSession.h: * html/PluginDocument.cpp: (WebCore::PluginDocumentParser::createDocumentStructure): * html/RangeInputType.cpp: (WebCore::RangeInputType::handleTouchEvent): * html/RangeInputType.h: * html/SearchInputType.cpp: (WebCore::SearchInputType::addSearchResult): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::isKeyboardFocusable const): (WebCore::TextFieldInputType::handleFocusEvent): (WebCore::TextFieldInputType::handleBlurEvent): (WebCore::TextFieldInputType::didSetValueByUserEdit): (WebCore::TextFieldInputType::listAttributeTargetChanged): * html/parser/HTMLParserScheduler.h: (WebCore::HTMLParserScheduler::shouldYieldBeforeToken): * html/parser/HTMLTreeBuilder.cpp: (WebCore::HTMLTreeBuilder::processCharacterBufferForInBody): * html/parser/HTMLTreeBuilder.h: * html/shadow/MediaControlElements.cpp: * html/shadow/MediaControlElements.h: * html/shadow/MediaControls.h: * html/shadow/SliderThumbElement.cpp: (WebCore::SliderThumbElement::dragFrom): * html/shadow/SliderThumbElement.h: * html/shadow/TextControlInnerElements.cpp: (WebCore::SearchFieldResultsButtonElement::defaultEventHandler): (WebCore::SearchFieldCancelButtonElement::SearchFieldCancelButtonElement): * html/shadow/TextControlInnerElements.h: * inspector/InspectorController.cpp: (WebCore::InspectorController::setIndicating): * inspector/InspectorFrontendHost.cpp: (WebCore::InspectorFrontendHost::platform): * inspector/PageScriptDebugServer.cpp: (WebCore::PageScriptDebugServer::runEventLoopWhilePaused): * inspector/agents/InspectorTimelineAgent.cpp: (WebCore::currentRunLoop): * loader/DocumentLoader.cpp: * loader/DocumentLoader.h: * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest): * loader/DocumentWriter.cpp: (WebCore::DocumentWriter::createDocument): * loader/EmptyClients.cpp: * loader/EmptyClients.h: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkCompleted): (WebCore::FrameLoader::willLoadMediaElementURL): (WebCore::FrameLoader::stopForUserCancel): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::didFirstLayout): (WebCore::createWindow): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/HistoryController.cpp: (WebCore::HistoryController::saveScrollPositionAndViewStateToItem): (WebCore::HistoryController::restoreScrollPositionAndViewState): * loader/ResourceLoader.cpp: (WebCore::ResourceLoader::init): (WebCore::ResourceLoader::willSendRequestInternal): * loader/ResourceLoader.h: * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::loadPlugin): * loader/SubresourceLoader.cpp: (WebCore::SubresourceLoader::create): (WebCore::SubresourceLoader::willCancel): (WebCore::SubresourceLoader::notifyDone): (WebCore::SubresourceLoader::releaseResources): * loader/SubresourceLoader.h: * loader/cache/CachedImage.cpp: * page/CaptionUserPreferencesMediaAF.cpp: (WebCore::userCaptionPreferencesChangedNotificationCallback): * page/Chrome.cpp: (WebCore::Chrome::createColorChooser): (WebCore::Chrome::dispatchViewportPropertiesDidChange const): (WebCore::Chrome::didReceiveDocType): * page/Chrome.h: * page/ChromeClient.h: * page/DOMTimer.cpp: (WebCore::DOMTimer::install): (WebCore::DOMTimer::fired): * page/DOMWindow.cpp: (WebCore::DOMWindow::outerHeight const): (WebCore::DOMWindow::outerWidth const): (WebCore::DOMWindow::clearTimeout): (WebCore::DOMWindow::addEventListener): (WebCore::DOMWindow::resetAllGeolocationPermission): (WebCore::DOMWindow::removeEventListener): (WebCore::DOMWindow::removeAllEventListeners): * page/DOMWindow.h: * page/DeprecatedGlobalSettings.cpp: (WebCore::DeprecatedGlobalSettings::globalConstRedeclarationShouldThrow): * page/DeprecatedGlobalSettings.h: * page/DragController.cpp: * page/EditorClient.h: * page/EventHandler.cpp: (WebCore::EventHandler::handleMousePressEventSingleClick): (WebCore::EventHandler::handleMouseReleaseEvent): (WebCore::EventHandler::startPanScrolling): (WebCore::EventHandler::handleMouseMoveEvent): * page/EventHandler.h: * page/Frame.cpp: (WebCore::Frame::Frame): (WebCore::Frame::willDetachPage): * page/Frame.h: * page/FrameView.cpp: (WebCore::FrameView::FrameView): (WebCore::FrameView::clear): (WebCore::FrameView::effectiveFrameFlattening const): (WebCore::FrameView::flushCompositingStateForThisFrame): (WebCore::FrameView::scrollPositionRespectingCustomFixedPosition const): (WebCore::FrameView::viewportConstrainedVisibleContentRect const): (WebCore::FrameView::updateContentsSize): (WebCore::FrameView::computeScrollability const): (WebCore::FrameView::adjustTiledBackingCoverage): (WebCore::FrameView::calculateExtendedBackgroundMode const): (WebCore::FrameView::performPostLayoutTasks): (WebCore::FrameView::sizeForResizeEvent const): (WebCore::FrameView::sendResizeEventIfNeeded): * page/FrameView.h: * page/FrameViewLayoutContext.cpp: (WebCore::FrameViewLayoutContext::layout): * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): (WebCore::releaseMemory): * page/Navigator.cpp: * page/Navigator.h: * page/NavigatorBase.cpp: * page/Page.cpp: (WebCore::Page::setIsVisibleInternal): (WebCore::Page::showPlaybackTargetPicker): * page/Page.h: * page/PerformanceMonitor.cpp: (WebCore::PerformanceMonitor::measurePostLoadMemoryUsage): * page/ResourceUsageOverlay.cpp: (WebCore::ResourceUsageOverlay::initialize): * page/SecurityOrigin.cpp: (WebCore::SecurityOrigin::canDisplay const): * page/SettingsBase.cpp: * page/SettingsBase.h: * page/SettingsDefaultValues.h: (WebCore::editingBehaviorTypeForPlatform): * page/TextIndicator.cpp: (WebCore::TextIndicator::createWithRange): (WebCore::initializeIndicator): * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::textDocumentParameters): * page/cocoa/MemoryReleaseCocoa.mm: (WebCore::platformReleaseMemory): (WebCore::jettisonExpensiveObjectsOnTopLevelNavigation): * page/cocoa/ResourceUsageOverlayCocoa.mm: (WebCore::showText): * page/cocoa/ResourceUsageThreadCocoa.mm: (WebCore::vmPageSize): * page/cocoa/SettingsBaseCocoa.mm: * page/ios/EventHandlerIOS.mm: * page/ios/FrameIOS.mm: * page/mac/ChromeMac.mm: * page/mac/PageMac.mm: (WebCore::Page::platformInitialize): * page/mac/WebCoreFrameView.h: * page/scrolling/AsyncScrollingCoordinator.cpp: (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): * page/scrolling/ScrollingTree.h: * page/scrolling/ScrollingTreeScrollingNode.h: * page/scrolling/ScrollingTreeScrollingNodeDelegate.cpp: * page/scrolling/ScrollingTreeScrollingNodeDelegate.h: * page/scrolling/ios/ScrollingCoordinatorIOS.h: * page/scrolling/ios/ScrollingCoordinatorIOS.mm: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.h: * page/scrolling/ios/ScrollingTreeFrameScrollingNodeIOS.mm: * page/scrolling/ios/ScrollingTreeIOS.cpp: * page/scrolling/ios/ScrollingTreeIOS.h: * platform/ContentFilterUnblockHandler.h: * platform/Cursor.cpp: * platform/Cursor.h: * platform/DragImage.cpp: * platform/DragImage.h: * platform/FileChooser.cpp: * platform/FileChooser.h: * platform/HostWindow.h: * platform/LocalizedStrings.cpp: * platform/LocalizedStrings.h: * platform/LowPowerModeNotifier.cpp: * platform/LowPowerModeNotifier.h: * platform/MIMETypeRegistry.cpp: (WebCore::initializeSupportedImageMIMETypes): (WebCore::initializeSupportedNonImageMimeTypes): (WebCore::initializeUnsupportedTextMIMETypes): * platform/Pasteboard.h: * platform/PasteboardStrategy.h: * platform/PlatformKeyboardEvent.h: * platform/PlatformPasteboard.h: * platform/PlatformScreen.h: * platform/RemoteCommandListener.cpp: * platform/RuntimeApplicationChecks.h: * platform/ScrollAnimator.cpp: * platform/ScrollView.cpp: (WebCore::ScrollView::contentsScrollPosition const): (WebCore::ScrollView::setContentsScrollPosition): (WebCore::ScrollView::visibleContentRectInternal const): * platform/ScrollView.h: * platform/ScrollableArea.cpp: * platform/ScrollableArea.h: * platform/Scrollbar.cpp: * platform/Scrollbar.h: * platform/ThreadTimers.cpp: * platform/Timer.cpp: (WebCore::shouldSuppressThreadSafetyCheck): * platform/Timer.h: (WebCore::TimerBase::isActive const): * platform/ValidationBubble.h: * platform/Widget.h: * platform/audio/AudioHardwareListener.cpp: (WebCore::AudioHardwareListener::AudioHardwareListener): * platform/audio/PlatformMediaSession.h: * platform/audio/PlatformMediaSessionManager.h: * platform/audio/ios/AudioDestinationIOS.cpp: * platform/audio/ios/AudioDestinationIOS.h: * platform/audio/ios/AudioFileReaderIOS.cpp: * platform/audio/ios/AudioFileReaderIOS.h: * platform/audio/ios/AudioSessionIOS.mm: (WebCore::AudioSession::setCategory): (WebCore::AudioSession::routingContextUID const): * platform/audio/ios/MediaSessionManagerIOS.h: * platform/audio/ios/MediaSessionManagerIOS.mm: * platform/cf/MainThreadSharedTimerCF.cpp: (WebCore::setupPowerObserver): (WebCore::MainThreadSharedTimer::setFireInterval): * platform/cf/URLCF.cpp: * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm: (WebCore::ContentFilterUnblockHandler::wrapWithDecisionHandler): (WebCore::ContentFilterUnblockHandler::needsUIProcess const): (WebCore::ContentFilterUnblockHandler::encode const): (WebCore::ContentFilterUnblockHandler::decode): (WebCore::ContentFilterUnblockHandler::canHandleRequest const): (WebCore::dispatchToMainThread): (WebCore::ContentFilterUnblockHandler::requestUnblockAsync const): * platform/cocoa/DataDetectorsCoreSoftLink.h: * platform/cocoa/DataDetectorsCoreSoftLink.mm: * platform/cocoa/KeyEventCocoa.mm: * platform/cocoa/LocalizedStringsCocoa.mm: (WebCore::localizedNSString): * platform/cocoa/NetworkExtensionContentFilter.mm: (WebCore::NetworkExtensionContentFilter::initialize): * platform/cocoa/ParentalControlsContentFilter.mm: (WebCore::ParentalControlsContentFilter::unblockHandler const): * platform/cocoa/PasteboardCocoa.mm: (WebCore::Pasteboard::fileContentState): * platform/cocoa/PlatformView.h: * platform/cocoa/PlaybackSessionInterface.h: * platform/cocoa/PlaybackSessionModel.h: * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: * platform/cocoa/SystemVersion.mm: (WebCore::createSystemMarketingVersion): * platform/cocoa/VideoFullscreenChangeObserver.h: * platform/cocoa/VideoFullscreenModel.h: * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: * platform/gamepad/cocoa/GameControllerGamepad.h: * platform/gamepad/cocoa/GameControllerGamepad.mm: * platform/gamepad/cocoa/GameControllerGamepadProvider.h: * platform/gamepad/cocoa/GameControllerGamepadProvider.mm: * platform/graphics/BitmapImage.h: * platform/graphics/Color.h: * platform/graphics/ComplexTextController.cpp: * platform/graphics/DisplayRefreshMonitor.cpp: (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): * platform/graphics/FloatSize.h: * platform/graphics/Font.cpp: (WebCore::Font::Font): (WebCore::createAndFillGlyphPage): * platform/graphics/Font.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::getCachedFontPlatformData): (WebCore::FontCache::fontForPlatformData): (WebCore::FontCache::purgeInactiveFontData): (WebCore::FontCache::inactiveFontCount): * platform/graphics/FontCascade.cpp: (WebCore::FontCascade::FontCascade): * platform/graphics/FontCascadeFonts.h: * platform/graphics/FontDescription.h: * platform/graphics/FontPlatformData.h: (WebCore::FontPlatformData::isEmoji const): * platform/graphics/GraphicsContext.cpp: (WebCore::GraphicsContext::drawImage): * platform/graphics/GraphicsContext3D.h: * platform/graphics/GraphicsLayer.h: * platform/graphics/Icon.h: * platform/graphics/Image.cpp: (WebCore::Image::drawTiled): (WebCore::Image::computeIntrinsicDimensions): * platform/graphics/Image.h: * platform/graphics/IntPoint.h: * platform/graphics/IntRect.h: * platform/graphics/IntSize.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::isAvailable): (WebCore::MediaPlayer::volumeChanged): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: * platform/graphics/NamedImageGeneratedImage.cpp: (WebCore::NamedImageGeneratedImage::draw): * platform/graphics/StringTruncator.cpp: (WebCore::centerTruncateToBuffer): (WebCore::rightTruncateToBuffer): (WebCore::rightClipToWordBuffer): * platform/graphics/TextTrackRepresentation.cpp: * platform/graphics/avfoundation/InbandMetadataTextTrackPrivateAVF.cpp: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.cpp: * platform/graphics/avfoundation/InbandTextTrackPrivateAVF.h: * platform/graphics/avfoundation/MediaPlaybackTargetMac.mm: * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::supportsFullscreen const): (WebCore::MediaPlayerPrivateAVFoundation::rateChanged): * platform/graphics/avfoundation/WebMediaSessionManagerMac.cpp: * platform/graphics/avfoundation/WebMediaSessionManagerMac.h: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.cpp: * platform/graphics/avfoundation/cf/InbandTextTrackPrivateLegacyAVCF.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::supportsPersistentKeys): * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.h: * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h: * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerLayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer): (WebCore::MediaPlayerPrivateAVFoundationObjC::setVideoFullscreenMode): (WebCore::MediaPlayerPrivateAVFoundationObjC::setVolume): (WebCore::MediaPlayerPrivateAVFoundationObjC::seekableTimeRangesLastModifiedTime const): (WebCore::MediaPlayerPrivateAVFoundationObjC::liveUpdateInterval const): (WebCore::MediaPlayerPrivateAVFoundationObjC::maximumDurationToCacheMediaTime const): (WebCore::MediaPlayerPrivateAVFoundationObjC::didPassCORSAccessCheck const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const): (WebCore::MediaPlayerPrivateAVFoundationObjC::isCurrentPlaybackTargetWireless const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetType const): (WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessPlaybackTargetName const): (WebCore::MediaPlayerPrivateAVFoundationObjC::updateDisableExternalPlayback): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::supportsPictureInPicture const): * platform/graphics/avfoundation/objc/OutOfBandTextTrackPrivateAVF.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::flushCompositingState): (WebCore::GraphicsLayerCA::computeVisibleAndCoverageRect const): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/ca/PlatformCALayer.h: * platform/graphics/ca/TileController.cpp: (WebCore::TileController::~TileController): (WebCore::TileController::adjustTileCoverageRect const): * platform/graphics/ca/TileController.h: * platform/graphics/ca/TileGrid.cpp: (WebCore::TileGrid::startedNewCohort): (WebCore::TileGrid::platformCALayerPaintContents): * platform/graphics/ca/TileGrid.h: * platform/graphics/ca/cocoa/LayerFlushSchedulerMac.cpp: (WebCore::currentRunLoop): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (-[WebAnimationDelegate animationDidStart:]): (-[WebAnimationDelegate animationDidStop:finished:]): (WebCore::PlatformCALayerCocoa::setContentsScale): (WebCore::layerContentsFormat): (WebCore::PlatformCALayer::drawLayerContents): (WebCore::PlatformCALayerCocoa::backingStoreBytesPerPixel const): * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): * platform/graphics/cg/GraphicsContextCG.cpp: (WebCore::displayP3ColorSpaceRef): (WebCore::GraphicsContext::drawNativeImage): (WebCore::drawPatternCallback): (WebCore::GraphicsContext::drawPattern): (WebCore::GraphicsContext::drawLine): (WebCore::applyShadowOffsetWorkaroundIfNeeded): (WebCore::GraphicsContext::setURLForRect): * platform/graphics/cg/ImageBufferCG.cpp: (WebCore::jpegUTI): * platform/graphics/cg/ImageBufferDataCG.cpp: * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::createFrameImageAtIndex): * platform/graphics/cg/ImageSourceCGMac.mm: * platform/graphics/cg/PDFDocumentImage.cpp: * platform/graphics/cocoa/ColorCocoa.h: * platform/graphics/cocoa/ColorCocoa.mm: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontCache::similarFont): (WebCore::computeNecessarySynthesis): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::variationCapabilitiesForFontDescriptor): (WebCore::lookupFallbackFont): (WebCore::FontCache::systemFallbackForCharacters): (WebCore::FontCache::lastResortFallbackFont): * platform/graphics/cocoa/FontCascadeCocoa.mm: (WebCore::FontCascade::drawGlyphs): (WebCore::FontCascade::fontForCombiningCharacterSequence const): * platform/graphics/cocoa/FontCocoa.mm: (WebCore::Font::platformInit): (WebCore::Font::variantCapsSupportsCharacterForSynthesis const): (WebCore::Font::determinePitch): * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): * platform/graphics/cocoa/FontPlatformDataCocoa.mm: (WebCore::FontPlatformData::FontPlatformData): (WebCore::cascadeToLastResortAndVariationsFontDescriptor): * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: (WebCore::GraphicsContext3D::GraphicsContext3D): (WebCore::GraphicsContext3D::texImageIOSurface2D): * platform/graphics/cocoa/GraphicsContextCocoa.mm: * platform/graphics/cocoa/IOSurface.mm: (WebCore::optionsForBiplanarSurface): (WebCore::optionsFor32BitSurface): (WebCore::IOSurface::maximumSize): (WebCore::IOSurface::surfaceID const): * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: (WebCore::SystemFontDatabaseCoreText::cascadeList): * platform/graphics/cocoa/TextTrackRepresentationCocoa.h: * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm: (-[WebCoreTextTrackRepresentationCocoaHelper observeValueForKeyPath:ofObject:change:context:]): * platform/graphics/cocoa/WebMetalLayer.h: * platform/graphics/cv/ImageTransferSessionVT.mm: (WebCore::cvPixelFormatOpenGLKey): (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): * platform/graphics/cv/VideoTextureCopierCV.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.h: * platform/graphics/ios/DisplayRefreshMonitorIOS.mm: * platform/graphics/ios/FontAntialiasingStateSaver.h: (WebCore::FontAntialiasingStateSaver::FontAntialiasingStateSaver): (WebCore::FontAntialiasingStateSaver::setup): (WebCore::FontAntialiasingStateSaver::restore): * platform/graphics/ios/FontCacheIOS.mm: * platform/graphics/ios/IconIOS.mm: * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * platform/graphics/mac/FloatPointMac.mm: * platform/graphics/mac/FloatRectMac.mm: * platform/graphics/mac/FloatSizeMac.mm: * platform/graphics/mac/FontCustomPlatformData.cpp: (WebCore::createFontCustomPlatformData): * platform/graphics/mac/ImageMac.mm: * platform/graphics/mac/IntPointMac.mm: * platform/graphics/mac/IntRectMac.mm: * platform/graphics/mac/IntSizeMac.mm: * platform/graphics/mac/WebKitNSImageExtras.h: * platform/graphics/mac/WebKitNSImageExtras.mm: * platform/graphics/mac/WebLayer.mm: (-[WebSimpleLayer display]): (-[WebSimpleLayer drawInContext:]): * platform/graphics/opengl/Extensions3DOpenGL.cpp: (WebCore::Extensions3DOpenGL::supportsExtension): * platform/graphics/opengl/GraphicsContext3DOpenGL.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: * platform/graphics/opengl/GraphicsContext3DOpenGLES.cpp: * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::multiply): * platform/graphics/transforms/TransformationMatrix.h: * platform/ios/CursorIOS.cpp: * platform/ios/Device.cpp: * platform/ios/Device.h: * platform/ios/DeviceMotionClientIOS.h: * platform/ios/DeviceMotionClientIOS.mm: (WebCore::DeviceMotionClientIOS::motionChanged): * platform/ios/DeviceOrientationClientIOS.h: * platform/ios/DeviceOrientationClientIOS.mm: (WebCore::DeviceOrientationClientIOS::orientationChanged): * platform/ios/DragImageIOS.mm: * platform/ios/EventLoopIOS.mm: * platform/ios/KeyEventIOS.mm: * platform/ios/LegacyTileCache.h: * platform/ios/LegacyTileCache.mm: * platform/ios/LegacyTileGrid.h: * platform/ios/LegacyTileGrid.mm: * platform/ios/LegacyTileGridTile.h: * platform/ios/LegacyTileGridTile.mm: * platform/ios/LegacyTileLayer.h: * platform/ios/LegacyTileLayer.mm: * platform/ios/LegacyTileLayerPool.h: * platform/ios/LegacyTileLayerPool.mm: * platform/ios/LowPowerModeNotifierIOS.mm: * platform/ios/PasteboardIOS.mm: * platform/ios/PlatformEventFactoryIOS.h: * platform/ios/PlatformEventFactoryIOS.mm: * platform/ios/PlatformPasteboardIOS.mm: * platform/ios/PlatformScreenIOS.mm: * platform/ios/PlatformSpeechSynthesizerIOS.mm: * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/ios/PlaybackSessionInterfaceAVKit.mm: * platform/ios/RemoteCommandListenerIOS.h: * platform/ios/RemoteCommandListenerIOS.mm: * platform/ios/SSLKeyGeneratorIOS.cpp: * platform/ios/ScrollAnimatorIOS.h: * platform/ios/ScrollAnimatorIOS.mm: * platform/ios/ScrollViewIOS.mm: (WebCore::ScrollView::platformSetContentsSize): * platform/ios/ScrollbarThemeIOS.h: * platform/ios/ScrollbarThemeIOS.mm: * platform/ios/SystemMemoryIOS.cpp: (WebCore::systemMemoryLevel): * platform/ios/ThemeIOS.h: * platform/ios/ThemeIOS.mm: * platform/ios/TileControllerMemoryHandlerIOS.cpp: * platform/ios/TileControllerMemoryHandlerIOS.h: * platform/ios/UserAgentIOS.mm: (WebCore::deviceNameForUserAgent): * platform/ios/ValidationBubbleIOS.mm: * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (WebCore::supportsPictureInPicture): * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: * platform/ios/WebBackgroundTaskController.h: * platform/ios/WebBackgroundTaskController.mm: * platform/ios/WebCoreMotionManager.h: * platform/ios/WebCoreMotionManager.mm: * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: * platform/ios/WebSQLiteDatabaseTrackerClient.h: * platform/ios/WebSQLiteDatabaseTrackerClient.mm: * platform/ios/WebVideoFullscreenControllerAVKit.h: * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::requestUpdateInlineRect): (VideoFullscreenControllerContext::requestVideoContentLayer): (VideoFullscreenControllerContext::returnVideoContentLayer): (VideoFullscreenControllerContext::didSetupFullscreen): (VideoFullscreenControllerContext::didExitFullscreen): * platform/ios/WidgetIOS.mm: * platform/ios/wak/FloatingPointEnvironment.cpp: * platform/ios/wak/FloatingPointEnvironment.h: * platform/ios/wak/WAKAppKitStubs.m: * platform/ios/wak/WAKClipView.m: * platform/ios/wak/WAKResponder.m: * platform/ios/wak/WAKScrollView.mm: * platform/ios/wak/WAKView.mm: * platform/ios/wak/WAKWindow.mm: * platform/ios/wak/WKContentObservation.cpp: * platform/ios/wak/WKGraphics.mm: * platform/ios/wak/WKUtilities.c: * platform/ios/wak/WKView.mm: * platform/ios/wak/WebCoreThread.mm: * platform/ios/wak/WebCoreThreadRun.cpp: * platform/ios/wak/WebCoreThreadSystemInterface.cpp: * platform/mac/DragDataMac.mm: (WebCore::rtfPasteboardType): (WebCore::rtfdPasteboardType): (WebCore::stringPasteboardType): (WebCore::urlPasteboardType): (WebCore::htmlPasteboardType): (WebCore::colorPasteboardType): (WebCore::pdfPasteboardType): (WebCore::tiffPasteboardType): (WebCore::DragData::containsURL const): * platform/mac/MediaRemoteSoftLink.cpp: * platform/mac/MediaRemoteSoftLink.h: * platform/mac/SuddenTermination.mm: * platform/mac/WebCoreFullScreenPlaceholderView.mm: * platform/mac/WebCoreFullScreenWarningView.h: * platform/mac/WebCoreFullScreenWarningView.mm: * platform/mac/WebCoreFullScreenWindow.h: * platform/mac/WebCoreFullScreenWindow.mm: * platform/mac/WebNSAttributedStringExtras.mm: * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::~RealtimeVideoSource): (WebCore::RealtimeVideoSource::prepareToProduceData): * platform/mediastream/ios/AVAudioSessionCaptureDevice.h: * platform/mediastream/ios/AVAudioSessionCaptureDevice.mm: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.h: * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.h: * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: * platform/mediastream/libwebrtc/LibWebRTCMacros.h: * platform/mediastream/mac/AVCaptureDeviceManager.mm: (WebCore::deviceIsAvailable): * platform/mediastream/mac/AVMediaCaptureSource.mm: (WebCore::AVMediaCaptureSource::AVMediaCaptureSource): (WebCore::AVMediaCaptureSource::stopProducingData): (-[WebCoreAVMediaCaptureSourceObserver addNotificationObservers]): (-[WebCoreAVMediaCaptureSourceObserver removeNotificationObservers]): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::stopProducingData): (WebCore::AVVideoCaptureSource::prefersPreset): (WebCore::sensorOrientation): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::monitorOrientation): (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]): (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]): * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp: (WebCore::AudioTrackPrivateMediaStreamCocoa::createAudioUnit): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioSharedUnit::setupAudioUnit): (WebCore::CoreAudioCaptureSource::create): (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::~CoreAudioCaptureSource): (WebCore::CoreAudioCaptureSource::startProducingData): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::~DisplayCaptureSourceCocoa): (WebCore::DisplayCaptureSourceCocoa::startProducingData): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferPool): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mock/MediaPlaybackTargetMock.cpp: * platform/mock/MediaPlaybackTargetMock.h: * platform/mock/MediaPlaybackTargetPickerMock.cpp: * platform/mock/MediaPlaybackTargetPickerMock.h: * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): * platform/mock/MockRealtimeMediaSourceCenter.cpp: * platform/mock/MockRealtimeVideoSource.cpp: * platform/network/CredentialStorage.cpp: * platform/network/NetworkStateNotifier.h: * platform/network/ResourceHandle.cpp: (WebCore::builtinResourceHandleConstructorMap): * platform/network/ResourceHandle.h: * platform/network/ResourceHandleClient.h: * platform/network/ResourceRequestBase.cpp: * platform/network/ResourceRequestBase.h: * platform/network/cf/DNSResolveQueueCFNet.cpp: * platform/network/cf/ProxyServerCFNet.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::resourcePrioritiesEnabled): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::ResourceRequest::doUpdatePlatformRequest): (WebCore::ResourceRequest::doUpdateResourceRequest): * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::callbacksRunLoop): (WebCore::copyCONNECTProxyResponse): * platform/network/cocoa/CookieCocoa.mm: (WebCore::Cookie::operator NSHTTPCookie * _Nullable const): * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): (WebCore::setHTTPCookiesForURL): * platform/network/cocoa/ResourceRequestCocoa.mm: (WebCore::ResourceRequest::doUpdateResourceRequest): (WebCore::ResourceRequest::doUpdatePlatformRequest): * platform/network/ios/NetworkStateNotifierIOS.mm: * platform/network/ios/WebCoreURLResponseIOS.h: * platform/network/ios/WebCoreURLResponseIOS.mm: * platform/network/mac/ResourceErrorMac.mm: * platform/network/mac/ResourceHandleMac.mm: (WebCore::ResourceHandle::createNSURLConnection): (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): * platform/network/mac/UTIUtilities.mm: * platform/sql/SQLiteDatabase.h: (WebCore::SQLiteDatabase::sqlite3Handle const): * platform/sql/SQLiteFileSystem.cpp: * platform/sql/SQLiteFileSystem.h: * platform/sql/SQLiteTransaction.cpp: (WebCore::SQLiteTransaction::begin): (WebCore::SQLiteTransaction::commit): (WebCore::SQLiteTransaction::rollback): (WebCore::SQLiteTransaction::stop): * platform/text/PlatformLocale.cpp: * platform/text/PlatformLocale.h: * platform/text/ios/LocalizedDateCache.h: * platform/text/ios/LocalizedDateCache.mm: * platform/text/ios/TextEncodingRegistryIOS.mm: * platform/text/mac/LocaleMac.h: * platform/text/mac/LocaleMac.mm: * plugins/PluginViewBase.h: * rendering/InlineTextBox.cpp: (WebCore::InlineTextBox::paintPlatformDocumentMarker): (WebCore::InlineTextBox::resolveStyleForMarkedText): (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): * rendering/MarkedText.h: * rendering/RenderBlock.cpp: (WebCore::RenderBlock::paint): * rendering/RenderBox.cpp: (WebCore::RenderBox::paintBoxDecorations): (WebCore::allowMinMaxPercentagesInAutoHeightBlocksQuirk): * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::decodingModeForImageDraw const): * rendering/RenderButton.cpp: * rendering/RenderButton.h: * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): (WebCore::RenderElement::styleDidChange): * rendering/RenderEmbeddedObject.cpp: (WebCore::RenderEmbeddedObject::allowsAcceleratedCompositing const): (WebCore::RenderEmbeddedObject::setPluginUnavailabilityReason): (WebCore::RenderEmbeddedObject::setPluginUnavailabilityReasonWithDescription): * rendering/RenderFileUploadControl.cpp: (WebCore::RenderFileUploadControl::maxFilenameWidth const): (WebCore::RenderFileUploadControl::paintObject): * rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::positionFrames): * rendering/RenderIFrame.h: * rendering/RenderImage.cpp: (WebCore::RenderImage::paintAreaElementFocusRing): * rendering/RenderImage.h: * rendering/RenderInline.cpp: * rendering/RenderInline.h: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::canCreateStackingContext): (WebCore::RenderLayer::canUseAcceleratedTouchScrolling const): (WebCore::RenderLayer::scrollTo): (WebCore::RenderLayer::scrollRectToVisible): (WebCore::RenderLayer::updateScrollInfoAfterLayout): (WebCore::RenderLayer::showsOverflowControls const): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): (WebCore::RenderLayerBacking::shouldClipCompositedBounds const): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::paintsIntoWindow const): (WebCore::RenderLayerBacking::setContentsNeedDisplayInRect): (WebCore::RenderLayerBacking::paintIntoLayer): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::visibleRectForLayerFlushing const): (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): (WebCore::RenderLayerCompositor::didFlushChangesForLayer): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::setIsInWindow): (WebCore::RenderLayerCompositor::requiresCompositingForScrollableFrame const): (WebCore::RenderLayerCompositor::isAsyncScrollableStickyLayer const): (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const): (WebCore::RenderLayerCompositor::contentsScaleMultiplierForNewTiles const): (WebCore::RenderLayerCompositor::ensureRootLayer): (WebCore::RenderLayerCompositor::computeStickyViewportConstraints const): (WebCore::RenderLayerCompositor::willRemoveScrollingLayerWithBacking): (WebCore::RenderLayerCompositor::didAddScrollingLayer): * rendering/RenderLayerCompositor.h: * rendering/RenderLayerModelObject.cpp: (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const): * rendering/RenderLineBreak.cpp: * rendering/RenderLineBreak.h: * rendering/RenderMenuList.cpp: (WebCore::RenderMenuList::RenderMenuList): (WebCore::RenderMenuList::willBeDestroyed): (WebCore::RenderMenuList::adjustInnerStyle): (RenderMenuList::updateFromElement): (RenderMenuList::setTextFromOption): (RenderMenuList::hidePopup): (RenderMenuList::popupDidHide): * rendering/RenderMenuList.h: * rendering/RenderObject.cpp: (WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint): (WebCore::RenderObject::destroy): * rendering/RenderObject.h: * rendering/RenderSearchField.cpp: (WebCore::RenderSearchField::itemText const): * rendering/RenderText.cpp: (WebCore::RenderText::setRenderedText): * rendering/RenderText.h: * rendering/RenderTextControl.cpp: * rendering/RenderTextControl.h: * rendering/RenderTextControlMultiLine.cpp: (WebCore::RenderTextControlMultiLine::getAverageCharWidth): * rendering/RenderTextControlSingleLine.cpp: (WebCore::RenderTextControlSingleLine::layout): (WebCore::RenderTextControlSingleLine::getAverageCharWidth): (WebCore::RenderTextControlSingleLine::preferredContentLogicalWidth const): * rendering/RenderTextLineBoxes.cpp: (WebCore::lineDirectionPointFitsInBox): (WebCore::RenderTextLineBoxes::positionForPoint const): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paintBorderOnly): * rendering/RenderThemeIOS.h: * rendering/RenderThemeIOS.mm: (WebCore::arKitBundle): * rendering/RenderView.cpp: (WebCore::RenderView::availableLogicalHeight const): (WebCore::RenderView::clientLogicalWidthForFixedPosition const): (WebCore::RenderView::clientLogicalHeightForFixedPosition const): (WebCore::RenderView::repaintViewRectangle const): * rendering/RenderWidget.cpp: (WebCore::RenderWidget::willBeDestroyed): * rendering/RootInlineBox.cpp: (WebCore::RootInlineBox::selectionTop const): (WebCore::RootInlineBox::selectionBottom const): * rendering/style/RenderStyle.h: * rendering/style/StyleRareInheritedData.cpp: (WebCore::StyleRareInheritedData::StyleRareInheritedData): (WebCore::StyleRareInheritedData::operator== const): * rendering/style/StyleRareInheritedData.h: * rendering/updating/RenderTreeUpdater.cpp: (WebCore::RenderTreeUpdater::updateElementRenderer): * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): * testing/Internals.cpp: (WebCore::Internals::getCurrentCursorInfo): (WebCore::Internals::isSelectPopupVisible): (WebCore::Internals::setQuickLookPassword): * testing/Internals.mm: (WebCore::Internals::userPrefersReducedMotion const): * testing/js/WebCoreTestSupportPrefix.h: * workers/WorkerThread.cpp: (WebCore::WorkerThread::workerThread): 2018-10-18 Per Arne Vollan <pvollan@apple.com> [WebVTT] The TextTrackLoader parameter in TextTrackLoaderClient virtual methods should be a reference https://bugs.webkit.org/show_bug.cgi?id=190730 Reviewed by Chris Dumez. No new tests. No change in behavior. * html/track/LoadableTextTrack.cpp: (WebCore::LoadableTextTrack::newCuesAvailable): (WebCore::LoadableTextTrack::cueLoadingCompleted): (WebCore::LoadableTextTrack::newRegionsAvailable): * html/track/LoadableTextTrack.h: * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::cueLoadTimerFired): (WebCore::TextTrackLoader::newRegionsParsed): * loader/TextTrackLoader.h: 2018-10-18 Alex Christensen <achristensen@webkit.org> Clean up FrameLoader two-state enums https://bugs.webkit.org/show_bug.cgi?id=190731 Reviewed by Chris Dumez. This patch does three things: 1. Add an overload to EnumTraits so we do not need to list out the valid values of boolean enum classes. The valid values are always 0 and 1. This is used when decoding from IPC. 2. Add a 2-state enum class for NewLoadInProgress instad of a bool so we can understand the code better. 3. Begin passing LockBackForwardList to the UIProcess. We will need it soon for PSON. * history/CachedFrame.h: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::provisionalLoadStarted): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::commitProvisionalLoad): (WebCore::FrameLoader::clientRedirectCancelledOrFinished): (WebCore::FrameLoader::clientRedirected): (WebCore::FrameLoader::receivedMainResourceError): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/FrameLoaderTypes.h: * loader/NavigationScheduler.cpp: (WebCore::ScheduledNavigation::didStopTimer): (WebCore::NavigationScheduler::cancel): * loader/NavigationScheduler.h: * platform/network/StoredCredentialsPolicy.h: 2018-10-18 Wenson Hsieh <wenson_hsieh@apple.com> [GTK] fast/css/pseudo-visited-background-color-on-input.html is failing since r237425 https://bugs.webkit.org/show_bug.cgi?id=190712 Reviewed by Tim Horton. Ensure that color inputs are enabled by default on GTK, and that color inputs have a `-webkit-appearance` of `color-well` by default. Fixes fast/css/pseudo-visited-background-color-on-input.html on GTK. * page/RuntimeEnabledFeatures.cpp: (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::colorInputStyleSheet const): * rendering/RenderTheme.h: (WebCore::RenderTheme::platformUsesColorWellAppearance const): (WebCore::RenderTheme::platformColorInputStyleSheet const): Deleted. Replace this with a platform hook that determines whether we want to use `-webkit-appearance: color-well;` by default for inputs of type color. For now, only iOS overrides this to return false; in the future, we should support `-webkit-appearance: color-well;` on iOS, and remove this platform hook entirely. * rendering/RenderThemeIOS.h: * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformColorInputStyleSheet const): Deleted. 2018-10-18 Youenn Fablet <youenn@apple.com> Handle MDNS resolution of candidates through libwebrtc directly https://bugs.webkit.org/show_bug.cgi?id=190681 Reviewed by Eric Carlson. Remove the previous MDNS resolution mechanism. Instead, add support for the AsyncResolver mechanism added to libwebrtc. Covered by current mdns webrtc test that is unflaked. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::addIceCandidate): * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::createPeerConnection): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::MockLibWebRTCPeerConnectionFactory::CreatePeerConnection): * testing/MockLibWebRTCPeerConnection.h: 2018-10-18 Ali Juma <ajuma@chromium.org> [IntersectionObserver] Factor out rect mapping and clipping logic from computeRectForRepaint https://bugs.webkit.org/show_bug.cgi?id=189833 Reviewed by Simon Fraser. Factor out the rect mapping and clipping logic from computeRectForRepaint to a new computeVisibleRectInContainer method that computeRectForRepaint now calls. Make computeVisibleRectInContainer take a VisibleRectContext with options to use edge-inclusive intersection and to apply all clips and scrolls rather than only the clips and scrolls that are currently applied by the repaint logic. These options will be used by IntersectionObserver in a future patch. No new tests, no change in behavior. * platform/graphics/FloatRect.cpp: (WebCore::FloatRect::edgeInclusiveIntersect): * platform/graphics/FloatRect.h: * platform/graphics/LayoutRect.cpp: (WebCore::LayoutRect::edgeInclusiveIntersect): * platform/graphics/LayoutRect.h: * rendering/RenderBox.cpp: (WebCore::RenderBox::applyCachedClipAndScrollPosition const): (WebCore::RenderBox::computeVisibleRectUsingPaintOffset const): (WebCore::RenderBox::computeVisibleRectInContainer const): (WebCore::RenderBox::applyCachedClipAndScrollPositionForRepaint const): Deleted. (WebCore::RenderBox::shouldApplyClipAndScrollPositionForRepaint const): Deleted. The iOS-specific logic in this method has moved to RenderObject::shouldApplyCompositedContainerScrollsForRepaint. (WebCore::RenderBox::computeRectForRepaint const): Deleted. * rendering/RenderBox.h: (WebCore::RenderBox::computeRectForRepaint): Deleted. * rendering/RenderInline.cpp: (WebCore::RenderInline::clippedOverflowRectForRepaint const): (WebCore::RenderInline::computeVisibleRectUsingPaintOffset const): (WebCore::RenderInline::computeVisibleRectInContainer const): (WebCore::RenderInline::computeRectForRepaint const): Deleted. * rendering/RenderInline.h: (WebCore::RenderInline::computeRectForRepaint): Deleted. * rendering/RenderObject.cpp: (WebCore::RenderObject::shouldApplyCompositedContainerScrollsForRepaint): (WebCore::RenderObject::visibleRectContextForRepaint): (WebCore::RenderObject::computeRectForRepaint const): (WebCore::RenderObject::computeFloatRectForRepaint const): (WebCore::RenderObject::computeVisibleRectInContainer const): (WebCore::RenderObject::computeFloatVisibleRectInContainer const): * rendering/RenderObject.h: (WebCore::RenderObject::computeAbsoluteRepaintRect const): (WebCore::RenderObject::VisibleRectContext::VisibleRectContext): (WebCore::RenderObject::RepaintContext::RepaintContext): Deleted. (WebCore::RenderObject::computeRectForRepaint): Deleted. * rendering/RenderTableCell.cpp: (WebCore::RenderTableCell::computeVisibleRectInContainer const): (WebCore::RenderTableCell::computeRectForRepaint const): Deleted. * rendering/RenderTableCell.h: * rendering/RenderView.cpp: (WebCore::RenderView::computeVisibleRectInContainer const): (WebCore::RenderView::computeRectForRepaint const): Deleted. * rendering/RenderView.h: * rendering/svg/RenderSVGForeignObject.cpp: (WebCore::RenderSVGForeignObject::computeFloatVisibleRectInContainer const): (WebCore::RenderSVGForeignObject::computeVisibleRectInContainer const): (WebCore::RenderSVGForeignObject::computeFloatRectForRepaint const): Deleted. (WebCore::RenderSVGForeignObject::computeRectForRepaint const): Deleted. * rendering/svg/RenderSVGForeignObject.h: * rendering/svg/RenderSVGInline.cpp: (WebCore::RenderSVGInline::computeFloatVisibleRectInContainer const): (WebCore::RenderSVGInline::computeFloatRectForRepaint const): Deleted. * rendering/svg/RenderSVGInline.h: * rendering/svg/RenderSVGModelObject.cpp: (WebCore::RenderSVGModelObject::computeFloatVisibleRectInContainer const): (WebCore::RenderSVGModelObject::computeFloatRectForRepaint const): Deleted. * rendering/svg/RenderSVGModelObject.h: * rendering/svg/RenderSVGRoot.cpp: (WebCore::RenderSVGRoot::computeFloatVisibleRectInContainer const): (WebCore::RenderSVGRoot::computeFloatRectForRepaint const): Deleted. * rendering/svg/RenderSVGRoot.h: * rendering/svg/RenderSVGText.cpp: (WebCore::RenderSVGText::computeVisibleRectInContainer const): (WebCore::RenderSVGText::computeFloatVisibleRectInContainer const): (WebCore::RenderSVGText::computeRectForRepaint const): Deleted. (WebCore::RenderSVGText::computeFloatRectForRepaint const): Deleted. * rendering/svg/RenderSVGText.h: * rendering/svg/SVGRenderSupport.cpp: (WebCore::SVGRenderSupport::clippedOverflowRectForRepaint): (WebCore::SVGRenderSupport::computeFloatVisibleRectInContainer): (WebCore::SVGRenderSupport::computeFloatRectForRepaint): Deleted. * rendering/svg/SVGRenderSupport.h: 2018-10-17 Wenson Hsieh <wenson_hsieh@apple.com> Enable the datalist element by default on iOS and macOS https://bugs.webkit.org/show_bug.cgi?id=190594 <rdar://problem/45281159> Reviewed by Ryosuke Niwa and Tim Horton. Rebaselined existing layout tests. * Configurations/FeatureDefines.xcconfig: * bindings/js/WebCoreBuiltinNames.h: * css/CSSDefaultStyleSheets.cpp: (WebCore::CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement): * css/CSSDefaultStyleSheets.h: * css/InspectorCSSOMWrappers.cpp: (WebCore::InspectorCSSOMWrappers::collectDocumentWrappers): * css/html.css: Remove color input and datalist style rules from the default UA stylesheet. (input[type="color"]::-webkit-color-swatch-wrapper): Deleted. * html/HTMLDataListElement.idl: Make HTMLDataListElement runtime-enabled. * html/HTMLTagNames.in: * html/RangeInputType.cpp: Make a slight adjustment here so that inputs of type range respect the list attribute. Fixes a few layout tests that add a datalist to an input of type range. See <https://bugs.webkit.org/show_bug.cgi?id=190613> for more details. (WebCore::RangeInputType::shouldRespectListAttribute): * html/TextFieldInputType.cpp: (WebCore::TextFieldInputType::shouldRespectListAttribute): * page/RuntimeEnabledFeatures.h: Add a runtime-enabled feature for the datalist element. Additionally, make the runtime-enabled feature for input type color false by default, so that it's off in WebKitLegacy. (WebCore::RuntimeEnabledFeatures::dataListElementEnabled const): (WebCore::RuntimeEnabledFeatures::setDataListElementEnabled): * rendering/RenderTheme.cpp: (WebCore::RenderTheme::colorInputStyleSheet const): Add new style-sheet hooks for datalist and input type color, so that style rules for color inputs and datalists can be added at runtime only if the feature is enabled. This ensures that in WebKitLegacy (or other ports where either or both elements are disabled), we don't still apply rules for datalist and input[type="color"]. Notably, this allows fallback content inside datalist elements to still work in WebKitLegacy (which would otherwise be hidden when using the default stylesheet since `display: none` is applied to datalist by default). This also prevents inputs of type color from having a smaller size, no outline, and the appearance of a color well on macOS. (WebCore::RenderTheme::dataListStyleSheet const): * rendering/RenderTheme.h: (WebCore::RenderTheme::platformColorInputStyleSheet const): * rendering/RenderThemeMac.h: * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::platformColorInputStyleSheet const): 2018-10-17 Justin Michaud <justin_michaud@apple.com> Parse paint() and store paint callbacks for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190657 Reviewed by Dean Jackson. Implement support for parsing paint() images in css, and store CSS paint callback objects in the paint definition map. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: (WebCore::JSCSSPaintWorkletGlobalScope::visitAdditionalChildren): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * css/CSSImageGeneratorValue.cpp: (WebCore::CSSImageGeneratorValue::image): (WebCore::CSSImageGeneratorValue::isFixedSize const): (WebCore::CSSImageGeneratorValue::fixedSize): (WebCore::CSSImageGeneratorValue::isPending const): (WebCore::CSSImageGeneratorValue::knownToBeOpaque const): (WebCore::CSSImageGeneratorValue::loadSubimages): * css/CSSPaintImageValue.cpp: Added. (WebCore::CSSPaintImageValue::customCSSText const): * css/CSSPaintImageValue.h: Added. * css/CSSPaintWorkletGlobalScope.h: * css/CSSPaintWorkletGlobalScope.idl: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isPaintImageValue const): * css/CSSValueKeywords.in: * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeCustomPaint): (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage): (WebCore::CSSPropertyParserHelpers::isGeneratedImage): * platform/mediastream/mac/RealtimeVideoUtilities.h: 2018-10-17 Eric Carlson <eric.carlson@apple.com> [MediaStream] Consolidate all image conversion and resizing into one class https://bugs.webkit.org/show_bug.cgi?id=190519 <rdar://problem/45224307> Try to fix the iOSMac build after r237236. * platform/graphics/cv/ImageTransferSessionVT.h: * platform/graphics/cv/ImageTransferSessionVT.mm: 2018-10-17 Justin Fan <justin_fan@apple.com> [WebGPU] Implement WebGPU bindings up through WebGPUDevice creation https://bugs.webkit.org/show_bug.cgi?id=190653 Reviewed by Dean Jackson. Test: webgpu/webgpu-enabled.html Add WebGPU Sketch bindings for window.webgpu, WebGPUAdapter, WebGPUAdapterDescriptor, and WebGPUDevice creation. Based off IDL commit version b6c61ee. https://github.com/gpuweb/gpuweb/blob/master/design/sketch.webidl * CMakeLists.txt: * DerivedSources.make: * Modules/webgpu/DOMWindowWebGPU.cpp: Added. (WebCore::DOMWindowWebGPU::DOMWindowWebGPU): (WebCore::DOMWindowWebGPU::supplementName): (WebCore::DOMWindowWebGPU::from): (WebCore::DOMWindowWebGPU::webgpu): (WebCore::DOMWindowWebGPU::webgpu const): * Modules/webgpu/DOMWindowWebGPU.h: Added. * Modules/webgpu/DOMWindowWebGPU.idl: Added. * Modules/webgpu/WebGPU.cpp: Added. (WebCore::WebGPU::create): (WebCore::WebGPU::requestAdapter const): * Modules/webgpu/WebGPU.h: Added. * Modules/webgpu/WebGPU.idl: Added. * Modules/webgpu/WebGPUAdapter.cpp: Added. (WebCore::WebGPUAdapter::create): (WebCore::WebGPUAdapter::WebGPUAdapter): (WebCore::WebGPUAdapter::createDevice): * Modules/webgpu/WebGPUAdapter.h: Added. * Modules/webgpu/WebGPUAdapter.idl: Added. * Modules/webgpu/WebGPUAdapterDescriptor.h: Added. * Modules/webgpu/WebGPUAdapterDescriptor.idl: Added. * Modules/webgpu/WebGPUDevice.cpp: Added. (WebCore::WebGPUDevice::create): (WebCore::WebGPUDevice::WebGPUDevice): * Modules/webgpu/WebGPUDevice.h: Added. (WebCore::WebGPUDevice::adapter const): * Modules/webgpu/WebGPUDevice.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: 2018-10-17 Andy Estes <aestes@apple.com> [Apple Pay] Increment the API version to 5 https://bugs.webkit.org/show_bug.cgi?id=190686 <rdar://problem/45348523> Reviewed by Simon Fraser. Test: http/tests/ssl/applepay/ApplePaySessionV5.html * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::supportsVersion): 2018-10-17 Eric Carlson <eric.carlson@apple.com> [MediaStream] Consolidate all image conversion and resizing into one class https://bugs.webkit.org/show_bug.cgi?id=190519 <rdar://problem/45224307> Reviewed by Youenn Fablet. No new tests, no functional change. * SourcesCocoa.txt: Add ImageTransferSessionVT. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/MediaSample.h: (WebCore::MediaSample::videoPixelFormat const): New. * platform/cocoa/VideoToolboxSoftLink.cpp: Add new kVTPixelTransferProperty keys. * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: (WebCore::MediaSampleAVFObjC::create): Remove unimplemented variant. * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::videoPixelFormat const): New. * platform/graphics/cv/ImageTransferSessionVT.h: Added. (WebCore::ImageTransferSessionVT::create): * platform/graphics/cv/ImageTransferSessionVT.mm: Added. (WebCore::ImageTransferSessionVT::ImageTransferSessionVT): (WebCore::ImageTransferSessionVT::~ImageTransferSessionVT): (WebCore::ImageTransferSessionVT::setSize): (WebCore::ImageTransferSessionVT::createPixelBuffer): (WebCore::ImageTransferSessionVT::createCMSampleBuffer): (WebCore::roundUpToMacroblockMultiple): (WebCore::ImageTransferSessionVT::ioSurfacePixelBufferCreationOptions): (WebCore::ImageTransferSessionVT::createMediaSample): * platform/graphics/cv/PixelBufferResizer.h: Removed. * platform/graphics/cv/PixelBufferResizer.mm: Removed. * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::prefersPreset): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): Remove the resizing logic, it is handled by the base class. * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::capabilities): (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): (WebCore::DisplayCaptureSourceCocoa::emitFrame): Remove resizing logic, just use a transfer session to create an image from the capture source native output format. (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Deleted. (WebCore::roundUpToMacroblockMultiple): Deleted. (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Deleted. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): Use image transfer session. (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Deleted. (WebCore::MockRealtimeVideoSourceMac::pixelBufferFromCGImage const): Deleted. (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): Deleted. * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): (WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return the IOSurface directly. * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: (WebCore::WindowDisplayCaptureSourceMac::generateFrame): Return the CGImage directly. (WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage): Deleted. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::capabilities): Only the camera supports device ID. (WebCore::MockRealtimeVideoSource::settings): Ditto. 2018-10-17 Eric Carlson <eric.carlson@apple.com> [MediaStream] Clean up capture source factory management https://bugs.webkit.org/show_bug.cgi?id=190502 <rdar://problem/45212447> Reviewed by Youenn Fablet. No new tests, no functional change. * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::setAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): (WebCore::RealtimeMediaSourceCenter::audioFactory): (WebCore::RealtimeMediaSourceCenter::setVideoFactory): (WebCore::RealtimeMediaSourceCenter::unsetVideoFactory): (WebCore::RealtimeMediaSourceCenter::videoFactory): (WebCore::RealtimeMediaSourceCenter::setDisplayCaptureFactory): (WebCore::RealtimeMediaSourceCenter::unsetDisplayCaptureFactory): (WebCore::RealtimeMediaSourceCenter::displayCaptureFactory): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::setAudioFactory): Deleted. (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): Deleted. (): Deleted. * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactoryPrivate): (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactoryPrivate): (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactoryPrivate): (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory): Deleted. (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory): Deleted. (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory): Deleted. (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory): Deleted. * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::audioFactoryPrivate): (WebCore::RealtimeMediaSourceCenterMac::videoFactoryPrivate): (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactoryPrivate): (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory): Deleted. (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory): Deleted. (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory): Deleted. (WebCore::RealtimeMediaSourceCenterMac::audioFactory): Deleted. (WebCore::RealtimeMediaSourceCenterMac::videoFactory): Deleted. (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory): Deleted. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeMediaSourceCenter::audioFactoryPrivate): (WebCore::MockRealtimeMediaSourceCenter::videoFactoryPrivate): (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactoryPrivate): (WebCore::MockRealtimeMediaSourceCenter::audioFactory): Deleted. (WebCore::MockRealtimeMediaSourceCenter::videoFactory): Deleted. (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): Deleted. * platform/mock/MockRealtimeMediaSourceCenter.h: 2018-10-17 Alex Christensen <achristensen@webkit.org> BackForwardClient needs to be able to support UIProcess-only back/forward lists https://bugs.webkit.org/show_bug.cgi?id=190675 Reviewed by Chris Dumez. Return a RefPtr<HistoryItem> instead of a HistoryItem so that we will be able to return a HistoryItem that has been created instead of a pointer to a HistoryItem that is owned by something else. Also use unsigned for the back and forward list counts because they can never be negative. * history/BackForwardClient.h: * history/BackForwardController.cpp: (WebCore::BackForwardController::backItem): (WebCore::BackForwardController::currentItem): (WebCore::BackForwardController::forwardItem): (WebCore::BackForwardController::canGoBackOrForward const): (WebCore::BackForwardController::goBackOrForward): (WebCore::BackForwardController::goBack): (WebCore::BackForwardController::goForward): (WebCore::BackForwardController::count const): (WebCore::BackForwardController::backCount const): (WebCore::BackForwardController::forwardCount const): (WebCore::BackForwardController::itemAtIndex): * history/BackForwardController.h: (WebCore::BackForwardController::backItem): Deleted. (WebCore::BackForwardController::currentItem): Deleted. (WebCore::BackForwardController::forwardItem): Deleted. * loader/EmptyClients.cpp: * loader/NavigationScheduler.cpp: (WebCore::NavigationScheduler::scheduleHistoryNavigation): 2018-10-17 Antoine Quint <graouts@apple.com> [Web Animations] Do not create a DocumentTimeline to suspend or resume animations https://bugs.webkit.org/show_bug.cgi?id=190660 Reviewed by Dean Jackson. We check that there is an existing timeline before trying to suspend or resume its animations, otherwise we're creating a DocumentTimeline when nothing requires for it to exist. We also have to check that we suspend animations when a DocumentTimeline is created while the page is not visible. No new tests as there is no change in behavior here. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::DocumentTimeline): * dom/Document.cpp: (WebCore::Document::didBecomeCurrentDocumentInFrame): (WebCore::Document::resume): * page/Frame.cpp: (WebCore::Frame::clearTimers): * page/Page.cpp: (WebCore::Page::setIsVisibleInternal): (WebCore::Page::hiddenPageCSSAnimationSuspensionStateChanged): 2018-10-17 Antti Koivisto <antti@apple.com> Tiling CSS gradients is slow https://bugs.webkit.org/show_bug.cgi?id=190615 Reviewed by Tim Horton. Painting blocks the main thread on CG rendering queue to make a copy of the backing store. * platform/graphics/BitmapImage.cpp: (WebCore::BitmapImage::drawPattern): Also use sinkIntoImage for bitmap image pattern drawing. * platform/graphics/GradientImage.cpp: (WebCore::GradientImage::drawPattern): Sink the gradient into an Image after generating it. Unlike ImageBuffer, painting it doesn't involve inefficient copies. Previous isCompatibleWithContext test is replaced with an equivalent scale factor test. * platform/graphics/GradientImage.h: 2018-10-17 Chris Dumez <cdumez@apple.com> Update more DOMWindow getters to return references instead of raw pointers https://bugs.webkit.org/show_bug.cgi?id=190654 Reviewed by Youenn Fablet. Update more DOMWindow getters to return references instead of raw pointers, since they can no longer return null after recent refactoring. * Modules/gamepad/GamepadManager.cpp: (WebCore::navigatorGamepadFromDOMWindow): * bindings/js/JSDOMWindowCustom.cpp: (WebCore::JSDOMWindow::heapSnapshot): * dom/Document.cpp: (WebCore::Document::location const): (WebCore::Document::dispatchPopstateEvent): * dom/Event.cpp: (WebCore::Event::timeStampForBindings const): * loader/DocumentThreadableLoader.cpp: (WebCore::DocumentThreadableLoader::loadRequest): * loader/ResourceTimingInformation.cpp: (WebCore::ResourceTimingInformation::addResourceTiming): * page/DOMWindow.cpp: (WebCore::DOMWindow::screen): (WebCore::DOMWindow::history): (WebCore::DOMWindow::crypto const): (WebCore::DOMWindow::locationbar): (WebCore::DOMWindow::menubar): (WebCore::DOMWindow::personalbar): (WebCore::DOMWindow::scrollbars): (WebCore::DOMWindow::statusbar): (WebCore::DOMWindow::toolbar): (WebCore::DOMWindow::applicationCache): (WebCore::DOMWindow::navigator): (WebCore::DOMWindow::performance const): (WebCore::DOMWindow::nowTimestamp const): (WebCore::DOMWindow::location): (WebCore::DOMWindow::visualViewport): (WebCore::DOMWindow::styleMedia): * page/DOMWindow.h: * page/FrameView.cpp: (WebCore::FrameView::updateLayoutViewport): * page/History.cpp: (WebCore::History::stateObjectAdded): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::createTimestamp const): * page/PerformanceObserver.cpp: (WebCore::PerformanceObserver::PerformanceObserver): * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::requestFullscreenMode): 2018-10-17 Chris Fleizach <cfleizach@apple.com> AX: Certain tags should identify their context to iOS API https://bugs.webkit.org/show_bug.cgi?id=190622 <rdar://problem/45308194> Reviewed by Zalan Bujtas. Convey the semantic meaning of <code> tag to the iOS API so VoiceOver can make use of it. Tests: accessibility/ios-simulator/text-context-attributes.html * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm: (-[WebAccessibilityObjectWrapper accessibilityTextualContext]): (AXAttributeStringSetStyle): 2018-10-17 Youenn Fablet <youenn@apple.com> Remove unused code from RealtimeOutgoingVideoSourceCocoa https://bugs.webkit.org/show_bug.cgi?id=190666 Reviewed by Eric Carlson. No change of behavior, removed no longer used code. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (): Deleted. 2018-10-17 Ali Juma <ajuma@chromium.org> Flaky IntersectionObserver web platform tests involving style updates https://bugs.webkit.org/show_bug.cgi?id=189091 Reviewed by Simon Fraser. Update intersection observations when flushing layers from the WebProcess to the UIProcess to make the timing of these updates more predictable, and more consistent with the IntersectionObserver spec, since the spec expects these updates to happen as part of the "Update the rendering" step in the HTML EventLoop. Getting a similar approach to work with WK1 seems to add more complexity than it's worth, since flushes don't happen for scrolls handled by platform widgets, and flushes for other invalidations only happen when in compositing mode. The only remaining timer-driven intersection observation update is for handling the initial observation on a newly added target, which needs to happen even if there are no changes triggering a flush. Tested by the following tests no longer being flaky: imported/w3c/web-platform-tests/intersection-observer/bounding-box.html imported/w3c/web-platform-tests/intersection-observer/display-none.html imported/w3c/web-platform-tests/intersection-observer/containing-block.html * dom/Document.cpp: (WebCore::Document::resolveStyle): (WebCore::Document::updateIntersectionObservations): (WebCore::Document::scheduleForcedIntersectionObservationUpdate): (WebCore::Document::scheduleIntersectionObservationUpdate): Deleted. * dom/Document.h: * page/FrameView.cpp: (WebCore::FrameView::flushCompositingStateForThisFrame): (WebCore::FrameView::viewportContentsChanged): * page/IntersectionObserver.cpp: (WebCore::IntersectionObserver::observe): * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::willDisplayPage): (WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): (WebCore::Page::updateIntersectionObservations): (WebCore::Page::scheduleForcedIntersectionObservationUpdate): * page/Page.h: 2018-10-17 Charlie Turner <cturner@igalia.com> [EME] Sanity check key ID length in the keyids init data format https://bugs.webkit.org/show_bug.cgi?id=190629 Reviewed by Xabier Rodriguez-Calvar. Covered by web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsKeyids): Ensure the decoded key id length is at least 1 byte and no more than 512 bytes. 2018-10-16 Chris Dumez <cdumez@apple.com> Regression(r236795) Check boxes are sometimes checked when they should not be https://bugs.webkit.org/show_bug.cgi?id=190651 <rdar://problem/45319934> Reviewed by Ryosuke Niwa. r236795 mistakenly dropped the statement resetting m_reflectsCheckedAttribute to true in HTMLInputElement::parseAttribute() because it looked like a no-op given that we made sure it was true a couple of line above. However, I overlooked that calling HTMLInputElement::setChecked() sets m_reflectsCheckedAttribute to false. This patch thus re-introduces the statement. It also renames m_reflectsCheckedAttribute to m_dirtyCheckednessFlag and reverses its value in order to match the specification more closely: - https://html.spec.whatwg.org/#concept-input-checked-dirty-flag Test: fast/dom/HTMLInputElement/checkbox-dirty-checkedness-flag.html * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::HTMLInputElement): (WebCore::HTMLInputElement::parseAttribute): (WebCore::HTMLInputElement::finishParsingChildren): (WebCore::HTMLInputElement::reset): (WebCore::HTMLInputElement::setChecked): (WebCore::HTMLInputElement::copyNonAttributePropertiesFromElement): * html/HTMLInputElement.h: 2018-10-16 Sihui Liu <sihui_liu@apple.com> Add a switch for Web SQL https://bugs.webkit.org/show_bug.cgi?id=190271 Reviewed by Ryosuke Niwa. Web SQL is still enabled by default. * Modules/webdatabase/DOMWindowWebDatabase.idl: * Modules/webdatabase/Database.idl: * Modules/webdatabase/SQLError.idl: * Modules/webdatabase/SQLResultSet.idl: * Modules/webdatabase/SQLResultSetRowList.idl: * bindings/js/WebCoreBuiltinNames.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebSQLDisabled): (WebCore::RuntimeEnabledFeatures::webSQLEnabled const): 2018-10-16 Chris Dumez <cdumez@apple.com> window.performance should not become null after the window loses its browsing context https://bugs.webkit.org/show_bug.cgi?id=190636 Reviewed by Ryosuke Niwa. window.performance should not become null after the window loses its browsing context. This WebKit behavior does not match the HTML specification nor the behavior of other browsers. Also note that the attribute is not nullable in the specification: - https://www.w3.org/TR/navigation-timing/#sec-window.performance-attribute No new tests, updated existing test. * page/DOMWindow.cpp: (WebCore::DOMWindow::performance const): * page/Performance.cpp: (WebCore::Performance::Performance): * page/Performance.h: * platform/GenericTaskQueue.h: (WebCore::TaskDispatcher::TaskDispatcher): (WebCore::TaskDispatcher::postTask): (WebCore::GenericTaskQueue::GenericTaskQueue): (WebCore::GenericTaskQueue::isClosed const): * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::WorkerGlobalScope): 2018-10-16 Jer Noble <jer.noble@apple.com> Refactoring: Convert HTMLMediaElement::scheduleDelayedAction() to individually schedulable & cancelable tasks https://bugs.webkit.org/show_bug.cgi?id=188208 Reviewed by Eric Carlson. Rather than have a single, monolithic, zero-duration-timer based dispatch for a bunch of methods to be performed in a future run-loop, convert them all to use a DeferrableTask, which in turn is a kind of GenericTaskQueue which can enqueue only a single task at a time. Convert some other zero-duration-timer and GenericTaskQueue dispatches to this new DeferrableTask. * WebCore.xcodeproj/project.pbxproj: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): (WebCore::HTMLMediaElement::finishParsingChildren): (WebCore::HTMLMediaElement::scheduleCheckPlaybackTargetCompatability): (WebCore::HTMLMediaElement::checkPlaybackTargetCompatablity): (WebCore::HTMLMediaElement::prepareForLoad): (WebCore::HTMLMediaElement::setReadyState): (WebCore::HTMLMediaElement::seekWithTolerance): (WebCore::HTMLMediaElement::setMuted): (WebCore::HTMLMediaElement::mediaPlayerDidAddTextTrack): (WebCore::HTMLMediaElement::didAddTextTrack): (WebCore::HTMLMediaElement::scheduleConfigureTextTracks): (WebCore::HTMLMediaElement::mediaPlayerTimeChanged): (WebCore::HTMLMediaElement::scheduleMediaEngineWasUpdated): (WebCore::HTMLMediaElement::mediaEngineWasUpdated): (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated): (WebCore::HTMLMediaElement::scheduleUpdatePlayState): (WebCore::HTMLMediaElement::updatePlayState): (WebCore::HTMLMediaElement::setPlaying): (WebCore::HTMLMediaElement::setPausedInternal): (WebCore::HTMLMediaElement::cancelPendingTasks): (WebCore::HTMLMediaElement::userCancelledLoad): (WebCore::HTMLMediaElement::clearMediaPlayer): (WebCore::HTMLMediaElement::contextDestroyed): (WebCore::HTMLMediaElement::stop): (WebCore::HTMLMediaElement::suspend): (WebCore::HTMLMediaElement::resume): (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): (WebCore::HTMLMediaElement::dispatchEvent): (WebCore::HTMLMediaElement::removeEventListener): (WebCore::HTMLMediaElement::enqueuePlaybackTargetAvailabilityChangedEvent): (WebCore::HTMLMediaElement::didBecomeFullscreenElement): (WebCore::HTMLMediaElement::markCaptionAndSubtitleTracksAsUnconfigured): (WebCore::HTMLMediaElement::scheduleUpdateMediaState): (WebCore::HTMLMediaElement::updateMediaState): (WebCore::HTMLMediaElement::playbackControlsManagerBehaviorRestrictionsTimerFired): (WebCore::setFlags): Deleted. (WebCore::clearFlags): Deleted. (WebCore::actionName): Deleted. (WebCore::HTMLMediaElement::scheduleDelayedAction): Deleted. (WebCore::HTMLMediaElement::pendingActionTimerFired): Deleted. * html/HTMLMediaElement.h: * html/HTMLMediaElementEnums.h: * platform/DeferrableTask.h: Added. (WebCore::DeferrableTask::DeferrableTask): (WebCore::DeferrableTask::scheduleTask): (WebCore::DeferrableTask::close): (WebCore::DeferrableTask::cancelTask): (WebCore::DeferrableTask::hasPendingTask const): 2018-10-16 Timothy Hatcher <timothy@apple.com> Add <meta name="supported-color-schemes"> to control what color schemes the page supports https://bugs.webkit.org/show_bug.cgi?id=190526 rdar://problem/45230140 Reviewed by Dean Jackson. Test: css-dark-mode/supported-color-schemes.html * dom/Document.cpp: (WebCore::isColorSchemeSeparator): Added. (WebCore::processColorSchemes): Added. (WebCore::Document::processSupportedColorSchemes): Added. (WebCore::Document::useDarkAppearance const): Take system appearance and document's suppoerted color shcemes into account. * dom/Document.h: * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::createFragment): Update use of LocalDefaultSystemAppearance. * html/HTMLMetaElement.cpp: (WebCore::HTMLMetaElement::process): Added supported-color-schemes behind runtime feature check. * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::paint): Update use of LocalDefaultSystemAppearance. * platform/mac/DragImageMac.mm: (WebCore::createDragImageForLink): Update use of LocalDefaultSystemAppearance. * platform/mac/LocalDefaultSystemAppearance.h: * platform/mac/LocalDefaultSystemAppearance.mm: (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Drop the need for useSystemAppearance. This is accounted for in Document::useDarkAppearance. * platform/mac/ThemeMac.mm: (WebCore::ThemeMac::paint): Update use of LocalDefaultSystemAppearance. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::paintContents): Update use of LocalDefaultSystemAppearance. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::paintContents): Update use of LocalDefaultSystemAppearance. * rendering/RenderTheme.cpp: (WebCore::RenderTheme::paint): Use document instead of page. * rendering/RenderThemeCocoa.mm: (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Update use of LocalDefaultSystemAppearance. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::documentViewFor const): Update use of LocalDefaultSystemAppearance. (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const): Ditto. (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const): Ditto. (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Ditto. (WebCore::RenderThemeMac::supportsSelectionForegroundColors const): Ditto. (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const): Ditto. (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const): Ditto. (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const): Ditto. (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const): Ditto. (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const): Ditto. (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const): Ditto. (WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Ditto. (WebCore::RenderThemeMac::colorCache const): Ditto. (WebCore::RenderThemeMac::systemColor const): Ditto. (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary): Ditto. (WebCore::RenderThemeMac::paintSliderThumb): Ditto. (WebCore::RenderThemeMac::usingDarkAppearance const): No need to limit to macOS here. * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::draw): Update use of LocalDefaultSystemAppearance. 2018-10-16 Rob Buis <rbuis@igalia.com> Remove superfluous VIDEO build guard https://bugs.webkit.org/show_bug.cgi?id=190624 Reviewed by Michael Catanzaro. Remove some instances where the VIDEO build guard is included within another VIDEO build guard. No new tests. No change in behavior. * platform/graphics/MediaPlayer.cpp: (WebCore::buildMediaEnginesVector): * platform/graphics/MediaPlayer.h: * platform/graphics/MediaPlayerPrivate.h: 2018-10-16 Youenn Fablet <youenn@apple.com> Support RTCConfiguration.certificates https://bugs.webkit.org/show_bug.cgi?id=190603 Reviewed by Eric Carlson. Update RTCConfiguration to have a certificates member. Add the conversion from RTCCertificate to libwebrtc certificates. Add check to ensure that certificates are not expired. Add check to ensure that certificates passed to setConfiguration were the same as the ones passed to RTCPeerConnection constructor. Once these checks are done, we reuse the certificates created at RCPeerConnection creation time when setting the configuration again. Covered by rebased WPT test. * Modules/mediastream/RTCConfiguration.h: * Modules/mediastream/RTCConfiguration.idl: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::certificatesFromConfiguration): (WebCore::RTCPeerConnection::initializeConfiguration): (WebCore::RTCPeerConnection::setConfiguration): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::setConfiguration): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::configurationFromMediaEndpointConfiguration): * platform/mediastream/MediaEndpointConfiguration.cpp: (WebCore::MediaEndpointConfiguration::MediaEndpointConfiguration): * platform/mediastream/MediaEndpointConfiguration.h: 2018-10-16 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r237163. Introduced layout test failures on iOS Simulator. Reverted changeset: "[CG] Adopt CG SPI for non-even cornered rounded rects" https://bugs.webkit.org/show_bug.cgi?id=190155 https://trac.webkit.org/changeset/237163 2018-10-16 Devin Rousso <drousso@apple.com> Web Inspector: Canvas: capture previously saved states and add them to the recording payload https://bugs.webkit.org/show_bug.cgi?id=190473 Reviewed by Joseph Pecoraro. Updated existing tests: inspector/canvas/recording-2d.html inspector/model/recording.html Instead of sending a single object of the current state of the context, send an array of objects, one for each restore point. * html/canvas/CanvasRenderingContext2DBase.h: * html/canvas/CanvasRenderingContext2DBase.cpp: (WebCore::CanvasRenderingContext2DBase::stateStack): Added. * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::stringIndexForKey): Added. (WebCore::InspectorCanvas::buildInitialState): 2018-10-16 Justin Michaud <justin_michaud@apple.com> Implement feature flag and bindings for CSS Painting API https://bugs.webkit.org/show_bug.cgi?id=190237 Reviewed by Ryosuke Niwa. Add feature flag and bindings for CSS Painting API. This adds a new property, CSS.paintWorkletGlobalScope, which will be a temporary way to access the paint worklet global scope untill CSS.paintWorklet is implemented. There are a few small changes, mostly adding headers and "using" declarations, that were required to get this to build. This is probably related to unified sources. Tests: fast/css-custom-paint/basic.html fast/css-custom-paint/registerPaintBindings.html * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSCSSPaintWorkletGlobalScopeCustom.cpp: Added. (WebCore::throwInvalidModificationError): (WebCore::JSCSSPaintWorkletGlobalScope::registerPaint): * bindings/js/JSEventListener.cpp: * bindings/js/JSRemoteDOMWindowCustom.cpp: * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: * bindings/js/WebCoreBuiltinNames.h: * css/CSSPaintCallback.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp. (WebCore::CSSPaintCallback::~CSSPaintCallback): * css/CSSPaintCallback.idl: Added. * css/CSSPaintWorkletGlobalScope.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp. (WebCore::CSSPaintWorkletGlobalScope::create): (WebCore::CSSPaintWorkletGlobalScope::CSSPaintWorkletGlobalScope): (WebCore::CSSPaintWorkletGlobalScope::devicePixelRatio): (WebCore::CSSPaintWorkletGlobalScope::addRegisteredPaint): * css/CSSPaintWorkletGlobalScope.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp. (WebCore::CSSPaintWorkletGlobalScope::paintDefinitionMap): * css/CSSPaintWorkletGlobalScope.idl: Added. * css/DOMCSSPaintWorklet.cpp: Copied from Source/WebCore/css/MediaQueryParserContext.cpp. (WebCore::DOMCSSPaintWorklet::ensurePaintWorkletGlobalScope): (WebCore::DOMCSSPaintWorklet::from): (WebCore::DOMCSSPaintWorklet::supplementName): * css/DOMCSSPaintWorklet.h: Copied from Source/WebCore/css/MediaQueryParserContext.cpp. * css/DOMCSSPaintWorklet.idl: Added. * css/MediaQueryParserContext.cpp: * css/StyleBuilder.h: * dom/Document.cpp: (WebCore::Document::ensureCSSPaintWorkletGlobalScope): * dom/Document.h: * features.json: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSPaintingAPIEnabled): (WebCore::RuntimeEnabledFeatures::cssPaintingAPIEnabled const): 2018-10-16 Per Arne Vollan <pvollan@apple.com> [WebVTT] Support inline WebVTT styles https://bugs.webkit.org/show_bug.cgi?id=190369 Reviewed by Eric Carlson. Add support for inline WebVTT styles, see https://w3c.github.io/webvtt/#styling. The parsed style strings from the VTT file are added to an optional vector of style strings in the TextTrack class. These styles are then added as HTMLStyleElement children to the parent of the cue span element. Test: media/track/track-cue-css.html * html/track/InbandGenericTextTrack.cpp: (WebCore::InbandGenericTextTrack::newStyleSheetsParsed): * html/track/InbandGenericTextTrack.h: * html/track/InbandWebVTTTextTrack.cpp: (WebCore::InbandWebVTTTextTrack::newStyleSheetsParsed): * html/track/InbandWebVTTTextTrack.h: * html/track/LoadableTextTrack.cpp: (WebCore::LoadableTextTrack::newStyleSheetsAvailable): * html/track/LoadableTextTrack.h: * html/track/TextTrack.h: (WebCore::TextTrack::styleSheets const): * html/track/VTTCue.cpp: (WebCore::VTTCue::getDisplayTree): * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::getNewCues): (WebCore::WebVTTParser::getStyleSheets): (WebCore::WebVTTParser::parse): (WebCore::WebVTTParser::collectWebVTTBlock): (WebCore::WebVTTParser::collectStyleSheet): (WebCore::WebVTTParser::checkStyleSheet): (WebCore::WebVTTParser::checkAndStoreStyleSheet): * html/track/WebVTTParser.h: * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::newStyleSheetsParsed): (WebCore::TextTrackLoader::getNewStyleSheets): * loader/TextTrackLoader.h: 2018-10-16 Chris Dumez <cdumez@apple.com> window.navigator should not become null after the window loses its browsing context https://bugs.webkit.org/show_bug.cgi?id=190595 Reviewed by Ryosuke Niwa. window.navigator should not become null after the window loses its browsing context. This does not match the HTML specification or the behavior of other browsers. No new tests, updated existing tests. * Modules/geolocation/NavigatorGeolocation.cpp: (WebCore::NavigatorGeolocation::geolocation const): * page/DOMWindow.cpp: (WebCore::DOMWindow::navigator): * page/Navigator.cpp: (WebCore::Navigator::Navigator): * page/Navigator.h: * page/NavigatorBase.cpp: (WebCore::NavigatorBase::NavigatorBase): * page/NavigatorBase.h: * page/WorkerNavigator.cpp: (WebCore::WorkerNavigator::WorkerNavigator): * workers/service/ServiceWorkerContainer.cpp: (WebCore::ServiceWorkerContainer::ServiceWorkerContainer): * workers/service/ServiceWorkerContainer.h: 2018-10-16 Alex Christensen <achristensen@webkit.org> Replace HistoryItem* with HistoryItem& where possible https://bugs.webkit.org/show_bug.cgi?id=190617 Reviewed by Chris Dumez. * history/BackForwardClient.h: * history/BackForwardController.cpp: (WebCore::BackForwardController::setCurrentItem): * history/BackForwardController.h: * history/HistoryItem.cpp: (WebCore::defaultNotifyHistoryItemChanged): (WebCore::HistoryItem::setAlternateTitle): (WebCore::HistoryItem::setURLString): (WebCore::HistoryItem::setOriginalURLString): (WebCore::HistoryItem::setReferrer): (WebCore::HistoryItem::setTitle): (WebCore::HistoryItem::setTarget): (WebCore::HistoryItem::setShouldRestoreScrollPosition): (WebCore::HistoryItem::setStateObject): (WebCore::HistoryItem::notifyChanged): * history/HistoryItem.h: * loader/EmptyClients.cpp: * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): (WebCore::FrameLoader::loadSameDocumentItem): * loader/HistoryController.cpp: (WebCore::HistoryController::goToItem): (WebCore::HistoryController::updateForCommit): (WebCore::HistoryController::recursiveUpdateForCommit): (WebCore::HistoryController::recursiveUpdateForSameDocumentNavigation): (WebCore::HistoryController::setCurrentItem): (WebCore::HistoryController::createItem): (WebCore::HistoryController::itemsAreClones const): (WebCore::HistoryController::currentFramesMatchItem const): * loader/HistoryController.h: 2018-10-16 Alex Christensen <achristensen@webkit.org> Remove unused WebHistoryItem._transientPropertyForKey https://bugs.webkit.org/show_bug.cgi?id=190606 Reviewed by Chris Dumez. This is unnecessary complexity in HistoryItem. * history/HistoryItem.h: * history/mac/HistoryItemMac.mm: (WebCore::HistoryItem::getTransientProperty const): Deleted. (WebCore::HistoryItem::setTransientProperty): Deleted. 2018-10-16 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Separate SSL Class for platform dependent way of setup. https://bugs.webkit.org/show_bug.cgi?id=190597 Reviewed by Alex Christensen. SSL setup is very platform dependent. This patch separate the class to allow platform-dependent setup at the SSL handle instantiation. No new tests because there's no behaviro changes. * PlatformWinCairo.cmake: * platform/network/curl/CurlSSLHandle.cpp: (WebCore::CurlSSLHandle::CurlSSLHandle): (WebCore::CurlSSLHandle::getCACertPathEnv): Moved. * platform/network/curl/CurlSSLHandle.h: * platform/network/win/CurlSSLHandleWin.cpp: (WebCore::getCACertPathEnv): (WebCore::CurlSSLHandle::platformInitialize): 2018-10-15 Keith Miller <keith_miller@apple.com> Support arm64 CPUs with a 32-bit address space https://bugs.webkit.org/show_bug.cgi?id=190273 Reviewed by Michael Saboff. Fix missing namespace annotation. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation): 2018-10-15 Justin Fan <justin_fan@apple.com> Add WebGPU 2018 feature flag and experimental feature flag https://bugs.webkit.org/show_bug.cgi?id=190509 Reviewed by Dean Jackson. Re-add ENABLE_WEBGPU, an experimental feature flag, and a RuntimeEnabledFeature for the 2018 WebGPU prototype. * Configurations/FeatureDefines.xcconfig: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): (WebCore::RuntimeEnabledFeatures::webGPUEnabled const): 2018-10-15 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r237162. https://bugs.webkit.org/show_bug.cgi?id=190612 Broke Windows build (Requested by dolmstead on #webkit). Reverted changeset: "Add stub implementation for accessibility objects" https://bugs.webkit.org/show_bug.cgi?id=190608 https://trac.webkit.org/changeset/237162 2018-10-15 Said Abou-Hallawa <sabouhallawa@apple.com> [CG] Adopt CG SPI for non-even cornered rounded rects https://bugs.webkit.org/show_bug.cgi?id=190155 Reviewed by Simon Fraser. Instead of creating bezier curves for the non-even corners of the rounded rects, we should use the optimized SPI provided by CG. * platform/graphics/cg/PathCG.cpp: (WebCore::Path::platformAddPathForRoundedRect): 2018-10-15 Don Olmstead <don.olmstead@sony.com> Add stub implementation for accessibility objects https://bugs.webkit.org/show_bug.cgi?id=190608 Reviewed by Michael Catanzaro. No new tests. No change in behavior. Add default implementation to associated cpp file. Removes the WPE specific stubs. * SourcesWPE.txt: * accessibility/AXObjectCache.cpp: (WebCore::AXObjectCache::detachWrapper): (WebCore::AXObjectCache::attachWrapper): (WebCore::AXObjectCache::postPlatformNotification): (WebCore::AXObjectCache::nodeTextChangePlatformNotification): (WebCore::AXObjectCache::frameLoadingEventPlatformNotification): (WebCore::AXObjectCache::platformHandleFocusedUIElementChanged): (WebCore::AXObjectCache::handleScrolledToAnchor): * accessibility/AccessibilityObject.cpp: (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const): (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const): * accessibility/AccessibilityObject.h: * accessibility/wpe/AXObjectCacheWPE.cpp: Removed. * accessibility/wpe/AccessibilityObjectWPE.cpp: Removed. 2018-10-15 Alex Christensen <achristensen@webkit.org> Modernize BackForwardClient.h https://bugs.webkit.org/show_bug.cgi?id=190610 Reviewed by Chris Dumez. * editing/markup.cpp: (WebCore::createPageForSanitizingWebContent): * history/BackForwardClient.h: * history/BackForwardController.h: (WebCore::BackForwardController::client): (WebCore::BackForwardController::client const): * inspector/InspectorOverlay.cpp: (WebCore::InspectorOverlay::overlayPage): * loader/EmptyClients.cpp: (WebCore::pageConfigurationWithEmptyClients): (WebCore::createEmptyFrameNetworkingContext): Deleted. (WebCore::fillWithEmptyClients): Deleted. (WebCore::createEmptyEditorClient): Deleted. * loader/EmptyClients.h: * page/Page.cpp: (WebCore::Page::Page): * page/PageConfiguration.cpp: (WebCore::PageConfiguration::PageConfiguration): * page/PageConfiguration.h: * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): 2018-10-15 Timothy Hatcher <timothy@apple.com> Add support for prefers-color-scheme media query https://bugs.webkit.org/show_bug.cgi?id=190499 rdar://problem/45212025 Reviewed by Dean Jackson. Test: css-dark-mode/prefers-color-scheme.html * Configurations/FeatureDefines.xcconfig: Added ENABLE_DARK_MODE_CSS. * css/CSSValueKeywords.in: Added light and dark. * css/MediaFeatureNames.h: Added prefers-color-scheme. * css/MediaQueryEvaluator.cpp: (WebCore::prefersColorSchemeEvaluate): Added. * css/MediaQueryExpression.cpp: (WebCore::featureWithValidIdent): Added prefers-color-scheme. * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setDarkModeCSSEnabled): Added. (WebCore::RuntimeEnabledFeatures::darkModeCSSEnabled const): Added. * testing/InternalSettings.cpp: (WebCore::InternalSettings::resetToConsistentState): Reset setUseDarkAppearance. (WebCore::InternalSettings::setUseDarkAppearance): Added. * testing/InternalSettings.h: Added setUseDarkAppearance. * testing/InternalSettings.idl: Ditto. 2018-10-15 Alex Christensen <achristensen@webkit.org> Remove unused WebView._globalHistoryItem https://bugs.webkit.org/show_bug.cgi?id=190601 Reviewed by Chris Dumez. This was a hack to give the client a more reliable current back/forward item, but it hasn't been used for years and it's adding unnecessary complexity to the history code. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::checkLoadCompleteForThisFrame): (WebCore::FrameLoader::continueLoadAfterNavigationPolicy): * loader/FrameLoaderClient.h: * loader/HistoryController.cpp: (WebCore::HistoryController::goToItem): (WebCore::HistoryController::updateForStandardLoad): (WebCore::HistoryController::updateForRedirectWithLockedBackForwardList): 2018-10-15 Chris Dumez <cdumez@apple.com> Experiment: target=_blank on anchors should imply rel=noopener https://bugs.webkit.org/show_bug.cgi?id=190481 Reviewed by Alex Christensen. As an experiment, try and make it so that target=_blank on anchors implies `rel=noopener` for improved security. WebContent can then request an opener relationship by using `rel=opener` instead. This change was discussed at: - https://github.com/whatwg/html/issues/4078 We want to attempt this change is STP to see if it is Web-compatible. Preliminary testing seems to indicate that OAuth workflows still work. * html/HTMLAnchorElement.cpp: (WebCore::HTMLAnchorElement::parseAttribute): (WebCore::HTMLAnchorElement::handleClick): (WebCore::HTMLAnchorElement::effectiveTarget const): * html/HTMLAnchorElement.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setBlankAnchorTargetImpliesNoOpenerEnabled): (WebCore::RuntimeEnabledFeatures::blankAnchorTargetImpliesNoOpenerEnabled const): 2018-10-15 Andy Estes <aestes@apple.com> [Apple Pay] New shipping methods are ignored when updating after the shippingaddresschange event https://bugs.webkit.org/show_bug.cgi?id=190560 <rdar://problem/44559075> Reviewed by Youenn Fablet. When a PaymentDetailsUpdate with shipping options was specified to updateWith() after the shippingaddresschange event fires, ApplePayPaymentHandler needs to convert the shipping options to ShippingMethods and add them to the ShippingContactUpdate so that the Apple Pay UI renders the new options. Added test cases to http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html. * Modules/applepay/ApplePayShippingMethod.idl: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::computeShippingMethods): (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * testing/MockPaymentCoordinator.cpp: (WebCore::convert): (WebCore::MockPaymentCoordinator::showPaymentUI): (WebCore::MockPaymentCoordinator::completeShippingContactSelection): * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: 2018-10-15 Youenn Fablet <youenn@apple.com> RTCPeerConnection.generateCertificate is not a function https://bugs.webkit.org/show_bug.cgi?id=173541 <rdar://problem/32638029> Reviewed by Eric Carlson. Add support for RTCCertificate generation through libwebrtc certificate generator. Make generation in the webrtc network thread. Support is as per spec (ECDSA and RSASSA_PKCS). Partially covered by WPT tests. * css/StyleBuilder.h: Fixing build. * CMakeLists.txt: * DerivedSources.make: * Modules/webauthn/PublicKeyCredential.cpp: Fixing build. * Modules/mediastream/PeerConnectionBackend.cpp: (WebCore::PeerConnectionBackend::generateCertificate): * Modules/mediastream/PeerConnectionBackend.h: (WebCore::PeerConnectionBackend::CertificateInformation::RSASSA_PKCS1_v1_5): (WebCore::PeerConnectionBackend::CertificateInformation::ECDSA_P256): (WebCore::PeerConnectionBackend::CertificateInformation::CertificateInformation): * Modules/mediastream/RTCCertificate.cpp: Added. (WebCore::RTCCertificate::create): (WebCore::RTCCertificate::RTCCertificate): * Modules/mediastream/RTCCertificate.h: Added. (WebCore::RTCCertificate::expires const): (WebCore::RTCCertificate::getFingerprints const): * Modules/mediastream/RTCCertificate.idl: Added. * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::certificateTypeFromAlgorithmIdentifier): (WebCore::RTCPeerConnection::generateCertificate): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.cpp: Added. (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::RTCCertificateGeneratorCallback): (WebCore::LibWebRTCCertificateGenerator::RTCCertificateGeneratorCallback::~RTCCertificateGeneratorCallback): (WebCore::LibWebRTCCertificateGenerator::keyParamsFromCertificateType): (WebCore::LibWebRTCCertificateGenerator::generateCertificate): * Modules/mediastream/libwebrtc/LibWebRTCCertificateGenerator.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: (WebCore::LibWebRTCProvider::certificateGenerator): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: 2018-10-15 Simon Fraser <simon.fraser@apple.com> Add compact logging for the paint-order RenderLayer tree https://bugs.webkit.org/show_bug.cgi?id=190592 Reviewed by Zalan Bujtas. Add a way to dump the RenderLayer tree in paint order, which will be extended in future to show more dirty bit state. * rendering/RenderLayer.cpp: (WebCore::outputPaintOrderTreeLegend): (WebCore::outputIdent): (WebCore::outputPaintOrderTreeRecursive): (WebCore::showPaintOrderTree): * rendering/RenderLayer.h: 2018-10-15 Alex Christensen <achristensen@webkit.org> Remove unused parameters from FrameLoaderClient::createFrame https://bugs.webkit.org/show_bug.cgi?id=190587 Reviewed by Chris Dumez. * loader/EmptyClients.cpp: (WebCore::EmptyFrameLoaderClient::createFrame): * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * loader/SubframeLoader.cpp: (WebCore::SubframeLoader::loadSubframe): 2018-10-15 Andy Estes <aestes@apple.com> [Apple Pay] Payment authorization results with ApplePayErrors should never be considered final https://bugs.webkit.org/show_bug.cgi?id=190559 <rdar://problem/37250908> Reviewed by Anders Carlsson. When PaymentCoordinator thinks a payment authorization result is final it releases the active ApplePaySession. The Apple Pay UI is dismissed after a receiving a final result. However, WebCore::isFinalStateResult had the wrong idea about what was a final state, in some cases causing PaymentCoordinator to release the active session even when the UI is still presented. If the user authorizes payment again, the website will not receive another paymentauthorized event, and the Apple Pay UI will eventually time out waiting for a result. Specifically, isFinalStateResult thought that: (1) results with STATUS_SUCCESS were always final, even if they had errors (2) errors with code "unknown" were final Both of these assumptions are wrong. PassKit considers any result with errors to be non-final, even if an error has code "unknown." Fixed WebCore::isFinalStateResult to agree with what PassKit considers to be final results. Test: http/tests/ssl/applepay/ApplePaySessionFinalState.https.html * Modules/applepay/ApplePaySessionPaymentRequest.cpp: (WebCore::isFinalStateResult): * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completePaymentSession): 2018-10-15 Andy Estes <aestes@apple.com> [Payment Request] PaymentResponse should be a ContextDestructionObserver https://bugs.webkit.org/show_bug.cgi?id=190558 Reviewed by Alex Christensen. Make PaymentResponse a ContextDestructionObserver so it has a ScriptExecutionContext to return for its override of EventTarget::scriptExecutionContext(). Do this instead of downcasting m_request to an ActiveDOMObject to ask for its context. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::accept): * Modules/paymentrequest/PaymentResponse.cpp: (WebCore::PaymentResponse::PaymentResponse): (WebCore::PaymentResponse::scriptExecutionContext const): Deleted. * Modules/paymentrequest/PaymentResponse.h: 2018-10-15 Andy Estes <aestes@apple.com> [Payment Request] Use a PendingActivity token rather than calling (un)setPendingActivity https://bugs.webkit.org/show_bug.cgi?id=190557 Reviewed by Alex Christensen. PaymentRequest has pending activity whenever there is an active payment handler, since user-initiated events can occur whenever the payment UI is displayed. Rather than manually track the pending activity with setPendingActivity() and unsetPendingActivity(), use a PendingActivity token tied to the lifetime of the active payment handler. Also, rewrite canSuspendForDocumentSuspension() in terms of hasPendingActivity(). * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::show): (WebCore::PaymentRequest::abortWithException): (WebCore::PaymentRequest::canSuspendForDocumentSuspension const): (WebCore::PaymentRequest::paymentMethodChanged): (WebCore::PaymentRequest::completeMerchantValidation): (WebCore::PaymentRequest::settleDetailsPromise): (WebCore::PaymentRequest::complete): (WebCore::PaymentRequest::cancel): * Modules/paymentrequest/PaymentRequest.h: 2018-10-15 Wenson Hsieh <wenson_hsieh@apple.com> Changing view scale should zoom to initial scale if the page is already at initial scale https://bugs.webkit.org/show_bug.cgi?id=190570 <rdar://problem/45261877> Reviewed by Tim Horton. Add a getter for ViewportConfiguration's layout size scale factor. See Source/WebKit/ChangeLog for more details. * page/ViewportConfiguration.h: (WebCore::ViewportConfiguration::layoutSizeScaleFactor const): 2018-10-15 Charlie Turner <cturner@igalia.com> Fix build error with !LOG_DISABLED in Release mode https://bugs.webkit.org/show_bug.cgi?id=190465 Reviewed by Michael Catanzaro. No tests due to no new functionality. * workers/service/ServiceWorkerRegistrationKey.cpp: * workers/service/ServiceWorkerRegistrationKey.h: 2018-10-15 Simon Fraser <simon.fraser@apple.com> LayerListMutationDetector should take a reference https://bugs.webkit.org/show_bug.cgi?id=190586 Reviewed by Zalan Bujtas. Change LayerListMutationDetector to take a RenderLayer&. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: (WebCore::LayerListMutationDetector::LayerListMutationDetector): (WebCore::LayerListMutationDetector::~LayerListMutationDetector): * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::layerHas3DContent const): 2018-10-15 Simon Fraser <simon.fraser@apple.com> Share some code to dirty z-order and normal flow lists when child layers are added or removed https://bugs.webkit.org/show_bug.cgi?id=190585 Reviewed by Zalan Bujtas. Factor code which dirties the normal flow list and child stacking context z-order lists when a layer is added or removed. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::dirtyPaintOrderListsOnChildChange): * rendering/RenderLayer.h: 2018-10-15 Simon Fraser <simon.fraser@apple.com> Make a helper function to check for reflection layers https://bugs.webkit.org/show_bug.cgi?id=190584 Reviewed by Zalan Bujtas. Add RenderLayer::isReflectionLayer() which returns true if the passed layer is the layer of this layer's reflection. It's used in z-order list building. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateNormalFlowList): (WebCore::RenderLayer::rebuildZOrderLists): (WebCore::RenderLayer::collectLayers): (WebCore::expandClipRectForDescendantsAndReflection): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2018-10-15 Simon Fraser <simon.fraser@apple.com> RenderLayer::addChild() and removeChild() should take references https://bugs.webkit.org/show_bug.cgi?id=190582 Reviewed by Zalan Bujtas. Pass the layer to be added or removed as a reference; it's never null. * rendering/RenderElement.cpp: (WebCore::addLayers): (WebCore::RenderElement::removeLayers): (WebCore::RenderElement::moveLayers): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::insertOnlyThisLayer): (WebCore::RenderLayer::removeOnlyThisLayer): * rendering/RenderLayer.h: 2018-10-15 Yoshiaki Jitsukawa <yoshiaki.jitsukawa@sony.com> [Cairo] Incorrect rendering for 135-deg skews https://bugs.webkit.org/show_bug.cgi?id=190513 Compensation value to zero the the translation components of the transformation matrix is incorrect if the matrix has a shear factor. Reviewed by Žan Doberšek. Tests: fast/transforms/skew-x-135deg-with-gradient.html fast/transforms/skew-y-135deg-with-gradient.html * platform/graphics/cairo/CairoUtilities.cpp: (WebCore::drawPatternToCairoContext): 2018-10-15 Christopher Reid <chris.reid@sony.com> [Curl][WinCairo] Add Public Suffix support to WinCairo https://bugs.webkit.org/show_bug.cgi?id=183060 Reviewed by Alex Christensen. Add Public Suffix support to WinCairo using LibPSL. LibPSL has been added to WinCairoRequirements in v2018.10.09. * platform/Curl.cmake: * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::searchCookies): Search for cookies using the topPrivatelyControlledDomain (WebCore::CookieJarDB::setCookie): Prevent cookies from being added under TLDs * platform/network/curl/PublicSuffixCurl.cpp: Added. (WebCore::isPublicSuffix): (WebCore::topPrivatelyControlledDomainInternal): (WebCore::topPrivatelyControlledDomain): 2018-10-15 Simon Fraser <simon.fraser@apple.com> RenderLayer tree-related cleanup https://bugs.webkit.org/show_bug.cgi?id=190572 Reviewed by Zalan Bujtas. Move code around so that functions related to parent/child and z-order tree structure are near the top of RenderLayer.cpp, since this is one of the primary functions of layers. Attempts to use inheritance or composition to separate out tree structure resulted in unwieldy code and/or performance regressions. The only behavior change is to store a bit for m_isStackingContext so that we don't have to consult the old style to know if it changed. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::insertOnlyThisLayer): (WebCore::RenderLayer::removeOnlyThisLayer): (WebCore::canCreateStackingContext): (WebCore::RenderLayer::shouldBeNormalFlowOnly const): (WebCore::RenderLayer::shouldBeStackingContext const): (WebCore::RenderLayer::setIsNormalFlowOnly): (WebCore::RenderLayer::setIsStackingContext): (WebCore::RenderLayer::setParent): (WebCore::RenderLayer::dirtyZOrderLists): (WebCore::RenderLayer::dirtyStackingContextZOrderLists): (WebCore::RenderLayer::dirtyNormalFlowList): (WebCore::RenderLayer::updateNormalFlowList): (WebCore::RenderLayer::rebuildZOrderLists): (WebCore::RenderLayer::collectLayers): (WebCore::RenderLayer::updateLayerListsIfNeeded): (WebCore::RenderLayer::beginTransparencyLayers): (WebCore::RenderLayer::willBeDestroyed): (WebCore::RenderLayer::isDescendantOf const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::compareZIndex): Deleted. * rendering/RenderLayer.h: 2018-10-15 Antti Koivisto <antti@apple.com> [PSON] Prewarm system fallback fonts https://bugs.webkit.org/show_bug.cgi?id=190517 Reviewed by Ryosuke Niwa. This seems to be ~2% progression in PSON PLT4 with large (40ms+) improvements on some pages after process swaps. * page/PrewarmInformation.h: (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: (WebCore::FontCache::PrewarmInformation::isolatedCopy const): (WebCore::FontCache::PrewarmInformation::encode const): (WebCore::FontCache::PrewarmInformation::decode): Make font cache prewarm information a struct with encode/decode support and move it into FontCache scope. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontCache::systemFallbackForCharacters): Collect the names of fonts that end up needing character specific system fallbacks. (WebCore::FontCache::collectPrewarmInformation const): Include them into prewarm information. (WebCore::FontCache::prewarm): Invoking CTFontCreateForCharactersWithLanguage for the correct named font seems sufficient to fully prewarm it for fallbacks (independent of size, locale or other characteristics). Any future calls to systemFallbackForCharacters are fast. 2018-10-15 Chris Dumez <cdumez@apple.com> Restrict browsing context lookup by name to frames that are related to one another https://bugs.webkit.org/show_bug.cgi?id=190475 Reviewed by Alex Christensen. Update our frame lookup by name logic to take in the active / requesting frame and only a return a frame that is related to it. By related to it, I mean: - Ancestor <-> Descendant relationship - Opener <-> Openee relationship Being able to look up unrelated frames makes process swapping difficult so we need to be stricter. This change is being discussed at: - https://github.com/whatwg/html/issues/313 Tests: http/tests/dom/new-window-can-target-opener.html http/tests/dom/noopener-window-cannot-target-opener.html http/tests/dom/noopener-window-not-targetable.html http/tests/dom/noopener-window-not-targetable2.html http/tests/dom/noreferrer-window-not-targetable.html http/tests/dom/opened-window-not-targetable-after-disowning-opener.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::findFrameForNavigation): * page/FrameTree.cpp: (WebCore::isFrameFamiliarWith): (WebCore::FrameTree::find const): * page/FrameTree.h: * rendering/HitTestResult.cpp: (WebCore::HitTestResult::targetFrame const): 2018-10-15 Alex Christensen <achristensen@webkit.org> Shrink more enum classes https://bugs.webkit.org/show_bug.cgi?id=190540 Reviewed by Chris Dumez. * Modules/notifications/NotificationDirection.h: * dom/Document.h: * loader/FrameLoader.h: * loader/FrameLoaderClient.h: * loader/HistoryController.h: * loader/ShouldSkipSafeBrowsingCheck.h: * loader/ShouldTreatAsContinuingLoad.h: * page/AutoplayEvent.h: * page/ChromeClient.h: * page/DiagnosticLoggingClient.h: * page/Page.h: * platform/CookiesStrategy.h: * platform/audio/AudioSession.h: * platform/network/NetworkStorageSession.h: * platform/network/StoredCredentialsPolicy.h: * workers/service/SWClientConnection.h: * workers/service/ServiceWorkerContainer.h: * workers/service/ServiceWorkerRegistrationData.h: * workers/service/ServiceWorkerRegistrationOptions.h: * workers/service/ServiceWorkerTypes.h: * workers/service/ServiceWorkerUpdateViaCache.h: * workers/service/server/SWServer.h: * workers/service/server/SWServerRegistration.h: 2018-10-15 Patrick Griffis <pgriffis@igalia.com> [GTK][WPE] Implement subprocess sandboxing https://bugs.webkit.org/show_bug.cgi?id=188568 Reviewed by Michael Catanzaro. Link against libseccomp. * PlatformGTK.cmake: 2018-10-15 YUHAN WU <yuhan_wu@apple.com> Implement error handler of MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=190438 Reviewed by Youenn Fablet. Test: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-error.html Implement error event handler (onerror) for MediaRecorder and basic architecture of start() function. * CMakeLists.txt: * DerivedSources.make: * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::~MediaRecorder): (WebCore::MediaRecorder::stop): (WebCore::MediaRecorder::start): (WebCore::MediaRecorder::setNewRecordingState): (WebCore::MediaRecorder::scheduleDeferredTask): (WebCore::MediaRecorder::didAddOrRemoveTrack): * Modules/mediarecorder/MediaRecorder.h: * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediarecorder/MediaRecorderErrorEvent.cpp: Added. (WebCore::MediaRecorderErrorEvent::create): (WebCore::MediaRecorderErrorEvent::MediaRecorderErrorEvent): (WebCore::MediaRecorderErrorEvent::eventInterface const): * Modules/mediarecorder/MediaRecorderErrorEvent.h: Added. * Modules/mediarecorder/MediaRecorderErrorEvent.idl: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * dom/EventNames.in: * dom/EventTargetFactory.in: 2018-10-15 Chris Dumez <cdumez@apple.com> Window's properties such as 'location' should not become null when it loses its browsing context https://bugs.webkit.org/show_bug.cgi?id=190539 Reviewed by Alex Christensen. Window's properties such as 'location' should not become null when it loses its browsing context. This Webkit behavior is not standard and does not match other browsers so this patch makes it so that those properties persist. Tests: http/tests/dom/cross-origin-detached-window-properties.html http/tests/dom/same-origin-detached-window-properties.html * bindings/js/JSDOMBindingSecurity.cpp: (WebCore::BindingSecurity::shouldAllowAccessToDOMWindow): * bindings/js/JSDOMBindingSecurity.h: * bindings/js/JSDOMWindowProperties.cpp: (WebCore::jsDOMWindowPropertiesGetOwnPropertySlotNamedItemGetter): (WebCore::JSDOMWindowProperties::getOwnPropertySlot): * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::putCommon): (WebCore::JSLocation::deleteProperty): (WebCore::JSLocation::deletePropertyByIndex): (WebCore::JSLocation::getOwnPropertyNames): (WebCore::JSLocation::defineOwnProperty): (WebCore::JSLocation::getPrototype): (WebCore::JSLocation::toStringName): * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateOperationBodyDefinition): * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp: (WebCore::jsTestActiveDOMObjectExcitingAttrGetter): (WebCore::jsTestActiveDOMObjectPrototypeFunctionExcitingFunctionBody): * crypto/SubtleCrypto.cpp: (WebCore::SubtleCrypto::SubtleCrypto): * crypto/SubtleCrypto.h: (WebCore::SubtleCrypto::create): * dom/Document.cpp: (WebCore::Document::~Document): * page/Crypto.cpp: (WebCore::Crypto::Crypto): * page/Crypto.h: (WebCore::Crypto::create): * page/DOMWindow.cpp: (WebCore::DOMWindow::~DOMWindow): (WebCore::DOMWindow::frameDestroyed): (WebCore::DOMWindow::screen): (WebCore::DOMWindow::history): (WebCore::DOMWindow::crypto): (WebCore::DOMWindow::locationbar): (WebCore::DOMWindow::menubar): (WebCore::DOMWindow::personalbar): (WebCore::DOMWindow::scrollbars): (WebCore::DOMWindow::statusbar): (WebCore::DOMWindow::toolbar): (WebCore::DOMWindow::console const): (WebCore::DOMWindow::applicationCache): (WebCore::DOMWindow::navigator): (WebCore::DOMWindow::performance const): (WebCore::DOMWindow::location): (WebCore::DOMWindow::visualViewport): (WebCore::DOMWindow::styleMedia): * page/DOMWindow.h: * page/DOMWindow.idl: * workers/WorkerGlobalScope.cpp: (WebCore::WorkerGlobalScope::crypto): 2018-10-15 Alex Christensen <achristensen@webkit.org> Include EnumTraits.h less https://bugs.webkit.org/show_bug.cgi?id=190535 Reviewed by Chris Dumez. * Modules/applepay/ApplePaySessionPaymentRequest.h: * Modules/applepay/PaymentAuthorizationStatus.h: * Modules/applicationmanifest/ApplicationManifest.h: * Modules/fetch/FetchHeaders.h: * Modules/webauthn/AuthenticatorTransport.h: * Modules/webauthn/PublicKeyCredentialType.h: * loader/ShouldSkipSafeBrowsingCheck.h: * loader/ShouldTreatAsContinuingLoad.h: * platform/Cookie.h: * platform/audio/AudioSession.h: * platform/mediastream/CaptureDevice.h: * platform/mediastream/MediaStreamRequest.h: * platform/mediastream/RealtimeMediaSourceSettings.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/network/NetworkLoadInformation.h: * workers/service/ServiceWorkerClientType.h: * workers/service/ServiceWorkerTypes.h: * workers/service/ServiceWorkerUpdateViaCache.h: 2018-10-15 Alex Christensen <achristensen@webkit.org> Remove InjectedBundle processing of back/forward lists https://bugs.webkit.org/show_bug.cgi?id=190459 Reviewed by Chris Dumez. The uses of these functions are dead code I removed in rdar://problem/45180545 Removing these functions is a step towards fixing the PSON history bugs. * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * loader/HistoryController.cpp: (WebCore::HistoryController::goToItem): 2018-10-14 Yusuke Suzuki <yusukesuzuki@slowstart.org> [JSC] Remove Option::useAsyncIterator https://bugs.webkit.org/show_bug.cgi?id=190567 Reviewed by Saam Barati. * Configurations/FeatureDefines.xcconfig: 2018-10-15 Philippe Normand <pnormand@igalia.com> [GStreamer] Fix EME build for GStreamer 1.14.x https://bugs.webkit.org/show_bug.cgi?id=190471 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformCaps): The GST_PROTECTION_UNSPECIFIED_SYSTEM_ID #define won't be shipped until the GStreamer 1.16.0 release, so its use needs to be wrapped between a version check. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): Ditto. 2018-10-12 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Allow SPI clients to lay out at arbitrarily scaled sizes and scale to fit the view https://bugs.webkit.org/show_bug.cgi?id=190504 <rdar://problem/45117760> Reviewed by Tim Horton. Add support in ViewportConfiguration for applying a layout size scale factor to the viewport. See below for more details. Tests: fast/viewport/ios/constant-width-viewport-after-changing-view-scale.html fast/viewport/ios/device-width-viewport-after-changing-view-scale.html * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::setViewLayoutSize): The viewport's layout size may now be changed alongside the layout size scale factor. If either of these two variables change, we recompute our minimum layout size and viewport configuration parameters. (WebCore::ViewportConfiguration::shouldIgnoreHorizontalScalingConstraints const): (WebCore::ViewportConfiguration::nativeWebpageParameters): (WebCore::ViewportConfiguration::testingParameters): (WebCore::ViewportConfiguration::updateConfiguration): Multiply the minimum scale, initial scale, and maximum scale by the layout size scale factor. This allows us to keep the document well-proportioned within the viewport, while still laying out at a different layout size. (WebCore::ViewportConfiguration::updateMinimumLayoutSize): Compute the minimum layout size by scaling the default layout size derived from our view's size. (WebCore::ViewportConfiguration::layoutWidth const): (WebCore::ViewportConfiguration::layoutHeight const): * page/ViewportConfiguration.h: Maintain the original initial scale, unaffected by the layout size scale factor. This is used when computing layout width and height to prevent scaling by the layout size scale factor twice when computing layout sizes. (WebCore::ViewportConfiguration::description const): Include the layout size scale factor in ViewportConfiguration's description string. (WebCore::ViewportConfiguration::Parameters::operator== const): (WebCore::operator<<): 2018-10-12 Youenn Fablet <youenn@apple.com> Use downcast for use of RealtimeMediaSource in LibWebRTCMediaEndpoint https://bugs.webkit.org/show_bug.cgi?id=190533 Reviewed by Chris Dumez. Clean-up work. No change of behavior. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::setExistingReceiverSourceTrack): * platform/mediastream/RealtimeIncomingAudioSource.h: (isType): * platform/mediastream/RealtimeIncomingVideoSource.h: (isType): * platform/mediastream/RealtimeMediaSource.h: 2018-10-12 Jer Noble <jer.noble@apple.com> WebAVSampleBufferErrorListener's parent should be a WeakPtr. https://bugs.webkit.org/show_bug.cgi?id=190524 <rdar://problem/44359307> Reviewed by Eric Carlson. Once WebAVSampleBufferErrorListener's parent is a WeakPtr, we no longer need to pass protectedSelf into the callOnMainThread lambdas; we can pass in the parent itself. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener initWithParent:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (-[WebAVSampleBufferErrorListener layerFailedToDecode:]): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::destroyRenderers): 2018-10-12 Ryosuke Niwa <rniwa@webkit.org> Address the review comment which was meant to be addressed in r237025. * editing/MarkupAccumulator.cpp: (WebCore::elementCannotHaveEndTag): 2018-10-12 Youenn Fablet <youenn@apple.com> and Alejandro G. Castro <alex@igalia.com> Refresh libwebrtc up to 343f4144be https://bugs.webkit.org/show_bug.cgi?id=190361 Reviewed by Chris Dumez. This refresh should not change behavior but will allow us to implement better mdns candidate support and simulcast activation surfacing through addTransceiver. Covered by existing tests. * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::doCreateAnswer): * testing/MockLibWebRTCPeerConnection.cpp: (WebCore::MockLibWebRTCPeerConnection::CreateAnswer): * testing/MockLibWebRTCPeerConnection.h: (WebCore::MockRtpSender::GetParameters): Deleted. (WebCore::MockRtpSender::SetParameters): Deleted. (WebCore::MockRtpSender::GetDtmfSender const): Deleted. 2018-10-12 Alex Christensen <achristensen@webkit.org> Allow encoding of small enum classes https://bugs.webkit.org/show_bug.cgi?id=190531 Reviewed by Tim Horton. * Modules/webauthn/PublicKeyCredentialCreationOptions.h: * dom/Document.h: * editing/FontAttributeChanges.h: * history/CachedFrame.h: * loader/FrameLoaderTypes.h: * platform/CookiesStrategy.h: * platform/PasteboardItemInfo.h: * platform/ReferrerPolicy.h: 2018-10-12 Rob Buis <rbuis@igalia.com> Solve the confusion around blankURL() and isBlankURL() in URL https://bugs.webkit.org/show_bug.cgi?id=158988 Reviewed by Alex Christensen. The name isBlankURL is not accurate as the function tests the protocol, not the full URL. Choose protocolIsAbout to align with exisiting protocolIsData, protocolIsBlob etc. No tests as no change in functionality. * WebCore.order: * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::loadApplicationManifest): (WebCore::DocumentLoader::startIconLoading): * loader/NavigationAction.cpp: (WebCore::shouldTreatAsSameOriginNavigation): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::appendCustomAttributes): (WebCore::PageSerializer::serializeFrame): * page/csp/ContentSecurityPolicyDirectiveList.cpp: (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForFrame const): (WebCore::ContentSecurityPolicyDirectiveList::violatedDirectiveForObjectSource const): * platform/URL.cpp: (WebCore::URL::protocolIsAbout const): (WebCore::URL::isBlankURL const): Deleted. * platform/URL.h: * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::loadFull): 2018-10-12 Youenn Fablet <youenn@apple.com> DOMCache should dereference itself as soon as stopped https://bugs.webkit.org/show_bug.cgi?id=190441 Reviewed by Chris Dumez. Dereference the DOMCache as soon as its context is stopped instead of waiting for garbage collection. This allows freeing resources sooner in the network process. No observable change of behavior since the DOMCache becomes no-op when its context is stopped. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::~DOMCache): (WebCore::DOMCache::stop): 2018-10-12 Jer Noble <jer.noble@apple.com> CRASH in WebCore::MediaPlayerPrivateAVFoundation::setPreload https://bugs.webkit.org/show_bug.cgi?id=190485 <rdar://problem/34613350> Reviewed by Eric Carlson. Crash analytics show that a pure-virtual function is called by MediaPlayerPrivateAVFoundation::setPreload(), and the likely cause of that pure-virtual function call is that the MediaPlayerPrivateAVFoundation object itself has been destroyed, likely as a side effect of calling MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL(). The usual suspect for this kind of crash is due to calling into JS (e.g., from a callback passed up to HTMLMediaElement). Code inspection hasn't yielded any good hints about why this might be occurring, so we will add a ScriptDisallowedScope assertion inside HTMLMediaElement::prepareToPlay(), to generate a good crashlog showing exactly what callback is resulting in a JS call. But just in case the deallocation is not due to JS, also add an explicit strong-ref inside MediaPlayer::prepareToPlay. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::prepareToPlay): * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::prepareToPlay): 2018-10-12 Jer Noble <jer.noble@apple.com> Null-dereference in SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged https://bugs.webkit.org/show_bug.cgi?id=190490 <rdar://problem/42213807> Reviewed by Eric Carlson. Crash analytics show a null dereference occurring, likely because m_mediaSource is null. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): 2018-10-11 Don Olmstead <don.olmstead@sony.com> Add Houdini specs to features.json https://bugs.webkit.org/show_bug.cgi?id=190494 <rdar://problem/45211879> Unreviewed fix. Specifications should not reference other specifications. Also move Worklet into the specifications section. * features.json: 2018-10-11 Youenn Fablet <youenn@apple.com> IOS 12 - Service worker cache not shared when added to homescreen https://bugs.webkit.org/show_bug.cgi?id=190269 <rdar://problem/45009961> Reviewed by Alex Christensen. Expose Cache Storage API when Service Worker API is exposed. This is used for API tests. * dom/ScriptExecutionContext.h: Make hasServiceWorkerScheme available outside SERVICE_WORKER compilation flag since used by DOMWindowCaches. * dom/ScriptExecutionContext.cpp: Ditto. * Modules/cache/DOMWindowCaches.idl: 2018-10-10 Simon Fraser <simon.fraser@apple.com> Hide RenderLayer z-order and normal flow lists behind iterators https://bugs.webkit.org/show_bug.cgi?id=190457 Reviewed by Zalan Bujtas. Expose the positive z-order, negative z-order and normal flow lists from RenderLayer as iterators rather than vectors of raw pointers. This hides the fact that the vectors can be null, and allows for easier casting in future. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::update3DTransformedDescendantStatus): (WebCore::RenderLayer::paintLayerContents): (WebCore::RenderLayer::paintList): (WebCore::RenderLayer::hitTestLayer): (WebCore::RenderLayer::hitTestList): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::traverseVisibleNonCompositedDescendantLayers): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::addToOverlapMapRecursive): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::updateLayerTreeGeometry): (WebCore::RenderLayerCompositor::updateCompositingDescendantGeometry): (WebCore::RenderLayerCompositor::recursiveRepaintLayer): (WebCore::RenderLayerCompositor::needsContentsCompositingLayer const): (WebCore::RenderLayerCompositor::layerHas3DContent const): * rendering/RenderTreeAsText.cpp: (WebCore::writeLayers): 2018-10-11 Don Olmstead <don.olmstead@sony.com> Add Houdini specs to features.json https://bugs.webkit.org/show_bug.cgi?id=190494 Reviewed by Simon Fraser. Add CSS Typed OM Level 1, CSS Layout API Level 1, CSS Animation Worklet, and group them under a Houdini feature set. * features.json: 2018-10-11 Ross Kirsling <ross.kirsling@sony.com> [WTF] Semaphore.h conflicts with POSIX header https://bugs.webkit.org/show_bug.cgi?id=190486 Reviewed by Yusuke Suzuki. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: 2018-10-11 Thibault Saunier <tsaunier@igalia.com> [GStreamer] Support arbitrary video resolution in getUserMedia API https://bugs.webkit.org/show_bug.cgi?id=189734 Reviewed by Xabier Rodriguez-Calvar. Implement arbitrary video resolution for the getUserMedia API in GStreamer. Fix the MockRealtimeMediaSource device list to make devices properties match test expectations. Reactivate tests that were failling because of that. * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::standardVideoSizes): (WebCore::standardVideoSizes): Deleted. * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/VideoPreset.h: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoPreset::create): (WebCore::GStreamerVideoPreset::GStreamerVideoPreset): (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): (WebCore::GStreamerVideoCaptureSource::capabilities): (WebCore::GStreamerVideoCaptureSource::generatePresets): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): 2018-10-11 Keith Rollin <krollin@apple.com> CURRENT_ARCH should not be used in Run Script phase. https://bugs.webkit.org/show_bug.cgi?id=190407 <rdar://problem/45133556> Reviewed by Alexey Proskuryakov. CURRENT_ARCH is used in a number of Xcode Run Script phases. However, CURRENT_ARCH is not well-defined during this phase (and may even have the value "undefined") since this phase is run just once per build rather than once per supported architecture. Migrate away from CURRENT_ARCH in favor of ARCHS, either by iterating over ARCHS and performing an operation for each value, or by picking the first entry in ARCHS and using that as a representative value. No new tests -- no functional changes. * DerivedSources.make: When forming TARGET_TRIPLE_FLAGS, grab the first entry in ARCHS rather than use CURRENT_ARCH. 2018-10-11 Daniel Bates <dabates@apple.com> Support building WebKit for macOS Mojave using a newer SDK https://bugs.webkit.org/show_bug.cgi?id=190431 Reviewed by Andy Estes. * platform/network/cocoa/CookieCocoa.mm: (WebCore::coreSameSitePolicy): (WebCore::nsSameSitePolicy): 2018-10-11 Daniel Bates <dabates@apple.com> [iOS] Add typedef for WebEvent keyboard flags https://bugs.webkit.org/show_bug.cgi?id=190435 Reviewed by Wenson Hsieh. Currently WebEvent and UIKit SPI are intertwined when it comes to keyboard flags. It seems sufficient to have WebEvent defined its own keyboard flags so that callers do not need to be aware of UIKit SPI. No functionality changed. So, no new tests. * platform/ios/WebEvent.h: * platform/ios/WebEvent.mm: (-[WebEvent keyboardFlags]): 2018-10-11 Antti Koivisto <antti@apple.com> Use finer grained locking in FontDatabase https://bugs.webkit.org/show_bug.cgi?id=190467 Reviewed by Alex Christensen. * platform/graphics/FontCache.h: Also use ListHashSet for prewarming info so we can prewarm in the same order the fonts were seen last time. * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): Only hold the lock when accessing the hashmap. There is no need to hold it during font construction which can take a long time. (WebCore::FontDatabase::fontForPostScriptName): This is currently not prewarmed from a thread so no need for locking. (WebCore::FontDatabase::clear): 2018-10-11 Thibault Saunier <tsaunier@igalia.com> [GStreamer] Fix race condition in GStreamerVideoDecoder https://bugs.webkit.org/show_bug.cgi?id=190470 The GStreamerVideoDecoder.m_dtsPtsMap filed is accessed from the main thread and some GStreamer streaming thread, make sure to protect its access. And use WTF::StdMap instead of std::map. Reviewed by Philippe Normand. Manually tested and a random crash is gone. * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: (WebCore::GStreamerVideoDecoder::newSampleCallback): 2018-10-11 Enrique Ocaña González <eocanha@igalia.com> [GStreamer][MSE] Fix height calculation for streams with source aspect ratio https://bugs.webkit.org/show_bug.cgi?id=190464 Reviewed by Xabier Rodriguez-Calvar. This patch is authored by Nikola Veljkovic <Nikola.Veljkovic@zenterio.com> * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::getVideoResolutionFromCaps): Reverse the SAR adjustment to "undo" it instead of applying it twice. 2018-10-11 Alejandro G. Castro <alex@igalia.com> [GTK][WPE] Add mediaDevices.enumerateDevices support https://bugs.webkit.org/show_bug.cgi?id=185761 Reviewed by Youenn Fablet. We are adopting the same policy COCOA is using when returning the list of media devices if the user does not have persistent access. Namely, we just return the first media device for audio and video capture. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::filterDeviceList): Add support for other platforms when filtering devices if there is no persistent access to the origin. 2018-10-10 Chris Dumez <cdumez@apple.com> Rename a couple of DOMWindowProperty virtual functions https://bugs.webkit.org/show_bug.cgi?id=190458 Reviewed by Geoffrey Garen. Rename a couple of DOMWindowProperty virtual functions as the current naming no longer makes sense after recent refactoring. disconnectFrameForDocumentSuspension() was renamed to suspendForPageCache(), and reconnectFrameFromDocumentSuspension(Frame*) was renamed to resumeFromPageCache(). DOMWindowProperty objects no longer need to disconnect / reconnect from their frame since they now get their frame from their associated Window. However, some DOMWindowProperty subclasses do have some page cache suspension / resuming logic implemented of overrides of these functions. Also drop the disconnectDOMWindowProperties() / reconnectDOMWindowProperties() methods in DOMWindow. The naming made little sense as it does not really disconnect those properties in any way. Instead, inline them in DOMWindow's suspendForPageCache() / resumeFromPageCache() since these are the only callers. * Modules/indexeddb/DOMWindowIndexedDatabase.cpp: (WebCore::DOMWindowIndexedDatabase::suspendForPageCache): (WebCore::DOMWindowIndexedDatabase::resumeFromPageCache): (WebCore::DOMWindowIndexedDatabase::disconnectFrameForDocumentSuspension): Deleted. (WebCore::DOMWindowIndexedDatabase::reconnectFrameFromDocumentSuspension): Deleted. * Modules/indexeddb/DOMWindowIndexedDatabase.h: * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): * loader/FrameLoader.cpp: (WebCore::FrameLoader::open): * loader/appcache/DOMApplicationCache.cpp: (WebCore::DOMApplicationCache::suspendForPageCache): (WebCore::DOMApplicationCache::resumeFromPageCache): (WebCore::DOMApplicationCache::disconnectFrameForDocumentSuspension): Deleted. (WebCore::DOMApplicationCache::reconnectFrameFromDocumentSuspension): Deleted. * loader/appcache/DOMApplicationCache.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::suspendForPageCache): (WebCore::DOMWindow::resumeFromPageCache): (WebCore::DOMWindow::suspendForDocumentSuspension): Deleted. (WebCore::DOMWindow::resumeFromDocumentSuspension): Deleted. (WebCore::DOMWindow::disconnectDOMWindowProperties): Deleted. (WebCore::DOMWindow::reconnectDOMWindowProperties): Deleted. * page/DOMWindow.h: * page/DOMWindowExtension.cpp: (WebCore::DOMWindowExtension::suspendForPageCache): (WebCore::DOMWindowExtension::resumeFromPageCache): (WebCore::DOMWindowExtension::disconnectFrameForDocumentSuspension): Deleted. (WebCore::DOMWindowExtension::reconnectFrameFromDocumentSuspension): Deleted. * page/DOMWindowExtension.h: * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::suspendForPageCache): (WebCore::DOMWindowProperty::resumeFromPageCache): (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): Deleted. (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension): Deleted. * page/DOMWindowProperty.h: 2018-10-10 Devin Rousso <drousso@apple.com> Web Inspector: create special Network waterfall for media events https://bugs.webkit.org/show_bug.cgi?id=189773 <rdar://problem/44626605> Reviewed by Joseph Pecoraro. Test: http/tests/inspector/dom/didFireEvent.html * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::HTMLMediaElement): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::addEventListenersToNode): Added. * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::addEventListenersToNodeImpl): Added. * inspector/agents/InspectorDOMAgent.h: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::EventFiredCallback): Added. (WebCore::EventFiredCallback::create): Added. (WebCore::EventFiredCallback::operator==): Added. (WebCore::EventFiredCallback::handleEvent): Added. (WebCore::EventFiredCallback::EventFiredCallback): Added. (WebCore::InspectorDOMAgent::didCreateFrontendAndBackend): (WebCore::InspectorDOMAgent::addEventListenersToNode): Added. 2018-10-10 Daniel Bates <dabates@apple.com> [iOS] Cleanup -[WAKView _selfHandleEvent:] and -[WAKWindow sendEventSynchronously:] https://bugs.webkit.org/show_bug.cgi?id=190402 Reviewed by Anders Carlsson. Unindent case statements. Remove use of default case statements with body ASSERT_NOT_REACHED() to catch the cases of a missing enumerator. By omitting the default case statement we turn such a scenario into a compile-time error instead of handling it as a runtime error. * platform/ios/wak/WAKView.mm: (-[WAKView _selfHandleEvent:]): * platform/ios/wak/WAKWindow.mm: (-[WAKWindow sendEventSynchronously:]): 2018-10-05 Ryosuke Niwa <rniwa@webkit.org> Rename MarkupAccumulator::appendStartTag, appendElement, etc... for clarity https://bugs.webkit.org/show_bug.cgi?id=190308 Reviewed by Darin Adler. Renamed appendStartTag and appendEndTag to startAppendingNode and endAppendingNode since serialize any node, not just elements which produce start and end tags. Renamed appendElement and appendEndElement to appendStartTag and appendEndTag since that's what they do. * editing/MarkupAccumulator.cpp: (WebCore::elementCannotHaveEndTag): Made this a static local function. (WebCore::shouldSelfClose): Ditto. (WebCore::MarkupAccumulator::serializeNodesWithNamespaces): (WebCore::MarkupAccumulator::startAppendingNode): Renamed from appendStartTag. (WebCore::MarkupAccumulator::endAppendingNode): Renamed from appendEndElement and merged appendEndMarkup here. (WebCore::MarkupAccumulator::appendTextSubstring): Deleted. This was only used by StyledMarkupAccumulator. (WebCore::MarkupAccumulator::appendStringView): Added. (WebCore::MarkupAccumulator::appendStartTag): Renamed from appendElement. (WebCore::MarkupAccumulator::appendCloseTag): (WebCore::MarkupAccumulator::appendNonElementNode): Renamed from appendStartMarkup. No longer serializes an element. StyledMarkupAccumulator had a check before calling this function already so this clarifies the purpose of this function. (WebCore::MarkupAccumulator::appendElement): Deleted. (WebCore::MarkupAccumulator::appendEndMarkup): Deleted. Merged into appendEndTag. * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::appendNodeEnd): Renamed from appendEndTag. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::wrapWithNode): (WebCore::StyledMarkupAccumulator::appendStartTag): Renamed from appendElement. (WebCore::StyledMarkupAccumulator::appendEndTag): Renamed from appendEndElement. (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): (WebCore::StyledMarkupAccumulator::appendNodeToPreserveMSOList): Use String::substring directly instead of going through appendTextSubstring which has been deleted. * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::appendStartTag): Renamed from appendElement. (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndTag): Renamed from appendEndElement. 2018-10-10 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, attempt to fix the build with current SDKs. * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::getPublicKeyComponents): 2018-10-10 Brent Fulgham <bfulgham@apple.com> Only report the supported WebGL version https://bugs.webkit.org/show_bug.cgi?id=190434 <rdar://problem/45024677> Reviewed by Dean Jackson. Tested by fast/canvas/webgl/gl-getstring.html Revise getParameter(gl.VERSION) to only return the WebGL version without the hardware and driver-specific details available through the low-level OpenGL driver interface. These details are not needed for WebGL use and expose information about the user's system that we do not need to share. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::getParameter): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getParameter): 2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org> Unreviewed, add missing headers for inline functions https://bugs.webkit.org/show_bug.cgi?id=190429 * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: 2018-10-10 Tim Horton <timothy_horton@apple.com> Share more WKShareSheet code between macOS and iOS, and fix a few bugs https://bugs.webkit.org/show_bug.cgi?id=190420 Reviewed by Simon Fraser. Test: fast/web-share/share-with-no-url.html * page/Navigator.cpp: (WebCore::Navigator::share): * page/ShareData.h: Make 'url' an optional field on ShareDataWithParsedURL, and don't reject the share() promise if the URL is totally empty (as opposed to invalid). 2018-10-10 Devin Rousso <drousso@apple.com> Web Inspector: notify the frontend when a canvas has started recording via console.record https://bugs.webkit.org/show_bug.cgi?id=190306 Reviewed by Brian Burg. Updated existing tests: LayoutTests/inspector/canvas/recording-2d.html LayoutTests/inspector/canvas/recording-bitmaprenderer.html LayoutTests/inspector/canvas/recording-webgl-snapshots.html LayoutTests/inspector/canvas/recording-webgl.html * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::startRecording): (WebCore::InspectorCanvasAgent::consoleStartRecordingCanvas): * inspector/InspectorCanvas.h: Default `singleFrame` to false to better match the default behaviour of other `console` functions (`profile` doesn't stop until `profileEnd` is called, so the same should be true of `record` and `recordEnd`). 2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org> [JSC] Rename createXXX to tryCreateXXX if it can return RefPtr https://bugs.webkit.org/show_bug.cgi?id=190429 Reviewed by Saam Barati. Use `tryCreate` or new `create`. If we use new `create`, we can use Ref<> and remove null check. * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp: (WebCore::CDMSessionClearKey::cachedKeyForKeyID const): * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithDictionaryInContext): * Modules/webaudio/AudioBuffer.cpp: (WebCore::AudioBuffer::AudioBuffer): (WebCore::AudioBuffer::getChannelData): * Modules/webvr/VREyeParameters.cpp: (WebCore::VREyeParameters::offset const): * Modules/webvr/VRFrameData.cpp: (WebCore::matrixToArray): * Modules/webvr/VRPose.cpp: (WebCore::optionalFloat3ToJSCArray): (WebCore::VRPose::position const): (WebCore::VRPose::orientation const): * Modules/webvr/VRStageParameters.cpp: (WebCore::VRStageParameters::sittingToStandingTransform const): * bindings/js/ReadableStreamDefaultController.h: (WebCore::ReadableStreamDefaultController::enqueue): * bindings/js/SerializedScriptValue.cpp: (WebCore::CloneDeserializer::readArrayBufferView): * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::CryptoKeyRSA::algorithm const): * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::algorithm const): * css/DOMMatrixReadOnly.cpp: (WebCore::DOMMatrixReadOnly::toFloat32Array const): (WebCore::DOMMatrixReadOnly::toFloat64Array const): * css/FontFace.cpp: (WebCore::FontFace::create): * dom/TextEncoder.cpp: (WebCore::TextEncoder::encode const): * html/ImageData.cpp: (WebCore::ImageData::ImageData): * html/ImageData.h: (WebCore::ImageData::data const): (): Deleted. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::bufferData): (WebCore::WebGL2RenderingContext::bufferSubData): (WebCore::WebGL2RenderingContext::getInternalformatParameter): (WebCore::WebGL2RenderingContext::getParameter): * html/canvas/WebGLRenderingContext.cpp: (WebCore::WebGLRenderingContext::getParameter): * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::getUniform): (WebCore::WebGLRenderingContextBase::getVertexAttrib): (WebCore::WebGLRenderingContextBase::getWebGLFloatArrayParameter): (WebCore::WebGLRenderingContextBase::getWebGLIntArrayParameter): * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::extractKeyURIKeyIDAndCertificateFromInitData): * platform/graphics/avfoundation/cf/CDMSessionAVFoundationCF.cpp: (WebCore::CDMSessionAVFoundationCF::generateKeyRequest): * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp: (WebCore::AVFWrapper::shouldWaitForLoadingOfResource): * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm: (WebCore::CDMSessionAVContentKeySession::generateKeyRequest): (WebCore::CDMSessionAVContentKeySession::releaseKeys): (WebCore::CDMSessionAVContentKeySession::update): (WebCore::CDMSessionAVContentKeySession::generateKeyReleaseMessage): * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm: (WebCore::CDMSessionAVFoundationObjC::generateKeyRequest): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::generateKeyRequest): (WebCore::CDMSessionAVStreamSession::releaseKeys): (WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.mm: (WebCore::MediaSampleAVFObjC::getRGBAImageData const): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): * platform/graphics/cairo/ImageBufferCairo.cpp: (WebCore::getImageData): * platform/graphics/cg/ImageBufferDataCG.cpp: (WebCore::ImageBufferData::getData const): * platform/graphics/filters/FEGaussianBlur.cpp: (WebCore::FEGaussianBlur::platformApplySoftware): * platform/graphics/filters/FilterEffect.cpp: (WebCore::FilterEffect::unmultipliedResult): (WebCore::FilterEffect::premultipliedResult): (WebCore::FilterEffect::copyUnmultipliedResult): (WebCore::FilterEffect::copyPremultipliedResult): (WebCore::FilterEffect::createUnmultipliedImageResult): (WebCore::FilterEffect::createPremultipliedImageResult): * platform/graphics/win/ImageBufferDataDirect2D.cpp: (WebCore::ImageBufferData::getData const): * platform/mac/SerializedPlatformRepresentationMac.mm: (WebCore::jsValueWithDictionaryInContext): * platform/mock/mediasource/MockBox.cpp: (WebCore::MockBox::peekType): (WebCore::MockBox::peekLength): (WebCore::MockTrackBox::MockTrackBox): (WebCore::MockInitializationBox::MockInitializationBox): (WebCore::MockSampleBox::MockSampleBox): * rendering/shapes/Shape.cpp: (WebCore::Shape::createRasterShape): * testing/LegacyMockCDM.cpp: (WebCore::initDataPrefix): (WebCore::keyPrefix): (WebCore::keyRequest): 2018-10-10 Daniel Bates <dabates@apple.com> [iOS] Compare input string to UIKeyInput constants using string comparison instead of pointer comparison https://bugs.webkit.org/show_bug.cgi?id=190432 Reviewed by Tim Horton. Pointer comparision is brittle. We should be more forgiving and perform string comparision of an input string to a UIKeyInput constant. * platform/ios/WebEvent.mm: (normalizedStringWithAppKitCompatibilityMapping): 2018-10-10 Chris Dumez <cdumez@apple.com> Unreviewed, rolling out r236802. Working on getting the HTML spec updated instead (https://github.com/whatwg/html/pull/4079) Reverted changeset: "Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener" https://bugs.webkit.org/show_bug.cgi?id=190251 https://trac.webkit.org/changeset/236802 2018-10-10 Yusuke Suzuki <yusukesuzuki@slowstart.org> XMLHttpRequest should use reportExtraMemoryAllocated/reportExtraMemoryVisited instead of deprecatedReportExtraMemory https://bugs.webkit.org/show_bug.cgi?id=190279 Reviewed by Ryosuke Niwa. This patch switches deprecatedReportExtraMemory to reportExtraMemoryAllocated/reportExtraMemoryVisited in XMLHttpRequest. We report extra memory allocation when the readyState becomes DONE. And memoryCost function returns the memory cost which is based on the readyState and m_responseBuilder. We annotate XMLHttpRequest with ReportExtraMemoryCost to use reportExtraMemoryVisited automatically with memoryCost() function. * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::changeState): (WebCore::XMLHttpRequest::abort): (WebCore::XMLHttpRequest::internalAbort): (WebCore::XMLHttpRequest::networkErrorTimerFired): (WebCore::XMLHttpRequest::memoryCost const): (WebCore::XMLHttpRequest::didFinishLoading): (WebCore::XMLHttpRequest::didReachTimeout): (WebCore::XMLHttpRequest::dropProtection): Deleted. * xml/XMLHttpRequest.h: * xml/XMLHttpRequest.idl: 2018-10-09 Antoine Quint <graouts@apple.com> Remove the frames() timing function https://bugs.webkit.org/show_bug.cgi?id=190034 <rdar://problem/44827544> Reviewed by Dean Jackson. * css/CSSComputedStyleDeclaration.cpp: (WebCore::createTimingFunctionValue): * css/CSSTimingFunctionValue.cpp: (WebCore::CSSFramesTimingFunctionValue::customCSSText const): Deleted. (WebCore::CSSFramesTimingFunctionValue::equals const): Deleted. * 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::isStepsTimingFunctionValue const): (WebCore::CSSValue::isFramesTimingFunctionValue const): Deleted. * css/CSSValueKeywords.in: * css/parser/CSSPropertyParser.cpp: (WebCore::consumeAnimationTimingFunction): (WebCore::consumeFrames): Deleted. * platform/animation/TimingFunction.cpp: (WebCore::operator<<): (WebCore::TimingFunction::transformTime const): (WebCore::TimingFunction::createFromCSSValue): * platform/animation/TimingFunction.h: (WebCore::TimingFunction::isStepsTimingFunction const): (WebCore::TimingFunction::isFramesTimingFunction const): Deleted. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::animationCanBeAccelerated const): (WebCore::animationHasFramesTimingFunction): Deleted. 2018-10-09 Devin Rousso <drousso@apple.com> Web Inspector: show redirect requests in Network and Timelines tabs https://bugs.webkit.org/show_bug.cgi?id=150005 <rdar://problem/5378164> Reviewed by Joseph Pecoraro. Updated existing test http/tests/inspector/network/resource-timing.html. * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::buildObjectForTiming): (WebCore::InspectorNetworkAgent::didFinishLoading): Add missing fields for `Network.types.ResourceTiming`. 2018-10-09 Said Abou-Hallawa <sabouhallawa@apple.com> REGRESSION(r234620): SVGLangSpace::svgAttributeChanged() should invalidate the renderer of the SVGGeometryElement descendant only https://bugs.webkit.org/show_bug.cgi?id=190411 Reviewed by Simon Fraser. Test: svg/dynamic-updates/SVGStopElement-dom-xml-lang-attrr.html When changing the attributes of the SVGLangSpace, we should invalidate the renderer of the SVGGeometryElement descendant only. Renderer of other elements, like SVGStopElement, should not be invalidated because they do not have geometry and they can be used as resources for drawing another SVGGeometryElement. * svg/SVGElement.h: (WebCore::SVGElement::isSVGGeometryElement const): * svg/SVGGeometryElement.h: (isType): * svg/SVGLangSpace.cpp: (WebCore::SVGLangSpace::svgAttributeChanged): 2018-10-09 Chris Dumez <cdumez@apple.com> Anchor target should be ignored on activation when the download attribute is set https://bugs.webkit.org/show_bug.cgi?id=190408 Reviewed by Geoffrey Garen. Anchor target should be ignored on activation when the download attribute is set: - https://html.spec.whatwg.org/#the-a-element:downloading-hyperlinks-2 When the download attribute is set, we should use the "download the hyperlink" algorithm [1] instead of the "follow the hyperlink" [2] algorithm. Note that the "download the hyperlink" triggers a download and ignores the target attribute entirely. This is important as an anchor element with target=_blank and the download attribute set may fail because of Safari's popup blocker if we do not disregard the anchor target. [1] https://html.spec.whatwg.org/#downloading-hyperlinks [2] https://html.spec.whatwg.org/#following-hyperlinks-2 Tests: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-base-target-popup-not-allowed.html fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target-popup-not-allowed.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): 2018-10-09 Michael Catanzaro <mcatanzaro@igalia.com> [WPE][GTK] Complex text crashes with harfbuzz 1.8.8 https://bugs.webkit.org/show_bug.cgi?id=190409 Reviewed by Žan Doberšek. We discovered that harfbuzz 1.8.8 breaks WebKit by changing the ownership semantics of hb_icu_get_unicode_funcs() from (transfer full) to (transfer none). Our code was actually expecting (transfer none), so it's not immediately clear to me why it's crashing now, but doesn't matter as Behdad recommends removing this line of code because it hasn't been been needed for many years. This should be covered by all our complex text tests if the bots were upgraded to the newer harfbuzz. * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): 2018-10-09 Daniel Bates <dabates@apple.com> [iOS] Cleanup EventHandler::passSubframeEventToSubframe() https://bugs.webkit.org/show_bug.cgi?id=190390 Reviewed by Wenson Hsieh. Unindent case statements in switch block and use more auto. * page/ios/EventHandlerIOS.mm: (WebCore::EventHandler::passSubframeEventToSubframe): 2018-10-09 Daniel Bates <dabates@apple.com> Cleanup WebEvent.mm https://bugs.webkit.org/show_bug.cgi?id=190391 Reviewed by Wenson Hsieh. Unindent case statements in switch blocks. * platform/ios/WebEvent.mm: (-[WebEvent _typeDescription]): (-[WebEvent _modiferFlagsDescription]): (-[WebEvent _touchPhaseDescription:]): (-[WebEvent _eventDescription]): 2018-10-09 Oriol Brufau <obrufau@igalia.com> Resolve inset properties to computed style when there is overconstraintment https://bugs.webkit.org/show_bug.cgi?id=188711 Reviewed by Manuel Rego Casasnovas. This patch makes WebKit behave closer to Blink. Specifically, - In overconstrained relative or absolute positioning, inset properties resolve to the computed value (absolutizing percentages) instead of to the used value. - In fixed positioning, the resolved value of non-'auto' values is no longer increased by the border of the containg block. This patch can slighlty alter the resolved value if it's a long decimal number. Tests: imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-absolute.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-fixed.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-nobox.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-relative.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-static.html imported/w3c/web-platform-tests/css/cssom/getComputedStyle-insets-sticky.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::positionOffsetValue): * rendering/RenderBox.h: 2018-10-09 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Import CTAP HID message and packet structure from Chromium https://bugs.webkit.org/show_bug.cgi?id=189289 <rdar://problem/44120310> Reviewed by Brent Fulgham. This patch imports CTAP HID message and packet structure: https://fidoalliance.org/specs/fido-v2.0-ps-20170927/fido-client-to-authenticator-protocol-v2.0-ps-20170927.html#message-and-packet-structure from Chromium. With this library, WebKit can now turn binaries into messages that CTAP devices could understand. This patch contains the following Chromium files and modifies them to fit into WebKit: https://cs.chromium.org/chromium/src/device/fido/fido_constants.cc?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75 https://cs.chromium.org/chromium/src/device/fido/fido_constants.h?l=1&rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75 https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.cc?l=1&rcl=387f3725de2842e0e6b7175a9b2ed472b0cf781a https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75 https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75 https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_packet.h?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75 https://cs.chromium.org/chromium/src/device/fido/hid/fido_hid_message_unittest.cc?rcl=1efcfbeaf4e4cedf58716e1982b5702770571a75 Covered by API tests. * Modules/webauthn/fido/FidoConstants.cpp: Added. (fido::isFidoHidDeviceCommand): * Modules/webauthn/fido/FidoConstants.h: Added. * Modules/webauthn/fido/FidoHidMessage.cpp: Added. (fido::FidoHidMessage::create): (fido::FidoHidMessage::createFromSerializedData): (fido::FidoHidMessage::messageComplete const): (fido::FidoHidMessage::getMessagePayload const): (fido::FidoHidMessage::popNextPacket): (fido::FidoHidMessage::addContinuationPacket): (fido::FidoHidMessage::numPackets const): (fido::FidoHidMessage::FidoHidMessage): * Modules/webauthn/fido/FidoHidMessage.h: Added. * Modules/webauthn/fido/FidoHidPacket.cpp: Added. (fido::FidoHidPacket::FidoHidPacket): (fido::FidoHidInitPacket::createFromSerializedData): (fido::FidoHidInitPacket::FidoHidInitPacket): (fido::FidoHidInitPacket::getSerializedData const): (fido::FidoHidContinuationPacket::createFromSerializedData): (fido::FidoHidContinuationPacket::FidoHidContinuationPacket): (fido::FidoHidContinuationPacket::getSerializedData const): * Modules/webauthn/fido/FidoHidPacket.h: Added. * Modules/webauthn/fido/FidoParsingUtils.cpp: Added. (fido::getInitPacketData): (fido::getContinuationPacketData): * Modules/webauthn/fido/FidoParsingUtils.h: Added. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-10-09 Carlos Eduardo Ramalho <cadubentzen@gmail.com> [CoordGraphics] Remove the 'previous backing store' logic https://bugs.webkit.org/show_bug.cgi?id=188838 Reviewed by Žan Doberšek. Remove previousBackingStore from LayerState, since it's not needed anymore. When there is scale adjustment, we now simply discard mainBackingStore and recreate a new one. No new tests required. * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly): (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): (WebCore::CoordinatedGraphicsLayer::purgeBackingStores): 2018-10-09 Antti Koivisto <antti@apple.com> [PSON] Prewarm system UI font https://bugs.webkit.org/show_bug.cgi?id=190397 Reviewed by Geoffrey Garen. Cache system UI font fallbacks. Almost every web process needs these. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::prewarmGlobally): 2018-10-09 Chris Dumez <cdumez@apple.com> REGRESSION (Safari 12): Download of Blob URL fails https://bugs.webkit.org/show_bug.cgi?id=190351 <rdar://problem/45091181> Reviewed by Geoffrey Garen. When using both the download attribute and target="_blank" on an anchor element, we would mistakenly drop the download attribute after the "new window" policy decision has been made. As a result, we would try to load the blob instead of downloading it. Test: fast/dom/HTMLAnchorElement/anchor-file-blob-download-blank-target.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): 2018-10-09 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] r236735 has some dead ASSERTs that need to be moved https://bugs.webkit.org/show_bug.cgi?id=190394 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::createOptionalParserForFormat): 2018-10-09 Chris Dumez <cdumez@apple.com> Have DOMWindow get its frame from its document https://bugs.webkit.org/show_bug.cgi?id=190389 Reviewed by Geoff Garen. Have DOMWindow get its frame from its document instead of having its own m_frame which can potentially be out-of-sync. * dom/Document.cpp: (WebCore::Document::frameDestroyed): (WebCore::Document::willDetachPage): (WebCore::Document::attachToCachedFrame): * dom/Document.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::allowPopUp): (WebCore::ContextDestructionObserver): (WebCore::DOMWindow::didSecureTransitionTo): (WebCore::DOMWindow::frameDestroyed): (WebCore::DOMWindow::willDetachDocumentFromFrame): (WebCore::DOMWindow::reconnectDOMWindowProperties): (WebCore::DOMWindow::isCurrentlyDisplayedInFrame const): (WebCore::DOMWindow::collectMatchingElementsInFlatTree): (WebCore::DOMWindow::matchingElementInFlatTree): (WebCore::DOMWindow::orientation const): (WebCore::DOMWindow::console const): (WebCore::DOMWindow::shouldHaveWebKitNamespaceForWorld): (WebCore::DOMWindow::webkitNamespace): (WebCore::DOMWindow::postMessage): (WebCore::DOMWindow::postMessageTimerFired): (WebCore::DOMWindow::frameElement const): (WebCore::DOMWindow::focus): (WebCore::DOMWindow::blur): (WebCore::DOMWindow::close): (WebCore::DOMWindow::print): (WebCore::DOMWindow::stop): (WebCore::DOMWindow::alert): (WebCore::DOMWindow::confirm): (WebCore::DOMWindow::prompt): (WebCore::DOMWindow::find const): (WebCore::DOMWindow::outerHeight const): (WebCore::DOMWindow::outerWidth const): (WebCore::DOMWindow::innerHeight const): (WebCore::DOMWindow::innerWidth const): (WebCore::DOMWindow::screenX const): (WebCore::DOMWindow::screenY const): (WebCore::DOMWindow::scrollX const): (WebCore::DOMWindow::scrollY const): (WebCore::DOMWindow::closed const): (WebCore::DOMWindow::length const): (WebCore::DOMWindow::name const): (WebCore::DOMWindow::setName): (WebCore::DOMWindow::setStatus): (WebCore::DOMWindow::setDefaultStatus): (WebCore::DOMWindow::self const): (WebCore::DOMWindow::opener const): (WebCore::DOMWindow::disownOpener): (WebCore::DOMWindow::parent const): (WebCore::DOMWindow::top const): (WebCore::DOMWindow::getMatchedCSSRules const): (WebCore::DOMWindow::devicePixelRatio const): (WebCore::DOMWindow::scrollBy const): (WebCore::DOMWindow::scrollTo const): (WebCore::DOMWindow::allowedToChangeWindowGeometry const): (WebCore::DOMWindow::moveBy const): (WebCore::DOMWindow::moveTo const): (WebCore::DOMWindow::resizeBy const): (WebCore::DOMWindow::resizeTo const): (WebCore::DOMWindow::clearTimeout): (WebCore::DOMWindow::isSameSecurityOriginAsMainFrame const): (WebCore::DOMWindow::finishedLoading): (WebCore::DOMWindow::setLocation): (WebCore::DOMWindow::open): (WebCore::DOMWindow::showModalDialog): (WebCore::DOMWindow::frame const): (WebCore::FrameDestructionObserver): Deleted. (WebCore::DOMWindow::willDetachPage): Deleted. (WebCore::DOMWindow::detachFromFrame): Deleted. (WebCore::DOMWindow::attachToFrame): Deleted. * page/DOMWindow.h: 2018-10-09 Jer Noble <jer.noble@apple.com> ISOTrackEncryptionBox returns incorrect defaultKeyID https://bugs.webkit.org/show_bug.cgi?id=190368 Reviewed by Eric Carlson. Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount. Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/iso/ISOBox.h: * platform/graphics/iso/ISOOriginalFormatBox.h: * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: * platform/graphics/iso/ISOSchemeInformationBox.h: * platform/graphics/iso/ISOSchemeTypeBox.h: * platform/graphics/iso/ISOTrackEncryptionBox.cpp: (WebCore::ISOTrackEncryptionBox::parse): * platform/graphics/iso/ISOTrackEncryptionBox.h: 2018-10-09 Youenn Fablet <youenn@apple.com> Add support for IceCandidate stats https://bugs.webkit.org/show_bug.cgi?id=190329 Reviewed by Eric Carlson. Convert IceCandidate stats gathered by libwebrtc. Since networkType might be sensitive information, we currently do not expose it. We do not expose address either if it is a host or prflx candidate. Test: webrtc/candidate-stats.html * Modules/mediastream/RTCStatsReport.h: * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::iceCandidateState): (WebCore::fillRTCIceCandidateStats): (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): 2018-10-09 Philippe Normand <pnormand@igalia.com> [GStreamer] Stealing cross-origin video pixel with HLS https://bugs.webkit.org/show_bug.cgi?id=190003 Reviewed by Xabier Rodriguez-Calvar. Report the SecurityOrigin of downloaded adaptivedemux (HLS, DASH, SmoothStreaming) fragments as tainted if their origin differs from the manifest SecurityOrigin. SecurityOrigins are stored in the CachedResourceStreamingClient implemented in the internal GStreamer HTTP(S) source element. The implementation is not ideal yet because the fragments download is performed by the WebProcess, until bug 189967 is fixed. When this bug is fixed, the m_hasTaintedOrigin member variable should be removed and all checks be done unconditionally to the webkithttpsrc element which will manage the download of the manifests and fragments. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::loadFull): Reset the m_hasTaintedOrigin value. (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Get the fragment URL from the adaptivedemux stats message and check if its origin is tainted. (WebCore::MediaPlayerPrivateGStreamer::wouldTaintOrigin const): Initial implementation by checking the m_hasTaintedOrigin member variable value. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (CachedResourceStreamingClient::responseReceived): Store the resource origin internally so it can be checked later on by webKitSrtcWouldTaintOrigin(). (webKitSrcWouldTaintOrigin): Check given origin against cached origins. This implementation is similar to Cocoa's WebCoreNSURLSession implementation. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.h: 2018-10-09 Antti Koivisto <antti@apple.com> Prewarm FontDatabase on process swap https://bugs.webkit.org/show_bug.cgi?id=190312 Reviewed by Chris Dumez. Implement basic prewarming of FontDatabase. When the domain of the first page load on a new process is known we pass the list of font families previous used by that domain to the process. This is used to prewarm CoreText font database. Initialization (which involves lots of blocking IPC) happens outside the main thread so the fonts are ready to use when needed. * WebCore.xcodeproj/project.pbxproj: * page/PrewarmInformation.h: Added. (WebCore::PrewarmInformation::encode const): (WebCore::PrewarmInformation::decode): Add data structure for prewarm information with encode/decode support. * page/ProcessWarming.cpp: (WebCore::ProcessWarming::collectPrewarmInformation): (WebCore::ProcessWarming::prewarmWithInformation): Prewarming interface to be used from WebKit. * page/ProcessWarming.h: * platform/graphics/FontCache.cpp: (WebCore::FontCache::collectPrewarmInformation const): (WebCore::FontCache::prewarm): * platform/graphics/FontCache.h: * platform/graphics/cocoa/FontCacheCoreText.cpp: (WebCore::FontDatabase::collectionForFamily): (WebCore::FontDatabase::fontForPostScriptName): (WebCore::FontDatabase::clear): Add mutex for thread safe access. (WebCore::FontCache::createFontPlatformData): (WebCore::FontCache::collectPrewarmInformation const): Collect font families seen by this process. (WebCore::FontCache::prewarm): Prewarm FontDatabase in a dispatch queue. 2018-10-08 Wenson Hsieh <wenson_hsieh@apple.com> [Cocoa] [WK2] Add support for text alignment and text lists in font attributes https://bugs.webkit.org/show_bug.cgi?id=190342 <rdar://problem/44767118> Reviewed by Tim Horton. Adds support for computing and encoding information about text alignment and enclosing list elements in the font attributes dictionary, exposed to the UI delegate on Cocoa platforms. This is exposed through NSParagraphStyle, which contains properties for both `NSTextAlignment` and an array of enclosing `NSTextList` objects. Test: FontAttributes.NestedTextListsWithHorizontalAlignment FontAttributes.FontAttributesAfterChangingSelection * editing/Editor.cpp: (WebCore::editableTextListsAtPositionInDescendingOrder): Add a helper function to ascend the DOM, starting at the given position, in search of enclosing list elements. For each enclosing list element we find within the scope of the editable root, we create a `TextList` representing the list element. (WebCore::Editor::fontAttributesAtSelectionStart const): Compute and set enclosing text lists and text alignment. For text alignment, we convert the initial text-align value, `start`, to NSTextAlignmentNatural (the default text alignment type on Cocoa platforms); other values then map to Left, Right, Center, and Justified as expected (taking direction into account). * editing/FontAttributes.h: (WebCore::TextList::encode const): (WebCore::TextList::decode): Introduce TextList, a platform-agnostic representation of an unordered or ordered list. On Cocoa, this can be used to construct a corresponding NSTextList. * editing/cocoa/FontAttributesCocoa.mm: (WebCore::cocoaTextListMarkerName): Attempt to map a WebCore list style type to a `NSTextListMarker*` constant. While most of the Cocoa marker formats have a corresponding web-exposed list style type, many web-exposed types have no Cocoa equivalent; as such, fall back to default marker formats: "{disc}" for unordered lists and "{decimal}" for ordered lists. (WebCore::TextList::createTextList const): (WebCore::FontAttributes::createDictionary const): Include an NSParagraphStyle in the dictionary of font attributes that includes information about text alignment and enclosing text lists (per Cocoa convention, in order from outermost list to innermost list). 2018-10-08 Justin Fan <justin_fan@apple.com> WebGPU: Rename old WebGPU prototype to WebMetal https://bugs.webkit.org/show_bug.cgi?id=190325 <rdar://problem/44990443> Reviewed by Dean Jackson. Existing WebGPU tests also renamed to reflect WebGPU -> WebMetal change. Rename WebGPU prototype files to WebMetal in preparation for implementing the new (Oct 2018) WebGPU interface. * CMakeLists.txt: * Configurations/FeatureDefines.xcconfig: * DerivedSources.make: * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSWebMetalRenderPassAttachmentDescriptorCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp. (WebCore::toJSNewlyCreated): (WebCore::toJS): * bindings/js/JSWebMetalRenderingContextCustom.cpp: Renamed from Source/WebCore/bindings/js/JSWebGPURenderingContextCustom.cpp. (WebCore::JSWebMetalRenderingContext::visitAdditionalChildren): * bindings/js/WebCoreBuiltinNames.h: * dom/Document.cpp: (WebCore::Document::getCSSCanvasContext): * dom/Document.h: * dom/Document.idl: * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::getContext): (WebCore::HTMLCanvasElement::isWebMetalType): (WebCore::HTMLCanvasElement::createContextWebMetal): (WebCore::HTMLCanvasElement::getContextWebMetal): (WebCore::HTMLCanvasElement::isWebGPUType): Deleted. (WebCore::HTMLCanvasElement::createContextWebGPU): Deleted. (WebCore::HTMLCanvasElement::getContextWebGPU): Deleted. * html/HTMLCanvasElement.h: * html/HTMLCanvasElement.idl: * html/canvas/CanvasRenderingContext.h: (WebCore::CanvasRenderingContext::isWebMetal const): (WebCore::CanvasRenderingContext::isWebGPU const): Deleted. * html/canvas/WebGPURenderingContext.cpp: Removed. * html/canvas/WebMetalBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.cpp. (WebCore::WebMetalBuffer::create): (WebCore::WebMetalBuffer::WebMetalBuffer): * html/canvas/WebMetalBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.h. * html/canvas/WebMetalBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUBuffer.idl. * html/canvas/WebMetalCommandBuffer.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.cpp. (WebCore::WebMetalCommandBuffer::create): (WebCore::WebMetalCommandBuffer::WebMetalCommandBuffer): (WebCore::WebMetalCommandBuffer::~WebMetalCommandBuffer): (WebCore::WebMetalCommandBuffer::commit): (WebCore::WebMetalCommandBuffer::presentDrawable): (WebCore::WebMetalCommandBuffer::createRenderCommandEncoderWithDescriptor): (WebCore::WebMetalCommandBuffer::createComputeCommandEncoder): (WebCore::WebMetalCommandBuffer::completed): * html/canvas/WebMetalCommandBuffer.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.h. * html/canvas/WebMetalCommandBuffer.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandBuffer.idl. * html/canvas/WebMetalCommandQueue.cpp: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.cpp. (WebCore::WebMetalCommandQueue::create): (WebCore::WebMetalCommandQueue::WebMetalCommandQueue): (WebCore::WebMetalCommandQueue::createCommandBuffer): * html/canvas/WebMetalCommandQueue.h: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.h. * html/canvas/WebMetalCommandQueue.idl: Renamed from Source/WebCore/html/canvas/WebGPUCommandQueue.idl. * html/canvas/WebMetalComputeCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.cpp. (WebCore::GPUSizeMake): (WebCore::WebMetalComputeCommandEncoder::create): (WebCore::WebMetalComputeCommandEncoder::WebMetalComputeCommandEncoder): (WebCore::WebMetalComputeCommandEncoder::setComputePipelineState): (WebCore::WebMetalComputeCommandEncoder::setBuffer): (WebCore::WebMetalComputeCommandEncoder::dispatch): (WebCore::WebMetalComputeCommandEncoder::endEncoding): * html/canvas/WebMetalComputeCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.h. * html/canvas/WebMetalComputeCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputeCommandEncoder.idl. * html/canvas/WebMetalComputePipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.cpp. (WebCore::WebMetalComputePipelineState::create): (WebCore::WebMetalComputePipelineState::WebMetalComputePipelineState): * html/canvas/WebMetalComputePipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.h. * html/canvas/WebMetalComputePipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUComputePipelineState.idl. * html/canvas/WebMetalDepthStencilDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.cpp. (WebCore::WebMetalDepthStencilDescriptor::create): (WebCore::WebMetalDepthStencilDescriptor::depthWriteEnabled const): (WebCore::WebMetalDepthStencilDescriptor::setDepthWriteEnabled): (WebCore::WebMetalDepthStencilDescriptor::depthCompareFunction const): (WebCore::WebMetalDepthStencilDescriptor::setDepthCompareFunction): * html/canvas/WebMetalDepthStencilDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.h. * html/canvas/WebMetalDepthStencilDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilDescriptor.idl. * html/canvas/WebMetalDepthStencilState.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.cpp. (WebCore::WebMetalDepthStencilState::create): (WebCore::WebMetalDepthStencilState::WebMetalDepthStencilState): (WebCore::WebMetalDepthStencilState::label const): (WebCore::WebMetalDepthStencilState::setLabel): * html/canvas/WebMetalDepthStencilState.h: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.h. * html/canvas/WebMetalDepthStencilState.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.idl. * html/canvas/WebMetalDrawable.cpp: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.cpp. (WebCore::WebMetalDrawable::create): (WebCore::WebMetalDrawable::WebMetalDrawable): * html/canvas/WebMetalDrawable.h: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.h. (WebCore::WebMetalDrawable::texture): * html/canvas/WebMetalDrawable.idl: Renamed from Source/WebCore/html/canvas/WebGPUDrawable.idl. * html/canvas/WebMetalEnums.cpp: Renamed from Source/WebCore/html/canvas/WebGPUEnums.cpp. (WebCore::toWebMetalCompareFunction): (WebCore::web3DCompareFunctionName): (WebCore::toGPUCompareFunction): * html/canvas/WebMetalEnums.h: Renamed from Source/WebCore/html/canvas/WebGPUEnums.h. * html/canvas/WebMetalEnums.idl: Renamed from Source/WebCore/html/canvas/WebGPUEnums.idl. * html/canvas/WebMetalFunction.cpp: Renamed from Source/WebCore/html/canvas/WebGPUFunction.cpp. (WebCore::WebMetalFunction::create): (WebCore::WebMetalFunction::WebMetalFunction): * html/canvas/WebMetalFunction.h: Renamed from Source/WebCore/html/canvas/WebGPUFunction.h. * html/canvas/WebMetalFunction.idl: Renamed from Source/WebCore/html/canvas/WebGPUFunction.idl. * html/canvas/WebMetalLibrary.cpp: Renamed from Source/WebCore/html/canvas/WebGPULibrary.cpp. (WebCore::WebMetalLibrary::create): (WebCore::WebMetalLibrary::WebMetalLibrary): (WebCore::WebMetalLibrary::functionNames const): (WebCore::WebMetalLibrary::functionWithName const): * html/canvas/WebMetalLibrary.h: Renamed from Source/WebCore/html/canvas/WebGPULibrary.h. * html/canvas/WebMetalLibrary.idl: Renamed from Source/WebCore/html/canvas/WebGPULibrary.idl. * html/canvas/WebMetalRenderCommandEncoder.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.cpp. (WebCore::WebMetalRenderCommandEncoder::create): (WebCore::WebMetalRenderCommandEncoder::WebMetalRenderCommandEncoder): (WebCore::WebMetalRenderCommandEncoder::setRenderPipelineState): (WebCore::WebMetalRenderCommandEncoder::setDepthStencilState): (WebCore::WebMetalRenderCommandEncoder::setVertexBuffer): (WebCore::WebMetalRenderCommandEncoder::setFragmentBuffer): (WebCore::WebMetalRenderCommandEncoder::drawPrimitives): (WebCore::WebMetalRenderCommandEncoder::endEncoding): * html/canvas/WebMetalRenderCommandEncoder.h: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.h. * html/canvas/WebMetalRenderCommandEncoder.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderCommandEncoder.idl. * html/canvas/WebMetalRenderPassAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.cpp. (WebCore::WebMetalRenderPassAttachmentDescriptor::WebMetalRenderPassAttachmentDescriptor): (WebCore::WebMetalRenderPassAttachmentDescriptor::loadAction const): (WebCore::WebMetalRenderPassAttachmentDescriptor::setLoadAction): (WebCore::WebMetalRenderPassAttachmentDescriptor::storeAction const): (WebCore::WebMetalRenderPassAttachmentDescriptor::setStoreAction): (WebCore::WebMetalRenderPassAttachmentDescriptor::texture const): (WebCore::WebMetalRenderPassAttachmentDescriptor::setTexture): * html/canvas/WebMetalRenderPassAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.h. * html/canvas/WebMetalRenderPassAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassAttachmentDescriptor.idl. * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp. (WebCore::WebMetalRenderPassColorAttachmentDescriptor::create): (WebCore::WebMetalRenderPassColorAttachmentDescriptor::WebMetalRenderPassColorAttachmentDescriptor): (WebCore::WebMetalRenderPassColorAttachmentDescriptor::descriptor const): (WebCore::WebMetalRenderPassColorAttachmentDescriptor::clearColor const): (WebCore::WebMetalRenderPassColorAttachmentDescriptor::setClearColor): * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.h. * html/canvas/WebMetalRenderPassColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassColorAttachmentDescriptor.idl. * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp. (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::create): (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::WebMetalRenderPassDepthAttachmentDescriptor): (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::clearDepth const): (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::setClearDepth): (WebCore::WebMetalRenderPassDepthAttachmentDescriptor::descriptor const): * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h. * html/canvas/WebMetalRenderPassDepthAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDepthAttachmentDescriptor.idl. * html/canvas/WebMetalRenderPassDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.cpp. (WebCore::WebMetalRenderPassDescriptor::create): (WebCore::WebMetalRenderPassDescriptor::depthAttachment): (WebCore::WebMetalRenderPassDescriptor::colorAttachments): * html/canvas/WebMetalRenderPassDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.h. * html/canvas/WebMetalRenderPassDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPassDescriptor.idl. * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp. (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::create): (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::WebMetalRenderPipelineColorAttachmentDescriptor): (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::pixelFormat const): (WebCore::WebMetalRenderPipelineColorAttachmentDescriptor::setPixelFormat): * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h. * html/canvas/WebMetalRenderPipelineColorAttachmentDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl. * html/canvas/WebMetalRenderPipelineDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.cpp. (WebCore::WebMetalRenderPipelineDescriptor::create): (WebCore::WebMetalRenderPipelineDescriptor::vertexFunction const): (WebCore::WebMetalRenderPipelineDescriptor::setVertexFunction): (WebCore::WebMetalRenderPipelineDescriptor::fragmentFunction const): (WebCore::WebMetalRenderPipelineDescriptor::setFragmentFunction): (WebCore::WebMetalRenderPipelineDescriptor::colorAttachments): (WebCore::WebMetalRenderPipelineDescriptor::depthAttachmentPixelFormat const): (WebCore::WebMetalRenderPipelineDescriptor::setDepthAttachmentPixelFormat): (WebCore::WebMetalRenderPipelineDescriptor::reset): * html/canvas/WebMetalRenderPipelineDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.h. * html/canvas/WebMetalRenderPipelineDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineDescriptor.idl. * html/canvas/WebMetalRenderPipelineState.cpp: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.cpp. (WebCore::WebMetalRenderPipelineState::create): (WebCore::WebMetalRenderPipelineState::WebMetalRenderPipelineState): (WebCore::WebMetalRenderPipelineState::label const): (WebCore::WebMetalRenderPipelineState::setLabel): * html/canvas/WebMetalRenderPipelineState.h: Renamed from Source/WebCore/html/canvas/WebGPURenderPipelineState.h. * html/canvas/WebMetalRenderPipelineState.idl: Renamed from Source/WebCore/html/canvas/WebGPUDepthStencilState.idl. * html/canvas/WebMetalRenderingContext.cpp: Added. (WebCore::WebMetalRenderingContext::create): (WebCore::WebMetalRenderingContext::WebMetalRenderingContext): (WebCore::WebMetalRenderingContext::canvas const): (WebCore::WebMetalRenderingContext::initializeNewContext): (WebCore::WebMetalRenderingContext::clampedCanvasSize const): (WebCore::WebMetalRenderingContext::hasPendingActivity const): (WebCore::WebMetalRenderingContext::stop): (WebCore::WebMetalRenderingContext::activeDOMObjectName const): (WebCore::WebMetalRenderingContext::canSuspendForDocumentSuspension const): (WebCore::WebMetalRenderingContext::platformLayer const): (WebCore::WebMetalRenderingContext::markLayerComposited): (WebCore::WebMetalRenderingContext::reshape): (WebCore::WebMetalRenderingContext::createLibrary): (WebCore::WebMetalRenderingContext::createRenderPipelineState): (WebCore::WebMetalRenderingContext::createDepthStencilState): (WebCore::WebMetalRenderingContext::createComputePipelineState): (WebCore::WebMetalRenderingContext::createCommandQueue): (WebCore::WebMetalRenderingContext::nextDrawable): (WebCore::WebMetalRenderingContext::createBuffer): (WebCore::WebMetalRenderingContext::createTexture): * html/canvas/WebMetalRenderingContext.h: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.h. * html/canvas/WebMetalRenderingContext.idl: Renamed from Source/WebCore/html/canvas/WebGPURenderingContext.idl. * html/canvas/WebMetalSize.h: Renamed from Source/WebCore/html/canvas/WebGPUSize.h. * html/canvas/WebMetalSize.idl: Renamed from Source/WebCore/html/canvas/WebGPUSize.idl. * html/canvas/WebMetalTexture.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTexture.cpp. (WebCore::WebMetalTexture::create): (WebCore::WebMetalTexture::WebMetalTexture): * html/canvas/WebMetalTexture.h: Renamed from Source/WebCore/html/canvas/WebGPUTexture.h. * html/canvas/WebMetalTexture.idl: Renamed from Source/WebCore/html/canvas/WebGPUTexture.idl. * html/canvas/WebMetalTextureDescriptor.cpp: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.cpp. (WebCore::WebMetalTextureDescriptor::create): (WebCore::WebMetalTextureDescriptor::WebMetalTextureDescriptor): (WebCore::WebMetalTextureDescriptor::width const): (WebCore::WebMetalTextureDescriptor::setWidth): (WebCore::WebMetalTextureDescriptor::height const): (WebCore::WebMetalTextureDescriptor::setHeight): (WebCore::WebMetalTextureDescriptor::sampleCount const): (WebCore::WebMetalTextureDescriptor::setSampleCount): (WebCore::WebMetalTextureDescriptor::textureType const): (WebCore::WebMetalTextureDescriptor::setTextureType): (WebCore::WebMetalTextureDescriptor::storageMode const): (WebCore::WebMetalTextureDescriptor::setStorageMode): (WebCore::WebMetalTextureDescriptor::usage const): (WebCore::WebMetalTextureDescriptor::setUsage): * html/canvas/WebMetalTextureDescriptor.h: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.h. * html/canvas/WebMetalTextureDescriptor.idl: Renamed from Source/WebCore/html/canvas/WebGPUTextureDescriptor.idl. * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildObjectForCanvas): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::requestContent): (WebCore::contextAsScriptValue): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setWebMetalEnabled): (WebCore::RuntimeEnabledFeatures::webMetalEnabled const): (WebCore::RuntimeEnabledFeatures::setWebGPUEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::webGPUEnabled const): Deleted. * platform/Logging.h: * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (WebCore::PlatformCALayerCocoa::layerTypeForPlatformLayer): (WebCore::PlatformCALayerCocoa::PlatformCALayerCocoa): * platform/graphics/cocoa/WebMetalLayer.h: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.h. * platform/graphics/cocoa/WebMetalLayer.mm: Renamed from Source/WebCore/platform/graphics/cocoa/WebGPULayer.mm. (-[WebMetalLayer initWithGPUDevice:]): * platform/graphics/gpu/GPUBuffer.cpp: (WebCore::GPUBuffer::~GPUBuffer): * platform/graphics/gpu/GPUBuffer.h: * platform/graphics/gpu/GPUCommandBuffer.cpp: (WebCore::GPUCommandBuffer::~GPUCommandBuffer): * platform/graphics/gpu/GPUCommandBuffer.h: * platform/graphics/gpu/GPUCommandQueue.cpp: (WebCore::GPUCommandQueue::~GPUCommandQueue): * platform/graphics/gpu/GPUCommandQueue.h: * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: (WebCore::GPUComputeCommandEncoder::~GPUComputeCommandEncoder): * platform/graphics/gpu/GPUComputeCommandEncoder.h: * platform/graphics/gpu/GPUComputePipelineState.cpp: (WebCore::GPUComputePipelineState::~GPUComputePipelineState): * platform/graphics/gpu/GPUComputePipelineState.h: * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: (WebCore::GPUDepthStencilDescriptor::~GPUDepthStencilDescriptor): * platform/graphics/gpu/GPUDepthStencilDescriptor.h: * platform/graphics/gpu/GPUDepthStencilState.cpp: (WebCore::GPUDepthStencilState::~GPUDepthStencilState): * platform/graphics/gpu/GPUDepthStencilState.h: * platform/graphics/gpu/GPUDevice.cpp: (WebCore::GPUDevice::~GPUDevice): * platform/graphics/gpu/GPUDevice.h: (WebCore::GPUDevice::layer const): * platform/graphics/gpu/GPUDrawable.cpp: (WebCore::GPUDrawable::~GPUDrawable): * platform/graphics/gpu/GPUDrawable.h: * platform/graphics/gpu/GPUEnums.h: * platform/graphics/gpu/GPUFunction.cpp: (WebCore::GPUFunction::~GPUFunction): * platform/graphics/gpu/GPUFunction.h: * platform/graphics/gpu/GPULibrary.cpp: (WebCore::GPULibrary::~GPULibrary): * platform/graphics/gpu/GPULibrary.h: * platform/graphics/gpu/GPURenderCommandEncoder.cpp: (WebCore::GPURenderCommandEncoder::~GPURenderCommandEncoder): * platform/graphics/gpu/GPURenderCommandEncoder.h: * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: (WebCore::GPURenderPassAttachmentDescriptor::~GPURenderPassAttachmentDescriptor): * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: (WebCore::GPURenderPassColorAttachmentDescriptor::~GPURenderPassColorAttachmentDescriptor): * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: (WebCore::GPURenderPassDepthAttachmentDescriptor::~GPURenderPassDepthAttachmentDescriptor): * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: * platform/graphics/gpu/GPURenderPassDescriptor.cpp: (WebCore::GPURenderPassDescriptor::~GPURenderPassDescriptor): * platform/graphics/gpu/GPURenderPassDescriptor.h: * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: (WebCore::GPURenderPipelineColorAttachmentDescriptor::~GPURenderPipelineColorAttachmentDescriptor): * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: (WebCore::GPURenderPipelineDescriptor::~GPURenderPipelineDescriptor): * platform/graphics/gpu/GPURenderPipelineDescriptor.h: * platform/graphics/gpu/GPURenderPipelineState.cpp: (WebCore::GPURenderPipelineState::~GPURenderPipelineState): * platform/graphics/gpu/GPURenderPipelineState.h: * platform/graphics/gpu/GPUSize.h: * platform/graphics/gpu/GPUTexture.cpp: (WebCore::GPUTexture::~GPUTexture): * platform/graphics/gpu/GPUTexture.h: * platform/graphics/gpu/GPUTextureDescriptor.cpp: (WebCore::GPUTextureDescriptor::~GPUTextureDescriptor): * platform/graphics/gpu/GPUTextureDescriptor.h: * platform/graphics/metal/GPUBufferMetal.mm: (WebCore::GPUBuffer::GPUBuffer): * platform/graphics/metal/GPUCommandBufferMetal.mm: * platform/graphics/metal/GPUCommandQueueMetal.mm: * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm: * platform/graphics/metal/GPUComputePipelineStateMetal.mm: (WebCore::GPUComputePipelineState::GPUComputePipelineState): * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm: * platform/graphics/metal/GPUDepthStencilStateMetal.mm: (WebCore::GPUDepthStencilState::setLabel const): * platform/graphics/metal/GPUDeviceMetal.mm: (WebCore::GPUDevice::reshape const): * platform/graphics/metal/GPUDrawableMetal.mm: (WebCore::GPUDrawable::release): * platform/graphics/metal/GPUFunctionMetal.mm: * platform/graphics/metal/GPULibraryMetal.mm: (WebCore::GPULibrary::GPULibrary): * platform/graphics/metal/GPURenderCommandEncoderMetal.mm: (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm: * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm: * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm: * platform/graphics/metal/GPURenderPassDescriptorMetal.mm: * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm: * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm: * platform/graphics/metal/GPURenderPipelineStateMetal.mm: (WebCore::GPURenderPipelineState::setLabel const): * platform/graphics/metal/GPUTextureDescriptorMetal.mm: * platform/graphics/metal/GPUTextureMetal.mm: (WebCore::GPUTexture::GPUTexture): * testing/InternalSettings.cpp: (WebCore::InternalSettings::Backup::Backup): (WebCore::InternalSettings::Backup::restoreTo): (WebCore::InternalSettings::setWebMetalEnabled): (WebCore::InternalSettings::setWebGPUEnabled): Deleted. * testing/InternalSettings.h: * testing/InternalSettings.idl: 2018-10-08 Dean Jackson <dino@apple.com> CrashTracer: backboardd at Recursion :: QuartzCore: CA::Render::Updater::prepare_sublayer0 https://bugs.webkit.org/show_bug.cgi?id=190376 <rdar://problem/44986520> Reviewed by Tim Horton. Very deep CoreAnimation layer trees can cause problems. Reduce our maximum depth from 256 to 128. Modified existing test: compositing/layer-creation/deep-tree.html * platform/graphics/ca/GraphicsLayerCA.cpp: Cap the depth at 128. 2018-10-08 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r236941. https://bugs.webkit.org/show_bug.cgi?id=190374 Causing API test failures in new test (Requested by jernoble on #webkit). Reverted changeset: "ISOTrackEncryptionBox returns incorrect defaultKeyID" https://bugs.webkit.org/show_bug.cgi?id=190368 https://trac.webkit.org/changeset/236941 2018-10-08 Aditya Keerthi <akeerthi@apple.com> Make <input type=color> a runtime enabled (on-by-default) feature https://bugs.webkit.org/show_bug.cgi?id=189162 Reviewed by Wenson Hsieh and Tim Horton. Enable the build-time flag INPUT_TYPE_COLOR by default and introduce a runtime-enabled feature for input type color, also on by default. Covered by rebaselining existing layout tests. * Configurations/FeatureDefines.xcconfig: * html/InputType.cpp: (WebCore::createInputTypeFactoryMap): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::inputTypeColorEnabled const): (WebCore::RuntimeEnabledFeatures::setInputTypeColorEnabled): 2018-10-08 Jer Noble <jer.noble@apple.com> ISOTrackEncryptionBox returns incorrect defaultKeyID https://bugs.webkit.org/show_bug.cgi?id=190368 Reviewed by Eric Carlson. Test: TestWebKitAPI.ISOBox.ISOProtectionSchemeInfoBox ISOTrackEncryptionBox::parse() increments the data offset by an incorrect amount. Drive-by fix: add EXPORT macros to all the ISO box classes so that tests can be written in TestWebKitAPI. * WebCore.xcodeproj/project.pbxproj: * platform/graphics/iso/ISOBox.h: * platform/graphics/iso/ISOOriginalFormatBox.h: * platform/graphics/iso/ISOProtectionSchemeInfoBox.h: * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: * platform/graphics/iso/ISOSchemeInformationBox.h: * platform/graphics/iso/ISOSchemeTypeBox.h: * platform/graphics/iso/ISOTrackEncryptionBox.cpp: (WebCore::ISOTrackEncryptionBox::parse): * platform/graphics/iso/ISOTrackEncryptionBox.h: 2018-10-08 Antti Koivisto <antti@apple.com> Move SystemFontDatabase to a file of its own https://bugs.webkit.org/show_bug.cgi?id=190347 Reviewed by Chris Dumez. Also rename it to SystemFontDatabaseCoreText as it is CoreText specific. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * page/MemoryRelease.cpp: (WebCore::releaseNoncriticalMemory): * page/cocoa/MemoryReleaseCocoa.mm: Release SystemFontDatabaseCoreText directly from platform specific cleanup code. (WebCore::platformReleaseMemory): * platform/graphics/cocoa/FontDescriptionCocoa.cpp: (WebCore::FontDescription::invalidateCaches): (WebCore::systemFontCascadeList): (WebCore::FontCascadeDescription::effectiveFamilyCount const): (WebCore::FontCascadeDescription::effectiveFamilyAt const): (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParameters): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::isHashTableDeletedValue const): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::operator== const): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::hash const): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::hash): Deleted. (WebCore::SystemFontDatabase::CoreTextCascadeListParameters::CoreTextCascadeListParametersHash::equal): Deleted. (): Deleted. (WebCore::SystemFontDatabase::singleton): Deleted. (WebCore::SystemFontDatabase::systemFontCascadeList): Deleted. (WebCore::SystemFontDatabase::clear): Deleted. (WebCore::SystemFontDatabase::SystemFontDatabase): Deleted. (WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): Deleted. (WebCore::SystemFontDatabase::removeCascadeList): Deleted. (WebCore::SystemFontDatabase::computeCascadeList): Deleted. (WebCore::systemFontParameters): Deleted. * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp: Added. (WebCore::SystemFontDatabaseCoreText::singleton): (WebCore::SystemFontDatabaseCoreText::SystemFontDatabaseCoreText): (WebCore::SystemFontDatabaseCoreText::systemFontCascadeList): (WebCore::SystemFontDatabaseCoreText::clear): (WebCore::SystemFontDatabaseCoreText::applyWeightItalicsAndFallbackBehavior): (WebCore::SystemFontDatabaseCoreText::removeCascadeList): (WebCore::SystemFontDatabaseCoreText::computeCascadeList): (WebCore::SystemFontDatabaseCoreText::systemFontParameters): * platform/graphics/cocoa/SystemFontDatabaseCoreText.h: Added. (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParameters): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::isHashTableDeletedValue const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::operator== const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::hash const): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::hash): (WebCore::SystemFontDatabaseCoreText::CascadeListParameters::CascadeListParametersHash::equal): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: 2018-10-08 Jeremy Jones <jeremyj@apple.com> Remove dead code: VideoFullscreenModel::isVisible() https://bugs.webkit.org/show_bug.cgi?id=190356 Reviewed by Jon Lee. No new tests because there is no behavior change. Remove isVisible() since it is no longer used. * platform/cocoa/VideoFullscreenModel.h: * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::isVisible const): Deleted. * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::isVisible const): Deleted. 2018-10-08 Jeremy Jones <jeremyj@apple.com> Remove dead code: resetMediaState. https://bugs.webkit.org/show_bug.cgi?id=190355 Reviewed by Jon Lee. No new tests because no behavior change. Remove resetMediaState since it is no longer used. * platform/cocoa/PlaybackSessionInterface.h: (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): * platform/ios/PlaybackSessionInterfaceAVKit.h: * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::resetMediaState): Deleted. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController resetMediaState]): Deleted. * platform/mac/PlaybackSessionInterfaceMac.h: * platform/mac/PlaybackSessionInterfaceMac.mm: (WebCore::PlaybackSessionInterfaceMac::resetMediaState): Deleted. 2018-10-08 Jeremy Jones <jeremyj@apple.com> Use MediaPlayerEnums::VideoGravity in VideoFullscreenModel. https://bugs.webkit.org/show_bug.cgi?id=190357 Reviewed by Jon Lee. No new tests because no behavior change. Use MediaPlayerEnums::VideoGravity instead of creating another identical enum in VideoFullscreenModel. * platform/cocoa/VideoFullscreenModel.h: (): Deleted. * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (WebCore::VideoFullscreenModelVideoElement::setVideoLayerGravity): * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer setVideoGravity:]): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::setVideoLayerGravity): * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]): 2018-10-08 Devin Rousso <drousso@apple.com> Web Inspector: group media network entries by the node that triggered the request https://bugs.webkit.org/show_bug.cgi?id=189606 <rdar://problem/44438527> Reviewed by Brian Burg. Test: http/tests/inspector/network/resource-initiatorNode.html Add extra arguments to functions that create `ResourceRequest` objects for media resources so that `initiatorNodeIdentifier` can be set for WebInspector frontend to use for grouping. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::loadResource): * html/HTMLVideoElement.cpp: (WebCore::HTMLVideoElement::setDisplayMode): * loader/FrameLoader.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::willLoadMediaElementURL): Handles initial (e.g. DNT) resource requests. * loader/ImageLoader.cpp: (ImageLoader::updateFromElement): Handles "poster" requests. * loader/MediaResourceLoader.cpp: (MediaResourceLoader::requestResource): Handles byte-range requests. * html/track/LoadableTextTrack.cpp: (WebCore::LoadableTextTrack::loadTimerFired): * loader/TextTrackLoader.h: * loader/TextTrackLoader.cpp: (WebCore::TextTrackLoader::load): * html/HTMLTrackElement.h: Handles <track> (e.g. subtitle) requests. * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::identifierForNode): * inspector/InspectorInstrumentation.h: (WebCore::InspectorInstrumentation::identifierForNode): * inspector/InspectorInstrumentation.cpp: (WebCore::InspectorInstrumentation::identifierForNodeImpl): Allows callers to get a `DOM.nodeId` for the given `Node`, which is (in this patch) attached to the `ResourceRequest` and later used by `InspectorNetworkAgent`. * inspector/agents/InspectorNetworkAgent.h: * inspector/agents/InspectorNetworkAgent.cpp: (WebCore::InspectorNetworkAgent::willSendRequest): (WebCore::InspectorNetworkAgent::didLoadResourceFromMemoryCache): (WebCore::InspectorNetworkAgent::buildInitiatorObject): * platform/network/ResourceRequestBase.h: (WebCore::ResourceRequestBase::initiatorNodeIdentifier const): (WebCore::ResourceRequestBase::setInitiatorNodeIdentifier): * platform/network/ResourceRequestBase.cpp: (WebCore::ResourceRequestBase::setAsIsolatedCopy): * platform/network/cf/ResourceRequestCFNet.cpp: (WebCore::ResourceRequest::updateFromDelegatePreservingOldProperties): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache): * inspector/InspectorCanvas.h: * inspector/InspectorCanvas.cpp: (WebCore::InspectorCanvas::buildObjectForCanvas): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::enable): (WebCore::InspectorCanvasAgent::didCreateCanvasRenderingContext): Don't try to push the canvas' node to the frontend, as this will create a dangling node in `InspectorDOMAgent` if the canvas' node is detached from the DOM. 2018-10-08 Andy Estes <aestes@apple.com> [Payment Request] Requests should be aborted after details settle when the user cancels https://bugs.webkit.org/show_bug.cgi?id=190333 Reviewed by Alex Christensen. In Payment Request's "update a PaymentRequest's details" algorithm, user agents are expected to disable the payment UI when PaymentRequest details are being updated by the merchant. This is to prevent the user from accepting a payment before updated details are displayed. Further, Payment Request's "user aborts the payment request" algorithm says that the algorithm should be terminated prior to throwing an AbortError if the request is currently being updated, and also that user agents SHOULD ensure this never occurs. This is based on the assumption that payment UIs are disabled during details updates. For Apple Pay, while it is true that a payment cannot be accepted by the user while details are being updated by the merchant, the payment UI is not completely disabled. In particular, the user is allowed to abort the payment while details are being updated. We need to honor the user's request to abort without doing so in the middle of a details update. This patch defers a user-initiated abort until after details are settled, at which point the promise returned by show() is rejected with an AbortError. This behaves as if the details update promise were rejected by the merchant. Added a test case to http/tests/paymentrequest/payment-request-show-method.https.html. * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::settleDetailsPromise): (WebCore::PaymentRequest::whenDetailsSettled): (WebCore::PaymentRequest::cancel): * Modules/paymentrequest/PaymentRequest.h: 2018-10-08 Chris Dumez <cdumez@apple.com> Have DOMWindowProperty get is frame from its associated DOMWindow https://bugs.webkit.org/show_bug.cgi?id=190341 Reviewed by Alex Christensen. Have DOMWindowProperty get is frame from its associated DOMWindow, instead of having its own m_frame that can potentially get out-of-sync. * Modules/cache/DOMWindowCaches.cpp: (WebCore::DOMWindowCaches::DOMWindowCaches): * Modules/geolocation/NavigatorGeolocation.cpp: (WebCore::NavigatorGeolocation::NavigatorGeolocation): (WebCore::NavigatorGeolocation::from): * Modules/geolocation/NavigatorGeolocation.h: * Modules/indexeddb/DOMWindowIndexedDatabase.cpp: (WebCore::DOMWindowIndexedDatabase::DOMWindowIndexedDatabase): * Modules/mediastream/NavigatorMediaDevices.cpp: (WebCore::NavigatorMediaDevices::NavigatorMediaDevices): (WebCore::NavigatorMediaDevices::from): * Modules/mediastream/NavigatorMediaDevices.h: * Modules/quota/DOMWindowQuota.cpp: (WebCore::DOMWindowQuota::DOMWindowQuota): * Modules/quota/NavigatorStorageQuota.cpp: (WebCore::NavigatorStorageQuota::NavigatorStorageQuota): * Modules/quota/NavigatorStorageQuota.h: * Modules/speech/DOMWindowSpeechSynthesis.cpp: (WebCore::DOMWindowSpeechSynthesis::DOMWindowSpeechSynthesis): * css/StyleMedia.cpp: (WebCore::StyleMedia::StyleMedia): (WebCore::StyleMedia::type const): (WebCore::StyleMedia::matchMedium const): * css/StyleMedia.h: * loader/appcache/DOMApplicationCache.cpp: (WebCore::DOMApplicationCache::DOMApplicationCache): (WebCore::DOMApplicationCache::applicationCacheHost const): (WebCore::DOMApplicationCache::scriptExecutionContext const): * loader/appcache/DOMApplicationCache.h: * page/BarProp.cpp: (WebCore::BarProp::BarProp): (WebCore::BarProp::visible const): * page/BarProp.h: (WebCore::BarProp::create): * page/DOMSelection.cpp: (WebCore::DOMSelection::DOMSelection): (WebCore::DOMSelection::visibleSelection const): (WebCore::DOMSelection::anchorNode const): (WebCore::DOMSelection::anchorOffset const): (WebCore::DOMSelection::focusNode const): (WebCore::DOMSelection::focusOffset const): (WebCore::DOMSelection::baseNode const): (WebCore::DOMSelection::baseOffset const): (WebCore::DOMSelection::extentNode const): (WebCore::DOMSelection::extentOffset const): (WebCore::DOMSelection::isCollapsed const): (WebCore::DOMSelection::type const): (WebCore::DOMSelection::rangeCount const): (WebCore::DOMSelection::collapse): (WebCore::DOMSelection::collapseToEnd): (WebCore::DOMSelection::collapseToStart): (WebCore::DOMSelection::empty): (WebCore::DOMSelection::setBaseAndExtent): (WebCore::DOMSelection::setPosition): (WebCore::DOMSelection::modify): (WebCore::DOMSelection::extend): (WebCore::DOMSelection::getRangeAt): (WebCore::DOMSelection::removeAllRanges): (WebCore::DOMSelection::addRange): (WebCore::DOMSelection::deleteFromDocument): (WebCore::DOMSelection::containsNode const): (WebCore::DOMSelection::toString): (WebCore::DOMSelection::shadowAdjustedNode const): (WebCore::DOMSelection::shadowAdjustedOffset const): (WebCore::DOMSelection::isValidForPosition const): * page/DOMSelection.h: (WebCore::DOMSelection::create): * page/DOMWindow.cpp: (WebCore::DOMWindow::screen): (WebCore::DOMWindow::history): (WebCore::DOMWindow::locationbar): (WebCore::DOMWindow::menubar): (WebCore::DOMWindow::personalbar): (WebCore::DOMWindow::scrollbars): (WebCore::DOMWindow::statusbar): (WebCore::DOMWindow::toolbar): (WebCore::DOMWindow::applicationCache): (WebCore::DOMWindow::navigator): (WebCore::DOMWindow::location): (WebCore::DOMWindow::visualViewport): (WebCore::DOMWindow::webkitNamespace): (WebCore::DOMWindow::getSelection): (WebCore::DOMWindow::styleMedia): * page/DOMWindow.h: * page/DOMWindowExtension.cpp: (WebCore::DOMWindowExtension::DOMWindowExtension): * page/DOMWindowExtension.h: (WebCore::DOMWindowExtension::create): * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::DOMWindowProperty): (WebCore::DOMWindowProperty::~DOMWindowProperty): (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): (WebCore::DOMWindowProperty::reconnectFrameFromDocumentSuspension): (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): (WebCore::DOMWindowProperty::willDetachGlobalObjectFromFrame): (WebCore::DOMWindowProperty::frame const): * page/DOMWindowProperty.h: (WebCore::DOMWindowProperty::window const): * page/History.cpp: (WebCore::History::History): (WebCore::History::length const): (WebCore::History::scrollRestoration const): (WebCore::History::setScrollRestoration): (WebCore::History::stateInternal const): (WebCore::History::go): (WebCore::History::urlForState): (WebCore::History::stateObjectAdded): * page/History.h: * page/Location.cpp: (WebCore::Location::Location): (WebCore::Location::url const): (WebCore::Location::href const): (WebCore::Location::protocol const): (WebCore::Location::host const): (WebCore::Location::hostname const): (WebCore::Location::port const): (WebCore::Location::pathname const): (WebCore::Location::search const): (WebCore::Location::origin const): (WebCore::Location::ancestorOrigins const): (WebCore::Location::hash const): (WebCore::Location::setHref): (WebCore::Location::setProtocol): (WebCore::Location::setHost): (WebCore::Location::setHostname): (WebCore::Location::setPort): (WebCore::Location::setPathname): (WebCore::Location::setSearch): (WebCore::Location::setHash): (WebCore::Location::assign): (WebCore::Location::replace): (WebCore::Location::reload): (WebCore::Location::setLocation): * page/Location.h: (WebCore::Location::create): * page/Navigator.cpp: (WebCore::Navigator::Navigator): (WebCore::Navigator::appVersion const): (WebCore::Navigator::userAgent const): (WebCore::Navigator::share): (WebCore::Navigator::plugins): (WebCore::Navigator::mimeTypes): (WebCore::Navigator::cookieEnabled const): (WebCore::Navigator::javaEnabled const): (WebCore::Navigator::standalone const): * page/Navigator.h: * page/Performance.cpp: (WebCore::Performance::navigation): (WebCore::Performance::timing): * page/PerformanceNavigation.cpp: (WebCore::PerformanceNavigation::PerformanceNavigation): (WebCore::PerformanceNavigation::type const): (WebCore::PerformanceNavigation::redirectCount const): * page/PerformanceNavigation.h: (WebCore::PerformanceNavigation::create): * page/PerformanceTiming.cpp: (WebCore::PerformanceTiming::PerformanceTiming): (WebCore::PerformanceTiming::documentLoader const): (WebCore::PerformanceTiming::documentTiming const): * page/PerformanceTiming.h: (WebCore::PerformanceTiming::create): * page/Screen.cpp: (WebCore::Screen::Screen): (WebCore::Screen::height const): (WebCore::Screen::width const): (WebCore::Screen::colorDepth const): (WebCore::Screen::pixelDepth const): (WebCore::Screen::availLeft const): (WebCore::Screen::availTop const): (WebCore::Screen::availHeight const): (WebCore::Screen::availWidth const): * page/Screen.h: * page/VisualViewport.cpp: (WebCore::VisualViewport::VisualViewport): (WebCore::VisualViewport::scriptExecutionContext const): (WebCore::VisualViewport::addEventListener): (WebCore::VisualViewport::updateFrameLayout const): (WebCore::VisualViewport::offsetLeft const): (WebCore::VisualViewport::offsetTop const): (WebCore::VisualViewport::pageLeft const): (WebCore::VisualViewport::pageTop const): (WebCore::VisualViewport::width const): (WebCore::VisualViewport::height const): (WebCore::VisualViewport::scale const): (WebCore::VisualViewport::update): (WebCore::VisualViewport::enqueueResizeEvent): (WebCore::VisualViewport::enqueueScrollEvent): * page/VisualViewport.h: * page/WebKitNamespace.cpp: (WebCore::WebKitNamespace::WebKitNamespace): * page/WebKitNamespace.h: (WebCore::WebKitNamespace::create): * plugins/DOMMimeTypeArray.cpp: (WebCore::DOMMimeTypeArray::DOMMimeTypeArray): (WebCore::DOMMimeTypeArray::item): (WebCore::DOMMimeTypeArray::namedItem): (WebCore::DOMMimeTypeArray::getPluginData const): * plugins/DOMMimeTypeArray.h: (WebCore::DOMMimeTypeArray::create): * plugins/DOMPluginArray.cpp: (WebCore::DOMPluginArray::DOMPluginArray): (WebCore::DOMPluginArray::item): (WebCore::DOMPluginArray::namedItem): (WebCore::DOMPluginArray::refresh): (WebCore::DOMPluginArray::pluginData const): * plugins/DOMPluginArray.h: (WebCore::DOMPluginArray::create): * storage/Storage.cpp: (WebCore::Storage::create): (WebCore::Storage::Storage): (WebCore::Storage::setItem): (WebCore::Storage::removeItem): (WebCore::Storage::clear): * storage/Storage.h: 2018-10-08 Antti Koivisto <antti@apple.com> Move FontCascadeDescription to a file of its own https://bugs.webkit.org/show_bug.cgi?id=190348 Reviewed by Chris Dumez. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/graphics/FontCascade.h: * platform/graphics/FontCascadeDescription.cpp: Copied from Source/WebCore/platform/graphics/FontDescription.cpp. (WebCore::FontDescription::FontDescription): Deleted. (WebCore::m_shouldAllowUserInstalledFonts): Deleted. (WebCore::FontDescription::setLocale): Deleted. (WebCore::FontDescription::invalidateCaches): Deleted. * platform/graphics/FontCascadeDescription.h: Copied from Source/WebCore/platform/graphics/FontDescription.h. (WebCore::FontDescription::operator!= const): Deleted. (WebCore::FontDescription::computedSize const): Deleted. (WebCore::FontDescription::computedPixelSize const): Deleted. (WebCore::FontDescription::italic const): Deleted. (WebCore::FontDescription::stretch const): Deleted. (WebCore::FontDescription::weight const): Deleted. (WebCore::FontDescription::fontSelectionRequest const): Deleted. (WebCore::FontDescription::renderingMode const): Deleted. (WebCore::FontDescription::textRenderingMode const): Deleted. (WebCore::FontDescription::script const): Deleted. (WebCore::FontDescription::locale const): Deleted. (WebCore::FontDescription::orientation const): Deleted. (WebCore::FontDescription::nonCJKGlyphOrientation const): Deleted. (WebCore::FontDescription::widthVariant const): Deleted. (WebCore::FontDescription::featureSettings const): Deleted. (WebCore::FontDescription::variationSettings const): Deleted. (WebCore::FontDescription::fontSynthesis const): Deleted. (WebCore::FontDescription::variantCommonLigatures const): Deleted. (WebCore::FontDescription::variantDiscretionaryLigatures const): Deleted. (WebCore::FontDescription::variantHistoricalLigatures const): Deleted. (WebCore::FontDescription::variantContextualAlternates const): Deleted. (WebCore::FontDescription::variantPosition const): Deleted. (WebCore::FontDescription::variantCaps const): Deleted. (WebCore::FontDescription::variantNumericFigure const): Deleted. (WebCore::FontDescription::variantNumericSpacing const): Deleted. (WebCore::FontDescription::variantNumericFraction const): Deleted. (WebCore::FontDescription::variantNumericOrdinal const): Deleted. (WebCore::FontDescription::variantNumericSlashedZero const): Deleted. (WebCore::FontDescription::variantAlternates const): Deleted. (WebCore::FontDescription::variantEastAsianVariant const): Deleted. (WebCore::FontDescription::variantEastAsianWidth const): Deleted. (WebCore::FontDescription::variantEastAsianRuby const): Deleted. (WebCore::FontDescription::variantSettings const): Deleted. (WebCore::FontDescription::opticalSizing const): Deleted. (WebCore::FontDescription::fontStyleAxis const): Deleted. (WebCore::FontDescription::shouldAllowUserInstalledFonts const): Deleted. (WebCore::FontDescription::setComputedSize): Deleted. (WebCore::FontDescription::setItalic): Deleted. (WebCore::FontDescription::setStretch): Deleted. (WebCore::FontDescription::setIsItalic): Deleted. (WebCore::FontDescription::setWeight): Deleted. (WebCore::FontDescription::setRenderingMode): Deleted. (WebCore::FontDescription::setTextRenderingMode): Deleted. (WebCore::FontDescription::setOrientation): Deleted. (WebCore::FontDescription::setNonCJKGlyphOrientation): Deleted. (WebCore::FontDescription::setWidthVariant): Deleted. (WebCore::FontDescription::setFeatureSettings): Deleted. (WebCore::FontDescription::setVariationSettings): Deleted. (WebCore::FontDescription::setFontSynthesis): Deleted. (WebCore::FontDescription::setVariantCommonLigatures): Deleted. (WebCore::FontDescription::setVariantDiscretionaryLigatures): Deleted. (WebCore::FontDescription::setVariantHistoricalLigatures): Deleted. (WebCore::FontDescription::setVariantContextualAlternates): Deleted. (WebCore::FontDescription::setVariantPosition): Deleted. (WebCore::FontDescription::setVariantCaps): Deleted. (WebCore::FontDescription::setVariantNumericFigure): Deleted. (WebCore::FontDescription::setVariantNumericSpacing): Deleted. (WebCore::FontDescription::setVariantNumericFraction): Deleted. (WebCore::FontDescription::setVariantNumericOrdinal): Deleted. (WebCore::FontDescription::setVariantNumericSlashedZero): Deleted. (WebCore::FontDescription::setVariantAlternates): Deleted. (WebCore::FontDescription::setVariantEastAsianVariant): Deleted. (WebCore::FontDescription::setVariantEastAsianWidth): Deleted. (WebCore::FontDescription::setVariantEastAsianRuby): Deleted. (WebCore::FontDescription::setOpticalSizing): Deleted. (WebCore::FontDescription::setFontStyleAxis): Deleted. (WebCore::FontDescription::setShouldAllowUserInstalledFonts): Deleted. (WebCore::FontDescription::operator== const): Deleted. * platform/graphics/FontDescription.cpp: (WebCore::FontDescription::invalidateCaches): (WebCore::FontCascadeDescription::FontCascadeDescription): Deleted. (WebCore::FontCascadeDescription::effectiveFamilyCount const): Deleted. (WebCore::FontCascadeDescription::effectiveFamilyAt const): Deleted. (WebCore::FontCascadeDescription::lighterWeight): Deleted. (WebCore::FontCascadeDescription::bolderWeight): Deleted. (WebCore::FontCascadeDescription::familiesEqualForTextAutoSizing const): Deleted. (WebCore::FontCascadeDescription::familyNamesAreEqual): Deleted. (WebCore::FontCascadeDescription::familyNameHash): Deleted. (WebCore::FontCascadeDescription::foldedFamilyName): Deleted. * platform/graphics/FontDescription.h: (WebCore::FontCascadeDescription::operator!= const): Deleted. (WebCore::FontCascadeDescription::familyCount const): Deleted. (WebCore::FontCascadeDescription::firstFamily const): Deleted. (WebCore::FontCascadeDescription::familyAt const): Deleted. (WebCore::FontCascadeDescription::families const): Deleted. (WebCore::FontCascadeDescription::specifiedSize const): Deleted. (WebCore::FontCascadeDescription::isAbsoluteSize const): Deleted. (WebCore::FontCascadeDescription::lighterWeight const): Deleted. (WebCore::FontCascadeDescription::bolderWeight const): Deleted. (WebCore::FontCascadeDescription::useFixedDefaultSize const): Deleted. (WebCore::FontCascadeDescription::kerning const): Deleted. (WebCore::FontCascadeDescription::keywordSize const): Deleted. (WebCore::FontCascadeDescription::keywordSizeAsIdentifier const): Deleted. (WebCore::FontCascadeDescription::fontSmoothing const): Deleted. (WebCore::FontCascadeDescription::isSpecifiedFont const): Deleted. (WebCore::FontCascadeDescription::setOneFamily): Deleted. (WebCore::FontCascadeDescription::setFamilies): Deleted. (WebCore::FontCascadeDescription::setSpecifiedSize): Deleted. (WebCore::FontCascadeDescription::setIsAbsoluteSize): Deleted. (WebCore::FontCascadeDescription::setKerning): Deleted. (WebCore::FontCascadeDescription::setKeywordSize): Deleted. (WebCore::FontCascadeDescription::setKeywordSizeFromIdentifier): Deleted. (WebCore::FontCascadeDescription::setFontSmoothing): Deleted. (WebCore::FontCascadeDescription::setIsSpecifiedFont): Deleted. (WebCore::FontCascadeDescription::equalForTextAutoSizing const): Deleted. (WebCore::FontCascadeDescription::initialItalic): Deleted. (WebCore::FontCascadeDescription::initialFontStyleAxis): Deleted. (WebCore::FontCascadeDescription::initialWeight): Deleted. (WebCore::FontCascadeDescription::initialStretch): Deleted. (WebCore::FontCascadeDescription::initialSmallCaps): Deleted. (WebCore::FontCascadeDescription::initialKerning): Deleted. (WebCore::FontCascadeDescription::initialFontSmoothing): Deleted. (WebCore::FontCascadeDescription::initialTextRenderingMode): Deleted. (WebCore::FontCascadeDescription::initialFontSynthesis): Deleted. (WebCore::FontCascadeDescription::initialVariantPosition): Deleted. (WebCore::FontCascadeDescription::initialVariantCaps): Deleted. (WebCore::FontCascadeDescription::initialVariantAlternates): Deleted. (WebCore::FontCascadeDescription::initialOpticalSizing): Deleted. (WebCore::FontCascadeDescription::initialLocale): Deleted. (WebCore::FontCascadeDescription::operator== const): Deleted. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * rendering/style/RenderStyle.h: 2018-10-08 Yacine Bandou <yacine.bandou_ext@softathome.com> [EME][GStreamer] Add support for WebM encrypted caps "application/x-webm-enc" https://bugs.webkit.org/show_bug.cgi?id=189239 Reviewed by Xabier Rodriguez-Calvar. Add the support of GStreamer caps "application/x-webm-enc" in GStreamerCommon. The DRM system id field in the encrypted event is set to GST_PROTECTION_UNSPECIFIED_SYSTEM_ID in case of WebM, for details, see https://bugzilla.gnome.org/attachment.cgi?id=365211. Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-eventmse.html media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::capsMediaType): (WebCore::areEncryptedCaps): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformCaps): 2018-10-07 Dan Bernstein <mitz@apple.com> Fixed building with the latest macOS SDK * platform/graphics/cocoa/IOSurface.mm: (WebCore::IOSurface::ensurePlatformContext): Suppressed deprecation warnings around use of CGIOSurfaceContextSetDisplayMask. 2018-10-06 Justin Michaud <justin_michaud@apple.com> Properly determine if css custom property values are computationally independent https://bugs.webkit.org/show_bug.cgi?id=190303 Reviewed by Antti Koivisto. Add getDirectComputationalDependencies method to determine if a value is computationally dependent. Use this method in CSS.registerProperty to replace existing substring checks. No new tests are needed because the existing tests cover this behaviour. * css/CSSCalculationValue.cpp: (WebCore::determineCategory): * css/CSSCalculationValue.h: (WebCore::CSSCalcValue::getDirectComputationalDependencies const): (WebCore::CSSCalcValue::getDirectRootComputationalDependencies const): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::customCSSText const): (WebCore::CSSCustomPropertyValue::tokens const): (WebCore::CSSCustomPropertyValue::setResolvedTypedValue): * css/CSSCustomPropertyValue.h: * css/CSSPrimitiveValue.cpp: (WebCore::CSSPrimitiveValue::getDirectComputationalDependencies const): (WebCore::CSSPrimitiveValue::getDirectRootComputationalDependencies const): * css/CSSPrimitiveValue.h: * css/CSSValue.cpp: (WebCore::CSSValue::getDirectComputationalDependencies const): (WebCore::CSSValue::getDirectRootComputationalDependencies const): * css/CSSValue.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::CSSVariableData): (WebCore::CSSVariableData::resolveVariableReference const): * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): 2018-10-05 Chris Dumez <cdumez@apple.com> Regression(r236862): Crash under DOMWindowExtension::willDetachGlobalObjectFromFrame() https://bugs.webkit.org/show_bug.cgi?id=190320 <rdar://problem/45044814> Reviewed by Geoffrey Garen. r236862 caused DOMWindowProperty::willDetachGlobalObjectFromFrame() to get called several times. There was no effect for most DOMWindowProperty objects. However, it would cause crashes for DOMWindowExtension objects, which subclass DOMWindowProperty and override DOMWindowProperty::willDetachGlobalObjectFromFrame() because they dereference the frame without null checking it. To address the issue, we now make sure DOMWindowProperty::willDetachGlobalObjectFromFrame() is not called several times. * dom/Document.cpp: (WebCore::Document::detachFromFrame): Stop calling DOMWindow::willDetachDocumentFromFrame() here as most call sites already take care of calling DOMWindow::willDetachDocumentFromFrame() beforehand (e.g. Document::prepareForDestruction()). Also, return early if the Document is already detached from its frame. (WebCore::Document::frameWasDisconnectedFromOwner): Add new utility function called when a Frame is disconnected from its owner which calls both Document::detachFromFrame() and DOMWindow::willDetachDocumentFromFrame(). * dom/Document.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::willDetachDocumentFromFrame): Return early if the Window is already detached from its frame. * page/Frame.cpp: (WebCore::Frame::disconnectOwnerElement): 2018-10-05 Jer Noble <jer.noble@apple.com> Further unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): 2018-10-05 Jer Noble <jer.noble@apple.com> Unreviewed watchOS build fix: videoPerformanceMetrics unavailable on watchOS. * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): 2018-10-05 Eric Carlson <eric.carlson@apple.com> [MediaStream] RealtimeMediaSource should be able to vend hashed IDs https://bugs.webkit.org/show_bug.cgi?id=190142 <rdar://problem/44911109> Reviewed by Youenn Fablet. No new tests, covered by existing tests. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed to base class. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same as passed salt. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID. (WebCore::MediaStreamTrack::getCapabilities const): Ditto. * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed to base class. * Modules/webaudio/MediaStreamAudioSource.cpp: (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto. * platform/mediastream/MediaConstraints.h: * platform/mediastream/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto. * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID. (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID. (WebCore::RealtimeMediaSource::hashedId const): New. (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating a source. (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto. (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto. * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters. * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: (WebCore::GStreamerAudioCaptureSource::create): Ditto. (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto. * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::create): Ditto. (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto. (WebCore::MockRealtimeAudioSource::create): Ditto. (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto. * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: (WebCore::MockRealtimeVideoSource::create): Ditto. (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto. * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::create): Ditto. (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto. (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID. (WebCore::AVVideoCaptureSource::capabilities): Ditto. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): Update parameters. (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto. (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID. (WebCore::CoreAudioCaptureSource::settings): Ditto. * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: (WebCore::MockRealtimeAudioSource::create): Ditto. (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto. * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSource::create): Ditto. (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto. (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto. (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging. (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto. (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto. * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::create): Ditto. (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto. (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID. (WebCore::MockRealtimeAudioSource::capabilities): Ditto. * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::create): Update parameters. (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto. (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID. (WebCore::MockRealtimeVideoSource::settings): Ditto. * platform/mock/MockRealtimeVideoSource.h: 2018-10-03 Jer Noble <jer.noble@apple.com> Add support for reporting "display composited video frames" through the VideoPlaybackQuality object. https://bugs.webkit.org/show_bug.cgi?id=190266 Reviewed by Eric Carlson. Test: TestWebKitAPI.VideoQualityDisplayCompositing Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its constructor (rather than individual fields). Add a new setting to control visibility of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC. * Modules/mediasource/VideoPlaybackQuality.cpp: (WebCore::VideoPlaybackQuality::create): (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): * Modules/mediasource/VideoPlaybackQuality.h: (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const): * Modules/mediasource/VideoPlaybackQuality.idl: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::getVideoPlaybackQuality): * html/HTMLMediaElement.h: * html/HTMLMediaElement.idl: * page/Settings.yaml: * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): 2018-10-05 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r236866. Breaks internal builds. Reverted changeset: "Add support for reporting "display composited video frames" through the VideoPlaybackQuality object." https://bugs.webkit.org/show_bug.cgi?id=190266 https://trac.webkit.org/changeset/236866 2018-10-05 Antoine Quint <graouts@apple.com> [Web Animations] REGRESSION (r236809): crash under AnimationTimeline::updateCSSAnimationsForElement() https://bugs.webkit.org/show_bug.cgi?id=190307 <rdar://problem/45009901> Reviewed by Dean Jackson. We could crash with an invalid access to cssAnimationsByName since cancelOrRemoveDeclarativeAnimation() already does the job of clearing the m_elementToCSSAnimationByName entry for this particular element if there are no animations targeting it anymore. This started happening in r236809 when we switched from a simple call to to cancel() to a call to cancelOrRemoveDeclarativeAnimation(). We can safely remove the removal here since cancelOrRemoveDeclarativeAnimation() will already have performed this task safely if needed. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::updateCSSAnimationsForElement): 2018-10-04 Jer Noble <jer.noble@apple.com> Add support for reporting "display composited video frames" through the VideoPlaybackQuality object. https://bugs.webkit.org/show_bug.cgi?id=190266 Reviewed by Eric Carlson. Test: TestWebKitAPI.VideoQualityDisplayCompositing Modify VideoPlaybackQuality to take a VideoPlaybackQualityMetrics object in its constructor (rather than individual fields). Add a new setting to control visibility of the displayCompositedVideoFrames attribute on VideoPlaybackQuality. Add support for VideoPlaybackQualityMetrics to MediaPlayerPrivateAVFoundationObjC. * Modules/mediasource/VideoPlaybackQuality.cpp: (WebCore::VideoPlaybackQuality::create): (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): * Modules/mediasource/VideoPlaybackQuality.h: (WebCore::VideoPlaybackQuality::displayCompositedVideoFrames const): * Modules/mediasource/VideoPlaybackQuality.idl: * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::getVideoPlaybackQuality): * html/HTMLMediaElement.h: * html/HTMLMediaElement.idl: * page/Settings.yaml: * platform/graphics/MediaPlayer.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::videoPlaybackQualityMetrics): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics): * platform/mock/mediasource/MockMediaSourcePrivate.cpp: (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): 2018-10-04 Chris Dumez <cdumez@apple.com> A Document / Window should lose its browsing context as soon as its iframe is removed from the document https://bugs.webkit.org/show_bug.cgi?id=190282 Reviewed by Ryosuke Niwa. A Document / Window should lose its browsing context (aka Frame) as soon as its iframe is removed from the document. In WebKit, a Document / Window's Frame was only getting nulled out when the frame gets destroyed, which happens later usually after a GC happens. Specification: - https://html.spec.whatwg.org/#the-iframe-element """ When an iframe element is removed from a document, the user agent must discard the element's nested browsing context, if it is not null, and then set the element's nested browsing context to null. """ This was not consistent with the specification or other browsers (tested Chrome and Firefox) so this patch is aligning our behavior. In a follow-up, I am planning to look into making the Window not be a FrameDestructionObserver, and instead get its frame from the Document. This should make the code simpler. No new tests, rebaselined existing tests. * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::getUserMedia const): * Modules/mediastream/MediaDevices.h: Update getUserMedia() to reject a the Promise with an InvalidStateError when calling after the document has been detached, instead of throwing an InvalidStateError. This behavior is as per specification: - https://w3c.github.io/mediacapture-main/#dom-mediadevices-getusermedia (Step 4) I needed to make this change to keep one of our layout tests passing. * dom/Document.cpp: (WebCore::Document::attachToCachedFrame): (WebCore::Document::detachFromFrame): * dom/Document.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::didSecureTransitionTo): (WebCore::DOMWindow::willDetachDocumentFromFrame): (WebCore::DOMWindow::setStatus): (WebCore::DOMWindow::detachFromFrame): (WebCore::DOMWindow::attachToFrame): * page/DOMWindow.h: * page/DOMWindowProperty.cpp: (WebCore::DOMWindowProperty::disconnectFrameForDocumentSuspension): (WebCore::DOMWindowProperty::willDestroyGlobalObjectInCachedFrame): (WebCore::DOMWindowProperty::willDestroyGlobalObjectInFrame): * page/Frame.cpp: (WebCore::Frame::disconnectOwnerElement): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::drawText): Calling drawText() with a null String hits an assertion in debug. This was triggered by one of our layout tests so I made sure we only call drawText when the String is not null. 2018-10-04 Jeremy Jones <jeremyj@apple.com> Unify implementation in VideoFullscreenInterfaceAVKit https://bugs.webkit.org/show_bug.cgi?id=190091 rdar://problem/44734523 Reviewed by Jer Noble. No new tests because no behavior change. Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include any changes that had been made in the old path. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]): (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen): (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::requestUpdateInlineRect): (VideoFullscreenControllerContext::requestVideoContentLayer): (VideoFullscreenControllerContext::returnVideoContentLayer): (VideoFullscreenControllerContext::didSetupFullscreen): (VideoFullscreenControllerContext::didExitFullscreen): 2018-10-04 Justin Michaud <justin_michaud@apple.com> Bindings generator should support static attributes that are interfaces with CallWith https://bugs.webkit.org/show_bug.cgi?id=190292 Reviewed by Chris Dumez. Add support for static attributes that support callWith to the bindings generator. This is needed for CSS.paintWorklet. * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::jsTestObjConstructorTestStaticReadonlyObjGetter): (WebCore::jsTestObjConstructorTestStaticReadonlyObj): * bindings/scripts/test/TestObj.idl: 2018-10-04 Matt Lewis <jlewis3@apple.com> Unreviewed, rolling out r236730. This caused a consistent crash in test http/tests/media/media-stream/get-display-media-prompt.html. Reverted changeset: "[MediaStream] RealtimeMediaSource should be able to vend hashed IDs" https://bugs.webkit.org/show_bug.cgi?id=190142 https://trac.webkit.org/changeset/236730 2018-10-04 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] Fix some font attribute conversion bugs in preparation for "Font > Styles…" support in WebKit2 https://bugs.webkit.org/show_bug.cgi?id=190289 <rdar://problem/45020806> Reviewed by Ryosuke Niwa. Makes some small adjustments to fix two bugs in font attribute conversion logic. See below for more detail. Tests: FontManagerTests.AddFontShadowUsingFontOptions FontManagerTests.AddAndRemoveColorsUsingFontOptions * editing/FontAttributeChanges.cpp: (WebCore::cssValueListForShadow): * editing/cocoa/FontAttributesCocoa.mm: Currently, we bail from adding a font shadow if the shadow's offset is empty. However, valid shadow offsets may have negative dimensions, so a check for `isZero()` should be used instead. (WebCore::FontAttributes::createDictionary const): * platform/mac/WebCoreNSFontManagerExtras.mm: Fall back to a transparent background color; this allows senders to remove the current background color by just removing NSBackgroundColorAttributeName from the attribute dictionary, rather than explicitly setting it to the transparent color (this scenario is exercised when using "Font > Styles…" to specify a font style without a background color). (WebCore::computedFontAttributeChanges): 2018-10-03 Ryosuke Niwa <rniwa@webkit.org> MutationRecord doesn't keep JS wrappers of target, addedNodes, and removedNodes alive https://bugs.webkit.org/show_bug.cgi?id=190277 Reviewed by Antti Koivisto. The bug was caused by JSMutationRecord not visiting any of the nodes referenced by mutation records. Fixed the bug by adding JSMutationRecord::visitAdditionalChildren, which adds the root nodes of the root nodes of the target, addedNodes, and removedNodes in each mutation record. Test: fast/dom/MutationObserver/mutation-record-keeps-js-wrappers-of-nodes-alive.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSMutationRecordCustom.cpp: Added. (WebCore::JSMutationRecord::visitAdditionalChildren): Added. * bindings/js/JSPerformanceObserverCustom.cpp: This file got dumped out of a unified build file where using namespace JSC was defined. Use the fully qualified names to refer to JSC types. (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots): * dom/MutationRecord.cpp: (WebCore::ChildListRecord::visitNodesConcurrently): Added. (WebCore::RecordWithEmptyNodeLists::visitNodesConcurrently): Added. (WebCore::MutationRecordWithNullOldValue::visitNodesConcurrently): Added. * dom/MutationRecord.h: * dom/MutationRecord.idl: 2018-10-04 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Move time out control from WebProcess to UIProcess https://bugs.webkit.org/show_bug.cgi?id=189642 <rdar://problem/44476765> Reviewed by Chris Dumez. Since now the control unit of WebAuthN has been moved to UI Process, i.e. AuthenticatorManager, the time out timer should move to UI Process as well. Tests: http/wpt/webauthn/public-key-credential-create-failure-local-silent.https.html http/wpt/webauthn/public-key-credential-get-failure-local-silent.https.html * Modules/webauthn/AuthenticatorCoordinator.cpp: (WebCore::AuthenticatorCoordinator::create const): (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const): (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer): Deleted. (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire): Deleted. * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::encode const): (WebCore::PublicKeyCredentialCreationOptions::decode): * Modules/webauthn/PublicKeyCredentialRequestOptions.h: (WebCore::PublicKeyCredentialRequestOptions::encode const): (WebCore::PublicKeyCredentialRequestOptions::decode): 2018-10-04 Chris Dumez <cdumez@apple.com> Regression(r236779): Crash when changing the input element type from inside an 'input' event listener https://bugs.webkit.org/show_bug.cgi?id=190252 Reviewed by Alex Christensen. Add a null check for element() after firing the 'input' event and before firing the 'change' event in case the input event listener changes the input type. Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html fast/dom/HTMLInputElement/change-type-in-input-event-listener.html * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::fireInputAndChangeEvents): 2018-10-04 Yuhan Wu <yuhan_wu@apple.com> runtime flag and IDL for MediaRecorder https://bugs.webkit.org/show_bug.cgi?id=190018 Reviewed by Youenn Fablet and Chris Dumez. Covered by tests: imported/w3c/web-platform-tests/mediacapture-record/MediaRecorder-constructor.html imported/w3c/web-platform-tests/mediacapture-record/BlobEvent-constructor.html Add an architecture of the IDL and the class for MediaRecorder and BlobEvent. * CMakeLists.txt: * DerivedSources.make: * Modules/mediarecorder/BlobEvent.h: (WebCore::BlobEvent::create): (WebCore::BlobEvent:::Event): * Modules/mediarecorder/BlobEvent.idl: * Modules/mediarecorder/MediaRecorder.cpp: (WebCore::MediaRecorder::create): (WebCore::MediaRecorder::MediaRecorder): (WebCore::MediaRecorder::activeDOMObjectName const): (WebCore::MediaRecorder::canSuspendForDocumentSuspension const): * Modules/mediarecorder/MediaRecorder.h: Added. (WebCore::MediaRecorder::state const): (WebCore::MediaRecorder::~MediaRecorder): * Modules/mediarecorder/MediaRecorder.idl: * Modules/mediastream/RTCRtpReceiver.cpp: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/WebCoreBuiltinNames.h: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::mediaRecorderEnabled const): (WebCore::RuntimeEnabledFeatures::setMediaRecorderEnabled): 2018-10-04 Chris Dumez <cdumez@apple.com> Unreviewed, rolling out r236803. Caused crashes on some bots Reverted changeset: "Regression(r236779): Crash when changing the input element type from inside an 'input' event listener" https://bugs.webkit.org/show_bug.cgi?id=190252 https://trac.webkit.org/changeset/236803 2018-10-04 Dan Bernstein <mitz@apple.com> Tried to fix the Mojave build after r236832. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): 2018-10-04 Michael Catanzaro <mcatanzaro@igalia.com> ENABLE(ASSERT) used in grid code when !ASSERT_DISABLED is desired https://bugs.webkit.org/show_bug.cgi?id=190145 Reviewed by Javier Fernandez. Replace ENABLE(ASSERT), which doesn't exist, with !ASSERT_DISABLED. * rendering/RenderGrid.cpp: (WebCore::RenderGrid::placeItemsOnGrid const): (WebCore::RenderGrid::baselinePosition const): * rendering/style/GridArea.h: (WebCore::GridSpan::GridSpan): 2018-10-04 Dan Bernstein <mitz@apple.com> WebCore part of [Xcode] Update some build settings as recommended by Xcode 10 https://bugs.webkit.org/show_bug.cgi?id=190250 Reviewed by Andy Estes. * Configurations/Base.xcconfig: Enabled CLANG_WARN_COMMA, CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF, CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED, and CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS. * WebCore.xcodeproj/project.pbxproj: Let Xcode update LastUpgradeCheck and remove a duplicate reference in a Compile Sources build phase. * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: Suppress -Wdeprecated-implementations around implementations of deprecated accessibility methods. * loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::checkForBOM): Addressed CLANG_WARN_COMMA. * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveAuthenticationChallenge:]): Suppress -Wdeprecated-implementations around implementations of this deprecated delegate method. (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): Ditto. 2018-10-02 Darin Adler <darin@apple.com> AudioNode.connect should use [ReturnValue] https://bugs.webkit.org/show_bug.cgi?id=190231 Reviewed by Eric Carlson. This is a slightly more efficient way to return a value that is always identical to one of the arguments, so use it here. * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::connect): Return ExceptionOr<void>. * Modules/webaudio/AudioBasicInspectorNode.h: Ditto. * Modules/webaudio/AudioNode.cpp: (WebCore::AudioNode::connect): Ditto. * Modules/webaudio/AudioNode.h: Ditto. * Modules/webaudio/AudioNode.idl: Use [ReturnValue]. 2018-10-03 Justin Michaud <justin_michaud@apple.com> Registered custom properties should allow inheritance to be controlled https://bugs.webkit.org/show_bug.cgi?id=190038 Reviewed by Antti Koivisto. Tests: css-custom-properties-api/inherits.html css-custom-properties-api/length.html css-custom-properties-api/length2.html Add support for inherits property on registered css custom properties, as well as a starting point for evaluating registered custom properties with types. Registered custom properties are evaluated as length values before being substituted. Currently, relative unit cycles are not detected. A proper solution is still needed to resolve relative unit cycles, and to apply properties like font and line-height before they are needed by custom properties. In this patch, the font-size property is applied twice, once before and once after resolving custom property values. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): (WebCore::CSSComputedStyleDeclaration::length const): (WebCore::CSSComputedStyleDeclaration::item const): Allow JS to get custom properties that have been resolved to a length. Also add properties from m_rareNonInheritedData. * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::checkVariablesForCycles const): (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.cpp: Copied from Source/WebCore/css/CSSRegisteredCustomProperty.h. (WebCore::CSSRegisteredCustomProperty::CSSRegisteredCustomProperty): (WebCore::CSSRegisteredCustomProperty::initialValueCopy const): * css/CSSRegisteredCustomProperty.h: (WebCore::CSSRegisteredCustomProperty::initialValue const): * css/CSSVariableData.cpp: (WebCore::CSSVariableData::checkVariablesForCycles const): (WebCore::CSSVariableData::checkVariablesForCyclesWithRange const): (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/CSSVariableReferenceValue.cpp: (WebCore::CSSVariableReferenceValue::checkVariablesForCycles const): * css/CSSVariableReferenceValue.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): Use RenderStyle over passing in a customProperties map. * css/StyleBuilder.h: * css/StyleBuilderConverter.h: (WebCore::StyleBuilderConverter::convertLength): (WebCore::StyleBuilderConverter::convertLengthOrAuto): (WebCore::StyleBuilderConverter::convertLengthSizing): (WebCore::StyleBuilderConverter::convertLengthMaxSizing): * css/StyleBuilderCustom.h: (WebCore::StyleBuilderCustom::applyInitialCustomProperty): (WebCore::StyleBuilderCustom::applyInheritCustomProperty): (WebCore::StyleBuilderCustom::applyValueCustomProperty): * css/StyleResolver.cpp: (WebCore::StyleResolver::useSVGZoomRules const): (WebCore::StyleResolver::useSVGZoomRulesForLength const): (WebCore::StyleResolver::applyProperty): (WebCore::StyleResolver::resolvedVariableValue const): (WebCore::StyleResolver::applyCascadedProperties): (WebCore::StyleResolver::useSVGZoomRules): Deleted. (WebCore::StyleResolver::useSVGZoomRulesForLength): Deleted. (WebCore::StyleResolver::resolvedVariableValue): Deleted. * css/StyleResolver.h: * css/makeprop.pl: Move custom property initial values to StyleBuilerCustom. Hook them up to correctly deal with inheritance, unset and revert values. * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * css/parser/CSSParserContext.cpp: (WebCore::CSSParserContext::CSSParserContext): * css/parser/CSSParserContext.h: * css/parser/CSSPropertyParser.cpp: (WebCore::CSSPropertyParser::parseSingleValue): Allow parsing custom property values as lengths. * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: (WebCore::RenderStyle::inheritedCustomProperties const): (WebCore::RenderStyle::nonInheritedCustomProperties const): (WebCore::RenderStyle::setInheritedCustomPropertyValue): (WebCore::RenderStyle::setNonInheritedCustomPropertyValue): (WebCore::RenderStyle::getCustomProperty const): (WebCore::RenderStyle::customProperties const): Deleted. (WebCore::RenderStyle::setCustomPropertyValue): Deleted. * rendering/style/StyleRareNonInheritedData.cpp: (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData): (WebCore::StyleRareNonInheritedData::operator== const): * rendering/style/StyleRareNonInheritedData.h: * style/StyleResolveForDocument.cpp: (WebCore::Style::resolveForDocument): Add support for RenderStyle to deal with both inherited and non-inherited properties, and to find cycles between them. 2018-10-03 Ryosuke Niwa <rniwa@webkit.org> Clear m_pendingTargets in MutationObserver::takeRecords https://bugs.webkit.org/show_bug.cgi?id=190240 Reviewed by Geoffrey Garen. In r236781, we delayed the clearing of m_pendingTargets until the end of microtask to avoid a race between mutation record's JS wrappers getting created and GC marking JS wrappers of elements in mutation records. This patch shortens this delay to until mutation record's JS wrappers are created. Specifically, we make MutationObserver::takeRecords() return a struct which has both pending targets hash set and the vector of mutation records so that the hash set survives through the creation of JS wrappers for mutation records. To do this, a new IDL extended attribute "ResultField" is introduced to specify the member variable in which the result is stored. No new tests. Unfortunately, this race condition appears to be impossible to capture in a regression test. * bindings/scripts/CodeGeneratorJS.pm: (GenerateOperationBodyDefinition): * bindings/scripts/IDLAttributes.json: * bindings/scripts/test/JS/JSTestInterface.cpp: (WebCore::jsTestInterfacePrototypeFunctionTakeNodesBody): (WebCore::jsTestInterfacePrototypeFunctionTakeNodes): * bindings/scripts/test/TestImplements.idl: Added a test case. * dom/MutationObserver.cpp: (WebCore::MutationObserver::takeRecords): (WebCore::MutationObserver::deliver): * dom/MutationObserver.h: * dom/MutationObserver.idl: 2018-10-03 Youenn Fablet <youenn@apple.com> Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. 2018-09-28 Jiewen Tan <jiewen_tan@apple.com> [WebCrypto] ECDSA could not deal with invalid signature inputs https://bugs.webkit.org/show_bug.cgi?id=189879 <rdar://problem/44701276> Reviewed by Brent Fulgham. Add some guards over detections of the start positions of r/s. Covered by improved existing tests. * crypto/mac/CryptoAlgorithmECDSAMac.cpp: (WebCore::verifyECDSA): 2018-10-03 Jer Noble <jer.noble@apple.com> Add a quirk to disable Modern EME for sites which are broken with it enabled https://bugs.webkit.org/show_bug.cgi?id=190051 Reviewed by Daniel Bates. Add a new class, parallel to Settings, to track quirk behavior. Extend the bindings generator to support a DisabledByQuirk attribute, and set this attribute for all the Modern EME types. Check whether the quirk is set inside HTMLMediaElement in addition to the existing Setting. * Modules/encryptedmedia/MediaKeyMessageEvent.idl: * Modules/encryptedmedia/MediaKeySession.idl: * Modules/encryptedmedia/MediaKeyStatusMap.idl: * Modules/encryptedmedia/MediaKeySystemAccess.idl: * Modules/encryptedmedia/MediaKeys.idl: * Modules/encryptedmedia/NavigatorEME.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/scripts/CodeGenerator.pm: (WK_ucfirst): * bindings/scripts/CodeGeneratorJS.pm: (NeedsRuntimeCheck): (GenerateRuntimeEnableConditionalString): * bindings/scripts/IDLAttributes.json: * bindings/scripts/preprocess-idls.pl: (GenerateConstructorAttributes): * dom/Document.cpp: (WebCore::Document::Document): * dom/Document.h: (WebCore::Document::quirks const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerKeyNeeded): (WebCore::HTMLMediaElement::mediaPlayerInitializationDataEncountered): * html/HTMLMediaElement.idl: * page/Quirks.cpp: Added. (Quirks::Quirks): (Quirks::disableEncryptedMediaAPIQuirk const): * page/Quirks.h: Added. 2018-10-03 Antoine Quint <graouts@apple.com> [Web Animations] REGRESSION: setting 'animation-name: none' after a 'fill: forwards' animation has completed does not revert to the unanimated style https://bugs.webkit.org/show_bug.cgi?id=190257 <rdar://problem/41341473> Reviewed by Dean Jackson. Test: animations/animation-fill-forwards-removal.html While we removed a declarative animation that was no longer targetting its element, we were not removing it from the declarative animation maps on the timeline, which means that the animation would still be picked up when resolving styles. We now notify the timeline that the animation was detached from the element. This preserves the DeclarativeAnimation relationship returning the element as its effect's target and the document timeline as its timeline, but the document timeline will no longer see this animation as targeting this element. * animation/AnimationTimeline.cpp: (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation): * animation/DeclarativeAnimation.h: (WebCore::DeclarativeAnimation::target const): 2018-10-03 Jer Noble <jer.noble@apple.com> CRASH in CVPixelBufferGetBytePointerCallback() https://bugs.webkit.org/show_bug.cgi?id=190092 Reviewed by Eric Carlson. Speculative fix for crash that occurs when callers of CVPixelBufferGetBytePointerCallback() attempt to read the last byte of a CVPixelBuffer (as a pre-flight check) and crash due to a memory access error. It's speculated that mismatching CVPixelBufferLockBytePointer / CVPixelBufferUnlockBytePointer calls could result in an incorrect state inside the CVPixelBuffer. Add log count checks, locking, and release logging to try to pinpoint if mismatch lock counts are occurring in this code path. * platform/graphics/cv/PixelBufferConformerCV.cpp: (WebCore::CVPixelBufferGetBytePointerCallback): (WebCore::CVPixelBufferReleaseBytePointerCallback): (WebCore::CVPixelBufferReleaseInfoCallback): (WebCore::PixelBufferConformerCV::createImageFromPixelBuffer): 2018-10-03 Chris Dumez <cdumez@apple.com> Regression(r236779): Crash when changing the input element type from inside an 'input' event listener https://bugs.webkit.org/show_bug.cgi?id=190252 Reviewed by Alex Christensen. Add a null check for element() after firing the 'input' event and before firing the 'change' event in case the input event listener changes the input type. Tests: fast/dom/HTMLInputElement/change-type-in-click-event-listener.html fast/dom/HTMLInputElement/change-type-in-input-event-listener.html * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::fireInputAndChangeEvents): 2018-10-03 Chris Dumez <cdumez@apple.com> Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener https://bugs.webkit.org/show_bug.cgi?id=190251 Reviewed by Alex Christensen. Passing noopener=NOOPENER to window.open() should cause the new window to not have an opener, similarly to noopener=1: - https://html.spec.whatwg.org/#window-open-steps (step 5) It does not matter what the value is, if there is a key named "noopener", then the new window should not have an opener. No new tests, rebaselined existing test. * page/WindowFeatures.cpp: (WebCore::setWindowFeature): 2018-10-03 Ryosuke Niwa <rniwa@webkit.org> GC can collect JS wrappers of nodes in the mutation records waiting to be delivered https://bugs.webkit.org/show_bug.cgi?id=190115 Reviewed by Geoffrey Garen. Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef. This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's target is kept alive and MutationObserverRegistration where each node which had been removed from an observed tree is kept alive for a subtree observation. No new test since the test which can reproduce this problem is too slow. * dom/GCReachableRef.h: (WebCore::GCReachableRef): Made it work with hash table. (WebCore::GCReachableRef::operator T& const): (WebCore::GCReachableRef::GCReachableRef): (WebCore::GCReachableRef::isHashTableDeletedValue const): (WebCore::GCReachableRef::isHashTableEmptyValue const): (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const): (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue): (WebCore::GCReachableRef::assignToHashTableEmptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty): (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek): (WTF::HashTraits<WebCore::GCReachableRef<P>>::take): * dom/MutationObserver.cpp: (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers to be collected before elements in mutation records are accessed. We delay until the end of the current microtask at which point deliver() function is called. (WebCore::MutationObserver::disconnect): (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive. This is needed for a newly inserted node, a node with attribute change, etc... (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation records are delivered to each observer. These are nodes which had been removed from a tree and whose subtree had still been obsreved up until this point. * dom/MutationObserver.h: * dom/MutationObserverRegistration.cpp: (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach): (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver function had been called. (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const): * dom/MutationObserverRegistration.h: 2018-10-03 Dean Jackson <dino@apple.com> Make the Pointer Events feature description valid https://bugs.webkit.org/show_bug.cgi?id=190254 Reviewed by Simon Fraser. * features.json: 2018-10-03 Matt Lewis <jlewis3@apple.com> Unreviewed, rolling out r236781. The test added with this commit is timing out consistently. Reverted changeset: "GC can collect JS wrappers of nodes in the mutation records waiting to be delivered" https://bugs.webkit.org/show_bug.cgi?id=190115 https://trac.webkit.org/changeset/236781 2018-10-03 Dean Jackson <dino@apple.com> [macOS] Switching to discrete GPU should be done in the UI process https://bugs.webkit.org/show_bug.cgi?id=189361 <rdar://problem/43949622> Try to fix the IOSMAC build. * platform/graphics/GraphicsContext3D.h: 2018-10-03 Chris Dumez <cdumez@apple.com> input.checked is incorrect while we're parsing its children https://bugs.webkit.org/show_bug.cgi?id=190227 Reviewed by Ryosuke Niwa. input.checked was incorrect while we're parsing its children because we were delaying updating the checked state until HTMLInputElement::finishParsingChildren() is called, to avoid a bad interaction with form state restoration. In this patch, we update the checked state as soon as the 'checked' attribute is set, when we know that no form state to restore. fast/forms/radio/state-restore-radio-group.html covers the form restoration case and is still passing. No new tests, rebaselined existing test. * html/FormController.cpp: (WebCore::FormController::hasFormStateToRestore const): * html/FormController.h: * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::parseAttribute): 2018-10-03 Miguel Gomez <magomez@igalia.com> [GTK][WPE] Incorrect rendering of layers whose backingStore hasn't changed https://bugs.webkit.org/show_bug.cgi?id=190249 Reviewed by Žan Doberšek. Do not overwrite m_nicosia.performLayerSync when updating the content buffers or we lose the value calculated during the layer flush. Use an OR instead to keep the old value. * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::CoordinatedGraphicsLayer::updateContentBuffers): 2018-10-03 Youenn Fablet <youenn@apple.com> Enable H264 simulcast https://bugs.webkit.org/show_bug.cgi?id=190167 Reviewed by Eric Carlson. Activate H264 simulcast trial field. Make track.getSettings() expose width and height for incoming tracks. Test: webrtc/simulcast-h264.html * Configurations/WebCore.xcconfig: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint): * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): 2018-10-03 Michael Catanzaro <mcatanzaro@igalia.com> -Wunused-variable in RenderLayer::updateScrollableAreaSet https://bugs.webkit.org/show_bug.cgi?id=190200 Reviewed by Yusuke Suzuki. Pass it through UNUSED_VARIABLE(). * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): 2018-10-03 Zan Dobersek <zdobersek@igalia.com> Ref<FetchResponse> use-after-move in DOMCache::put() https://bugs.webkit.org/show_bug.cgi?id=190239 Reviewed by Youenn Fablet. Retrieve reference from the Ref<FetchResponse> object before it's move-captured in the lambda that's passed to the FetchResponse::consumeBodyReceivedByChunk() method that is invoked on that very same object. This is a classic use-after-move bug that pops up on compilers with different C++ calling convention. * Modules/cache/DOMCache.cpp: (WebCore::DOMCache::put): 2018-10-03 Ryosuke Niwa <rniwa@webkit.org> Enable selectionAcrossShadowBoundariesEnabled by default in WebKitLegacy https://bugs.webkit.org/show_bug.cgi?id=190238 Reviewed by Antti Koivisto. Enable the feature by default. * page/Settings.yaml: 2018-10-02 Ryosuke Niwa <rniwa@webkit.org> Copying content with shadow DOM doesn't copy any contents https://bugs.webkit.org/show_bug.cgi?id=157443 Reviewed by Wenson Hsieh. This patch adds the support for copying and pasting content across shadow boundaries in HTML and plain text, which is enabled whenever selection across shadow boundaries is enabled. To do this, TextIterator now has a constructor which takes two Positions, and the node traversal code in StyledMarkupAccumulator has been abstracted via helper functions as done for TextIterator. When serializing a HTMl slot element, serialize it as a span with "display: contents" to make sure when the content is pasted into a shadow tree, it wouldn't affect the slot assignment of the shadow tree. Tests: editing/pasteboard/copy-paste-across-shadow-boundaries-1.html editing/pasteboard/copy-paste-across-shadow-boundaries-2.html editing/pasteboard/copy-paste-across-shadow-boundaries-3.html editing/pasteboard/copy-paste-across-shadow-boundaries-4.html editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-1.html editing/pasteboard/copy-paste-across-shadow-boundaries-with-style-2.html editing/pasteboard/copy-paste-with-shadow-content.html * dom/ComposedTreeIterator.h: (WebCore::assignedSlotIgnoringUserAgentShadow): Moved from TextIterator.cpp. (WebCore::shadowRootIgnoringUserAgentShadow): Ditto. (WebCore::firstChildInComposedTreeIgnoringUserAgentShadow): Ditto. (WebCore::nextSiblingInComposedTreeIgnoringUserAgentShadow): Ditto. * dom/Position.h: (WebCore::Position::treeScope const): Added. * editing/EditingStyle.cpp: (WebCore::EditingStyle::addDisplayContents): Added. * editing/EditingStyle.h: * editing/Editor.cpp: (WebCore::Editor::selectedText const): Use the new behavior when selectionAcrossShadowBoundariesEnabled is set. (WebCore::Editor::selectedTextForDataTransfer const): Ditto. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::appendEndElement): Renamed from appendEndTag. Now takes StringBuilder. * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::appendEndTag): * editing/TextIterator.cpp: (WebCore::TextIterator::TextIterator): Added a new variant which takes two positions. (WebCore::TextIterator::init): (WebCore::firstChild): (WebCore::nextSibling): (WebCore::plainText): Ditto. * editing/TextIterator.h: * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::selectionInHTMLFormat): Use the new behavior if selectionAcrossShadowBoundariesEnabled is set. * editing/gtk/EditorGtk.cpp: (WebCore::Editor::writeSelectionToPasteboard): Ditto. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::parentNode): Added. (WebCore::StyledMarkupAccumulator::firstChild): Added. (WebCore::StyledMarkupAccumulator::nextSibling): Added. (WebCore::StyledMarkupAccumulator::nextSkippingChildren): Added. (WebCore::StyledMarkupAccumulator::hasChildNodes): Added. (WebCore::StyledMarkupAccumulator::isDescendantOf): Added. (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): (WebCore::StyledMarkupAccumulator::appendElement): Serialize a slot element as a span with display: contents. (WebCore::StyledMarkupAccumulator::appendEndElement): Added. Ditto. (WebCore::StyledMarkupAccumulator::serializeNodes): (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): Use the newly added helper functions to traverse the composed tree when m_useComposedTree is set. (WebCore::commonShadowIncludingAncestor): Added. (WebCore::serializePreservingVisualAppearanceInternal): Added SerializeComposedTree as an argument. Also use StyledMarkupAccumulator::parentNode to serialize special common ancestors; e.g. to preserve b, i, etc... (WebCore::serializePreservingVisualAppearance): Ditto to the variant which takes VisibleSelection. (WebCore::sanitizedMarkupForFragmentInDocument): * editing/markup.h: * editing/wpe/EditorWPE.cpp: (WebCore::Editor::writeSelectionToPasteboard): * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::createFromSelection): * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::appendEndElement): * testing/Internals.cpp: (WebCore::Internals::setSelectionWithoutValidation): Added. A helper function to create a selection across shadow boundaries for testing purposes. * testing/Internals.h: * testing/Internals.idl: 2018-10-02 Chris Dumez <cdumez@apple.com> MessageEvent.ports should return the same object https://bugs.webkit.org/show_bug.cgi?id=190151 Reviewed by Darin Adler. MessageEvent.ports should return the same object it was initialized to instead of constructing a new JSValue every time. No new tests, rebaselined existing test. * bindings/js/JSMessageEventCustom.cpp: (WebCore::JSMessageEvent::ports const): (WebCore::JSMessageEvent::visitAdditionalChildren): * dom/MessageEvent.cpp: (WebCore::MessageEvent::initMessageEvent): * dom/MessageEvent.h: * dom/MessageEvent.idl: 2018-10-01 Ryosuke Niwa <rniwa@webkit.org> GC can collect JS wrappers of nodes in the mutation records waiting to be delivered https://bugs.webkit.org/show_bug.cgi?id=190115 Reviewed by Geoffrey Garen. Fixed the bug by retaining JS wrappers of elements in mutation records using GCReachableRef. This patch deploys GCReachableRef in two places: MutationObserver where each mutation record's target is kept alive and MutationObserverRegistration where each node which had been removed from an observed tree is kept alive for a subtree observation. Test: fast/dom/MutationObserver/mutation-observer-retains-js-wrappers-of-targets-alive.html * dom/GCReachableRef.h: (WebCore::GCReachableRef): Made it work with hash table. (WebCore::GCReachableRef::operator T& const): (WebCore::GCReachableRef::GCReachableRef): (WebCore::GCReachableRef::isHashTableDeletedValue const): (WebCore::GCReachableRef::isHashTableEmptyValue const): (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue const): (WebCore::GCReachableRef::ptrAllowingHashTableEmptyValue): (WebCore::GCReachableRef::assignToHashTableEmptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::emptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::constructEmptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::isEmptyValue): (WTF::HashTraits<WebCore::GCReachableRef<P>>::assignToEmpty): (WTF::HashTraits<WebCore::GCReachableRef<P>>::peek): (WTF::HashTraits<WebCore::GCReachableRef<P>>::take): * dom/MutationObserver.cpp: (WebCore::MutationObserver::takeRecords): Don't clear m_pendingTargets because that would allow wrappers to be collected before elements in mutation records are accessed. We delay until the end of the current microtask at which point deliver() function is called. (WebCore::MutationObserver::disconnect): (WebCore::MutationObserver::enqueueMutationRecord): Add the target to the list of elements to keep alive. This is needed for a newly inserted node, a node with attribute change, etc... (WebCore::MutationObserver::deliver): Keep the set of transient registration targets alive until mutation records are delivered to each observer. These are nodes which had been removed from a tree and whose subtree had still been obsreved up until this point. * dom/MutationObserver.h: * dom/MutationObserverRegistration.cpp: (WebCore::MutationObserverRegistration::observedSubtreeNodeWillDetach): (WebCore::MutationObserverRegistration::takeTransientRegistrations): Return the hash set of elemenets that need to be kept alive so that MutationObserver::deliver can keep them alive until the deliver function had been called. (WebCore::MutationObserverRegistration::addRegistrationNodesToSet const): * dom/MutationObserverRegistration.h: 2018-10-02 Chris Dumez <cdumez@apple.com> radio / checkbox inputs should fire "click, input, change" events in order when clicked https://bugs.webkit.org/show_bug.cgi?id=190223 Reviewed by Ryosuke Niwa. radio / checkbox inputs should fire "click, input, change" events in order when clicked: - https://html.spec.whatwg.org/#radio-button-state-(type=radio) - https://html.spec.whatwg.org/#checkbox-state-(type=checkbox) - https://dom.spec.whatwg.org/#ref-for-eventtarget-activation-behavior③ (step 11) Gecko and Blink already behave this way. However, WebKit has the following issues: - the input event is not fired - the click event is fired after the change event No new tests, updated / rebaselined existing tests. * html/BaseCheckableInputType.cpp: (WebCore::BaseCheckableInputType::fireInputAndChangeEvents): * html/BaseCheckableInputType.h: * html/CheckboxInputType.cpp: (WebCore::CheckboxInputType::willDispatchClick): (WebCore::CheckboxInputType::didDispatchClick): * html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::setChecked): * html/HTMLInputElement.h: * html/RadioInputType.cpp: (WebCore::RadioInputType::willDispatchClick): (WebCore::RadioInputType::didDispatchClick): 2018-10-02 Chris Dumez <cdumez@apple.com> fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection https://bugs.webkit.org/show_bug.cgi?id=190218 Reviewed by Alex Christensen. fieldset.elements should return an HTMLCollection instead of an HTMLFormControlsCollection: - https://github.com/whatwg/html/commit/8beedf0c2ffd38853caddec67490288f47afc8eb Gecko has always behaved this way. Blink aligned with Gecko and the HTML specification in December 2016: - https://bugs.chromium.org/p/chromium/issues/detail?id=665291 This simplifies our HTMLFieldSetElement code a lot. Test: fast/forms/fieldset/fieldset-elements-htmlcollection.html * html/CollectionType.h: * html/GenericCachedHTMLCollection.cpp: (WebCore::GenericCachedHTMLCollection<traversalType>::elementMatches const): * html/HTMLCollection.cpp: (WebCore::HTMLCollection::rootTypeFromCollectionType): (WebCore::invalidationTypeExcludingIdAndNameAttributes): * html/HTMLFieldSetElement.cpp: (WebCore::HTMLFieldSetElement::elements): * html/HTMLFieldSetElement.h: * html/HTMLFieldSetElement.idl: * html/HTMLFormControlsCollection.cpp: (WebCore::HTMLFormControlsCollection::HTMLFormControlsCollection): (WebCore:: const): (WebCore::HTMLFormControlsCollection::copyFormControlElementsVector const): (WebCore::HTMLFormControlsCollection::ownerNode const): (WebCore::HTMLFormControlsCollection::updateNamedElementCache const): * html/HTMLFormControlsCollection.h: 2018-10-02 Devin Rousso <drousso@apple.com> Web Inspector: prevent layer events from firing until the layer information is re-requested https://bugs.webkit.org/show_bug.cgi?id=190159 Reviewed by Joseph Pecoraro. Test: inspector/layers/layerTreeDidChange.html * inspector/agents/InspectorLayerTreeAgent.h: * inspector/agents/InspectorLayerTreeAgent.cpp: (WebCore::InspectorLayerTreeAgent::reset): (WebCore::InspectorLayerTreeAgent::layerTreeDidChange): (WebCore::InspectorLayerTreeAgent::layersForNode): 2018-10-02 Brian Burg <bburg@apple.com> Web Automation: tab default key handler should always cycle focus when page is controlled by automation https://bugs.webkit.org/show_bug.cgi?id=190221 <rdar://problem/44914534> Reviewed by Joseph Pecoraro. This change progresses WPT WebDriver test special_keys.py::test_webdriver_special_key_sends_keydown[TAB-expected24]. * page/FocusController.cpp: (WebCore::FocusController::advanceFocusInDocumentOrder): Always cycle focus if the page is controlled by automation. If the chrome takes focus, then the first responder will be something other than the WebView, which causes subsequent WebDriver commands to hang. 2018-10-01 Dean Jackson <dino@apple.com> [macOS] Switching to discrete GPU should be done in the UI process https://bugs.webkit.org/show_bug.cgi?id=189361 <rdar://problem/43949622> Reviewed by Simon Fraser. Based on an earlier patch by Per Arne Vollan. Due to the fact we can't talk to the Window Server, the Web Process can no longer muxing to the discrete GPU directly. Instead we have to get the UI Process to process the change. Do this by adding a new Chrome client called GPUClient, that will have implementations provided by both WebKit and legacy WebKit. Unfortunately this can't be tested by a regular WKTR since: - it requires specific hardware - swapping to/from the discrete GPU takes about 20 seconds - running concurrent tests could confuse the tests into thinking the wrong GPU is active Instead we'll write a specific test for this functionality and run it on a separate bot. * WebCore.xcodeproj/project.pbxproj: Add GPUClient files. * page/Chrome.cpp: Drive by clean-up. (WebCore::Chrome::windowScreenDidChange): * platform/graphics/GraphicsContext3D.h: We need to keep track of whether we've muxed for this context, in order to not respond to the screen change notifications (they are misleading in the case of muxing). * platform/graphics/GraphicsContext3DManager.cpp: Rather than try to mux directly, call into GPUClient. (WebCore::GraphicsContext3DManager::displayWasReconfigured): (WebCore::GraphicsContext3DManager::updateHighPerformanceState): (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): * platform/graphics/GraphicsContext3DManager.h: * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: Only reconfigure the virtual display if it didn't happen from muxing. (WebCore::GraphicsContext3D::GraphicsContext3D): (WebCore::GraphicsContext3D::updateCGLContext): (WebCore::GraphicsContext3D::screenDidChange): * platform/graphics/mac/SwitchingGPUClient.cpp: Added. (WebCore::SwitchingGPUClient::singleton): (WebCore::SwitchingGPUClient::setSingleton): * platform/graphics/mac/SwitchingGPUClient.h: Added. * testing/Internals.cpp: Testing helper. (WebCore::Internals::hasMuxableGPU): * testing/Internals.h: * testing/Internals.idl: 2018-10-02 Chris Dumez <cdumez@apple.com> Image.__proto__ should be Function.prototype, not HTMLElement.prototype https://bugs.webkit.org/show_bug.cgi?id=190216 Reviewed by Alex Christensen. Properties created for named constructors should always use Function.prototype as prototype, as per: - https://heycam.github.io/webidl/#named-constructors Gecko and Blink agree with the Web IDL specification. However, WebKit was using the parent interface's prototype if such a parent existing. So Image.__proto__ would end up being HTMLElement.prototype instead of Function.prototype. No new tests, rebaselined existing test. * bindings/scripts/CodeGeneratorJS.pm: (GenerateConstructorHelperMethods): 2018-10-02 Alex Christensen <achristensen@webkit.org> Prepare WebCoreNSURLExtras for ARC https://bugs.webkit.org/show_bug.cgi?id=190219 Reviewed by Tim Horton. ARC doesn't like the explicit sending of -release. Use RetainPtr instead. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::collectRangesThatNeedMapping): (WebCore::collectRangesThatNeedEncoding): (WebCore::collectRangesThatNeedDecoding): (WebCore::applyHostNameFunctionToMailToURLString): (WebCore::applyHostNameFunctionToURLString): (WebCore::mapHostNames): (WebCore::stringByTrimmingWhitespace): (WebCore::URLWithUserTypedString): (WebCore::userVisibleString): (WebCore::rangeOfURLScheme): (WebCore::looksLikeAbsoluteURL): (WebCore::retain): Deleted. 2018-10-02 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Fix missing values of resource timing API. https://bugs.webkit.org/show_bug.cgi?id=190193 Reviewed by Alex Christensen. The property nextHopProtocol was not returned correctly. It was returned only when remote inspector is opened. Tests: http/wpt/resource-timing/rt-nextHopProtocol.html http/wpt/resource-timing/rt-nextHopProtocol.worker.html * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::getNetworkLoadMetrics): (WebCore::CurlHandle::addExtraNetworkLoadMetrics): 2018-10-02 Alex Christensen <achristensen@webkit.org> Remove unused linked-on-or-before-iOS5 check https://bugs.webkit.org/show_bug.cgi?id=190164 Reviewed by Michael Saboff. If an app hasn't been updated since iOS5, it can't run supported iOS. This value is also only checked in an uninstantiated template function. * platform/URL.cpp: (WebCore::enableURLSchemeCanonicalization): Deleted. (WebCore::equal): Deleted. * platform/URL.h: 2018-10-02 Alex Christensen <achristensen@webkit.org> Remove ParsedURLString https://bugs.webkit.org/show_bug.cgi?id=190154 Reviewed by Chris Dumez. Before the introduction of URLParser, it would indicate that we should assume the String is from a valid URL so we can skip canonicalization and just find the offsets inside the String to quickly create a URL. It was a performance optimization that caused security issues when misused. Since the introduction of URLParser, we have a fast path for all URL parsing, so right now it actually doesn't change any behavior. It's just a relic of the past that complicates the URL class, making it harder to express which constructor to use and making it harder to move the class. * Modules/navigatorcontentutils/NavigatorContentUtils.cpp: (WebCore::NavigatorContentUtils::registerProtocolHandler): (WebCore::NavigatorContentUtils::isProtocolHandlerRegistered): (WebCore::NavigatorContentUtils::unregisterProtocolHandler): * dom/Document.cpp: (WebCore::Document::updateBaseURL): (WebCore::Document::initSecurityContext): * dom/ExtensionStyleSheets.cpp: (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache const): * dom/ProcessingInstruction.cpp: (WebCore::ProcessingInstruction::checkStyleSheet): * editing/markup.cpp: (WebCore::completeURLs): * fileapi/BlobURL.cpp: (WebCore::BlobURL::createBlobURL): * history/HistoryItem.cpp: (WebCore::HistoryItem::url const): (WebCore::HistoryItem::originalURL const): * html/HTMLFrameElementBase.cpp: (WebCore::HTMLFrameElementBase::location const): * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript): * html/PublicURLManager.cpp: (WebCore::PublicURLManager::stop): * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyleSheet::resourceStyleSheetText const): * inspector/agents/InspectorPageAgent.cpp: (WebCore::InspectorPageAgent::getCookies): (WebCore::InspectorPageAgent::deleteCookie): (WebCore::InspectorPageAgent::getResourceContent): (WebCore::InspectorPageAgent::searchInResource): * inspector/agents/page/PageDebuggerAgent.cpp: (WebCore::PageDebuggerAgent::sourceMapURLForScript): * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::subresources const): * loader/FrameLoader.cpp: (WebCore::FrameLoader::init): (WebCore::FrameLoader::initForSynthesizedDocument): * loader/HistoryController.cpp: (WebCore::HistoryController::pushState): (WebCore::HistoryController::replaceState): * loader/appcache/ApplicationCache.cpp: (WebCore::ApplicationCache::addResource): (WebCore::ApplicationCache::resourceForURL): * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::startLoadingEntry): (WebCore::ApplicationCacheGroup::addEntry): * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::cacheGroupForURL): (WebCore::ApplicationCacheStorage::fallbackCacheGroupForURL): (WebCore::ApplicationCacheStorage::loadCache): (WebCore::ApplicationCacheStorage::manifestURLs): * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): * page/PageSerializer.cpp: (WebCore::PageSerializer::urlForBlankFrame): * platform/URL.cpp: (WebCore::blankURL): * platform/URL.h: (): Deleted. * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp: (WebCore::MediaPlayerPrivateAVFoundation::load): * platform/network/BlobRegistryImpl.cpp: (WebCore::BlobRegistryImpl::populateBlobsForFileWriting): * platform/network/ResourceRequestBase.h: (WebCore::ResourceRequestBase::decodeBase): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::sanitizeSuggestedFilename): * platform/network/cf/DNSResolveQueueCFNet.cpp: (WebCore::DNSResolveQueueCFNet::updateIsUsingProxy): * platform/network/cf/ResourceRequest.h: (WebCore::ResourceRequest::ResourceRequest): * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::searchCookies): (WebCore::CookieJarDB::setCookie): (WebCore::CookieJarDB::deleteCookie): * platform/network/curl/ResourceRequest.h: (WebCore::ResourceRequest::ResourceRequest): * platform/network/soup/ResourceRequest.h: (WebCore::ResourceRequest::ResourceRequest): * xml/XSLTProcessorLibxslt.cpp: (WebCore::docLoaderFunc): 2018-10-02 Per Arne Vollan <pvollan@apple.com> [WebVTT] Cue with line setting is not rendered correctly https://bugs.webkit.org/show_bug.cgi?id=190168 Reviewed by Eric Carlson. When the line setting contains an optional alignment value, the cue is not rendered at the correct position, see https://w3c.github.io/webvtt/#webvtt-line-cue-setting. This patch does not implement correct handling of the line setting alignment values, it only makes sure parsing does not fail when the cue has line alignment settings. Test: media/track/track-cue-line-position.html * html/track/VTTCue.cpp: (WebCore::VTTCueBox::applyCSSProperties): (WebCore::VTTCue::getPositionCoordinates const): (WebCore::VTTCue::setCueSettings): 2018-10-02 Antti Koivisto <antti@apple.com> User installed fonts are not always disabled when they should be https://bugs.webkit.org/show_bug.cgi?id=190195 Reviewed by Geoffrey Garen. SVG images and some theme cases fail to respect the setting. Besides the obvious problem this is also a performance issue as various font caches include this setting in the key. * platform/graphics/FontDescription.cpp: (WebCore::m_shouldAllowUserInstalledFonts): Initialize to 'No' by default. All paths where user fonts make sense already set the bit from settings. This fixes some cases in system themes that construct FontDescriptions from scratch. * rendering/RenderElement.cpp: (WebCore::RenderElement::styleWillChange): Add assertion. This verified the change with the existing tests. * svg/graphics/SVGImage.cpp: (WebCore::SVGImage::dataChanged): Always disallow user fonts in SVG used as images. 2018-10-01 Dean Jackson <dino@apple.com> Remove CSS Animation Triggers https://bugs.webkit.org/show_bug.cgi?id=190175 <rdar://problem/44925626> Reviewed by Simon Fraser. Remove the never-properly specified CSS Animation Triggers. * Configurations/FeatureDefines.xcconfig: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSAnimationTriggerScrollValue.cpp: Removed. * css/CSSAnimationTriggerScrollValue.h: Removed. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::valueForPropertyinStyle): (WebCore::createAnimationTriggerValue): Deleted. (WebCore::animationTriggerValue): Deleted. * css/CSSProperties.json: * css/CSSToStyleMap.cpp: (WebCore::CSSToStyleMap::mapAnimationTrigger): Deleted. * css/CSSToStyleMap.h: * css/CSSValue.cpp: (WebCore::CSSValue::equals const): (WebCore::CSSValue::cssText const): (WebCore::CSSValue::destroy): * css/CSSValue.h: (WebCore::CSSValue::isAnimationTriggerScrollValue const): Deleted. * css/parser/CSSPropertyParser.cpp: (WebCore::consumeAnimationValue): (WebCore::CSSPropertyParser::parseSingleValue): (WebCore::consumeWebkitAnimationTrigger): Deleted. * page/FrameView.cpp: (WebCore::FrameView::sendScrollEvent): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setAnimationTriggersEnabled): Deleted. (WebCore::RuntimeEnabledFeatures::animationTriggersEnabled const): Deleted. * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::updateStateMachine): (WebCore::AnimationBase::fireAnimationEventsIfNeeded): (WebCore::AnimationBase::timeToNextService): (WebCore::AnimationBase::getElapsedTime const): * page/animation/CSSAnimationController.cpp: (WebCore::CSSAnimationControllerPrivate::animationWillBeRemoved): (WebCore::CSSAnimationControllerPrivate::addToAnimationsDependentOnScroll): Deleted. (WebCore::CSSAnimationControllerPrivate::removeFromAnimationsDependentOnScroll): Deleted. (WebCore::CSSAnimationControllerPrivate::scrollWasUpdated): Deleted. (WebCore::CSSAnimationController::wantsScrollUpdates const): Deleted. (WebCore::CSSAnimationController::scrollWasUpdated): Deleted. * page/animation/CSSAnimationController.h: * page/animation/CSSAnimationControllerPrivate.h: (WebCore::CSSAnimationControllerPrivate::wantsScrollUpdates const): Deleted. (WebCore::CSSAnimationControllerPrivate::scrollPosition const): Deleted. * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::updateKeyframeAnimations): * page/animation/CompositeAnimation.h: (WebCore::CompositeAnimation::hasScrollTriggeredAnimation const): Deleted. * platform/animation/Animation.cpp: (WebCore::Animation::Animation): (WebCore::Animation::operator=): (WebCore::Animation::animationsMatch const): * platform/animation/Animation.h: (WebCore::Animation::isTimingFunctionSet const): (WebCore::Animation::isEmpty const): (WebCore::Animation::clearTimingFunction): (WebCore::Animation::clearAll): (WebCore::Animation::animationMode const): (WebCore::Animation::setAnimationMode): (WebCore::Animation::initialTimingFunction): (WebCore::Animation::isTriggerSet const): Deleted. (WebCore::Animation::clearTrigger): Deleted. (WebCore::Animation::trigger const): Deleted. (WebCore::Animation::setTrigger): Deleted. (WebCore::Animation::initialTrigger): Deleted. * platform/animation/AnimationTrigger.h: Removed. * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::animationCanBeAccelerated const): 2018-10-02 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r236624 and r236671. https://bugs.webkit.org/show_bug.cgi?id=190207 The change in r236624 introduced crashes on the bots (Requested by ryanhaddad on #webkit). Reverted changesets: "Refactoring: eliminate raw pointer usage in Fullscreen code" https://bugs.webkit.org/show_bug.cgi?id=188747 https://trac.webkit.org/changeset/236624 "Unify implementation in VideoFullscreenInterfaceAVKit" https://bugs.webkit.org/show_bug.cgi?id=190091 https://trac.webkit.org/changeset/236671 2018-10-02 Sihui Liu <sihui_liu@apple.com> Add release assertion to ensure m_owningPointerForClose is null in UniqueIDBDatabase::invokeOperationAndTransactionTimer() https://bugs.webkit.org/show_bug.cgi?id=190178 Reviewed by Chris Dumez. This would help debug rdar://problem/44902833. * Modules/indexeddb/server/UniqueIDBDatabase.cpp: (WebCore::IDBServer::UniqueIDBDatabase::invokeOperationAndTransactionTimer): 2018-10-02 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r236719. https://bugs.webkit.org/show_bug.cgi?id=190197 this revision caused 39 layout test failures that tested for scrolling, a bug was also not present in the commit or change log. (Requested by Truitt on #webkit). Reverted changeset: "Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet" https://trac.webkit.org/changeset/236719 2018-10-02 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Add h264parse to accept MP4 without stss https://bugs.webkit.org/show_bug.cgi?id=190143 Reviewed by Xabier Rodriguez-Calvar. The MP4 file used in this URL does not contain a stss (Sync Sample Box). In consequence, in acordance with the ISO BMFF spec, all samples are assumed to be sync frames... But in this case that is not true, it's just that the file is wrong (e.g. created with a buggy muxer). http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest The way it works in other browsers is because instead of trusting the MP4 stss table, they rely on parsing the h264 frames. We can do that too. This patch also changes RELEASE_ASSERT() when creating the parsers to GLib criticals. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::createOptionalParserForFormat): 2018-10-02 Eric Carlson <eric.carlson@apple.com> [MediaStream] RealtimeMediaSource should be able to vend hashed IDs https://bugs.webkit.org/show_bug.cgi?id=190142 <rdar://problem/44911109> Reviewed by Youenn Fablet. No new tests, covered by existing tests. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): Update order of parameters passed to base class. * Modules/mediastream/MediaDevicesRequest.cpp: (WebCore::MediaDevicesRequest::start): ASSERT if document.deviceIDHashSalt is not the same as passed salt. * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::getSettings const): Don't need to hash ID. (WebCore::MediaStreamTrack::getCapabilities const): Ditto. * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.idl: * Modules/mediastream/UserMediaRequest.cpp: (WebCore::UserMediaRequest::allow): Pass hash salt to createMediaStream. * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::createReceiverForSource): Update order of parameters passed to base class. * Modules/webaudio/MediaStreamAudioSource.cpp: (WebCore::MediaStreamAudioSource::MediaStreamAudioSource): Ditto. * platform/mediastream/MediaConstraints.h: * platform/mediastream/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource): Ditto. * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): Ditto. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::RealtimeMediaSource): Calculate hashed ID. (WebCore::RealtimeMediaSource::selectSettings): Use m_hashedID. (WebCore::RealtimeMediaSource::hashedId const): New. (WebCore::RealtimeMediaSource::deviceIDHashSalt const): New. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::createMediaStream): Take hash salt, pass it when creating a source. (WebCore::RealtimeMediaSourceCenter::getUserMediaDevices): Ditto. (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): Ditto. * platform/mediastream/RealtimeMediaSourceCenter.h: * platform/mediastream/RealtimeMediaSourceFactory.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::RealtimeVideoSource): Update parameters. * platform/mediastream/RealtimeVideoSource.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: (WebCore::GStreamerAudioCaptureSource::create): Ditto. (WebCore::GStreamerAudioCaptureSource::GStreamerAudioCaptureSource): Ditto. * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::create): Ditto. (WebCore::GStreamerVideoCaptureSource::GStreamerVideoCaptureSource): Ditto. * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: (WebCore::WrappedMockRealtimeAudioSource::WrappedMockRealtimeAudioSource): Ditto. (WebCore::MockRealtimeAudioSource::create): Ditto. (WebCore::MockGStreamerAudioCaptureSource::MockGStreamerAudioCaptureSource): Ditto. * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: (WebCore::MockRealtimeVideoSource::create): Ditto. (WebCore::MockGStreamerVideoCaptureSource::MockGStreamerVideoCaptureSource): Ditto. * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::create): Ditto. (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Ditto. (WebCore::AVVideoCaptureSource::settings): Use hashedId to set device ID. (WebCore::AVVideoCaptureSource::capabilities): Ditto. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::create): Update parameters. (WebCore::CoreAudioCaptureSource::CoreAudioCaptureSource): Ditto. (WebCore::CoreAudioCaptureSource::capabilities): Use hashedId to set device ID. (WebCore::CoreAudioCaptureSource::settings): Ditto. * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): Update parameters. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.h: * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm: (WebCore::MockRealtimeAudioSource::create): Ditto. (WebCore::MockRealtimeAudioSourceMac::MockRealtimeAudioSourceMac): Ditto. * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSource::create): Ditto. (WebCore::MockRealtimeVideoSourceMac::MockRealtimeVideoSourceMac): Ditto. * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::create): Ditto. (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Ditto. (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update logging. (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto. (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto. * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: (WebCore::WindowDisplayCaptureSourceMac::create): Update parameters. * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::create): Ditto. (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): Ditto. (WebCore::MockRealtimeAudioSource::settings): Use hashedId to set device ID. (WebCore::MockRealtimeAudioSource::capabilities): Ditto. * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::create): Update parameters. (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Ditto. (WebCore::MockRealtimeVideoSource::capabilities): Use hashedId to set device ID. (WebCore::MockRealtimeVideoSource::settings): Ditto. * platform/mock/MockRealtimeVideoSource.h: 2018-10-02 Philippe Normand <pnormand@igalia.com> [GStreamer][playbin3] Stream tag lists leaks https://bugs.webkit.org/show_bug.cgi?id=190192 Reviewed by Xabier Rodriguez-Calvar. The gst_stream_get_tags() result is transfer-full, so needs to be adopted to prevent a leak. Also check the tags list pointer which might be NULL in some cases. * platform/graphics/gstreamer/AudioTrackPrivateGStreamer.cpp: (WebCore::AudioTrackPrivateGStreamer::AudioTrackPrivateGStreamer): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp: (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): 2018-10-01 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, fix unused variable in RenderLayer::updateScrollableAreaSet * rendering/RenderLayer.cpp: (WebCore::RenderLayer::calculateClipRects const): This is a prepare-ChangeLog bug. I don't have any changes in this function.... 2018-10-02 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Make same thread assert non-release https://bugs.webkit.org/show_bug.cgi?id=189924 Reviewed by Xabier Rodriguez-Calvar. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::handleNewAppsinkSample): 2018-10-01 Ryosuke Niwa <rniwa@webkit.org> Add a new variant of serializePreservingVisualAppearance which takes VisibleSelection https://bugs.webkit.org/show_bug.cgi?id=190108 Reviewed by Wenson Hsieh. Added a version of serializePreservingVisualAppearance which takes VisibleSelection so that we can avoid creating a range simply to get the first node and the end node of the selection later. This simple change also fixes a bug demonstrated in editing/pasteboard/paste-table-003.html. Test: editing/pasteboard/paste-table-003.html * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::selectionInHTMLFormat): Adopt the new variant. * editing/gtk/EditorGtk.cpp: (WebCore::Editor::writeSelectionToPasteboard): Ditto. * editing/markup.cpp: (WebCore::serializePreservingVisualAppearance): Added. * editing/markup.h: * editing/wpe/EditorWPE.cpp: (WebCore::Editor::writeSelectionToPasteboard): Ditto. * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::createFromSelection): Ditto. * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeSelection): Ditto. 2018-10-01 Alex Christensen <achristensen@webkit.org> Don't read from WebCore's bundle for IDNScriptWhiteList https://bugs.webkit.org/show_bug.cgi?id=190157 Reviewed by Dan Bernstein. No change in behavior. This increases performance by not reading from the WebCore bundle, and it makes it so that URL-related functionality can be moved to a place without a bundle for resources. * Resources/IDNScriptWhiteList.txt: Removed. * WebCore.xcodeproj/project.pbxproj: * platform/mac/WebCoreNSURLExtras.mm: (WebCore::whiteListIDNScripts): (WebCore::allCharactersInIDNScriptWhiteList): (WebCore::readIDNScriptWhiteListFile): Deleted. 2018-10-01 Alex Christensen <achristensen@webkit.org> Unreviewed, rolling out r236551. Fails URL validating too aggressively Reverted changeset: "URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL" https://bugs.webkit.org/show_bug.cgi?id=189979 https://trac.webkit.org/changeset/236551 2018-10-01 Keith Miller <keith_miller@apple.com> Create a RELEASE_AND_RETURN macro for ExceptionScopes https://bugs.webkit.org/show_bug.cgi?id=190163 Reviewed by Mark Lam. The new RELEASE_AND_RETURN does all the work for cases where you want to return the result of some expression without explicitly checking for an exception. This is much like the existing RETURN_IF_EXCEPTION macro. No new tests since this is a refactor. * bridge/runtime_array.cpp: (JSC::RuntimeArray::put): 2018-10-01 Daniel Bates <dabates@apple.com> Attempt to fix the watchOS build after <https://trac.webkit.org/changeset/236678> (https://bugs.webkit.org/show_bug.cgi?id=189974) Explicitly cast index to unsigned to make the operator[] call unambiguous. * platform/ios/KeyEventIOS.mm: (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): 2018-10-01 Ryosuke Niwa <rniwa@webkit.org> ASAN failure in ~GCReachableRef() https://bugs.webkit.org/show_bug.cgi?id=190113 Reviewed by Darin Adler. The bug was caused by ~GCReachableRef accessing Ref after it had been poisoned for ASAN in Ref::leakRef via Ref(Ref&& other). Fixed the bug by using RefPtr instead since that's the simplest solution here although we could unpoison Ref temporarily as done in ~Ref. * dom/GCReachableRef.h: (WebCore::GCReachableRef::GCReachableRef): (WebCore::GCReachableRef::~GCReachableRef): (WebCore::GCReachableRef::operator-> const): (WebCore::GCReachableRef::get const): (WebCore::GCReachableRef::operator T& const): (WebCore::GCReachableRef::operator! const): (WebCore::GCReachableRef::isNull const): Deleted. 2018-10-01 Sihui Liu <sihui_liu@apple.com> Remove StorageProcess https://bugs.webkit.org/show_bug.cgi?id=189975 Reviewed by Geoffrey Garen. Clean up code. No behavior change. * English.lproj/Localizable.strings: 2018-10-01 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Set a minimum sample duration https://bugs.webkit.org/show_bug.cgi?id=190125 Reviewed by Xabier Rodriguez-Calvar. The last sample of the audio track in the asset used in this test player has a tiny duration (100 ns): http://orange-opensource.github.io/hasplayer.js/1.2.0/player.html?url=http://playready.directtaps.net/smoothstreaming/SSWSS720H264/SuperSpeedway_720.ism/Manifest So small, we were truncating it to zero. We're not supposed to have frames with zero duration. Instead, lets set a minimum frame duration for those fringe cases. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): 2018-10-01 Daniel Bates <dabates@apple.com> [iOS] Special keys are misidentified in DOM keyboard events https://bugs.webkit.org/show_bug.cgi?id=189974 Reviewed by Wenson Hsieh. This patch fixes two issues: 1. Special keyboard keys would be misidentified in dispatched DOM keyboard events. 2. DOM keypress events may not be dispatched for some special keys. UIKit uses special input strings to identify the Page Up, Page Down, Escape, Up Arrow, Down Arrow, Left Arrow, and Right Arrow keys. It also uses ASCII control characters to represent some other special keys, including Num Lock / Clear, Home, End, Forward Delete, and F1, ..., F24. We need to explicitly handle these special keyboard keys in order to be able to identify the key that was pressed as well as to correctly disambiguate a key down to know whether to dispatch a DOM keypress event for the key. Unlike UIKit, AppKit reserves Unicode Private Use Area (PUA) code points in 0xF700–0xF8FF to represent special keyboard keys. This makes it straightforward to disambiguate such keys using the input string of the keyboard event alone. To simplify the implementation for iOS we normalize the input string be AppKit compatible. See the explaination for WebCore::windowsKeyCodeForCharCode() below for more details on why this is done. Tests: fast/events/ios/keydown-keyup-arrow-keys-in-non-editable-element.html fast/events/ios/keypress-keys-in-non-editable-element.html * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: Do not use unified source build strategy when building WebEvent.mm as it makes use of SoftLinking macros that are incompatible with this strategy. * platform/ios/KeyEventIOS.mm: (WebCore::windowsKeyCodeForCharCode): Recognize some special AppKit special char codes. These special char codes are generated by WebKit. WebKit uses the same special char codes as AppKit as a convenience instead of defining our own constants for the same purpose. Encoding the special UIKit input strings (e.g. up arrow) as distinct char codes allows us to use integer arithmetic and switch blocks to map characters to Windows virtual key codes as opposed to special cased branches to perform pointer or string comparisions. The latter would be necessary in Modern WebKit in order for key down events to be properly disambiguated to dispatch a DOM keypress event because pointers are not perserved, though what they point to is, when sending the WebEvent from UIProcess to the WebProcess and vice versa. (WebCore::isFunctionKey): Convenience function that determines whether the specified char code corresponds to a function key on the keyboard. The term "function key" is taken from AppKit parlance to describe a special keyboard key. These keys include F1, F2, ..., F24, and cursor keys among other special keyboard keys. (WebCore::PlatformKeyboardEvent::disambiguateKeyDownEvent): Write in terms of isFunctionKey(). * platform/ios/PlatformEventFactoryIOS.h: * platform/ios/PlatformEventFactoryIOS.mm: (WebCore::keyIdentifierForKeyEvent): Remove code to handle UIKit special input strings as we now map such special input strings to char codes and hence can use the default code path. (WebCore::keyForKeyEvent): Ditto. (WebCore::codeForKeyEvent): Remove code to compute the Window virtual key code corresponding to a UIKit special key command now that we map such special input strings to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...] constructors). So, we can now use WebEvent.keyCode directly to compute the DOM UIEvents code for the event. (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder): Remove code to fix up WebEvent.keyCode to account for UIKit special input strings now that we map such special key commands to char codes and subsequently map the char codes to the Windows virtual key code (see -[WebEvent initWithKeyEventType:...] constructors). So, we can now take WebEvent.keyCode verbatim to be the Window virtual key code. (WebCore::convertSpecialKeyToCharCode): Deleted. (WebCore::keyCodeForEvent): Deleted. * platform/ios/WebEvent.mm: (normalizedStringWithAppKitCompatibilityMapping): Added; converts a UIKit character string to the corresponding AppKit-compatible one (if not already compatible). See the explaination for WebCore::windowsKeyCodeForCharCode() above for more details on why this is done. (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): Normalize the character strings to be AppKit compatible. 2018-10-01 Simon Fraser <simon.fraser@apple.com> Optimize RenderStyle::diff() and clean up the code https://bugs.webkit.org/show_bug.cgi?id=190104 Reviewed by Dan Bernstein. RenderStyle::changeRequiresLayout() and related should only check values on m_rareNonInheritedData and m_rareInheritedData after checking for pointer equality. To reduce the chances of future changes regressing this, move code comparing values on StyleRare[Non]InheritedData into dedication functions. In addition, the transform comparison double-compared the transformOperations, because m_rareNonInheritedData->transform != other.m_rareNonInheritedData->transform is a deep comparison, and it was followed by *m_rareNonInheritedData->transform != *other.m_rareNonInheritedData->transform. Change the first to be a pointer comparison. * rendering/style/RenderStyle.cpp: (WebCore::rareNonInheritedDataChangeRequiresLayout): (WebCore::rareInheritedDataChangeRequiresLayout): (WebCore::RenderStyle::changeRequiresLayout const): (WebCore::rareNonInheritedDataChangeRequiresLayerRepaint): (WebCore::RenderStyle::changeRequiresLayerRepaint const): (WebCore::rareNonInheritedDataChangeRequiresRepaint): (WebCore::rareInheritedDataChangeRequiresRepaint): (WebCore::RenderStyle::changeRequiresRepaint const): 2018-10-01 Alex Christensen <achristensen@webkit.org> URL should not use TextEncoding internally https://bugs.webkit.org/show_bug.cgi?id=190111 Reviewed by Andy Estes. That dependency makes it impossible to move or use elsewhere. Using TextEncoding was overkill because we know the credentials are UTF-8 percent-encoded in a parsed URL. No change in behavior as verified by new API tests. * page/SecurityOrigin.cpp: * page/csp/ContentSecurityPolicySourceList.cpp: * platform/URL.cpp: (WebCore::decodeEscapeSequencesFromParsedURL): (WebCore::URL::user const): (WebCore::URL::pass const): (WebCore::URL::fileSystemPath const): (WebCore::decodeURLEscapeSequences): Deleted. * platform/URL.h: * platform/network/DataURLDecoder.cpp: * platform/text/TextEncoding.cpp: (WebCore::decodeURLEscapeSequences): * platform/text/TextEncoding.h: 2018-10-01 Simon Pieters <zcorpan@gmail.com> <form> in quirks mode should have margin-block-end: 1em https://bugs.webkit.org/show_bug.cgi?id=157788 Reviewed by Simon Fraser. Change the default style for forms to take writing-mode into account in quirks mode. Matches the behavior of Gecko and Edge and the HTML standard. Spec: https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3 Test: imported/w3c/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/form-margin-quirk.html * css/quirks.css: (form): 2018-10-01 Jeremy Jones <jeremyj@apple.com> Unify implementation in VideoFullscreenInterfaceAVKit https://bugs.webkit.org/show_bug.cgi?id=190091 rdar://problem/44734523 Reviewed by Jer Noble. No new tests because no behavior change. Unified code in VideoFullscreenInterfaceAVKit now that new code path is proven and include any changes that had been made in the old path. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerViewControllerDelegate playerViewControllerShouldStartPictureInPictureFromInlineWhenEnteringBackground:]): (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen): (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::requestUpdateInlineRect): (VideoFullscreenControllerContext::requestVideoContentLayer): (VideoFullscreenControllerContext::returnVideoContentLayer): (VideoFullscreenControllerContext::didSetupFullscreen): (VideoFullscreenControllerContext::didExitFullscreen): 2018-10-01 Antoine Quint <graouts@apple.com> [Web Animations] Ensure renderers with accelerated animations have layers https://bugs.webkit.org/show_bug.cgi?id=189990 Reviewed by Simon Fraser. In r236501 we added code that would make a RenderBox and a RenderInline query the document timeline for whether a given element has accelerated animations running on it. Since the calls to requiresLayer() are in a hot path, we instead keep a list of elements with exclusively accelerated animations running. No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element. * animation/AnimationTimeline.h: * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::detachFromDocument): (WebCore::DocumentTimeline::animationWasAddedToElement): (WebCore::DocumentTimeline::animationWasRemovedFromElement): (WebCore::DocumentTimeline::animationAcceleratedRunningStateDidChange): (WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement): Iterate over an element's animations to determine whether all of its animations are running accelerated, then update the HashSet containing elements running accelerated animations to remove or add this element. (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): Make a simple contains() call on the HashSet containing elements running accelerated animations. * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): * rendering/RenderBoxModelObject.h: 2018-10-01 Alicia Boya García <aboya@igalia.com> [GStreamer] Fix abort in gst_sample_get_info() https://bugs.webkit.org/show_bug.cgi?id=190135 Reviewed by Philippe Normand. A flush can occur before any frame has finished decoding -- especially in tests, where actions on the player often occur in quick succession. Therefore, the code must not assume by the time a flush occurs any frame has reached the sink. This patch fixes a case when such wrong assumption was causing gst_sample_get_info() to abort (crashing WebKit). * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer): (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink): 2018-10-01 Olivier Blin <olivier.blin@softathome.com> [WPE] fix buffer over-read in RenderThemeWPE::mediaControlsStyleSheet() https://bugs.webkit.org/show_bug.cgi?id=190139 Reviewed by Michael Catanzaro. Like done upstream for EFL in r210213 https://bugs.webkit.org/show_bug.cgi?id=166622 This has been detected by a charactersAreAllASCII() assert failure. This is because ASCIILiteral() is wrongly used in mediaControlsStyleSheet(). mediaControlsBaseUserAgentStyleSheet is a char array, not a null-terminated string. It is thus incorrect to use StringImpl::createFromLiteral() that calls strlen() to get the string length. The String::ConstructFromLiteral constructor can not be used, since it skips the last character. * platform/wpe/RenderThemeWPE.cpp: (WebCore::RenderThemeWPE::mediaControlsStyleSheet): Explicitely pass the size to the String constructor. 2018-10-01 Rob Buis <rbuis@igalia.com> Align XMLHttpRequest's overrideMimeType() with the standard https://bugs.webkit.org/show_bug.cgi?id=169276 Reviewed by Chris Dumez. Implement the overrideMimeType() as specified in that standard, i.e. add a check that the passed mime type is valid and if not fallback to application/octet-stream. In order for this patch to have any effect, I went ahead and made an improvement to the ContentType parsing, parseContentType now will reject mime types that do not match the type / subtype format, I believe this is required by both RFC2045 and mimesniff specs. This behavior matches Chrome and Firefox. Test: web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm * platform/network/ParsedContentType.cpp: (WebCore::parseContentType): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::overrideMimeType): 2018-10-01 Chris Dumez <cdumez@apple.com> Make crossOriginObject.then undefined for promises https://bugs.webkit.org/show_bug.cgi?id=190094 Reviewed by Darin Adler. Make crossOriginObject.then undefined for promises. This allows promises to work better with cross-origin WindowProxy and Location objects. Specification: - https://github.com/whatwg/html/pull/3242 - https://github.com/whatwg/dom/issues/536 This aligns our behavior with Blink and Gecko. No new tests, rebaselined existing test. * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::addCrossOriginWindowOwnPropertyNames): * bindings/js/JSLocationCustom.cpp: (WebCore::getOwnPropertySlotCommon): (WebCore::addCrossOriginLocationOwnPropertyNames): 2018-10-01 Xan Lopez <xan@igalia.com> [SOUP] Fix the build for libsoup > 2.61.90 https://bugs.webkit.org/show_bug.cgi?id=190126 Reviewed by Michael Catanzaro. * platform/network/soup/SocketStreamHandleImplSoup.cpp: 2018-10-01 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Reset running time in PlaybackPipeline::flush() https://bugs.webkit.org/show_bug.cgi?id=190076 Reviewed by Philippe Normand. Test: media/media-source/media-source-seek-redundant-append.html PlaybackPipeline::flush() is called when already enqueued frames are appended again. This may be caused by a quality change or just a redundant append. Either way, the pipeline has to be flushed and playback begin again, but without changing the player position by much. There are two kinds of time to consider here: stream time (i.e. the time of a frame as written in the file, e.g. a frame may have stream time 0:01:00), and running time (i.e. how much time since playback started should pass before the frame should be played, e.g. if we started playing at 0:00:59 that same frame would have a running time of just 1 second). Notice how running time depends on where and when playback starts. Running time can also be optionally resetted after a flush. (This is indeed done currently by most demuxers after a seek.) Instead of resetting running time, PlaybackPipeline used to modify the first GstSegment emitted after the flush. A GstSegment declares the mapping between stream time and running time for the following frames. There, PlaybackPipeline used to set `base` (the running time at which the segment starts) to the position reported by a position query (which is stream time). This, of course, only worked when playback (or the last seek) started at stream time 0:00:00, since that's the only case where running time equals stream time. In other cases delays as long as the difference between these timelines would appear. This is demonstrated in the attached test, where seeks and appends are made in such an order that the difference is more than 5 minutes, making the playback stall for >5 minutes before playing 1 second of audio. This patch fixes the problem by resetting running time with the flush and not modifying GstSegment.base anymore (it will be left as zero, which is now correct since the running time has been reset). * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp: (WebCore::PlaybackPipeline::flush): (WebCore::segmentFixerProbe): Deleted. 2018-09-30 Ryosuke Niwa <rniwa@webkit.org> Use Position instead of Range in createMarkupInternal https://bugs.webkit.org/show_bug.cgi?id=190107 Reviewed by Darin Adler. Use two Position's indicating start and end instead of Range in createMarkupInternal and StylizedMarkupAccumulator in order to support copy & paste across shadow boundaries in the bug 157443. This patch also removes the use of Range in MarkupAccumulator since all uses of range is via StylizedMarkupAccumulator. Also renamed createMarkupInternal to serializePreservingVisualAppearanceInternal to match the rename in r236612. * dom/Position.cpp: (WebCore::Position::firstNode const): Added. * dom/Position.h: * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::MarkupAccumulator): No longer takes Range. (WebCore::MarkupAccumulator::appendText): Removed the code to truncate string at the boundary points of the range. * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator): Made this class non-copyable. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): Now takes and stores two positions. (WebCore::StyledMarkupAccumulator::appendText): Use textContentRespectingRange in the case annotation is disabled instead of calling to MarkupAccumulator::appendText, which no longer respects boundary offsets. (WebCore::StyledMarkupAccumulator::renderedTextRespectingRange): Renamed from renderedText. Updated to respect boundary offsets defined by m_start and m_end Positions instead of m_range Range. (WebCore::StyledMarkupAccumulator::textContentRespectingRange): Renamed from stringValueForRange. Ditto. (WebCore::StyledMarkupAccumulator::serializeNodes): Now computes startNode and pastEnd nodes from start and end Positions. Note that the end position is always the next node in the tree order for a character node and computeNodeAfterPosition returns nullptr for a character data. (WebCore::highestAncestorToWrapMarkup): Now takes two positions instead of a range. (WebCore::serializePreservingVisualAppearanceInternal): Renamed from createMarkupInternal. Removed the obsolete comments which were added for DOMRange in WebKitLegacy. (WebCore::serializePreservingVisualAppearance): (WebCore::sanitizedMarkupForFragmentInDocument): Create positions instead of a range to pass to serializePreservingVisualAppearanceInternal. (WebCore::serializeFragment): * editing/markup.h: * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator): Removed the unnecessary WebCore namespace qualifier. 2018-09-30 Walker Henderson <wjahenderson@gmail.com> AudioNode.connect should return passed destination node https://bugs.webkit.org/show_bug.cgi?id=188834 Reviewed by Eric Carlson. No new tests, rebaselined existing test. * Modules/webaudio/AudioBasicInspectorNode.cpp: (WebCore::AudioBasicInspectorNode::connect): Deleted. * Modules/webaudio/AudioBasicInspectorNode.h: * Modules/webaudio/AudioNode.cpp: * Modules/webaudio/AudioNode.h: * Modules/webaudio/AudioNode.idl: 2018-09-30 Eric Carlson <eric.carlson@apple.com> [MediaStream] Clean up RealtimeMediaSource settings change handling https://bugs.webkit.org/show_bug.cgi?id=189998 <rdar://problem/44797884> Reviewed by Youenn Fablet. No new tests, updated webrtc/video-disabled-black.html. * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::Source::Source): (WebCore::CanvasCaptureMediaStreamTrack::Source::settings): (WebCore::CanvasCaptureMediaStreamTrack::Source::settingsDidChange): (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized): * Modules/mediastream/CanvasCaptureMediaStreamTrack.h: * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource): (WebCore::RealtimeIncomingVideoSource::settings): (WebCore::RealtimeIncomingVideoSource::settingsDidChange): * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::settingsDidChange): (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers): (WebCore::RealtimeMediaSource::setSize): (WebCore::RealtimeMediaSource::setFrameRate): (WebCore::RealtimeMediaSource::setAspectRatio): (WebCore::RealtimeMediaSource::setFacingMode): (WebCore::RealtimeMediaSource::setVolume): (WebCore::RealtimeMediaSource::setSampleRate): (WebCore::RealtimeMediaSource::setSampleSize): (WebCore::RealtimeMediaSource::setEchoCancellation): * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp: (WebCore::GStreamerAudioCaptureSource::settingsDidChange): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::GStreamerVideoCaptureSource::settingsDidChange): * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::settingsDidChange): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::settingsDidChange): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::settingsDidChange): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::settingsDidChange): 2018-09-30 Eric Carlson <eric.carlson@apple.com> [MediaStream] Use display-specific capture factories https://bugs.webkit.org/show_bug.cgi?id=190043 <rdar://problem/44834412> Reviewed by Youenn Fablet. No new tests, no change in functionality. * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::AudioCaptureFactory::~AudioCaptureFactory): Deleted. (WebCore::RealtimeMediaSource::VideoCaptureFactory::~VideoCaptureFactory): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::createMediaStream): (WebCore::RealtimeMediaSourceCenter::getDisplayMediaDevices): * platform/mediastream/RealtimeMediaSourceCenter.h: (WebCore::RealtimeMediaSourceCenter::setAudioFactory): (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory): * platform/mediastream/RealtimeMediaSourceFactory.cpp: Added. (WebCore::SingleSourceFactory::setActiveSource): (WebCore::SingleSourceFactory::unsetActiveSource): * platform/mediastream/RealtimeMediaSourceFactory.h: Added. (WebCore::SingleSourceFactory::activeSource): (WebCore::VideoCaptureFactory::setVideoCapturePageState): (WebCore::DisplayCaptureFactory::setDisplayCapturePageState): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp: (WebCore::libWebRTCVideoCaptureSourceFactory): (WebCore::libWebRTCDisplayCaptureSourceFactory): (WebCore::GStreamerVideoCaptureSource::factory): (WebCore::GStreamerVideoCaptureSource::displayFactory): * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp: (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioCaptureSourceFactory): (WebCore::RealtimeMediaSourceCenterLibWebRTC::audioFactory): (WebCore::RealtimeMediaSourceCenterLibWebRTC::videoFactory): (WebCore::RealtimeMediaSourceCenterLibWebRTC::displayCaptureFactory): * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::setupCaptureSession): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::factory): * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: (WebCore::RealtimeMediaSourceCenterMac::videoCaptureSourceFactory): (WebCore::RealtimeMediaSourceCenterMac::displayCaptureSourceFactory): (WebCore::RealtimeMediaSourceCenterMac::audioCaptureSourceFactory): (WebCore::RealtimeMediaSourceCenterMac::audioFactory): (WebCore::RealtimeMediaSourceCenterMac::videoFactory): (WebCore::RealtimeMediaSourceCenterMac::displayCaptureFactory): * platform/mediastream/mac/RealtimeMediaSourceCenterMac.h: * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::~MockRealtimeAudioSource): (WebCore::MockRealtimeAudioSource::startProducingData): (): Deleted. (WebCore::mockAudioCaptureSourceFactory): Deleted. (WebCore::MockRealtimeAudioSource::factory): Deleted. * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): (WebCore::MockRealtimeMediaSourceCenter::audioFactory): (WebCore::MockRealtimeMediaSourceCenter::videoFactory): (WebCore::MockRealtimeMediaSourceCenter::displayCaptureFactory): * platform/mock/MockRealtimeMediaSourceCenter.h: * platform/mock/MockRealtimeVideoSource.cpp: (): Deleted. (WebCore::MockRealtimeVideoSourceFactory::setVideoCapturePageState): Deleted. (WebCore::mockVideoCaptureSourceFactory): Deleted. (WebCore::MockRealtimeVideoSource::factory): Deleted. * platform/mock/MockRealtimeVideoSource.h: 2018-09-29 Oriol Brufau <obrufau@igalia.com> [css-grid] Properly align items next to collapsed tracks with gutters https://bugs.webkit.org/show_bug.cgi?id=190089 Reviewed by Manuel Rego Casasnovas. gridAreaPositionForInFlowChild could return a wrong end position for grid items adjacent to a collapsed track, because it didn't take into account that gutters collapse in that case. Therefore, "center" or "end" alignments displayed the item at the wrong position. Test: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-013.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::gridAreaPositionForInFlowChild const): 2018-09-29 Alicia Boya García <aboya@igalia.com> [GStreamer][MSE] Use GObject for GST_TRACE_OBJECT https://bugs.webkit.org/show_bug.cgi?id=190045 Reviewed by Philippe Normand. Passing a non-GObject object to GST_TRACE_OBJECT() can be theoretically misunderstood by the GStreamer logging function, so this patch avoids that. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::consumeAppsinkAvailableSamples): (WebCore::AppendPipeline::pushNewBuffer): 2018-09-28 Zamiul Haque <zhaque@apple.com> Angled gradient backgrounds in body render vertically when body height is 0 https://bugs.webkit.org/show_bug.cgi?id=177232 <rdar://problem/34548230>. Reviewed by Tim Horton. Specifically, gradients displayed at an angle (ie. 45 degrees) are rendered as if they are vertical when the body tag containing the gradient has a height of 0. Other browsers do not render under these circumstances, so WebKit was modified to follow in suit. The problem was due to layout sizes for fill tiles being calculated with a minimum height of 1px. A simple change of the minimum height and width to 0px was enough to bring about the desired behavior. Tests: angled-background-repeating-gradient-rendering-vertical.html * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::calculateFillTileSize const): 2018-09-28 Wenson Hsieh <wenson_hsieh@apple.com> No DOM API to instantiate an attachment for an img element https://bugs.webkit.org/show_bug.cgi?id=189934 <rdar://problem/44743222> Reviewed by Ryosuke Niwa. Adds support for HTMLAttachmentElement.getAttachmentIdentifier, a function that internal WebKit clients can use to ensure that an image element is backed by a unique _WKAttachment. See below for more details. Tests: WKAttachmentTests.AddAttachmentToConnectedImageElement WKAttachmentTests.ChangeFileWrapperForPastedImage WKAttachmentTests.ConnectImageWithAttachmentToDocument * dom/Document.cpp: (WebCore::Document::registerAttachmentIdentifier): Add a new hook to register an empty _WKAttachment in the UI process with a given identifier. Used when creating a new empty attachment to back an image element. * dom/Document.h: * editing/Editor.cpp: (WebCore::Editor::registerAttachmentIdentifier): (WebCore::Editor::notifyClientOfAttachmentUpdates): * editing/Editor.h: * html/HTMLAttachmentElement.cpp: (WebCore::HTMLAttachmentElement::getAttachmentIdentifier): Creates an attachment element to back the image element, if an attachment does not already exist, and returns the unique identifier. This also causes an empty corresponding _WKAttachment to be created in the client, whose file wrapper determines the contents of the image. (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier): (WebCore::HTMLAttachmentElement::hasEnclosingImage const): (WebCore::HTMLAttachmentElement::updateEnclosingImageWithData): Add a helper that updates the source of the enclosing image element given a content type and image data, by creating a new blob and blob URL. * html/HTMLAttachmentElement.h: * html/HTMLAttachmentElement.idl: * html/HTMLImageElement.idl: Rename webkitAttachmentIdentifier to just attachmentIdentifier. * page/EditorClient.h: (WebCore::EditorClient::registerAttachmentIdentifier): (WebCore::EditorClient::didInsertAttachmentWithIdentifier): 2018-09-28 Chris Dumez <cdumez@apple.com> The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString https://bugs.webkit.org/show_bug.cgi?id=190090 Reviewed by Ryosuke Niwa. The return value of an OnBeforeUnloadEventHandler should always be coerced into a DOMString: - https://html.spec.whatwg.org/#onbeforeunloadeventhandler - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5) In particular, this means that returning false in an OnBeforeUnloadEventHandler should NOT cancel the event when the event is a CustomEvent (and not a BeforeUnloadEvent). This is because the return value cannot be false at: - https://html.spec.whatwg.org/#the-event-handler-processing-algorithm (Step 5. Otherwise case). No new tests, rebaselined existing test. * bindings/js/JSEventListener.cpp: (WebCore::JSEventListener::handleEvent): 2018-09-28 Simon Fraser <simon.fraser@apple.com> RenderLayer::removeOnlyThisLayer() should not call updateLayerPositions() https://bugs.webkit.org/show_bug.cgi?id=190093 Reviewed by Dean Jackson and Zalan Bujtas. It's wrong for RenderLayer::removeOnlyThisLayer() to call updateLayerPositions(), because this is called at style update time, and layout will be stale. It was added (see webkit.org/b/25252) so that opacity changes, which can destroy layers, correctly update descendants. However, RenderStyle::changeRequiresLayout() checks for opacity <=> no opacity changes and triggers layout accordingly, which will result in a full post-layout updateLayerPositions(). This also revealed that changes to the "isolate" property fail to trigger any kind of style recalc or layout; we need it to trigger layout (for now) because it affects z-order. Covered by existing tests. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::removeOnlyThisLayer): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::changeRequiresLayout const): 2018-09-28 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Polish WebAuthN auto-test environment https://bugs.webkit.org/show_bug.cgi?id=189283 <rdar://problem/44117828> Reviewed by Chris Dumez. This patch removes the old mocking mechanism. Tests: http/wpt/webauthn/public-key-credential-create-with-invalid-parameters.https.html http/wpt/webauthn/public-key-credential-get-with-invalid-parameters.https.html http/wpt/webauthn/public-key-credential-same-origin-with-ancestors.https.html * DerivedSources.make: * WebCore.xcodeproj/project.pbxproj: * testing/Internals.cpp: (WebCore::Internals::Internals): (WebCore::Internals::mockAuthenticatorCoordinator const): Deleted. * testing/Internals.h: * testing/Internals.idl: * testing/MockAuthenticatorCoordinator.cpp: Removed. * testing/MockAuthenticatorCoordinator.h: Removed. * testing/MockAuthenticatorCoordinator.idl: Removed. 2018-09-28 Jer Noble <jer.noble@apple.com> Refactoring: eliminate raw pointer usage in Fullscreen code https://bugs.webkit.org/show_bug.cgi?id=188747 <rdar://problem/43541164> Reviewed by Alex Christensen. Two sources of raw pointers in the Fullscreen code: - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so they are passed around as raw references. - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't be ref-able. Make Model classes ref-able by adding ref() and deref() which call virtual refModel and derefModel methods, overridden by implementing subclasses. Make every concrete observer inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around the client interface. Since every Interface class now holds a strong reference to its Model classes, and each Model class holds a weak reference to all its clients, no explicit invalidate() method is necessary. Notes: - Since the weak pointer methods need to be able to downcast to the abstract base class, observers need to inherit publically (rather than privately) from those base classes. - Media element Models should compose EventListener rather than inheriting from it, since EventListener has its own RefCount. - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when their underlying object is destroyed), so clients should be stored in a Vector instead. - Interfaces should be given all required Refs at creation time, so that they can store those parameters as Refs instead of RefPtrs. * platform/cocoa/PlaybackSessionInterface.h: (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted. * platform/cocoa/PlaybackSessionModel.h: (WebCore::PlaybackSessionModel::ref): (WebCore::PlaybackSessionModel::deref): (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted. * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement): (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement): (WebCore::PlaybackSessionModelMediaElement::setMediaElement): (WebCore::PlaybackSessionModelMediaElement::updateForEventName): (WebCore::PlaybackSessionModelMediaElement::addClient): (WebCore::PlaybackSessionModelMediaElement::removeClient): (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions): (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices): (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted. * platform/cocoa/VideoFullscreenChangeObserver.h: (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModel::ref): (WebCore::VideoFullscreenModel::deref): (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted. * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): (VideoFullscreenModelVideoElement::setVideoElement): (VideoFullscreenModelVideoElement::addClient): (VideoFullscreenModelVideoElement::removeClient): (VideoFullscreenModelVideoElement::setHasVideo): (VideoFullscreenModelVideoElement::setVideoDimensions): (VideoFullscreenModelVideoElement::willEnterPictureInPicture): (VideoFullscreenModelVideoElement::didEnterPictureInPicture): (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): (VideoFullscreenModelVideoElement::willExitPictureInPicture): (VideoFullscreenModelVideoElement::didExitPictureInPicture): (VideoFullscreenModelVideoElement::handleEvent): Deleted. * platform/ios/PlaybackSessionInterfaceAVKit.h: (WebCore::PlaybackSessionInterfaceAVKit::create): (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): (): Deleted. * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer resolveBounds]): (-[WebAVPlayerLayer setVideoGravity:]): (VideoFullscreenInterfaceAVKit::create): (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit): (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit): (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver): (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive): (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::presentingViewController): (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen): (VideoFullscreenInterfaceAVKit::willStartPictureInPicture): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): (VideoFullscreenInterfaceAVKit::willStopPictureInPicture): (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): (VideoFullscreenInterfaceAVKit::doSetup): (VideoFullscreenInterfaceAVKit::setMode): (VideoFullscreenInterfaceAVKit::clearMode): (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted. (VideoFullscreenInterfaceAVKit::invalidate): Deleted. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController delegate]): (-[WebAVPlayerController playbackSessionInterface]): (-[WebAVPlayerController setPlaybackSessionInterface:]): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::didCleanupFullscreen): (VideoFullscreenControllerContext::addClient): (VideoFullscreenControllerContext::removeClient): (VideoFullscreenControllerContext::willEnterPictureInPicture): (VideoFullscreenControllerContext::didEnterPictureInPicture): (VideoFullscreenControllerContext::failedToEnterPictureInPicture): (VideoFullscreenControllerContext::willExitPictureInPicture): (VideoFullscreenControllerContext::didExitPictureInPicture): (VideoFullscreenControllerContext::setUpFullscreen): * platform/mac/PlaybackSessionInterfaceMac.h: * platform/mac/PlaybackSessionInterfaceMac.mm: (WebCore::PlaybackSessionInterfaceMac::create): (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac): (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const): (WebCore::PlaybackSessionInterfaceMac::rateChanged): (WebCore::PlaybackSessionInterfaceMac::beginScrubbing): (WebCore::PlaybackSessionInterfaceMac::endScrubbing): (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager): (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming): (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted. (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted. * platform/mac/VideoFullscreenInterfaceMac.h: (WebCore::VideoFullscreenInterfaceMac::create): (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const): (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const): (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const): * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]): (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]): (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]): (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]): (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac): (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac): (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver): (WebCore::VideoFullscreenInterfaceMac::setMode): (WebCore::VideoFullscreenInterfaceMac::clearMode): (WebCore::VideoFullscreenInterfaceMac::invalidate): (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted. * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]): (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]): (-[WebPlaybackControlsManager togglePlayback]): (-[WebPlaybackControlsManager setPlaying:]): (-[WebPlaybackControlsManager isPlaying]): (-[WebPlaybackControlsManager togglePictureInPicture]): 2018-09-28 Chris Dumez <cdumez@apple.com> Drop support for cross-origin-window-policy header https://bugs.webkit.org/show_bug.cgi?id=190081 Reviewed by Ryosuke Niwa. Drop support for cross-origin-window-policy header as this was never enabled and its design has some issues we have not resolved. An alternative is being worked on but will be substantially different so there is not much value in keeping this code around. * bindings/js/JSDOMBindingSecurity.cpp: * bindings/js/JSDOMBindingSecurity.h: * bindings/js/JSDOMWindowCustom.cpp: (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess): (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): (WebCore::addCrossOriginWindowPropertyNames): (WebCore::addScopedChildrenIndexes): (WebCore::addCrossOriginWindowOwnPropertyNames): (WebCore::JSDOMWindow::getOwnPropertyNames): * bindings/js/JSDOMWindowCustom.h: * bindings/js/JSRemoteDOMWindowCustom.cpp: * bindings/scripts/CodeGeneratorJS.pm: (GenerateAttributeGetterBodyDefinition): (GenerateAttributeSetterBodyDefinition): (GenerateOperationBodyDefinition): * bindings/scripts/IDLAttributes.json: * dom/Document.cpp: (WebCore::Document::canNavigate): * loader/FrameLoader.cpp: (WebCore::FrameLoader::didBeginDocument): * page/AbstractDOMWindow.cpp: (WebCore::AbstractDOMWindow::AbstractDOMWindow): * page/AbstractDOMWindow.h: * page/DOMWindow.idl: * page/Settings.yaml: * platform/network/HTTPParsers.cpp: * platform/network/HTTPParsers.h: 2018-09-28 Daniel Bates <dabates@apple.com> [iOS] Allow programmatic focus when hardware keyboard is attached https://bugs.webkit.org/show_bug.cgi?id=190017 <rdar://problem/42270463> Reviewed by Wenson Hsieh. Add support for checking if the embedding client is WebKitTestRunner and export isDumpRenderTree() so that we can make use of it from WebKit. We will make use of these functions to keep the current behavior of disallowing programmatic focus when running tests in these apps. This is needed to keep testing deterministic. Otherwise, test results would be dependent on whether a hardware keyboard is attached. When running tests in Simulator.app the hardware keyboard may also not be connected (i.e. Hardware > Keyboard > Connect Hardware Keyboard is disabled). * platform/RuntimeApplicationChecks.h: * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::IOSApplication::isWebKitTestRunner): Added. 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r236609): API tests for mso list preservation are failing https://bugs.webkit.org/show_bug.cgi?id=190095 Reviewed by Wenson Hsieh. The regression was caused by appendNodeToPreserveMSOList called after an early return for not having renderer. Clearly, comment & style elements coming from a MS word document wouldn't have a renderer. Fixed the bug by changing the order. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> Build fix after r236612. * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeSelection): 2018-09-28 Andy Estes <aestes@apple.com> [Apple Pay] Remove the "in-store" button type https://bugs.webkit.org/show_bug.cgi?id=190079 Reviewed by Tim Horton. According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>, this button is meant only for certain kinds of native apps. It shouldn't be available on the web. Updated http/tests/ssl/applepay/ApplePayButton.html. * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const): * css/CSSValueKeywords.in: * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * rendering/RenderThemeCocoa.mm: (WebCore::toPKPaymentButtonType): * rendering/style/RenderStyleConstants.h: 2018-09-28 Chris Dumez <cdumez@apple.com> document.open() should throw errors for cross-origin calls https://bugs.webkit.org/show_bug.cgi?id=189371 <rdar://problem/44282700> Reviewed by Youenn Fablet. document.open() / document.write() should throw errors for cross-origin calls as per: - https://html.spec.whatwg.org/#document-open-steps (Step 4) No new tests, rebaselined existing tests. * dom/Document.cpp: (WebCore::Document::open): (WebCore::Document::write): (WebCore::Document::writeln): * dom/Document.h: 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> Rename createMarkup to serializePreservingVisualAppearance https://bugs.webkit.org/show_bug.cgi?id=190086 Reviewed by Wenson Hsieh. Renamed the function to clarify what it does. Also removed the unused Range::toHTML. * dom/Range.cpp: (WebCore::Range::toHTML const): Deleted. * dom/Range.h: * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::selectionInHTMLFormat): * editing/gtk/EditorGtk.cpp: (WebCore::Editor::writeSelectionToPasteboard): * editing/markup.cpp: (WebCore::serializePreservingVisualAppearance): (WebCore::createMarkup): Deleted. * editing/markup.h: * editing/wpe/EditorWPE.cpp: (WebCore::Editor::writeSelectionToPasteboard): * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): (WebCore::LegacyWebArchive::createFromSelection): * platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeRangeToDataObject): 2018-09-28 Simon Fraser <simon.fraser@apple.com> Remove some unused RenderLayer code https://bugs.webkit.org/show_bug.cgi?id=190078 Reviewed by Zalan Bujtas. The 'outOfFlowDescendantContainingBlocks' code was related to the accelerated overflow scrolling code that I removed recently. updateDescendantsLayerListsIfNeeded() is never called. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateDescendantDependentFlags): (WebCore::RenderLayer::calculateClipRects const): * rendering/RenderLayer.h: 2018-09-28 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r236605. https://bugs.webkit.org/show_bug.cgi?id=190087 caused three API test timeouts (Requested by jernoble on #webkit). Reverted changeset: "Refactoring: eliminate raw pointer usage in Fullscreen code" https://bugs.webkit.org/show_bug.cgi?id=188747 https://trac.webkit.org/changeset/236605 2018-09-28 Ryosuke Niwa <rniwa@webkit.org> Simplify StyledMarkupAccumulator::traverseNodesForSerialization https://bugs.webkit.org/show_bug.cgi?id=190073 Reviewed by Antti Koivisto. Simplified the range traversal algorithm in traverseNodesForSerialization as it was too complicated to support shadow DOM for copy and paste. Instead of using NodeTraversal::next to traverse past ancestors and then figuring out which ancestor must be closed or to wrap the existing markup with, new code collects the list of ancestors as we traverse out of them. Also extracted lambdas for generating markup and deciding whether to skip a node as well as keeping track of the depth of the current markup. This further reduces the code complexity of the actual node traversal algorithm. Keeping track of the depth allows us to now generate ancestor elements' closing tags without keeping a stack of ancestor nodes we opened at all times. * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): 2018-09-27 Ryosuke Niwa <rniwa@webkit.org> Replace every use of Node::offsetInCharacters() by Node::isCharacterDataNode() https://bugs.webkit.org/show_bug.cgi?id=190069 Reviewed by Zalan Bujtas. Removed Node::offsetInCharacters() and replaced every use of it by isCharacterDataNode() because their implementations are identical. Note that offsetInCharacters() sounds like a function which returns some kind of an offset but it doesn't. It returns true when called on a CharacterData and false elsewhere. * accessibility/AXObjectCache.cpp: (WebCore::characterOffsetsInOrder): (WebCore::AXObjectCache::startOrEndCharacterOffsetForRange): (WebCore::AXObjectCache::characterOffsetFromVisiblePosition): * dom/CharacterData.cpp: (WebCore::CharacterData::offsetInCharacters const): Deleted. * dom/CharacterData.h: * dom/Node.cpp: (WebCore::Node::offsetInCharacters const): Deleted. * dom/Node.h: * dom/Position.cpp: (WebCore::Position::parentAnchoredEquivalent const): * dom/Position.h: (WebCore::lastOffsetInNode): (WebCore::minOffsetForNode): (WebCore::offsetIsBeforeLastNodeOffset): * dom/Range.cpp: (WebCore::Range::firstNode const): (WebCore::Range::pastLastNode const): * dom/RangeBoundaryPoint.h: (WebCore::RangeBoundaryPoint::setOffset): (WebCore::RangeBoundaryPoint::setToEndOfNode): * editing/Editing.cpp: (WebCore::lastOffsetForEditing): * editing/TextIterator.cpp: (WebCore::nextInPreOrderCrossingShadowBoundaries): (WebCore::TextIterator::node const): (WebCore::SimplifiedBackwardsTextIterator::SimplifiedBackwardsTextIterator): * page/DOMSelection.cpp: (WebCore::DOMSelection::extend): 2018-09-28 Jer Noble <jer.noble@apple.com> Refactoring: eliminate raw pointer usage in Fullscreen code https://bugs.webkit.org/show_bug.cgi?id=188747 <rdar://problem/43541164> Reviewed by Alex Christensen. Two sources of raw pointers in the Fullscreen code: - Model classes (PlaybackSessionModel and VideoFullscreenModel) aren't ref-able, so they are passed around as raw references. - Observer classes (PlaybackSessionModelClient and VideoFullscreenModelClient, and VideoFullscreenChangeObserver) are also passed around as raw pointers, but shouldn't be ref-able. Make Model classes ref-able by adding ref() and deref() which call virtual refModel and derefModel methods, overridden by implementing subclasses. Make every concrete observer inherit from CanMakeWeakPtr, and every registration method take WeakPtr wrappers around the client interface. Since every Interface class now holds a strong reference to its Model classes, and each Model class holds a weak reference to all its clients, no explicit invalidate() method is necessary. Notes: - Since the weak pointer methods need to be able to downcast to the abstract base class, observers need to inherit publically (rather than privately) from those base classes. - Media element Models should compose EventListener rather than inheriting from it, since EventListener has its own RefCount. - WeakPtrs can't be held in HashSets (because they change value, and therefore hash, when their underlying object is destroyed), so clients should be stored in a Vector instead. - Interfaces should be given all required Refs at creation time, so that they can store those parameters as Refs instead of RefPtrs. * platform/cocoa/PlaybackSessionInterface.h: (WebCore::PlaybackSessionInterface::~PlaybackSessionInterface): Deleted. * platform/cocoa/PlaybackSessionModel.h: (WebCore::PlaybackSessionModel::ref): (WebCore::PlaybackSessionModel::deref): (WebCore::PlaybackSessionModel::~PlaybackSessionModel): Deleted. * platform/cocoa/PlaybackSessionModelMediaElement.h: * platform/cocoa/PlaybackSessionModelMediaElement.mm: (WebCore::PlaybackSessionModelMediaElement::PlaybackSessionModelMediaElement): (WebCore::PlaybackSessionModelMediaElement::~PlaybackSessionModelMediaElement): (WebCore::PlaybackSessionModelMediaElement::setMediaElement): (WebCore::PlaybackSessionModelMediaElement::updateForEventName): (WebCore::PlaybackSessionModelMediaElement::addClient): (WebCore::PlaybackSessionModelMediaElement::removeClient): (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions): (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionIndices): (WebCore::PlaybackSessionModelMediaElement::handleEvent): Deleted. * platform/cocoa/VideoFullscreenChangeObserver.h: (WebCore::VideoFullscreenChangeObserver::~VideoFullscreenChangeObserver): Deleted. * platform/cocoa/VideoFullscreenModel.h: (WebCore::VideoFullscreenModel::ref): (WebCore::VideoFullscreenModel::deref): (WebCore::VideoFullscreenModel::~VideoFullscreenModel): Deleted. * platform/cocoa/VideoFullscreenModelVideoElement.h: * platform/cocoa/VideoFullscreenModelVideoElement.mm: (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): (VideoFullscreenModelVideoElement::setVideoElement): (VideoFullscreenModelVideoElement::addClient): (VideoFullscreenModelVideoElement::removeClient): (VideoFullscreenModelVideoElement::setHasVideo): (VideoFullscreenModelVideoElement::setVideoDimensions): (VideoFullscreenModelVideoElement::willEnterPictureInPicture): (VideoFullscreenModelVideoElement::didEnterPictureInPicture): (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): (VideoFullscreenModelVideoElement::willExitPictureInPicture): (VideoFullscreenModelVideoElement::didExitPictureInPicture): (VideoFullscreenModelVideoElement::handleEvent): Deleted. * platform/ios/PlaybackSessionInterfaceAVKit.h: (WebCore::PlaybackSessionInterfaceAVKit::create): (WebCore::PlaybackSessionInterfaceAVKit::playbackSessionModel const): (): Deleted. * platform/ios/PlaybackSessionInterfaceAVKit.mm: (WebCore::PlaybackSessionInterfaceAVKit::PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::~PlaybackSessionInterfaceAVKit): (WebCore::PlaybackSessionInterfaceAVKit::invalidate): Deleted. * platform/ios/VideoFullscreenInterfaceAVKit.h: * platform/ios/VideoFullscreenInterfaceAVKit.mm: (-[WebAVPlayerLayer layoutSublayers]): (-[WebAVPlayerLayer resolveBounds]): (-[WebAVPlayerLayer setVideoGravity:]): (VideoFullscreenInterfaceAVKit::create): (VideoFullscreenInterfaceAVKit::VideoFullscreenInterfaceAVKit): (VideoFullscreenInterfaceAVKit::~VideoFullscreenInterfaceAVKit): (VideoFullscreenInterfaceAVKit::setVideoFullscreenChangeObserver): (VideoFullscreenInterfaceAVKit::applicationDidBecomeActive): (VideoFullscreenInterfaceAVKit::setupFullscreen): (VideoFullscreenInterfaceAVKit::presentingViewController): (VideoFullscreenInterfaceAVKit::requestHideAndExitFullscreen): (VideoFullscreenInterfaceAVKit::preparedToExitFullscreen): (VideoFullscreenInterfaceAVKit::willStartPictureInPicture): (VideoFullscreenInterfaceAVKit::didStartPictureInPicture): (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): (VideoFullscreenInterfaceAVKit::willStopPictureInPicture): (VideoFullscreenInterfaceAVKit::didStopPictureInPicture): (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): (VideoFullscreenInterfaceAVKit::doSetup): (VideoFullscreenInterfaceAVKit::setMode): (VideoFullscreenInterfaceAVKit::clearMode): (VideoFullscreenInterfaceAVKit::setVideoFullscreenModel): Deleted. (VideoFullscreenInterfaceAVKit::invalidate): Deleted. * platform/ios/WebAVPlayerController.h: * platform/ios/WebAVPlayerController.mm: (-[WebAVPlayerController delegate]): (-[WebAVPlayerController playbackSessionInterface]): (-[WebAVPlayerController setPlaybackSessionInterface:]): * platform/ios/WebVideoFullscreenControllerAVKit.mm: (VideoFullscreenControllerContext::didCleanupFullscreen): (VideoFullscreenControllerContext::addClient): (VideoFullscreenControllerContext::removeClient): (VideoFullscreenControllerContext::willEnterPictureInPicture): (VideoFullscreenControllerContext::didEnterPictureInPicture): (VideoFullscreenControllerContext::failedToEnterPictureInPicture): (VideoFullscreenControllerContext::willExitPictureInPicture): (VideoFullscreenControllerContext::didExitPictureInPicture): (VideoFullscreenControllerContext::setUpFullscreen): * platform/mac/PlaybackSessionInterfaceMac.h: * platform/mac/PlaybackSessionInterfaceMac.mm: (WebCore::PlaybackSessionInterfaceMac::create): (WebCore::PlaybackSessionInterfaceMac::PlaybackSessionInterfaceMac): (WebCore::PlaybackSessionInterfaceMac::playbackSessionModel const): (WebCore::PlaybackSessionInterfaceMac::rateChanged): (WebCore::PlaybackSessionInterfaceMac::beginScrubbing): (WebCore::PlaybackSessionInterfaceMac::endScrubbing): (WebCore::PlaybackSessionInterfaceMac::setPlayBackControlsManager): (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerTiming): (WebCore::PlaybackSessionInterfaceMac::~PlaybackSessionInterfaceMac): Deleted. (WebCore::PlaybackSessionInterfaceMac::invalidate): Deleted. * platform/mac/VideoFullscreenInterfaceMac.h: (WebCore::VideoFullscreenInterfaceMac::create): (WebCore::VideoFullscreenInterfaceMac::videoFullscreenModel const): (WebCore::VideoFullscreenInterfaceMac::playbackSessionModel const): (WebCore::VideoFullscreenInterfaceMac::videoFullscreenChangeObserver const): * platform/mac/VideoFullscreenInterfaceMac.mm: (-[WebVideoFullscreenInterfaceMacObjC setUpPIPForVideoView:withFrame:inWindow:]): (-[WebVideoFullscreenInterfaceMacObjC boundsDidChangeForVideoViewContainer:]): (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]): (-[WebVideoFullscreenInterfaceMacObjC pipActionPlay:]): (-[WebVideoFullscreenInterfaceMacObjC pipActionPause:]): (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): (WebCore::VideoFullscreenInterfaceMac::VideoFullscreenInterfaceMac): (WebCore::VideoFullscreenInterfaceMac::~VideoFullscreenInterfaceMac): (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenChangeObserver): (WebCore::VideoFullscreenInterfaceMac::setMode): (WebCore::VideoFullscreenInterfaceMac::clearMode): (WebCore::VideoFullscreenInterfaceMac::invalidate): (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): (WebCore::VideoFullscreenInterfaceMac::setVideoFullscreenModel): Deleted. * platform/mac/WebPlaybackControlsManager.mm: (-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]): (-[WebPlaybackControlsManager setCurrentAudioTouchBarMediaSelectionOption:]): (-[WebPlaybackControlsManager setCurrentLegibleTouchBarMediaSelectionOption:]): (-[WebPlaybackControlsManager togglePlayback]): (-[WebPlaybackControlsManager setPlaying:]): (-[WebPlaybackControlsManager isPlaying]): (-[WebPlaybackControlsManager togglePictureInPicture]): 2018-09-28 Chris Dumez <cdumez@apple.com> Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() https://bugs.webkit.org/show_bug.cgi?id=190077 <rdar://problem/44812613> Reviewed by Zalan Bujtas. Drop iOS specific quirk in SettingsBase::scriptEnabledChanged() that would dirty style after the "JavaScriptEnabled" setting's state is toggled. I do not see a good reason to do this given that scripts would not get executed until a reload. If we find out after dropping this that this is actually useful for some reason, then we can always bring it back and consider making this non-iOS specific, as well as documenting why this it is needed. * page/Settings.yaml: * page/SettingsBase.cpp: (WebCore::SettingsBase::scriptEnabledChanged): Deleted. * page/SettingsBase.h: 2018-09-27 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Fix priority issue with multiple cookies with different level of path. https://bugs.webkit.org/show_bug.cgi?id=189920 Reviewed by Fujii Hironori. When multiple cookies are stored in the database for same site, the priority of multiple cookies which matches path criteria was not defined. The backend implementation `sqlite` then returns the first matching result, which is the one stored earlier. Test: http/tests/cookies/cookie-with-multiple-level-path.html * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::searchCookies): 2018-09-26 Ryosuke Niwa <rniwa@webkit.org> Use enum class in createMarkup arguments https://bugs.webkit.org/show_bug.cgi?id=190028 Reviewed by Wenson Hsieh. Replaced enums used by createMarkup with equivalent enum classes: EChildrenOnly with SerializedNodes, EAbsoluteURLs with ResolveURLs, and EFragmentSerialization with SerializationSyntax. Also replaced the boolean convertBlocksToInlines with an enum class of the same name. Finally, renamed the createMarkup variant which doesn't serialize style and used for innerHTML and XMLSerializer to serializeFragment. * dom/Element.cpp: (WebCore::Element::innerHTML const): (WebCore::Element::outerHTML const): * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::innerHTML const): * editing/CompositeEditCommand.cpp: (WebCore::CompositeEditCommand::moveParagraphs): * editing/HTMLInterchange.h: (WebCore::AnnotateForInterchange): Renamed from EAnnotateForInterchange. * editing/MarkupAccumulator.cpp: (WebCore::MarkupAccumulator::MarkupAccumulator): (WebCore::MarkupAccumulator::serializeNodes): (WebCore::MarkupAccumulator::serializeNodesWithNamespaces): (WebCore::MarkupAccumulator::resolveURLIfNeeded const): * editing/MarkupAccumulator.h: (WebCore::MarkupAccumulator::inXMLFragmentSerialization const): * editing/ReplaceRangeWithTextCommand.cpp: (WebCore::ReplaceRangeWithTextCommand::inputEventDataTransfer const): * editing/ReplaceSelectionCommand.cpp: (WebCore::ReplaceSelectionCommand::willApplyCommand): * editing/SpellingCorrectionCommand.cpp: (WebCore::SpellingCorrectionCommand::inputEventDataTransfer const): * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::selectionInHTMLFormat): * editing/cocoa/WebContentReaderCocoa.mm: (WebCore::WebContentMarkupReader::readRTFD): (WebCore::WebContentMarkupReader::readRTF): * editing/gtk/EditorGtk.cpp: (WebCore::Editor::writeImageToPasteboard): (WebCore::Editor::writeSelectionToPasteboard): * editing/markup.cpp: (WebCore::StyledMarkupAccumulator::StyledMarkupAccumulator): (WebCore::StyledMarkupAccumulator::serializeNodes): (WebCore::StyledMarkupAccumulator::traverseNodesForSerialization): (WebCore::highestAncestorToWrapMarkup): (WebCore::createMarkupInternal): (WebCore::createMarkup): (WebCore::sanitizedMarkupForFragmentInDocument): (WebCore::serializeFragment): Renamed from createMarkup. This is used for innerHTML and XMLSerializer, which faithfully serializes the fragment without any computed style as inline styles. (WebCore::documentTypeString): (WebCore::createFullMarkup): Deleted two varinats used in WebKitLegacy. * editing/markup.h: (WebCore::ResolveURLs): Renamed from EAbsoluteURLs. (WebCore::ConvertBlocksToInlines): Added. (WebCore::SerializedNodes): Renamed from EChildrenOnly. (WebCore::SerializationSyntax): Renamed from EFragmentSerialization. * editing/wpe/EditorWPE.cpp: (WebCore::Editor::writeSelectionToPasteboard): * inspector/DOMEditor.cpp: * inspector/agents/InspectorDOMAgent.cpp: (WebCore::InspectorDOMAgent::getOuterHTML): * loader/archive/cf/LegacyWebArchive.cpp: (WebCore::LegacyWebArchive::create): (WebCore::LegacyWebArchive::createFromSelection): * page/PageSerializer.cpp: (WebCore::PageSerializer::SerializerMarkupAccumulator::SerializerMarkupAccumulator): (WebCore::PageSerializer::serializeFrame): * page/win/DragControllerWin.cpp: (WebCore::DragController::declareAndWriteDragImage): * Source/WebCore/platform/win/PasteboardWin.cpp: (WebCore::Pasteboard::writeRangeToDataObject): (WebCore::Pasteboard::writeSelection): * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::send): * xml/XMLSerializer.cpp: (WebCore::XMLSerializer::serializeToString): * xml/XSLTProcessorLibxslt.cpp: (WebCore::xsltStylesheetPointer): (WebCore::xmlDocPtrFromNode): 2018-09-27 John Wilander <wilander@apple.com> Resource Load Statistics: Non-redirected top frame navigation should not get captured in statistics https://bugs.webkit.org/show_bug.cgi?id=190055 <rdar://problem/44843460> Reviewed by Chris Dumez. Test: http/tests/resourceLoadStatistics/do-not-capture-statistics-for-simple-top-navigations.html * loader/ResourceLoadStatistics.cpp: (WebCore::ResourceLoadStatistics::decode): Corrects legacy statistics for frames and triggers a re-classification. 2018-09-27 Jer Noble <jer.noble@apple.com> Unreviewed watchOS build fix; Fix declaration for ports which USE(ENCRYPTED_MEDIA) but don't HAVE(AVCONTENTKEYSESSION). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: 2018-09-27 Justin Michaud <justin_michaud@apple.com> Remove duplicate CSS Properties and Values feature on status page https://bugs.webkit.org/show_bug.cgi?id=189909 Reviewed by Simon Fraser. Update CSS properties and values api feature in features.json * features.json: 2018-09-27 Jer Noble <jer.noble@apple.com> MediaPlayer should have mediaPlayerWaitingForKeyChanged() / bool waitingForKey() accessor https://bugs.webkit.org/show_bug.cgi?id=189951 Reviewed by Eric Carlson. In order to implement the "Resume Playback" section of EME, part 4, we need to be able to query whether the MediaPlayer is still waiting for a key after attemptToDecrypt() has been called. Currently this involves no behavioral changes, as all modern EME ports will still just notify the media element that they no longer need keys after one has been added, but future ports may be able to wait for multiple keys before reporting that it is no longer waiting for keys. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerWaitingForKeyChanged): (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary): (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey): Deleted. * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::waitingForKeyChanged): (WebCore::MediaPlayer::waitingForKey const): (WebCore::MediaPlayer::waitingForKey): Deleted. * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerWaitingForKeyChanged): (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey): Deleted. * platform/graphics/MediaPlayerPrivate.h: (WebCore::MediaPlayerPrivateInterface::waitingForKey const): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): (WebCore::MediaPlayerPrivateAVFoundationObjC::attemptToDecryptWithInstance): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::attemptToDecryptWithInstance): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKey const): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::waitingForKeyChanged): (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::attemptToDecrypt): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey): (WebCore::MediaPlayerPrivateGStreamerBase::setWaitingForKey): (WebCore::MediaPlayerPrivateGStreamerBase::waitingForKey const): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptSinkEventHandler): 2018-09-27 Alicia Boya García <aboya@igalia.com> [MSE] Fix unwanted sample erase from the decode queue https://bugs.webkit.org/show_bug.cgi?id=180643 Reviewed by Jer Noble. Test: media/media-source/media-source-append-acb-no-frame-lost.html This bug reproduced when unordered appends were made. For instance, if the application appended [0, 10) and then [20, 30), the frame at 20 would be wrongly discarded from the decode queue. Later the application could append [10, 20) and the gap at [20, 21) would persist in the decode queue, even if the frame remained in the track buffer table. Thanks to Daniel Zhang for reporting the issue. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::provideMediaData): 2018-09-27 Alex Christensen <achristensen@webkit.org> URLParser should use TextEncoding through an abstract class https://bugs.webkit.org/show_bug.cgi?id=190027 Reviewed by Andy Estes. URLParser uses TextEncoding for one call to encode, which is only used for encoding the query of URLs in documents with non-UTF encodings. There are 3 call sites that specify the TextEncoding to use from the Document, and even those call sites use a UTF encoding most of the time. All other URL parsing is done using a well-optimized path which assumes UTF-8 encoding and uses macros from ICU headers, not a TextEncoding. Moving the logic in this way breaks URL and URLParser's dependency on TextEncoding, which makes it possible to use in a lower-level project without also moving TextEncoding, TextCodec, TextCodecICU, ThreadGlobalData, and the rest of WebCore and JavaScriptCore. There is no observable change in behavior. There is now one virtual function call in a code path in URLParser that is not performance-sensitive, and TextEncodings now have a vtable, which uses a few more bytes of memory total for WebKit. * css/parser/CSSParserContext.h: (WebCore::CSSParserContext::completeURL const): * css/parser/CSSParserIdioms.cpp: (WebCore::completeURL): * dom/Document.cpp: (WebCore::Document::completeURL const): * html/HTMLBaseElement.cpp: (WebCore::HTMLBaseElement::href const): Move the call to encodingForFormSubmission from the URL constructor to the 3 call sites that specify the encoding from the Document. * loader/FormSubmission.cpp: (WebCore::FormSubmission::create): * loader/TextResourceDecoder.cpp: (WebCore::TextResourceDecoder::encodingForURLParsing): * loader/TextResourceDecoder.h: * platform/URL.cpp: (WebCore::URL::URL): * platform/URL.h: (WebCore::URLTextEncoding::~URLTextEncoding): * platform/URLParser.cpp: (WebCore::URLParser::encodeNonUTF8Query): (WebCore::URLParser::copyURLPartsUntil): (WebCore::URLParser::URLParser): (WebCore::URLParser::parse): (WebCore::URLParser::encodeQuery): Deleted. A pointer replaces the boolean isUTF8Encoding and the TextEncoding& which had a default value of UTF8Encoding. Now the pointer being null means that we use UTF8, and the pointer being non-null means we use that encoding. * platform/URLParser.h: (WebCore::URLParser::URLParser): * platform/text/TextEncoding.cpp: (WebCore::UTF7Encoding): (WebCore::TextEncoding::encodingForFormSubmissionOrURLParsing const): (WebCore::ASCIIEncoding): (WebCore::Latin1Encoding): (WebCore::UTF16BigEndianEncoding): (WebCore::UTF16LittleEndianEncoding): (WebCore::UTF8Encoding): (WebCore::WindowsLatin1Encoding): (WebCore::TextEncoding::encodingForFormSubmission const): Deleted. Use NeverDestroyed because TextEncoding now has a virtual destructor. * platform/text/TextEncoding.h: Rename encodingForFormSubmission to encodingForFormSubmissionOrURLParsing to make it more clear that we are intentionally using it for both. 2018-09-27 John Wilander <wilander@apple.com> Resource Load Statistics: Remove temporary compatibility fix for auto-dismiss popups https://bugs.webkit.org/show_bug.cgi?id=189980 <rdar://problem/44780645> Reviewed by Alex Christensen. Test: http/tests/storageAccess/deny-storage-access-under-opener-if-auto-dismiss.html The change in https://bugs.webkit.org/show_bug.cgi?id=183620 was a temporary compatibility fix as explained in: https://webkit.org/blog/8311/intelligent-tracking-prevention-2-0/. We should remove it. Most of these changes remove the parameter isTriggeredByUserGesture since it's no longer needed. * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::setRequestStorageAccessUnderOpenerCallback): (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): (WebCore::ResourceLoadObserver::requestStorageAccessUnderOpener): (WebCore::ResourceLoadObserver::logWindowCreation): Deleted. * loader/ResourceLoadObserver.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): Now no longer logs anything to ResourceLoadObserver. 2018-09-27 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r236557. Really roll out r236557 this time because it breaks internal builds. Reverted changeset: "Add VP8 support to WebRTC" https://bugs.webkit.org/show_bug.cgi?id=189976 https://trac.webkit.org/changeset/236557 2018-09-27 Chris Dumez <cdumez@apple.com> Fragment should be stripped from document URL during document.open() URL propagation https://bugs.webkit.org/show_bug.cgi?id=189374 <rdar://problem/44282736> Reviewed by Alex Christensen. Strip the Document URL fragment during document.open() URL propagation if the entry document is not the current document, as per: - https://html.spec.whatwg.org/#document-open-steps (Step 11.2.) No new tests, rebaselined existing test. * dom/Document.cpp: (WebCore::Document::open): 2018-09-27 Youenn Fablet <youenn@apple.com> Add VP8 support to WebRTC https://bugs.webkit.org/show_bug.cgi?id=189976 Reviewed by Eric Carlson. Add a runtime flag to control activation of VP8 codec. Bind this runtime flag to the video codec factories. Test: webrtc/video-mute-vp8.html * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::createLibWebRTCPeerConnectionBackend): * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::webRTCVP8CodecEnabled const): (WebCore::RuntimeEnabledFeatures::setWebRTCVP8CodecEnabled): * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): * testing/Internals.cpp: (WebCore::Internals::resetToConsistentState): Enable VP8 codec for tests. 2018-09-27 Chris Dumez <cdumez@apple.com> Crash under WebCore::deleteCookiesForHostnames() https://bugs.webkit.org/show_bug.cgi?id=190040 <rdar://problem/38020368> Reviewed by Alex Christensen. Update NetworkStorageSession::deleteCookiesForHostnames() to properly deal with the fact that NSHTTPCookie.domain can return nil. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::NetworkStorageSession::deleteCookiesForHostnames): 2018-09-27 Youenn Fablet <youenn@apple.com> Use kCVPixelFormatType_420YpCbCr8Planar for capturing frames https://bugs.webkit.org/show_bug.cgi?id=190014 Reviewed by Eric Carlson. On Mac, rely on the monoplanar format which can be displayed without any issue. Once rendering is fixed, we should change it back to biplanar as it is closer to what libwebrtc consumes. Covered by manual testing. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::avVideoCapturePixelBufferFormat): (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): 2018-09-27 Andy Estes <aestes@apple.com> [Apple Pay] Support granular errors in PaymentDetailsUpdate https://bugs.webkit.org/show_bug.cgi?id=189938 Reviewed by Youenn Fablet. Implemented the shippingAddressErrors, payerErrors, and paymentMethodErrors properties on PaymentDetailsUpdate, as specified in the Payment Request API W3C Editor's Draft of 26 September 2018. When these errors are specified in a PaymentDetailsUpdate, map them to PaymentErrors. For shippingAddressErrors and payerErrors, we use the "shippingContactInvalid" code and a contact field that matches the shippingAddressError or payerError property specified. For paymentMethodErrors, we interpret this as a sequence of ApplePayErrors, which are converted to PaymentErrors as in Apple Pay JS. Tests: http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrors.https.html http/tests/ssl/applepay/ApplePayShippingAddressChangeEventErrorsV3.https.html * DerivedSources.make: Removed some tabs and added new .idl files. * Modules/applepay/ApplePayError.idl: Moved ApplePayErrorCode and ApplePayErrorContactField into their own .idl files so they can be used in MockPaymentError. * Modules/applepay/ApplePayErrorCode.h: Added. * Modules/applepay/ApplePayErrorCode.idl: Added. * Modules/applepay/ApplePayErrorContactField.h: Added. * Modules/applepay/ApplePayErrorContactField.idl: Added. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::appendShippingContactInvalidError): Appended a "shippingContactInvalid" PaymentError to errors if the message is non-null. (WebCore::ApplePayPaymentHandler::computeErrors const): (WebCore::ApplePayPaymentHandler::detailsUpdated): (WebCore::ApplePayPaymentHandler::shippingAddressUpdated): Computed a vector of PaymentErrors based on shippingAddressErrors, payerErrors, and paymentMethodErrors. * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/paymentrequest/PaymentDetailsUpdate.h: * Modules/paymentrequest/PaymentDetailsUpdate.idl: Defined shippingAddressErrors, payerErrors, and paymentMethodErrors. * Modules/paymentrequest/PaymentHandler.h: * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::paymentMethodChanged): (WebCore::PaymentRequest::settleDetailsPromise): Passed shippingAddressErrors, payerErrors, and paymentMethodErrors to the payment handler. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * testing/MockPaymentCoordinator.cpp: (WebCore::MockPaymentCoordinator::completeShippingContactSelection): Stored errors in m_errors. * testing/MockPaymentCoordinator.h: * testing/MockPaymentCoordinator.idl: Added an errors attribute. * testing/MockPaymentError.h: Added. * testing/MockPaymentError.idl: Added. 2018-09-27 Alex Christensen <achristensen@webkit.org> URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL https://bugs.webkit.org/show_bug.cgi?id=189979 Reviewed by Youenn Fablet. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::URLWithUserTypedString): (WebCore::dataForURLComponentType): (WebCore::URLByRemovingComponentAndSubsequentCharacter): (WebCore::URLByCanonicalizingURL): (WebCore::originalURLData): (WebCore::userVisibleString): 2018-09-27 Chris Dumez <cdumez@apple.com> document.open() should not propagate URLs to non-fully active documents https://bugs.webkit.org/show_bug.cgi?id=189375 <rdar://problem/44282755> Reviewed by Youenn Fablet. Update our document.open() to not propagate URLs to non-fully active documents, as per: - https://html.spec.whatwg.org/#document-open-steps (Step 11) A "fully active" document is defined by at: - https://html.spec.whatwg.org/#fully-active No new tests, rebaselined existing test. * dom/Document.cpp: (WebCore::Document::open): (WebCore::Document::isFullyActive const): * dom/Document.h: * dom/Document.idl: 2018-09-27 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Use sentinel buffer to detect end of append https://bugs.webkit.org/show_bug.cgi?id=189924 Reviewed by Philippe Normand. This patch introduces a new mechanism to detect when an append has been consumed completely by the demuxer. It takes advantage of the fact that buffer pushing is synchronous: both the appsrc and the demuxer live in the same streaming thread. When appsrc pushes a buffer, it's actually making a qtdemux function call (it calls its "chain" function). The demuxer will return from that call when it has finished processing that buffer; only then the control returns to appsrc, that can push the next buffer. By pushing an additional buffer and capturing it in a probe we can detect reliably when the previous buffer has been processed. Because the pipeline only has one thread, at this point no more frames can arrive to the appsink. This replaces the old method of detecting end of append which relied on the `need-data` event, which is more difficult to handle correctly because it fires whenever the appsrc is empty (or below a given level), which also happens when a buffer has not been pushed yet or in response to a flush. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::EndOfAppendMeta::init): (WebCore::EndOfAppendMeta::transform): (WebCore::EndOfAppendMeta::free): (WebCore::AppendPipeline::staticInitialization): (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::appsrcEndOfAppendCheckerProbe): (WebCore::AppendPipeline::handleApplicationMessage): (WebCore::AppendPipeline::handleEndOfAppend): (WebCore::AppendPipeline::consumeAppsinkAvailableSamples): (WebCore::AppendPipeline::resetPipeline): (WebCore::AppendPipeline::pushNewBuffer): (WebCore::AppendPipeline::handleAppsrcNeedDataReceived): Deleted.: (WebCore::AppendPipeline::handleAppsrcAtLeastABufferLeft): Deleted. (WebCore::AppendPipeline::checkEndOfAppend): Deleted. (WebCore::AppendPipeline::setAppsrcDataLeavingProbe): Deleted. (WebCore::AppendPipeline::removeAppsrcDataLeavingProbe): Deleted. (WebCore::AppendPipeline::reportAppsrcAtLeastABufferLeft): Deleted. (WebCore::AppendPipeline::reportAppsrcNeedDataReceived): Deleted. (WebCore::appendPipelineAppsrcDataLeaving): Deleted. (WebCore::appendPipelineAppsrcNeedData): Deleted. * platform/graphics/gstreamer/mse/AppendPipeline.h: 2018-09-27 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=184183 <rdar://problem/36800576> Reviewed by Ryosuke Niwa. Drop test infrastructure for the DoNotProcessIncomingMessagesWhenWaitingForSyncReply IPC::SendOption given that this SendOption was removed from this patch. * page/ChromeClient.h: * testing/Internals.cpp: * testing/Internals.h: * testing/Internals.idl: 2018-09-27 Philippe Normand <pnormand@igalia.com> Unreviewed, GTK Ubuntu LTS build fix attempt after r236396. * platform/graphics/gstreamer/GStreamerCommon.h: 2018-09-27 Antoine Quint <graouts@apple.com> [Web Animations] Turn Web Animations with CSS integration on https://bugs.webkit.org/show_bug.cgi?id=184819 <rdar://problem/39597337> Reviewed by Dean Jackson. * page/RuntimeEnabledFeatures.h: 2018-09-26 YUHAN WU <yuhan_wu@apple.com> Video track clone cannot preserve original property https://bugs.webkit.org/show_bug.cgi?id=189872 <rdar://problem/44706579> Reviewed by Youenn Fablet. Fix the issue that the cloned track created by canvas.captureStream().getVideoTracks() cannot keep some attributes, such as enabled. Updated a testcase expected result: LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp: (WebCore::CanvasCaptureMediaStreamTrack::CanvasCaptureMediaStreamTrack): (WebCore::CanvasCaptureMediaStreamTrack::create): (WebCore::CanvasCaptureMediaStreamTrack::clone): * Modules/mediastream/CanvasCaptureMediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.h: 2018-09-26 Alex Christensen <achristensen@webkit.org> Unreviewed, rolling out r236524. Broke API tests Reverted changeset: "URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL" https://bugs.webkit.org/show_bug.cgi?id=189979 https://trac.webkit.org/changeset/236524 2018-09-26 Per Arne Vollan <pvollan@apple.com> WebVTT cue alignment broken https://bugs.webkit.org/show_bug.cgi?id=190004 Reviewed by Eric Carlson. If the position of the queue is unspecified, the default value of 50 was used, which is incorrect. This patch also updates the API according to https://w3c.github.io/webvtt/#the-vttcue-interface. The position attribute should not be a double, but either a double or the "auto" keyword. Parts of this patch is inspired by the associated code in the Chromium project. Test: media/track/track-cue-left-align.html * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): (WebCore::TextTrackCueGeneric::setPosition): * html/track/TextTrackCueGeneric.h: * html/track/VTTCue.cpp: (WebCore::VTTCueBox::applyCSSProperties): (WebCore::VTTCue::initialize): (WebCore::VTTCue::position const): (WebCore::VTTCue::setPosition): (WebCore::VTTCue::textPositionIsAuto const): (WebCore::VTTCue::calculateComputedTextPosition const): (WebCore::VTTCue::calculateDisplayParameters): (WebCore::VTTCue::toJSON const): * html/track/VTTCue.h: (WebCore::VTTCue::position const): Deleted. * html/track/VTTCue.idl: 2018-09-26 James Savage <james.savage@apple.com> Allow override of viewport configuration. https://bugs.webkit.org/show_bug.cgi?id=188772. <rdar://problem/43538892>. Reviewed by Simon Fraser. * page/Settings.yaml: * page/ViewportConfiguration.cpp: (WebCore::ViewportConfiguration::nativeWebpageParameters): Provide a viewport configuration similar to width=device-width, with initial scale set to 1. * page/ViewportConfiguration.h: 2018-09-26 Alex Christensen <achristensen@webkit.org> URLs with mismatched surrogate pairs in the host should fail to parse https://bugs.webkit.org/show_bug.cgi?id=190005 Reviewed by Chris Dumez. Elsewhere in the URLParser, when we encounter mismatched surrogate pairs we use the replacement character, but that just fails later on in domainToASCII, so we may as well just fail. This behavior matches Chrome, but is unclear in the spec. There are no valid uses of hosts containing mismatched surrogate pairs. Covered by new API tests. * platform/URLParser.cpp: (WebCore::URLParser::parseHostAndPort): 2018-09-26 Alex Christensen <achristensen@webkit.org> uidna_nameToASCII only needs a buffer capacity of 64 https://bugs.webkit.org/show_bug.cgi?id=190006 Reviewed by Chris Dumez. This is specified in https://www.unicode.org/reports/tr46/#ToASCII This is how Chrome and Firefox also behave with long unicode hosts. * platform/URLParser.cpp: (WebCore::URLParser::domainToASCII): 2018-09-26 Alex Christensen <achristensen@webkit.org> URLWithUserTypedString should return nil for URLs deemed to be invalid by WebCore::URL https://bugs.webkit.org/show_bug.cgi?id=189979 <rdar://problem/44119696> Reviewed by Chris Dumez. Covered by an API test. * platform/mac/WebCoreNSURLExtras.mm: (WebCore::URLWithData): 2018-09-26 Ryosuke Niwa <rniwa@webkit.org> Selection should work across shadow boundary when initiated by a mouse drag https://bugs.webkit.org/show_bug.cgi?id=151380 <rdar://problem/24363872> Revert the change that I said I would from r236519. * editing/VisibleSelection.cpp: (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): 2018-09-26 Commit Queue <commit-queue@webkit.org> Unreviewed, rolling out r236511. https://bugs.webkit.org/show_bug.cgi?id=190008 It is breaking some WebRTC tests (Requested by youenn on #webkit). Reverted changeset: "[MediaStream] Clean up RealtimeMediaSource settings change handling" https://bugs.webkit.org/show_bug.cgi?id=189998 https://trac.webkit.org/changeset/236511 2018-09-26 Ryosuke Niwa <rniwa@webkit.org> Selection should work across shadow boundary when initiated by a mouse drag https://bugs.webkit.org/show_bug.cgi?id=151380 <rdar://problem/24363872> Reviewed by Antti Koivisto and Wenson Hsieh. This patch adds the basic support for selecting content across shadow DOM boundaries to VisibleSelection, which is enough to allow users to select content across shadow DOM boundaries via a mouse drag. This is the first step in allowing users to select, copy and paste content across shadow DOM boundaries, which is a serious user experience regression right now. The new behavior is disabled by default under an interal debug feature flag: selectionAcrossShadowBoundariesEnabled. Like Chrome, we are not going to support selecting editable content across shadow DOM boundaries since we'd have to generalize every editing commands to make that work, and there aren't any HTML editors that use shadow DOM boundaries within an editable region yet. For simplicity, we also don't support extending a selection out of a shadow root which resides inside an editing region. The keyboard based navigation & manipulation of selection as well as allowing copy & paste of content across shadow DOM boundaries will be implemented by separate patches. DOMSelection will not expose this new behavior either. This is tracked in the spec as https://github.com/w3c/webcomponents/issues/79 Tests: editing/selection/selection-across-shadow-boundaries-mixed-editability-1.html editing/selection/selection-across-shadow-boundaries-mixed-editability-2.html editing/selection/selection-across-shadow-boundaries-mixed-editability-3.html editing/selection/selection-across-shadow-boundaries-mixed-editability-4.html editing/selection/selection-across-shadow-boundaries-mixed-editability-5.html editing/selection/selection-across-shadow-boundaries-readonly-1.html editing/selection/selection-across-shadow-boundaries-readonly-2.html editing/selection/selection-across-shadow-boundaries-readonly-3.html editing/selection/selection-across-shadow-boundaries-user-select-all-1.html * editing/VisibleSelection.cpp: (WebCore::isInUserAgentShadowRootOrHasEditableShadowAncestor): Added. (WebCore::VisibleSelection::adjustSelectionToAvoidCrossingShadowBoundaries): When the feature is enabled, allow crossing shadow DOM boundaries except when either end is inside an user agent shadow root, or one of its shadow includign ancestor is inside an editable region. The latter check is needed to disallow an extension of a selection starting in a shadow tree inside a non-editable region inside an editable region to outside the editable region. The rest of the editing code is not ready to deal with selection like that. * page/Settings.yaml: Added an internal debug feature to enable this new behavior. 2018-09-26 Chris Dumez <cdumez@apple.com> Ignore-opens-during-unload counter of a parent should apply to its children during beforeunload event https://bugs.webkit.org/show_bug.cgi?id=189376 <rdar://problem/44282754> Reviewed by Ryosuke Niwa. Make sure the Ignore-opens-during-unload counter of a parent stays incremented while we are firing the beforeunload event for its descendants, as per: - https://html.spec.whatwg.org/multipage/browsing-the-web.html#prompt-to-unload-a-document No new tests, rebaselined existing tests. * loader/FrameLoader.cpp: (WebCore::FrameLoader::shouldClose): (WebCore::FrameLoader::dispatchBeforeUnloadEvent): 2018-09-26 Justin Fan <justin_fan@apple.com> WebGL 2: Adding logging to in-progress features https://bugs.webkit.org/show_bug.cgi?id=189978 Reviewed by Jon Lee. Logging will allow us to better identify the most in-demand WebGL 2 features and prioritize our efforts. No tests as no change in WebGL functionality. * html/canvas/WebGL2RenderingContext.cpp: Added logging statement to every function not yet implemented. (WebCore::WebGL2RenderingContext::blitFramebuffer): (WebCore::WebGL2RenderingContext::framebufferTextureLayer): (WebCore::WebGL2RenderingContext::invalidateFramebuffer): (WebCore::WebGL2RenderingContext::invalidateSubFramebuffer): (WebCore::WebGL2RenderingContext::readBuffer): (WebCore::WebGL2RenderingContext::texStorage3D): (WebCore::WebGL2RenderingContext::texImage2D): (WebCore::WebGL2RenderingContext::texImage3D): (WebCore::WebGL2RenderingContext::texSubImage2D): (WebCore::WebGL2RenderingContext::texSubImage3D): (WebCore::WebGL2RenderingContext::copyTexSubImage3D): (WebCore::WebGL2RenderingContext::compressedTexImage2D): (WebCore::WebGL2RenderingContext::compressedTexImage3D): (WebCore::WebGL2RenderingContext::compressedTexSubImage3D): (WebCore::WebGL2RenderingContext::getFragDataLocation): (WebCore::WebGL2RenderingContext::uniform1ui): (WebCore::WebGL2RenderingContext::uniform2ui): (WebCore::WebGL2RenderingContext::uniform3ui): (WebCore::WebGL2RenderingContext::uniform4ui): (WebCore::WebGL2RenderingContext::uniform1uiv): (WebCore::WebGL2RenderingContext::uniform2uiv): (WebCore::WebGL2RenderingContext::uniform3uiv): (WebCore::WebGL2RenderingContext::uniform4uiv): (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv): (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv): (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv): (WebCore::WebGL2RenderingContext::vertexAttribI4i): (WebCore::WebGL2RenderingContext::vertexAttribI4iv): (WebCore::WebGL2RenderingContext::vertexAttribI4ui): (WebCore::WebGL2RenderingContext::vertexAttribI4uiv): (WebCore::WebGL2RenderingContext::vertexAttribIPointer): (WebCore::WebGL2RenderingContext::drawRangeElements): (WebCore::WebGL2RenderingContext::createQuery): (WebCore::WebGL2RenderingContext::deleteQuery): (WebCore::WebGL2RenderingContext::isQuery): (WebCore::WebGL2RenderingContext::beginQuery): (WebCore::WebGL2RenderingContext::endQuery): (WebCore::WebGL2RenderingContext::getQuery): (WebCore::WebGL2RenderingContext::getQueryParameter): (WebCore::WebGL2RenderingContext::createSampler): (WebCore::WebGL2RenderingContext::deleteSampler): (WebCore::WebGL2RenderingContext::isSampler): (WebCore::WebGL2RenderingContext::bindSampler): (WebCore::WebGL2RenderingContext::samplerParameteri): (WebCore::WebGL2RenderingContext::samplerParameterf): (WebCore::WebGL2RenderingContext::getSamplerParameter): (WebCore::WebGL2RenderingContext::fenceSync): (WebCore::WebGL2RenderingContext::isSync): (WebCore::WebGL2RenderingContext::deleteSync): (WebCore::WebGL2RenderingContext::clientWaitSync): (WebCore::WebGL2RenderingContext::waitSync): (WebCore::WebGL2RenderingContext::getSyncParameter): (WebCore::WebGL2RenderingContext::createTransformFeedback): (WebCore::WebGL2RenderingContext::deleteTransformFeedback): (WebCore::WebGL2RenderingContext::isTransformFeedback): (WebCore::WebGL2RenderingContext::bindTransformFeedback): (WebCore::WebGL2RenderingContext::beginTransformFeedback): (WebCore::WebGL2RenderingContext::endTransformFeedback): (WebCore::WebGL2RenderingContext::transformFeedbackVaryings): (WebCore::WebGL2RenderingContext::getTransformFeedbackVarying): (WebCore::WebGL2RenderingContext::pauseTransformFeedback): (WebCore::WebGL2RenderingContext::resumeTransformFeedback): (WebCore::WebGL2RenderingContext::bindBufferBase): (WebCore::WebGL2RenderingContext::bindBufferRange): (WebCore::WebGL2RenderingContext::getUniformIndices): (WebCore::WebGL2RenderingContext::getUniformBlockIndex): (WebCore::WebGL2RenderingContext::getActiveUniformBlockParameter): (WebCore::WebGL2RenderingContext::getActiveUniformBlockName): (WebCore::WebGL2RenderingContext::uniformBlockBinding): 2018-09-26 Eric Carlson <eric.carlson@apple.com> [MediaStream] Clean up RealtimeMediaSource settings change handling https://bugs.webkit.org/show_bug.cgi?id=189998 <rdar://problem/44797884> Reviewed by Youenn Fablet. No new tests, no change in functionality. * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::notifySettingsDidChangeObservers): (WebCore::RealtimeMediaSource::setSize): (WebCore::RealtimeMediaSource::setFrameRate): (WebCore::RealtimeMediaSource::setAspectRatio): (WebCore::RealtimeMediaSource::setFacingMode): (WebCore::RealtimeMediaSource::setVolume): (WebCore::RealtimeMediaSource::setSampleRate): (WebCore::RealtimeMediaSource::setSampleSize): (WebCore::RealtimeMediaSource::setEchoCancellation): (WebCore::RealtimeMediaSource::settingsDidChange): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::settingsDidChange): * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::settingsDidChange): * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::settingsDidChange): * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::settingsDidChange): 2018-09-26 Antoine Quint <graouts@apple.com> [Web Animations] Ensure renderers with accelerated animations have layers https://bugs.webkit.org/show_bug.cgi?id=189990 <rdar://problem/44791222> Reviewed by Zalan Bujtas. We have done some work already in webkit.org/b/189784 to prevent never-ending calls to DocumentTimeline::updateAnimations(). This was due to the change made for webkit.org/b/186930 where we queued calls to updateAnimations() in KeyframeEffectReadOnly::applyPendingAcceleratedActions() while we were waiting for a renderer with a layer backing for a given animation target. Instead of doing this, we now ensure renderers always have a layer when they have an accelerated animation applied. No new tests, this is already covered by webanimations/accelerated-animation-with-delay.html and webanimations/opacity-animation-yields-compositing-span.html which respectively check that we can apply an accelerated animation to a non-positioned block and an inline element. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated const): This method should have been marked const all along and it is now required so it can be called through RenderBox::requiresLayer() and RenderInline::requiresLayer(). (WebCore::DocumentTimeline::runningAnimationsForElementAreAllAccelerated): Deleted. * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Stop enqueuing the accelerated actions in case we're lacking a composited renderer since this situation should no longer arise. * rendering/RenderBox.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations. * rendering/RenderBoxModelObject.cpp: (WebCore::RenderBoxModelObject::hasRunningAcceleratedAnimations const): Query the document timeline, if it exists, to check that this renderer's element has accelerated animations applied. * rendering/RenderBoxModelObject.h: * rendering/RenderInline.h: Make requiresLayer() return true if this renderer's element is the target of accelerated animations. 2018-09-25 Eric Carlson <eric.carlson@apple.com> [MediaStream] Add Mac window capture source https://bugs.webkit.org/show_bug.cgi?id=189958 <rdar://problem/44767616> Reviewed by Youenn Fablet. * SourcesCocoa.txt: Add WindowDisplayCaptureSourceMac. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp: (WebCore::DisplayCaptureManagerCocoa::captureDevices): Include window "devices". (WebCore::DisplayCaptureManagerCocoa::updateWindowCaptureDevices): New. (WebCore::DisplayCaptureManagerCocoa::windowCaptureDeviceWithPersistentID): New. (WebCore::DisplayCaptureManagerCocoa::captureDeviceWithPersistentID): Include window devices. * platform/mediastream/mac/DisplayCaptureManagerCocoa.h: * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::DisplayCaptureSourceCocoa): (WebCore::DisplayCaptureSourceCocoa::settings): Use frameSize, report surface type and logical surface. (WebCore::DisplayCaptureSourceCocoa::settingsDidChange): Clear m_lastSampleBuffer when size changes. (WebCore::DisplayCaptureSourceCocoa::frameSize const): New, return size() or intrinsic size. (WebCore::DisplayCaptureSourceCocoa::setIntrinsicSize): New. (WebCore::DisplayCaptureSourceCocoa::emitFrame): generateFrame now returns a CVPixelBuffer so derived classes don't have to deal with resizing/transforming. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/RealtimeMediaSourceCenterMac.cpp: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h: * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm: (WebCore::ScreenDisplayCaptureSourceMac::ScreenDisplayCaptureSourceMac): Add fixme. (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Update intrinsic size when width/height changes. (WebCore::ScreenDisplayCaptureSourceMac::generateFrame): Return a CVPixelBuffer. * platform/mediastream/mac/WindowDisplayCaptureSourceMac.h: Added. * platform/mediastream/mac/WindowDisplayCaptureSourceMac.mm: Added. (WebCore::anyOfCGWindow): (WebCore::windowDescription): (WebCore::WindowDisplayCaptureSourceMac::create): (WebCore::WindowDisplayCaptureSourceMac::WindowDisplayCaptureSourceMac): (WebCore::WindowDisplayCaptureSourceMac::windowImage): (WebCore::WindowDisplayCaptureSourceMac::generateFrame): (WebCore::WindowDisplayCaptureSourceMac::pixelBufferFromCGImage): (WebCore::WindowDisplayCaptureSourceMac::windowCaptureDeviceWithPersistentID): (WebCore::WindowDisplayCaptureSourceMac::windowCaptureDevices): 2018-09-25 Justin Fan <justin_fan@apple.com> WebGL 2 Conformance: primitive restart and draw_primitive_restart WebGL2 sample https://bugs.webkit.org/show_bug.cgi?id=189625 <rdar://problem/42882620> Reviewed by Dean Jackson. Ref test: webgl/webgl2-primitive-restart.html. Implement support for Primitive Restart Fixed Index as expected by the WebGL 2 specifications. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::validateIndexArrayConservative): * html/canvas/WebGLRenderingContextBase.h: (WebCore::WebGLRenderingContextBase::getLastIndex): Template that must be defined in header. * html/canvas/WebGLRenderingContextBase.cpp: (WebCore::WebGLRenderingContextBase::validateIndexArrayPrecise): * platform/graphics/GraphicsContext3D.h: * platform/graphics/cocoa/GraphicsContext3DCocoa.mm: (WebCore::GraphicsContext3D::GraphicsContext3D): * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::primitiveRestartIndex): 2018-09-25 John Wilander <wilander@apple.com> Change from HAVE(CFNETWORK_STORAGE_PARTITIONING) to ENABLE(RESOURCE_LOAD_STATISTICS) https://bugs.webkit.org/show_bug.cgi?id=189959 <rdar://problem/44767642> Reviewed by Chris Dumez. No new tests because of no code change. We no longer make use of CFNetwork's cookie partitioning so we should change the compile-time flag to something that makes sense. This should also make it easier/cleaner for other ports. * dom/Document.cpp: (WebCore::Document::hasStorageAccess): (WebCore::Document::requestStorageAccess): (WebCore::Document::setHasRequestedPageSpecificStorageAccessWithUserInteraction): * dom/Document.h: * loader/EmptyFrameLoaderClient.h: * loader/FrameLoaderClient.h: * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution): (WebCore::ResourceLoadObserver::logWindowCreation): * loader/ResourceLoadObserver.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::cookiesForURL): (WebCore::NetworkStorageSession::setCookiesFromDOM const): 2018-09-25 Jiewen Tan <jiewen_tan@apple.com> [WebAuthN] Make AuthenticatorManager https://bugs.webkit.org/show_bug.cgi?id=189279 <rdar://problem/44116792> Reviewed by Chris Dumez. This patch does the following things in WebCore in order to support AuthenticatorManager: 1) It separates AuthenticatorTransport from PublicKeyCredentialDescriptor such that the enum can be queried from WebKit directly. 2) It adds AuthenticatorAttachment to PublicKeyCredentialCreationOptions such that relying parties could express their interests in cross platform authenticators. 3) It enhances IPC encoder/decoder of a few such that Vectors and empty objects can be correctly coded. 4) It moves the LocalAuthenticator implementation to WebKit to better integrate with AuthenticatorManager. 5) It moves linking to LocalAuthentication.framework to WebKit as well. 6) It temporarily bans old mock test mechanism in Internals so we could enable the new mock test mechanism in WebKitTestRunner which we will have a better coverage of codes in UI Process. Those tests will be either removed or ported to the new mechanism in Bug 189283. 7) It also removes "using namespace WebCore" from the top namespace in some .mm files as they are reordered to where they could introduce name confusions. Tests: http/wpt/webauthn/public-key-credential-create-failure-local.https.html http/wpt/webauthn/public-key-credential-create-success-local.https.html http/wpt/webauthn/public-key-credential-get-failure-local.https.html http/wpt/webauthn/public-key-credential-get-success-local.https.html http/wpt/webauthn/public-key-credential-is-user-verifying-platform-authenticator-available.html * CMakeLists.txt: * Configurations/WebCore.xcconfig: * DerivedSources.make: * Modules/webauthn/AuthenticatorTransport.h: Copied from Source/WebCore/platform/cocoa/LocalAuthenticationSoftLink.h. * Modules/webauthn/AuthenticatorTransport.idl: Copied from Source/WebCore/Modules/webauthn/PublicKeyCredentialDescriptor.idl. * Modules/webauthn/PublicKeyCredentialCreationOptions.h: (WebCore::PublicKeyCredentialCreationOptions::encode const): (WebCore::PublicKeyCredentialCreationOptions::decode): * Modules/webauthn/PublicKeyCredentialCreationOptions.idl: * Modules/webauthn/PublicKeyCredentialData.h: (WebCore::PublicKeyCredentialData::encode const): (WebCore::PublicKeyCredentialData::decode): * Modules/webauthn/PublicKeyCredentialDescriptor.h: (WebCore::PublicKeyCredentialDescriptor::encode const): * Modules/webauthn/PublicKeyCredentialDescriptor.idl: * Modules/webauthn/cocoa/LocalAuthenticator.mm: Removed. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * dom/ExceptionData.h: * platform/cocoa/LocalAuthenticationSoftLink.mm: Removed. * platform/cocoa/SharedBufferCocoa.mm: (-[WebCoreSharedBufferData initWithSharedBufferDataSegment:]): * platform/cocoa/VideoFullscreenModelVideoElement.mm: (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): Deleted. (VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement): Deleted. (VideoFullscreenModelVideoElement::setVideoElement): Deleted. (VideoFullscreenModelVideoElement::handleEvent): Deleted. (VideoFullscreenModelVideoElement::updateForEventName): Deleted. (VideoFullscreenModelVideoElement::willExitFullscreen): Deleted. (VideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted. (VideoFullscreenModelVideoElement::waitForPreparedForInlineThen): Deleted. (VideoFullscreenModelVideoElement::requestFullscreenMode): Deleted. (VideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted. (VideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted. (VideoFullscreenModelVideoElement::observedEventNames): Deleted. (VideoFullscreenModelVideoElement::eventNameAll): Deleted. (VideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted. (VideoFullscreenModelVideoElement::addClient): Deleted. (VideoFullscreenModelVideoElement::removeClient): Deleted. (VideoFullscreenModelVideoElement::isVisible const): Deleted. (VideoFullscreenModelVideoElement::setHasVideo): Deleted. (VideoFullscreenModelVideoElement::setVideoDimensions): Deleted. (VideoFullscreenModelVideoElement::willEnterPictureInPicture): Deleted. (VideoFullscreenModelVideoElement::didEnterPictureInPicture): Deleted. (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture): Deleted. (VideoFullscreenModelVideoElement::willExitPictureInPicture): Deleted. (VideoFullscreenModelVideoElement::didExitPictureInPicture): Deleted. * platform/graphics/ca/cocoa/PlatformCAAnimationCocoa.mm: (WebCore::hasExplicitBeginTime): (WebCore::setHasExplicitBeginTime): (WebCore::toCAFillModeType): (WebCore::toCAValueFunctionType): (WebCore::toCAMediaTimingFunction): (WebCore::PlatformCAAnimationCocoa::setFromValue): (WebCore::PlatformCAAnimationCocoa::setToValue): (WebCore::PlatformCAAnimationCocoa::setValues): (fromCAFillModeType): Deleted. (fromCAValueFunctionType): Deleted. (PlatformCAAnimationCocoa::create): Deleted. (PlatformCAAnimationCocoa::PlatformCAAnimationCocoa): Deleted. (PlatformCAAnimationCocoa::~PlatformCAAnimationCocoa): Deleted. (PlatformCAAnimationCocoa::copy const): Deleted. (PlatformCAAnimationCocoa::platformAnimation const): Deleted. (PlatformCAAnimationCocoa::keyPath const): Deleted. (PlatformCAAnimationCocoa::beginTime const): Deleted. (PlatformCAAnimationCocoa::setBeginTime): Deleted. (PlatformCAAnimationCocoa::duration const): Deleted. (PlatformCAAnimationCocoa::setDuration): Deleted. (PlatformCAAnimationCocoa::speed const): Deleted. (PlatformCAAnimationCocoa::setSpeed): Deleted. (PlatformCAAnimationCocoa::timeOffset const): Deleted. (PlatformCAAnimationCocoa::setTimeOffset): Deleted. (PlatformCAAnimationCocoa::repeatCount const): Deleted. (PlatformCAAnimationCocoa::setRepeatCount): Deleted. (PlatformCAAnimationCocoa::autoreverses const): Deleted. (PlatformCAAnimationCocoa::setAutoreverses): Deleted. (PlatformCAAnimationCocoa::fillMode const): Deleted. (PlatformCAAnimationCocoa::setFillMode): Deleted. (PlatformCAAnimationCocoa::setTimingFunction): Deleted. (PlatformCAAnimationCocoa::copyTimingFunctionFrom): Deleted. (PlatformCAAnimationCocoa::isRemovedOnCompletion const): Deleted. (PlatformCAAnimationCocoa::setRemovedOnCompletion): Deleted. (PlatformCAAnimationCocoa::isAdditive const): Deleted. (PlatformCAAnimationCocoa::setAdditive): Deleted. (PlatformCAAnimationCocoa::valueFunction const): Deleted. (PlatformCAAnimationCocoa::setValueFunction): Deleted. (PlatformCAAnimationCocoa::setFromValue): Deleted. (PlatformCAAnimationCocoa::copyFromValueFrom): Deleted. (PlatformCAAnimationCocoa::setToValue): Deleted. (PlatformCAAnimationCocoa::copyToValueFrom): Deleted. (PlatformCAAnimationCocoa::setValues): Deleted. (PlatformCAAnimationCocoa::copyValuesFrom): Deleted. (PlatformCAAnimationCocoa::setKeyTimes): Deleted. (PlatformCAAnimationCocoa::copyKeyTimesFrom): Deleted. (PlatformCAAnimationCocoa::setTimingFunctions): Deleted. (PlatformCAAnimationCocoa::copyTimingFunctionsFrom): Deleted. * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: (PlatformCAFilters::filterValueForOperation): Deleted. (PlatformCAFilters::colorMatrixValueForFilter): Deleted. (PlatformCAFilters::setBlendingFiltersOnLayer): Deleted. (PlatformCAFilters::numAnimatedFilterProperties): Deleted. (PlatformCAFilters::animatedFilterPropertyName): Deleted. * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (-[WebAnimationDelegate animationDidStart:]): (-[WebAnimationDelegate animationDidStop:finished:]): (-[WebAnimationDelegate setOwner:]): (PlatformCALayerCocoa::create): Deleted. (PlatformCALayer::platformCALayer): Deleted. (mediaTimeToCurrentTime): Deleted. (PlatformCALayerCocoa::setOwner): Deleted. (toCAFilterType): Deleted. (PlatformCALayerCocoa::layerTypeForPlatformLayer): Deleted. (PlatformCALayerCocoa::PlatformCALayerCocoa): Deleted. (PlatformCALayerCocoa::commonInit): Deleted. (PlatformCALayerCocoa::clone const): Deleted. (PlatformCALayerCocoa::~PlatformCALayerCocoa): Deleted. (PlatformCALayerCocoa::animationStarted): Deleted. (PlatformCALayerCocoa::animationEnded): Deleted. (PlatformCALayerCocoa::setNeedsDisplay): Deleted. (PlatformCALayerCocoa::setNeedsDisplayInRect): Deleted. (PlatformCALayerCocoa::copyContentsFromLayer): Deleted. (PlatformCALayerCocoa::superlayer const): Deleted. (PlatformCALayerCocoa::removeFromSuperlayer): Deleted. (PlatformCALayerCocoa::setSublayers): Deleted. (PlatformCALayerCocoa::removeAllSublayers): Deleted. (PlatformCALayerCocoa::appendSublayer): Deleted. (PlatformCALayerCocoa::insertSublayer): Deleted. (PlatformCALayerCocoa::replaceSublayer): Deleted. (PlatformCALayerCocoa::adoptSublayers): Deleted. (PlatformCALayerCocoa::addAnimationForKey): Deleted. (PlatformCALayerCocoa::removeAnimationForKey): Deleted. (PlatformCALayerCocoa::animationForKey): Deleted. (PlatformCALayerCocoa::setMask): Deleted. (PlatformCALayerCocoa::isOpaque const): Deleted. (PlatformCALayerCocoa::setOpaque): Deleted. (PlatformCALayerCocoa::bounds const): Deleted. (PlatformCALayerCocoa::setBounds): Deleted. (PlatformCALayerCocoa::position const): Deleted. (PlatformCALayerCocoa::setPosition): Deleted. (PlatformCALayerCocoa::anchorPoint const): Deleted. (PlatformCALayerCocoa::setAnchorPoint): Deleted. (PlatformCALayerCocoa::transform const): Deleted. (PlatformCALayerCocoa::setTransform): Deleted. (PlatformCALayerCocoa::sublayerTransform const): Deleted. (PlatformCALayerCocoa::setSublayerTransform): Deleted. (PlatformCALayerCocoa::isHidden const): Deleted. (PlatformCALayerCocoa::setHidden): Deleted. (PlatformCALayerCocoa::contentsHidden const): Deleted. (PlatformCALayerCocoa::setContentsHidden): Deleted. (PlatformCALayerCocoa::userInteractionEnabled const): Deleted. (PlatformCALayerCocoa::setUserInteractionEnabled): Deleted. (PlatformCALayerCocoa::setBackingStoreAttached): Deleted. (PlatformCALayerCocoa::backingStoreAttached const): Deleted. (PlatformCALayerCocoa::geometryFlipped const): Deleted. (PlatformCALayerCocoa::setGeometryFlipped): Deleted. (PlatformCALayerCocoa::isDoubleSided const): Deleted. (PlatformCALayerCocoa::setDoubleSided): Deleted. (PlatformCALayerCocoa::masksToBounds const): Deleted. (PlatformCALayerCocoa::setMasksToBounds): Deleted. (PlatformCALayerCocoa::acceleratesDrawing const): Deleted. (PlatformCALayerCocoa::setAcceleratesDrawing): Deleted. (PlatformCALayerCocoa::wantsDeepColorBackingStore const): Deleted. (PlatformCALayerCocoa::setWantsDeepColorBackingStore): Deleted. (PlatformCALayerCocoa::supportsSubpixelAntialiasedText const): Deleted. (PlatformCALayerCocoa::setSupportsSubpixelAntialiasedText): Deleted. (PlatformCALayerCocoa::hasContents const): Deleted. (PlatformCALayerCocoa::contents const): Deleted. (PlatformCALayerCocoa::setContents): Deleted. (PlatformCALayerCocoa::setContentsRect): Deleted. (PlatformCALayerCocoa::setMinificationFilter): Deleted. (PlatformCALayerCocoa::setMagnificationFilter): Deleted. (PlatformCALayerCocoa::backgroundColor const): Deleted. (PlatformCALayerCocoa::setBackgroundColor): Deleted. (PlatformCALayerCocoa::setBorderWidth): Deleted. (PlatformCALayerCocoa::setBorderColor): Deleted. (PlatformCALayerCocoa::opacity const): Deleted. (PlatformCALayerCocoa::setOpacity): Deleted. (PlatformCALayerCocoa::setFilters): Deleted. (PlatformCALayerCocoa::copyFiltersFrom): Deleted. (PlatformCALayerCocoa::filtersCanBeComposited): Deleted. (PlatformCALayerCocoa::setBlendMode): Deleted. (PlatformCALayerCocoa::setName): Deleted. (PlatformCALayerCocoa::setSpeed): Deleted. (PlatformCALayerCocoa::setTimeOffset): Deleted. (PlatformCALayerCocoa::contentsScale const): Deleted. (PlatformCALayerCocoa::setContentsScale): Deleted. (PlatformCALayerCocoa::cornerRadius const): Deleted. (PlatformCALayerCocoa::setCornerRadius): Deleted. (PlatformCALayerCocoa::setEdgeAntialiasingMask): Deleted. (PlatformCALayerCocoa::shapeRoundedRect const): Deleted. (PlatformCALayerCocoa::setShapeRoundedRect): Deleted. (PlatformCALayerCocoa::shapeWindRule const): Deleted. (PlatformCALayerCocoa::setShapeWindRule): Deleted. (PlatformCALayerCocoa::shapePath const): Deleted. (PlatformCALayerCocoa::setShapePath): Deleted. (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const): Deleted. (PlatformCALayerCocoa::updateCustomAppearance): Deleted. (layerContentsFormat): Deleted. (PlatformCALayerCocoa::updateContentsFormat): Deleted. (PlatformCALayerCocoa::tiledBacking): Deleted. (PlatformCALayer::isWebLayer): Deleted. (PlatformCALayer::setBoundsOnMainThread): Deleted. (PlatformCALayer::setPositionOnMainThread): Deleted. (PlatformCALayer::setAnchorPointOnMainThread): Deleted. (PlatformCALayer::collectRectsToPaint): Deleted. (PlatformCALayer::drawLayerContents): Deleted. (PlatformCALayer::frameForLayer): Deleted. (PlatformCALayerCocoa::createCompatibleLayer const): Deleted. (PlatformCALayerCocoa::enumerateRectsBeingDrawn): Deleted. (PlatformCALayerCocoa::backingStoreBytesPerPixel const): Deleted. (PlatformCALayerCocoa::avPlayerLayer const): Deleted. * platform/graphics/ca/cocoa/WebSystemBackdropLayer.mm: (-[WebLightSystemBackdropLayer init]): (-[WebDarkSystemBackdropLayer init]): * platform/graphics/ca/cocoa/WebTiledBackingLayer.mm: (-[WebTiledBackingLayer createTileController:]): (-[WebTiledBackingLayer setNeedsDisplayInRect:]): (-[WebTiledBackingLayer setBorderColor:]): * testing/Internals.cpp: (WebCore::Internals::Internals): 2018-09-25 YUHAN WU <yuhan_wu@apple.com> Implement MediaStreamTrack Content Hints https://bugs.webkit.org/show_bug.cgi?id=189262 <rdar://problem/44101773> Reviewed by Youenn Fablet. contentHint is a new attribute which is stored in MediaStreamTrackPrivate. https://w3c.github.io/mst-content-hint/ Covered by tests: LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/MediaStreamTrack-contentHint.html LayoutTests/imported/w3c/web-platform-tests/mst-content-hint/idlharness.window.html * Modules/mediastream/MediaStreamTrack.cpp: (WebCore::MediaStreamTrack::contentHint const): (WebCore::MediaStreamTrack::setContentHint): * Modules/mediastream/MediaStreamTrack.h: * Modules/mediastream/MediaStreamTrack.idl: * platform/mediastream/MediaStreamTrackPrivate.cpp: (WebCore::MediaStreamTrackPrivate::setContentHint): (WebCore::MediaStreamTrackPrivate::clone): * platform/mediastream/MediaStreamTrackPrivate.h: (WebCore::MediaStreamTrackPrivate::contentHint): 2018-09-25 Alex Christensen <achristensen@webkit.org> Allow for suffixes to com.apple.WebKit.WebContent https://bugs.webkit.org/show_bug.cgi?id=189972 Reviewed by Chris Dumez. * platform/cocoa/RuntimeApplicationChecksCocoa.mm: (WebCore::isInWebProcess): 2018-09-25 Wenson Hsieh <wenson_hsieh@apple.com> [iOS] Fix the open source iOS 12 build after r236445 https://bugs.webkit.org/show_bug.cgi?id=189953 Reviewed by Alex Christensen. Remove soft-linking macros from several sources in WebCore, and instead import UIKitSoftLink from PAL. This allows different WebCore sources to soft-link UIKit (and its classes and symbols) without reimplementing WebCore::UIKitLibrary. * editing/cocoa/FontAttributesCocoa.mm: * editing/cocoa/FontShadowCocoa.mm: (WebCore::FontShadow::createShadow const): * platform/graphics/cocoa/ColorCocoa.mm: (WebCore::platformColor): * platform/ios/PlatformScreenIOS.mm: (WebCore::screenIsMonochrome): (WebCore::screenHasInvertedColors): (WebCore::screenSize): (WebCore::availableScreenSize): (WebCore::screenScaleFactor): 2018-09-25 Thibault Saunier <tsaunier@igalia.com> [WPE][GTK][WebRTC] Fixup VP8 encoding support https://bugs.webkit.org/show_bug.cgi?id=189921 Previous leak fixing commit introduced a regression in the way the encoded buffer were prepared in the default GStreamerVideoEncoder::Fragmentize implementation (when encoding with VP8 basically). + Fix a build warning in the decoder. + Fix some wrong object members namings. + Properly move the caps reference when setting restriction caps. + Do not raise a GStreamer error when GStreamerVideoEncoder::OnEncodedImage fails - this might be a network issue and other encoders do not consider that fatal. + Use GstMappedBuffer where appropriate. Reviewed by Philippe Normand. * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::InitEncode): (WebCore::GStreamerVideoEncoder::newSampleCallback): (WebCore::GStreamerVideoEncoder::Fragmentize): (WebCore::GStreamerVideoEncoder::SetRestrictionCaps): 2018-09-25 Eric Carlson <eric.carlson@apple.com> [MediaStream] Update constraints supported by getDisplayMedia https://bugs.webkit.org/show_bug.cgi?id=189930 Reviewed by Youenn Fablet. No new tests, updated http/tests/media/media-stream/get-display-media-prompt.html. * Modules/mediastream/MediaDevices.cpp: (WebCore::MediaDevices::getDisplayMedia const): Ignore audio constraints. * Modules/mediastream/UserMediaRequest.cpp: (WebCore::hasInvalidGetDisplayMediaConstraint): Check for invalid constraints. (WebCore::UserMediaRequest::start): Check for invalid constraints. (WebCore::UserMediaRequest::deny): Support new error. * Modules/mediastream/UserMediaRequest.h: * platform/mediastream/RealtimeMediaSourceCenter.cpp: (WebCore::RealtimeMediaSourceCenter::validateRequestConstraints): 2018-09-25 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME] Fix variable name that should have gone in r236317 https://bugs.webkit.org/show_bug.cgi?id=189944 Reviewed by Jer Noble. m_cdmInstanceClientWeakPtrFactory becomes m_cdmInstanceSessionClientWeakPtrFactory as its type changes to CDMInstanceSessionClient. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::MediaKeySession): * Modules/encryptedmedia/MediaKeySession.h: 2018-09-25 Simon Fraser <simon.fraser@apple.com> Clean up code around RenderLayer's "has accelerated scrolling" functions https://bugs.webkit.org/show_bug.cgi?id=189932 Reviewed by Zalan Bujtas. RenderLayer had: bool hasAcceleratedTouchScrolling() bool hasTouchScrollableOverflow() bool usesAcceleratedScrolling() bool usesCompositedScrolling() bool usesAsyncScrolling() which are hard to keep in your head. Removed usesAcceleratedScrolling() since it just returns hasTouchScrollableOverflow(). Renamed hasAcceleratedTouchScrolling() to canUseAcceleratedTouchScrolling() to indicate that it just looks at style, not whether layout has given the layer scrollable overflow yet. Tidy up some #ifdefs. usesCompositedScrolling() and usesAsyncScrolling() are ScrollableArea overrides, and look at backing layers, so require that compositing has run already. Note this in comments. * rendering/RenderLayer.cpp: (WebCore::RenderLayer::canUseAcceleratedTouchScrolling const): (WebCore::RenderLayer::hasTouchScrollableOverflow const): (WebCore::RenderLayer::handleTouchEvent): (WebCore::RenderLayer::usesAsyncScrolling const): (WebCore::RenderLayer::showsOverflowControls const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::RenderLayer::hasAcceleratedTouchScrolling const): Deleted. (WebCore::RenderLayer::usesAcceleratedScrolling const): Deleted. * rendering/RenderLayer.h: * rendering/RenderLayerBacking.cpp: (WebCore::layerOrAncestorIsTransformedOrUsingCompositedScrolling): (WebCore::RenderLayerBacking::updateConfiguration): * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::useCoordinatedScrollingForLayer const): (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const): 2018-09-24 Fujii Hironori <Hironori.Fujii@sony.com> Rename WTF_COMPILER_GCC_OR_CLANG to WTF_COMPILER_GCC_COMPATIBLE https://bugs.webkit.org/show_bug.cgi?id=189733 Reviewed by Michael Catanzaro. No new tests (No behavior change). * platform/graphics/cpu/arm/filters/FELightingNEON.cpp: * platform/graphics/cpu/arm/filters/FELightingNEON.h: * platform/graphics/filters/FELighting.cpp: (WebCore::FELighting::platformApply): * platform/graphics/filters/FELighting.h: 2018-09-24 John Wilander <wilander@apple.com> Cap lifetime of persistent cookies created client-side through document.cookie https://bugs.webkit.org/show_bug.cgi?id=189933 <rdar://problem/44741888> Reviewed by Chris Dumez. Test: http/tests/cookies/capped-lifetime-for-cookie-set-in-js.html As pointed out in https://github.com/mikewest/http-state-tokens: 1) Cookies are available to JavaScript by default via document.cookie, which enables a smooth upgrade from one-time XSS to theft of persistent credentials and also makes cookies available to Spectre-like attacks on memory. 2) Though the HttpOnly attribute was introduced well over a decade ago, only ~8.31% of Set-Cookie operations use it today (stats from Chrome). We need developer incentives to put proper protections in place. 3) The median (uncompressed) Cookie request header is 409 bytes, while the 90th percentile is 1,589 bytes, the 95th 2,549 bytes, the 99th 4,601 bytes, and ~0.1% of Cookie headers are over 10kB (stats from Chrome). This is bad for load performance. In addition to this, third-party scripts running in first-party contexts can read user data through document.cookie and even store cross-site tracking data in them. Authentication cookies should be HttpOnly and thus not be affected by restrictions to document.cookie. Cookies that persist for a long time should be Secure, HttpOnly, and SameSite to provide good security and privacy. By capping the lifetime of persistent cookies set through document.cookie we embark on a journey towards better cookie management on the web. * platform/network/cocoa/NetworkStorageSessionCocoa.mm: (WebCore::filterCookies): Now caps the life time of persistent cookies to one week (seven days). * testing/Internals.cpp: (WebCore::Internals::getCookies const): New test function to get to cookie meta data such as expiry. * testing/Internals.h: * testing/Internals.idl: 2018-09-24 Simon Fraser <simon.fraser@apple.com> Remove filterRes parameter from SVG filters https://bugs.webkit.org/show_bug.cgi?id=129565 <rdar://problem/44714340> Reviewed by Dean Jackson. Remove support for the "filterRes" attribute on SVG filters. It's marked as deprecated in https://drafts.fxtf.org/filter-effects/#element-attrdef-filter-filterres and no longer supported by Chrome or Firefox. Removed existing filterRes tests, added new test checking that it has no effect. Tests: svg/filters/filterRes-is-noop.svg * rendering/svg/RenderSVGResourceFilter.cpp: (WebCore::RenderSVGResourceFilter::applyResource): * svg/SVGElement.cpp: (WebCore::SVGElement::animatableAttributeForName): * svg/SVGFilterElement.cpp: (WebCore::SVGFilterElement::registerAttributes): (WebCore::SVGFilterElement::parseAttribute): (WebCore::SVGFilterElement::filterResXIdentifier): Deleted. (WebCore::SVGFilterElement::filterResYIdentifier): Deleted. (WebCore::SVGFilterElement::setFilterRes): Deleted. * svg/SVGFilterElement.h: * svg/SVGFilterElement.idl: * svg/svgattrs.in: 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> Don't cause a crash even when some IDL attribute is missing CEReactions https://bugs.webkit.org/show_bug.cgi?id=189937 Reviewed by Simon Fraser. Replaced release assertions in ElementQueue::add and ElementQueue::invokeAll by debug assertions since a missing CEReactions resulting in a crash is a terrible user experience. Also made the iteration in invokeAll safe when more elements were added to m_elements. No new tests since we would still hit debug assertions, and this behavior should only come up when some IDL attribute is erroneously missing CEReactions. * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::ElementQueue::add): (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): 2018-09-24 Wenson Hsieh <wenson_hsieh@apple.com> Refactor Editor::fontAttributesForSelectionStart to be platform-agnostic https://bugs.webkit.org/show_bug.cgi?id=189918 Work towards <rdar://problem/44648705> Reviewed by Tim Horton. Refactors the functionality in Editor::fontAttributesForSelectionStart to not be Cocoa-only. Rename this to fontAttributesAtSelectionStart (to be consistent with `EditingStyle::styleAtSelectionStart`) and move it from EditorCocoa.mm to Editor.cpp; instead of creating and populating an NSDictionary with font attribute information, create and populate a new `FontAttributes` struct that contains the same information. Cocoa clients in WebKitLegacy may then create an `NSDictionary` as needed from the `FontAttributes`. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * editing/Editor.cpp: (WebCore::Editor::platformFontAttributesAtSelectionStart const): Add a hook to allow platforms to supply additional information in FontAttributes. On Cocoa, this adds a UIFont or NSFont to FontAttributes; otherwise, this is a no-op. (WebCore::Editor::fontAttributesAtSelectionStart const): * editing/Editor.h: * editing/FontAttributeChanges.cpp: (WebCore::cssValueListForShadow): * editing/FontAttributeChanges.h: (): Deleted. (WebCore::FontShadow::encode const): Deleted. (WebCore::FontShadow::decode): Deleted. * editing/FontAttributes.h: Added. Introduce a new struct that contains font attribute information. May be converted into an NSDictionary for use by Cocoa clients in WebKitLegacy and WebKit. In a future patch, this will become serializable over IPC for use in WebKit2. * editing/FontShadow.h: Added. Move FontShadow out into a separate header file, included in `FontAttributeChanges.h` and `FontAttributes.h`. (WebCore::FontShadow::encode const): (WebCore::FontShadow::decode): * editing/cocoa/EditorCocoa.mm: Add a helper function to convert a WebCore::Color to either `UIColor` on iOS or `NSColor` when AppKit is being used. (WebCore::Editor::platformFontAttributesAtSelectionStart const): (WebCore::Editor::getTextDecorationAttributesRespectingTypingStyle const): Deleted. Remove a helper function that was only used to compute text decoration attributes in fontAttributesForSelectionStart. (WebCore::Editor::fontAttributesForSelectionStart const): Deleted. * editing/cocoa/FontAttributesCocoa.mm: Added. (WebCore::FontAttributes::createDictionary const): * editing/cocoa/FontShadowCocoa.mm: Added. (WebCore::FontShadow::createShadow const): * editing/cocoa/HTMLConverter.mm: (_webKitBundle): (HTMLConverter::_colorForElement): (_platformColor): Deleted. Adopt platformColor(). * platform/graphics/cocoa/ColorCocoa.h: Added. * platform/graphics/cocoa/ColorCocoa.mm: Added. (WebCore::platformColor): * platform/graphics/metal/GPURenderPassDescriptorMetal.mm: Build fix due to changes in unified sources. * platform/mac/WebCoreNSFontManagerExtras.mm: (WebCore::computedFontAttributeChanges): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: More build fixes due to changes in unified sources. 2018-09-24 Jer Noble <jer.noble@apple.com> SharedBuffer should have an equality test https://bugs.webkit.org/show_bug.cgi?id=189919 Reviewed by Alex Christensen. Test: TestWebKitAPI SharedBuffer.isEqualTo. * platform/SharedBuffer.cpp: * platform/SharedBuffer.h: (WebCore::operator==): (WebCore::operator!=): 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> imported/w3c/web-platform-tests/shadow-dom/slotchange.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=167652 Reviewed by Saam Barati. The bug appears to be caused by the JS wrappers of slot elements getting prematurely collected. Deployed GCReachableRef introduced in r236376 to fix the bug. Test: fast/shadow-dom/signal-slot-list-retains-js-wrappers.html * dom/MutationObserver.cpp: (WebCore::signalSlotList): (WebCore::MutationObserver::enqueueSlotChangeEvent): (WebCore::MutationObserver::notifyMutationObservers): 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> Release assert when using paper-textarea due to autocorrect IDL attribute missing CEReactions https://bugs.webkit.org/show_bug.cgi?id=174629 <rdar://problem/33407620> Reviewed by Simon Fraser. The bug was caused by autocorrect and autocapitalize IDL attributes missing CEReactions. Test: fast/custom-elements/autocorrect-autocapitalize-idl-attributes-crash.html * html/HTMLElement.idl: 2018-09-24 Chris Dumez <cdumez@apple.com> No-op document.open() calls should not have any side effects https://bugs.webkit.org/show_bug.cgi?id=189373 <rdar://problem/44282702> Reviewed by Geoffrey Garen. Update document.open() implementation to match the specification [1] more closely. In particular, URLs updates should happen much later, at step 11. They were happening too early and would cause side effects when returning early. [1] https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#document-open-steps No new tests, rebaselined existing test. * dom/Document.cpp: (WebCore::Document::open): 2018-09-24 Daniel Bates <dabates@apple.com> Include more headers in IOSurface.mm, PixelBufferResizer.{h, mm} https://bugs.webkit.org/show_bug.cgi?id=189928 Reviewed by Andy Estes. Make building IOSurface.mm and PixelBufferResizer.mm deterministic regardless of which bundle of unified sources they are built in. * platform/graphics/cocoa/IOSurface.mm: Include headers HostWindow.h and PlatformScreen.h since we make use of functionality from these headers. * platform/graphics/cv/PixelBufferResizer.h: Include header IntSize.h since we need the size of an IntSize for m_size. * platform/graphics/cv/PixelBufferResizer.mm: Include header Logging.h since this file makes use of logging facilities. Also substitute #import for #include while I am here since this file is an Objective-C++ file. 2018-09-24 Andy Estes <aestes@apple.com> [Payment Request] Events cleanup https://bugs.webkit.org/show_bug.cgi?id=189925 Reviewed by Simon Fraser. 1. Constructed MerchantValidationEvents (and ApplePayValidateMerchantEvents) with rvalue references to validationURLs. 2. Instead of MerchantValidationEvent and PaymentRequestUpdateEvent having a RefPtr<PaymentRequest>, downcasted their target to a PaymentRequest. Trusted versions of these events are always dispatched to a PaymentRequest object. 3. Defined MerchantValidationEventInit in MerchantValidationEvent.idl instead of having a separate .idl and .h for this dictionary. No new tests. No change in behavior. * CMakeLists.txt: * DerivedSources.make: * Modules/applepay/ApplePaySession.cpp: (WebCore::ApplePaySession::validateMerchant): * Modules/applepay/ApplePaySession.h: * Modules/applepay/ApplePayValidateMerchantEvent.cpp: (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent): * Modules/applepay/ApplePayValidateMerchantEvent.h: (WebCore::ApplePayValidateMerchantEvent::create): * Modules/applepay/PaymentCoordinator.cpp: (WebCore::PaymentCoordinator::validateMerchant): * Modules/applepay/PaymentCoordinator.h: * Modules/applepay/PaymentSession.h: * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp: (WebCore::ApplePayPaymentHandler::validateMerchant): * Modules/applepay/paymentrequest/ApplePayPaymentHandler.h: * Modules/paymentrequest/MerchantValidationEvent.cpp: (WebCore::MerchantValidationEvent::create): (WebCore::MerchantValidationEvent::MerchantValidationEvent): (WebCore::MerchantValidationEvent::complete): * Modules/paymentrequest/MerchantValidationEvent.h: * Modules/paymentrequest/MerchantValidationEvent.idl: * Modules/paymentrequest/MerchantValidationEventInit.h: Removed. * Modules/paymentrequest/MerchantValidationEventInit.idl: Removed. * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent): * Modules/paymentrequest/PaymentMethodChangeEvent.h: * Modules/paymentrequest/PaymentRequest.cpp: (WebCore::PaymentRequest::shippingAddressChanged): (WebCore::PaymentRequest::shippingOptionChanged): (WebCore::PaymentRequest::paymentMethodChanged): * Modules/paymentrequest/PaymentRequest.h: (isType): * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp: (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent): (WebCore::PaymentRequestUpdateEvent::updateWith): * Modules/paymentrequest/PaymentRequestUpdateEvent.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * dom/EventTarget.cpp: (WebCore::EventTarget::isPaymentRequest const): * dom/EventTarget.h: 2018-09-24 Daniel Bates <dabates@apple.com> Separate Mac and iOS implementation of windowsKeyCodeForCharCode() https://bugs.webkit.org/show_bug.cgi?id=189898 Reviewed by Tim Horton. Extract the Mac and iOS implementations into a windowsKeyCodeForCharCode() defined in file KeyEventMac.mm and file KeyEventIOS, respectively. Mac and iOS have significant differences in how they represent function keys. It is not worthwhile to share windowsKeyCodeForCharCode() between them given these differences. On Mac function keys are represented by a char code in the range 0xF700-0xF8FF. On iOS these keys may not have a unique char code (e.g. F1 = 0x10 = F10) and must be identified either by special string (e.g. UIKeyInputUpArrow) or key code. * platform/cocoa/KeyEventCocoa.mm: (WebCore::windowsKeyCodeForCharCode): Deleted. * platform/ios/KeyEventIOS.mm: (WebCore::windowsKeyCodeForCharCode): Added. Remove the handling of NS*FunctionKey char codes as function keys are not represented using them as of iOS 12. * platform/mac/KeyEventMac.mm: (WebCore::windowsKeyCodeForCharCode): Added. 2018-09-21 Simon Fraser <simon.fraser@apple.com> Remove the old "AcceleratedCompositingForOverflowScroll" code https://bugs.webkit.org/show_bug.cgi?id=189870 Reviewed by Zalan Bujtas. The "AcceleratedCompositingForOverflowScroll" code was added to allow overflow:scroll to use composited scrolling if an overflow:scroll could be made a stacking context without affecting z-order. We need overflow:scroll to be accelerated always, so a different approach is needed. Remove this old code (unused by any platform?) to make working on new code easier. * page/Settings.yaml: * rendering/RenderLayer.cpp: (WebCore::RenderLayer::RenderLayer): (WebCore::RenderLayer::setHasVisibleContent): (WebCore::RenderLayer::updateDescendantDependentFlags): (WebCore::RenderLayer::dirty3DTransformedDescendantStatus): (WebCore::RenderLayer::stackingContext const): (WebCore::compositingContainer): (WebCore::RenderLayer::addChild): (WebCore::RenderLayer::removeChild): (WebCore::RenderLayer::hasAcceleratedTouchScrolling const): (WebCore::RenderLayer::usesAcceleratedScrolling const): (WebCore::adjustedScrollDelta): (WebCore::RenderLayer::updateCompositingLayersAfterScroll): (WebCore::RenderLayer::updateScrollInfoAfterLayout): (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): (WebCore::RenderLayer::calculateClipRects const): (WebCore::RenderLayer::acceleratedCompositingForOverflowScrollEnabled const): Deleted. (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrder): Deleted. (WebCore::RenderLayer::updateDescendantsAreContiguousInStackingOrderRecursive): Deleted. (WebCore::RenderLayer::positionNewlyCreatedOverflowControls): Deleted. (WebCore::RenderLayer::canBeStackingContainer const): Deleted. (WebCore::RenderLayer::stackingContainer const): Deleted. (WebCore::RenderLayer::needsCompositedScrolling const): Deleted. (WebCore::RenderLayer::updateNeedsCompositedScrolling): Deleted. * rendering/RenderLayer.h: (WebCore::RenderLayer::clearZOrderLists): (WebCore::RenderLayer::updateZOrderLists): * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::updateAfterLayout): (WebCore::RenderLayerBacking::computeParentGraphicsLayerRect const): (WebCore::RenderLayerBacking::updateGeometry): (WebCore::RenderLayerBacking::requiresHorizontalScrollbarLayer const): (WebCore::RenderLayerBacking::requiresVerticalScrollbarLayer const): (WebCore::RenderLayerBacking::requiresScrollCornerLayer const): (WebCore::RenderLayerBacking::compositingOpacity const): (WebCore::traverseVisibleNonCompositedDescendantLayers): (WebCore::RenderLayerBacking::hasUnpositionedOverflowControlsLayers const): Deleted. * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayersAfterFlush): (WebCore::RenderLayerCompositor::updateCustomLayersAfterFlush): (WebCore::styleChangeRequiresLayerRebuild): (WebCore::RenderLayerCompositor::enclosingNonStackingClippingLayer const): (WebCore::RenderLayerCompositor::computeCompositingRequirements): (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::requiresCompositingLayer const): (WebCore::RenderLayerCompositor::requiresOwnBackingStore const): (WebCore::RenderLayerCompositor::reasonsForCompositing const): (WebCore::RenderLayerCompositor::requiresCompositingForBackfaceVisibility const): (WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const): (WebCore::RenderLayerCompositor::requiresCompositingForPosition const): (WebCore::RenderLayerCompositor::requiresCompositingForOverflowScrolling const): (WebCore::RenderLayerCompositor::requiresCompositingForScrolling const): Deleted. * rendering/RenderLayerCompositor.h: 2018-09-24 Youenn Fablet <youenn@apple.com> Enable conversion of libwebrtc internal frames as CVPixelBuffer https://bugs.webkit.org/show_bug.cgi?id=189892 Reviewed by Eric Carlson. Make sure to handle the case of libwebrtc frames that are not backed by CVPixelBuffer. No observable change of behavior. * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp: (WebCore::LibWebRTCProviderCocoa::createDecoderFactory): (WebCore::LibWebRTCProviderCocoa::createEncoderFactory): Update according renamed methods. * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame): In case of libwebrtc frame that are not backed by CVPixelBuffer, we create a CVPixelBuffer from a pixel buffer pool. This CVPixelBuffer is then filled as part of webrtc::pixelBufferFromFrame. * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV): Make sure to use preferred pixel buffer format. 2018-09-24 Eric Carlson <eric.carlson@apple.com> [MediaStream] Add mock window capture source https://bugs.webkit.org/show_bug.cgi?id=189843 <rdar://problem/44687445> Reviewed by Youenn Fablet. No new tests, the API is disabled and it isn't possible to test yet. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::processNewFrame): Remove an extra blank line. * platform/mock/MockMediaDevice.h: (WebCore::MockDisplayProperties::encode const): Get rid of defaultFrameRate, add type. (WebCore::MockDisplayProperties::decode): Ditto. (WebCore::MockMediaDevice::type const): * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): Add mock window devices. (WebCore::MockRealtimeMediaSourceCenter::audioDevices): Cleanup. (WebCore::MockRealtimeMediaSourceCenter::videoDevices): Cleanup. (WebCore::MockRealtimeMediaSourceCenter::displayDevices): New. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Set default size on displays. (WebCore::MockRealtimeVideoSource::supportsSizeAndFrameRate): Call RealtimeVideoSource for mock camera, base class for device. (WebCore::MockRealtimeVideoSource::setSizeAndFrameRate): Ditto. (WebCore::MockRealtimeVideoSource::generatePresets): ASSERT if called as a camera. (WebCore::MockRealtimeVideoSource::capabilities): updateCapabilities is only appropriate for cameras. (WebCore::MockRealtimeVideoSource::settings): Camera and Device are different surface types. (WebCore::MockRealtimeVideoSource::drawText): Render name, not ID. (WebCore::MockRealtimeVideoSource::mockDisplayType const): * platform/mock/MockRealtimeVideoSource.h: (WebCore::MockRealtimeVideoSource::mockDisplay const): (WebCore::MockRealtimeVideoSource::mockScreen const): (WebCore::MockRealtimeVideoSource::mockWindow const): 2018-09-24 Daniel Bates <dabates@apple.com> [iOS] Key code is 0 for many hardware keyboard keys https://bugs.webkit.org/show_bug.cgi?id=189604 Reviewed by Wenson Hsieh. Based off a patch by Jeremy Jones. Add iOS-specific implementation of windowsKeyCodeForKeyCode() to map an iOS virtual key code to the corresponding Windows virtual key code. Only hardware keyboard-generated events have a virtual key code. For software-generated keyboard events we do what we do now and compute the Windows virtual key code from the character string associated with the event. When a WebEvent is instantiated with a non-zero iOS virtual key code (keyCode) we now always convert it to its corresponding Windows virtual key code without considering the specified charactersIgnoringModifiers character string. Currently we prefer computing the key code from charactersIgnoringModifiers regardless of whether a non-zero iOS virtual key code was given. However this causes special keys, including function keys (e.g. F10) to be misidentified because keyboard layouts in iOS (at least iOS 12) map such special keys to ASCII control characters (e.g. F10 maps to ASCII control character "data link escape" = 0x10) as opposed to special 16-bit integral constants as we do on Mac (e.g. F10 maps to NSF10FunctionKey = 0xF70D on Mac). I will look to fix up the computation of a Windows virtual key code from a char code on iOS in a subsequent commit(s). For now, computing the Windows virtual key code directly from the iOS virtual key code specified to the WebEvent constructor avoids the misidentification using an ANSI US keyboard layout. * platform/cocoa/KeyEventCocoa.mm: (WebCore::windowsKeyCodeForKeyCode): Deleted; moved to KeyEventMac.mm as this mapping is specific to Mac. * platform/ios/KeyEventIOS.mm: (WebCore::windowsKeyCodeForKeyCode): Added. * platform/ios/WebEvent.mm: (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:keyCode:isTabKey:characterSet:]): Address the NOTE comment and compute the Windows virtual key code from the iOS virtual key code when we have one. Also inline the value of an unncessary local variable. (-[WebEvent initWithKeyEventType:timeStamp:characters:charactersIgnoringModifiers:modifiers:isRepeating:withFlags:withInputManagerHint:keyCode:isTabKey:]): Ditto. * platform/mac/KeyEventMac.mm: (WebCore::windowsKeyCodeForKeyCode): Moved from KeyEventCocoa.mm. Updated code to make use of WTF_ARRAY_LENGTH() instead of hardcoding the upper bound of the lookup table. 2018-09-24 Simon Fraser <simon.fraser@apple.com> feMorphology filter in CSS doesn't update when element moves https://bugs.webkit.org/show_bug.cgi?id=189895 Reviewed by Dean Jackson. SourceAlpha needs to be invalidated from clearIntermediateResults(), so get it from the SVGFilterBuilder (which always creates one) and store in a member variable. Test: css3/filters/invalidate-sourceAlpha.html * rendering/CSSFilter.cpp: (WebCore::CSSFilter::buildReferenceFilter): (WebCore::CSSFilter::clearIntermediateResults): * rendering/CSSFilter.h: * svg/graphics/filters/SVGFilterBuilder.h: 2018-09-24 Simon Fraser <simon.fraser@apple.com> CSS reference filter with feDisplacementMap shows buffer corruption on Retina displays https://bugs.webkit.org/show_bug.cgi?id=188486 <rdar://problem/43189750> Reviewed by Dean Jackson. The paintSize needs to be scaled by filterScale on Retina displays. Test: css3/filters/hidpi-feDisplacementMap.html * platform/graphics/filters/FEDisplacementMap.cpp: (WebCore::FEDisplacementMap::platformApplySoftware): * platform/graphics/filters/FEDisplacementMap.h: 2018-09-24 Simon Fraser <simon.fraser@apple.com> ReferenceFilterOperation doesn't need to store the FilterEffect https://bugs.webkit.org/show_bug.cgi?id=189904 Reviewed by Dean Jackson. ReferenceFilterOperation doesn't do anything with m_filterEffect so don't store it. * platform/graphics/filters/FilterOperation.cpp: (WebCore::ReferenceFilterOperation::setFilterEffect): Deleted. * platform/graphics/filters/FilterOperation.h: (WebCore::ReferenceFilterOperation::filterEffect const): Deleted. * rendering/CSSFilter.cpp: (WebCore::CSSFilter::build): 2018-09-24 Simon Fraser <simon.fraser@apple.com> Garbled rendering of image when applied feConvolveMatrix to it, on Retina display https://bugs.webkit.org/show_bug.cgi?id=189748 <rdar://problem/44621494> Reviewed by Jon Lee. feConvolveMatrix needs to scale the paintSize by the filter scale (2x on Retina displays), otherwise parts of the output buffer are uninitialized and the result is incorrect. Test: css3/filters/hidpi-feConvolveMatrix.html * platform/graphics/filters/FEConvolveMatrix.cpp: (WebCore::FEConvolveMatrix::platformApplySoftware): 2018-09-22 Dean Jackson <dino@apple.com> Ensure PointerEvent is not visible when disabled https://bugs.webkit.org/show_bug.cgi?id=189889 <rdar://problem/44708253> Reviewed by Eric Carlson. Test: pointerevents/disabled.html * bindings/js/WebCoreBuiltinNames.h: Now that it is enabled at runtime, it needs a built-in name. * dom/PointerEvent.idl: Add EnabledAtRuntime. 2018-09-24 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Pull demuxed samples in batches https://bugs.webkit.org/show_bug.cgi?id=189871 Reviewed by Xabier Rodriguez-Calvar. After this patch, only the notifications of "new samples available" (appsink-new-sample bus messages) travel from the streaming thread to the main thread through the bus and the main thread is the responsible of pulling as many samples as it can from appsink. Before, the samples were pulled from appsink in the non-main thread and traveled to the main thread through the bus one by one. This reduces drastically the amount of context switches and waiting time in the streaming thread, resulting in a noticeable performance improvement. This fixes stutter while loading YouTube videos. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::~AppendPipeline): (WebCore::AppendPipeline::clearPlayerPrivate): (WebCore::AppendPipeline::handleApplicationMessage): (WebCore::AppendPipeline::appsinkNewSample): (WebCore::AppendPipeline::consumeAppSinkAvailableSamples): (WebCore::AppendPipeline::resetPipeline): (WebCore::AppendPipeline::handleNewAppsinkSample): * platform/graphics/gstreamer/mse/AppendPipeline.h: 2018-09-24 Per Arne Vollan <pvollan@apple.com> [WebVTT] Change name of WebVTT region attribute 'height' to 'lines'. https://bugs.webkit.org/show_bug.cgi?id=189862 Reviewed by Eric Carlson. The WebVTT region attribute 'height' has been renamed to 'lines', see https://w3c.github.io/webvtt/#region-settings. No new tests, covered by existing tests. * html/track/VTTRegion.cpp: (WebCore::VTTRegion::setLines): (WebCore::VTTRegion::updateParametersFromRegion): (WebCore::VTTRegion::scanSettingName): (WebCore::VTTRegion::parseSettingValue): (WebCore::VTTRegion::prepareRegionDisplayTree): (WebCore::VTTRegion::setHeight): Deleted. * html/track/VTTRegion.h: * html/track/VTTRegion.idl: 2018-09-24 Alicia Boya García <aboya@igalia.com> [MSE][GStreamer] Use no-more-pads event for noticing initialization segments https://bugs.webkit.org/show_bug.cgi?id=189868 Reviewed by Xabier Rodriguez-Calvar. Fixes the following YTTV 2018 tests: 62.VideoDimensionVP9 63.PlaybackStateVP9 This removes the hack that was making supporting multiple tracks in the same file in MSE impossible. For WebM, this GStreamer patch is required: https://bugzilla.gnome.org/show_bug.cgi?id=797187 "matroskademux: Emit no-more-pads after parsing Tracks" * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::AppendPipeline): (WebCore::AppendPipeline::handleApplicationMessage): (WebCore::AppendPipeline::demuxerNoMorePads): (WebCore::AppendPipeline::appsinkCapsChanged): (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): (WebCore::AppendPipeline::appendPipelineDemuxerNoMorePadsFromAnyThread): (WebCore::appendPipelineDemuxerNoMorePads): * platform/graphics/gstreamer/mse/AppendPipeline.h: 2018-09-24 Thibault Saunier <tsaunier@igalia.com> [WPE][GTK][WebRTC] Fix leaks in the libwebrtc Decoder and Encoder https://bugs.webkit.org/show_bug.cgi?id=189835 Reviewed by Philippe Normand. - Rework memory management to avoid leaking encoded frames (basically use the same strategy as other libwebrtc encoder implementation). - Plug a GstCaps leak. * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: (WebCore::GStreamerVideoEncoder::InitEncode): (WebCore::GStreamerVideoEncoder::newSampleCallback): (WebCore::GStreamerVideoEncoder::Fragmentize): (WebCore::GStreamerVideoEncoder::SetRestrictionCaps): 2018-09-24 Philippe Normand <pnormand@igalia.com> [GStreamer] Utilities cleanups https://bugs.webkit.org/show_bug.cgi?id=189699 <rdar://problem/44634143> Reviewed by Xabier Rodriguez-Calvar. The GstMappedBuffer now has a move constructor so that it can be easily reused in the webaudiosrc element. The now-unused corresponding buffer-mapping utilities are removed from the code-base. The HTTP source element used to handle a GstBuffer in its private structure but this is no longer required since data is now pushed in chunks, see bug #182829. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcLoop): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::createGstBuffer): Deleted. (WebCore::createGstBufferForData): Deleted. (WebCore::getGstBufferDataPointer): Deleted. (WebCore::mapGstBuffer): Deleted. (WebCore::unmapGstBuffer): Deleted. * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::create): New method returning a reference to a newly created GstMappedBuffer instance. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStop): Remove reference to unused GstBuffer. (CachedResourceStreamingClient::dataReceived): Ditto. 2018-09-24 Enrique Ocaña González <eocanha@igalia.com> [MSE][GStreamer] Don't update duration when it was not previously NaN https://bugs.webkit.org/show_bug.cgi?id=189869 Reviewed by Xabier Rodriguez-Calvar. This is what the spec mandates. The spec doesn't say anything about updating duration when it had been previously set, even if the new init segment says that the duration is growing. This fixes MSE YTTV 2018 69.MediaSourceDurationVP9. * platform/graphics/gstreamer/mse/AppendPipeline.cpp: (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink): 2018-09-23 Frederic Wang <fwang@igalia.com> Add missing includes in TextCodecReplacement.cpp https://bugs.webkit.org/show_bug.cgi?id=189894 Reviewed by Darin Adler. No new tests, behavior unchanged. * platform/text/TextCodecReplacement.cpp: Add missing headers. 2018-09-22 Adrian Perez de Castro <aperez@igalia.com> [ARM] Building FELightingNEON.cpp fails due to missing lightVector member https://bugs.webkit.org/show_bug.cgi?id=189890 Reviewed by Darin Adler. No new tests needed. * platform/graphics/cpu/arm/filters/FELightingNEON.h: (WebCore::FELighting::platformApplyNeon): Adapt to new layout of "struct PaintingData" after r225122. 2018-09-22 Zan Dobersek <zdobersek@igalia.com> [Cairo] Null-check cairo_pattern_t gradient objects https://bugs.webkit.org/show_bug.cgi?id=189820 Reviewed by Alex Christensen. Cairo-specific implementation of Gradient::createPlatformGradient() can now return a nullptr value when a conic gradient is described by the Gradient object. Cairo doesn't have a way to create cairo_pattern_t objects for such gradients. Null-checks are now done on return values of createPlatformGradient(), in order to avoid proceeding to paint a null cairo_pattern_t object. * platform/graphics/cairo/GradientCairo.cpp: (WebCore::Gradient::fill): * platform/graphics/cairo/GraphicsContextImplCairo.cpp: (WebCore::GraphicsContextImplCairo::fillRect): 2018-09-21 Ryosuke Niwa <rniwa@webkit.org> Cannot start a drag inside a shadow tree when an inclusive-ancestor of its shadow host is a draggable element https://bugs.webkit.org/show_bug.cgi?id=136836 Reviewed by Wenson Hsieh. Fixed the bug by simply generalizing the existing code path existed for video / input type=color. Tests: fast/shadow-dom/dragging-element-inside-shadow-tree.html fast/shadow-dom/dragging-element-with-shadow-tree.html * page/DragController.cpp: (WebCore::DragController::startDrag): 2018-09-22 Chris Dumez <cdumez@apple.com> FontDataCache should use Ref<Font> instead of a RefPtr<Font> https://bugs.webkit.org/show_bug.cgi?id=189861 Reviewed by Antti Koivisto. * platform/graphics/FontCache.cpp: (WebCore::FontCache::fontForPlatformData): (WebCore::FontCache::purgeInactiveFontData): 2018-09-21 Justin Michaud <justin_michaud@apple.com> Implement initialValue support for CSS Custom Properties and Values API https://bugs.webkit.org/show_bug.cgi?id=189819 Reviewed by Simon Fraser. * css/CSSComputedStyleDeclaration.cpp: (WebCore::ComputedStyleExtractor::customPropertyValue): * css/CSSCustomPropertyValue.cpp: (WebCore::CSSCustomPropertyValue::resolveVariableReferences const): * css/CSSCustomPropertyValue.h: * css/CSSRegisteredCustomProperty.h: * css/CSSVariableData.cpp: (WebCore::CSSVariableData::resolveVariableFallback const): (WebCore::CSSVariableData::resolveVariableReference const): (WebCore::CSSVariableData::resolveVariableReferences const): (WebCore::CSSVariableData::resolveTokenRange const): * css/CSSVariableData.h: * css/DOMCSSRegisterCustomProperty.cpp: (WebCore::DOMCSSRegisterCustomProperty::registerProperty): * css/DOMCSSRegisterCustomProperty.h: * css/DOMCSSRegisterCustomProperty.idl: * css/StyleResolver.cpp: (WebCore::StyleResolver::resolvedVariableValue): (WebCore::StyleResolver::applyCascadedProperties): * css/parser/CSSParser.cpp: (WebCore::CSSParser::parseValueWithVariableReferences): * css/parser/CSSParser.h: * dom/Document.h: (WebCore::Document::getCSSRegisteredCustomPropertySet const): * rendering/style/RenderStyle.cpp: (WebCore::RenderStyle::checkVariablesInCustomProperties): * rendering/style/RenderStyle.h: 2018-09-21 Dean Jackson <dino@apple.com> Add PointerEvent, plus feature flag, plus Web Platform Tests https://bugs.webkit.org/show_bug.cgi?id=189867 <rdar://problem/44697384> Reviewed by Simon Fraser. Add the PointerEvent interface. Tests: imported/w3c/web-platform-tests/pointerevents/extension/idlharness.window.html imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_constructor.html imported/w3c/web-platform-tests/pointerevents/extension/pointerevent_touch-action-verification.html imported/w3c/web-platform-tests/pointerevents/idlharness.window.html imported/w3c/web-platform-tests/pointerevents/pointerevent_constructor.html imported/w3c/web-platform-tests/pointerevents/pointerevent_on_event_handlers.html imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-illegal.html imported/w3c/web-platform-tests/pointerevents/pointerevent_touch-action-verification.html * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: Add the new files. * dom/Event.h: (WebCore::Event::isPointerEvent const): New virtual identification method. * dom/EventNames.in: Add PointerEvent so the InterfaceType code is generated. * dom/PointerEvent.cpp: The PointerEvent interface, as specified by W3C. (WebCore::PointerEvent::PointerEvent): (WebCore::PointerEvent::eventInterface const): * dom/PointerEvent.h: Added. * dom/PointerEvent.idl: Added. * page/RuntimeEnabledFeatures.h: Clean up the ordering of the features, so there aren't confusing blank lines interspersed with #if USE macros. (WebCore::RuntimeEnabledFeatures::setPointerEventsEnabled): Add a new flag for Pointer Events. (WebCore::RuntimeEnabledFeatures::pointerEventsEnabled const): 2018-09-21 Ryosuke Niwa <rniwa@webkit.org> Custom elements in a reaction queue can lose its JS wrapper and become HTMLUnknownElement https://bugs.webkit.org/show_bug.cgi?id=184307 Reviewed by Keith Miller. The bug was caused by the custom elements reaction queue not reporting its content to GC during marking. When there is no JS reference to the JS wrappers of those custom element, and if those custom elements are disconnected, GC would happily collect those the wrappers. Unfortunately, the same bug exists for any asynchronous events and other WebCore code which keeps elements alive for a later use but doesn't report them to GC (e.g. during visitChildren). This patch, therefore, introduces a generic mechanism to keep these elements' wrappers alive. Namely, we introduce GCReachableRef, a new smart pointer type for Node's subclasses, which keeps element as well as its wrappers alive. GCReachableRef works by adding its Node to a global hash counted set when it's created and making JSNodeOwner::isReachableFromOpaqueRoots return true when the node is in the set. Test: fast/custom-elements/custom-elements-reaction-queue-retains-js-wrapper.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * bindings/js/JSNodeCustom.cpp: (WebCore::isReachableFromDOM): * dom/CustomElementReactionQueue.cpp: (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Don't swap the vector of elements in in the queue. Assuming each DOM API has an appropriate CustomElementsReactionStack, we should never append a new element to this queue while invoking custom element reactions. * dom/CustomElementReactionQueue.h: * dom/GCReachableRef.cpp: Added. * dom/GCReachableRef.h: Added. (WebCore::GCReachableRefMap::contains): Added. (WebCore::GCReachableRefMap::add): Added. (WebCore::GCReachableRefMap::remove): Added. (WebCore::GCReachableRef::GCReachableRef): Added. We need isNull() check since WTFMove may have been called on the source GCReachableRef. (WebCore::GCReachableRef::~GCReachableRef): Ditto. (WebCore::GCReachableRef::operator-> const): Added. (WebCore::GCReachableRef::get const): Added. (WebCore::GCReachableRef::operator T& const): Added. (WebCore::GCReachableRef::operator! const): Added. (WebCore::GCReachableRef::isNull const): Added. Returns true if WTFMove had been called on Ref. 2018-09-21 Alex Christensen <achristensen@webkit.org> Use a Variant for FormDataElement https://bugs.webkit.org/show_bug.cgi?id=189777 Reviewed by Chris Dumez. * platform/network/FormData.cpp: (WebCore::FormData::FormData): (WebCore::FormDataElement::lengthInBytes const): (WebCore::FormDataElement::isolatedCopy const): (WebCore::FormData::appendData): (WebCore::FormData::flatten const): (WebCore::FormData::resolveBlobReferences): (WebCore::FormData::generateFiles): (WebCore::FormData::hasGeneratedFiles const): (WebCore::FormData::hasOwnedGeneratedFiles const): (WebCore::FormData::removeGeneratedFilesIfNeeded): (WebCore::FormData::asSharedBuffer const): (WebCore::FormData::asBlobURL const): (WebCore::FormData::expandDataStore): Deleted. * platform/network/FormData.h: (WebCore::FormDataElement::FormDataElement): (WebCore::FormDataElement::encode const): (WebCore::FormDataElement::decode): (WebCore::FormDataElement::EncodedFileData::isolatedCopy const): (WebCore::FormDataElement::EncodedFileData::operator== const): (WebCore::FormDataElement::EncodedFileData::encode const): (WebCore::FormDataElement::EncodedFileData::decode): (WebCore::FormDataElement::EncodedBlobData::operator== const): (WebCore::FormDataElement::EncodedBlobData::encode const): (WebCore::FormDataElement::EncodedBlobData::decode): (WebCore::FormDataElement::operator== const): (WebCore::FormDataElement::operator!= const): * platform/network/cf/FormDataStreamCFNet.cpp: (WebCore::advanceCurrentStream): (WebCore::createHTTPBodyCFReadStream): (WebCore::setHTTPBody): * platform/network/curl/CurlFormDataStream.cpp: (WebCore::CurlFormDataStream::computeContentLength): (WebCore::CurlFormDataStream::read): (WebCore::CurlFormDataStream::readFromFile): (WebCore::CurlFormDataStream::readFromData): * platform/network/curl/CurlFormDataStream.h: 2018-09-20 Simon Fraser <simon.fraser@apple.com> Simplify the logic around has*ScrollbarWithAutoBehavior https://bugs.webkit.org/show_bug.cgi?id=189813 Reviewed by Zalan Bujtas. The boolean logic in scrollsOverflowX() and hasHorizontalScrollbarWithAutoBehavior() (and the vertical equivalents) reduces simply to hasOverflowClip() && (style().overflowX() == Overflow::Scroll || style().overflowX() == Overflow::Auto); Similarly, RenderBox::intrinsicScrollbarLogicalWidth() just needs the part of the logic that asks whether the theme uses overlay scrollbars which are not customized (and thus turned into non-overlay scrollbars). * rendering/RenderBox.cpp: (WebCore::RenderBox::intrinsicScrollbarLogicalWidth const): (WebCore::RenderBox::canUseOverlayScrollbars const): (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const): (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const): * rendering/RenderBox.h: (WebCore::RenderBox::scrollsOverflowX const): (WebCore::RenderBox::scrollsOverflowY const): * rendering/RenderLayer.cpp: (WebCore::RenderLayer::updateScrollbarsAfterLayout): 2018-09-21 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, rolling out r236255. Many WebAudio crashes Reverted changeset: "[GStreamer] Utilities cleanups" https://bugs.webkit.org/show_bug.cgi?id=189699 https://trac.webkit.org/changeset/236255 2018-09-21 Jer Noble <jer.noble@apple.com> Move AVVideoPerformanceMetrics into AVFoundationSPI.h https://bugs.webkit.org/show_bug.cgi?id=189842 Reviewed by Jon Lee. * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: 2018-09-21 Chris Dumez <cdumez@apple.com> WebSQL: User cannot grant quota increase if the JS provides an expected usage value that is too low https://bugs.webkit.org/show_bug.cgi?id=189801 <rdar://problem/43592498> Reviewed by Youenn Fablet. User was unable to grant a quota increase for WebSQL if the JS provided an expected usage value that is too low. This is because WebKit was passing this provided expectedUsage value to the client for the purpose of quota increase, even when this expectedUsage value does not make any sense (i.e. it is lower than the current database size). As a result, the client would grant a quota that is equal to the previous quota and the JS would not be able to insert any data. In order to address the issue, when the current quota is exceeded and Database::didExceedQuota() is called, we now make sure that the expectedUsage value is greater than the current quota. If it is not, we provide `current quota + 5MB` as expected usage to the client. This way, the client will grant a quota that is actually increased (provided that the user accepts). Test: storage/websql/transaction-database-expand-quota.html * Modules/webdatabase/Database.cpp: (WebCore::Database::setEstimatedSize): (WebCore::Database::didExceedQuota): * Modules/webdatabase/Database.h: 2018-09-21 Youenn Fablet <youenn@apple.com> Use biplanar CVPixelBuffer for black frames sent to libwebrtc https://bugs.webkit.org/show_bug.cgi?id=189837 Reviewed by Eric Carlson. Covered by webrtc/video-mute.html. Add support to call CVPixelBufferGetBytesPerRowOfPlane. Make createBlackPixelBuffer use a biplanar CVPixelBuffer as this is better supported in libwebrtc. It is also what is being used in iOS for capture. * platform/cocoa/CoreVideoSoftLink.cpp: * platform/cocoa/CoreVideoSoftLink.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::createBlackPixelBuffer): 2018-09-21 Youenn Fablet <youenn@apple.com> Add RTCCodecStats support https://bugs.webkit.org/show_bug.cgi?id=189792 <rdar://problem/32370668> Reviewed by Eric Carlson. Covered by updated and rebased tests. * Modules/mediastream/RTCStatsReport.h: Removed fields that are already defined in the base class. (WebCore::RTCStatsReport::CodecStats::CodecStats): Add support for RTCCodecStats. * Modules/mediastream/RTCStatsReport.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::OnStatsDelivered): * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: (WebCore::fillRTCRTPStreamStats): (WebCore::fillRTCCodecStats): (WebCore::LibWebRTCStatsCollector::OnStatsDelivered): Add routines to fill RTCCodecStats from libwebrtc stats. 2018-09-20 Simon Fraser <simon.fraser@apple.com> Make "overflow: overlay" a synonym for "overflow: auto" https://bugs.webkit.org/show_bug.cgi?id=189811 Reviewed by Zalan Bujtas. The "overlay" value for overflow was added for an internal Safari feature, and only has an effect (allow the scrollbar to overlap the content) with legacy scrollbars on macOS. It's little used on the web. To simplify code in rendering, just make "overflow: overlay" behave like "overflow: auto". It's still parsed, but turns into an "auto" value internally, and will be returned from getComputedStyle as "auto". Test: fast/css/getComputedStyle/getComputedStyle-overflow.html * css/CSSPrimitiveValueMappings.h: (WebCore::CSSPrimitiveValue::CSSPrimitiveValue): (WebCore::CSSPrimitiveValue::operator Overflow const): * css/CSSProperties.json: * css/CSSValueKeywords.in: * css/StyleResolver.cpp: (WebCore::isScrollableOverflow): * css/parser/CSSParserFastPaths.cpp: (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue): * page/ios/FrameIOS.mm: (WebCore::Frame::nodeRespondingToScrollWheelEvents): * rendering/RenderBox.cpp: (WebCore::RenderBox::hasVerticalScrollbarWithAutoBehavior const): (WebCore::RenderBox::hasHorizontalScrollbarWithAutoBehavior const): * rendering/RenderLayer.cpp: (WebCore::styleDefinesAutomaticScrollbar): * rendering/RenderLayerCompositor.cpp: (WebCore::isScrollableOverflow): * rendering/style/RenderStyleConstants.h: 2018-09-21 Youenn Fablet <youenn@apple.com> Centralize which CVPixelBuffer format is being used https://bugs.webkit.org/show_bug.cgi?id=189772 Reviewed by Eric Carlson. Get the format type from a single point. This changes the video capture and mock realtime video sources on Mac to use a biplanar format. No observable change of behavior. * WebCore.xcodeproj/project.pbxproj: * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::createBlackPixelBuffer): * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated): * platform/mediastream/mac/RealtimeVideoUtilities.h: Added. 2018-09-21 Antoine Quint <graouts@apple.com> REGRESSION (r235962-r235963): Layout Test animations/suspend-resume-animation-events.html is a flaky failure https://bugs.webkit.org/show_bug.cgi?id=189607 <rdar://problem/44652315> Reviewed by Dean Jackson. There is no reason we shouldn't return the document timeline's time when suspended as otherwise animations may report an unresolved current time when suspended which would wreak havoc when invalidating what DOM events to dispatch for CSS Animations and Transitions. We also shouldn't be invalidation DOM events when suspended. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::currentTime): (WebCore::DocumentTimeline::DocumentTimeline::performInvalidationTask): 2018-09-21 Mike Gorse <mgorse@suse.com> Build tools should work when the /usr/bin/python is python3 https://bugs.webkit.org/show_bug.cgi?id=156674 Reviewed by Michael Catanzaro. No new tests (no behavior change). * platform/network/create-http-header-name-table: remove xreadlines. 2018-09-21 Jer Noble <jer.noble@apple.com> [EME] Introduce the concept of CDMInstanceSession. https://bugs.webkit.org/show_bug.cgi?id=189725 Reviewed by Eric Carlson. Currently, the same CDMInstance owned by a MediaKeys object is passed to every MediaKeySession created by that MediaKeys, and since the CDMInstance has only a single CDMInstanceClient, subsequent MediaKeySessions prevent previous ones from getting updates. Add a new virtual interface, CDMInstanceSession, to be passed to MediaKeySession upon creation. Refactor CDMInstanceClearKey and CDMInstanceFairPlayStreamingAVFObjC to adopt this new interface. Drive-by fixes: Made a number of virtual overrides in final classes final themselves. * Modules/encryptedmedia/MediaKeySession.cpp: (WebCore::MediaKeySession::create): (WebCore::MediaKeySession::MediaKeySession): (WebCore::MediaKeySession::generateRequest): (WebCore::MediaKeySession::load): (WebCore::MediaKeySession::update): (WebCore::MediaKeySession::remove): (WebCore::MediaKeySession::updateKeyStatuses): * Modules/encryptedmedia/MediaKeySession.h: * Modules/encryptedmedia/MediaKeys.cpp: (WebCore::MediaKeys::createSession): * WebCore.xcodeproj/project.pbxproj: * platform/encryptedmedia/CDMInstance.h: (WebCore::CDMInstance::setHDCPStatus): (WebCore::CDMInstance::setClient): Deleted. (WebCore::CDMInstance::clearClient): Deleted. * platform/encryptedmedia/CDMInstanceSession.h: Copied from Source/WebCore/platform/encryptedmedia/CDMInstance.h. (WebCore::CDMInstanceSession::setClient): (WebCore::CDMInstanceSession::clearClient): * platform/encryptedmedia/clearkey/CDMClearKey.cpp: (WebCore::parseLicenseFormat): (WebCore::CDMInstanceClearKey::keySystem const): (WebCore::CDMInstanceClearKey::createSession): (WebCore::CDMInstanceSessionClearKey::requestLicense): (WebCore::CDMInstanceSessionClearKey::keys const): (WebCore::CDMInstanceSessionClearKey::updateLicense): (WebCore::CDMInstanceSessionClearKey::loadSession): (WebCore::CDMInstanceSessionClearKey::closeSession): (WebCore::CDMInstanceSessionClearKey::removeSessionData): (WebCore::CDMInstanceSessionClearKey::storeRecordOfKeyUsage): (WebCore::CDMInstanceClearKey::requestLicense): Deleted. (WebCore::CDMInstanceClearKey::keys const): Deleted. (WebCore::CDMInstanceClearKey::updateLicense): Deleted. (WebCore::CDMInstanceClearKey::loadSession): Deleted. (WebCore::CDMInstanceClearKey::closeSession): Deleted. (WebCore::CDMInstanceClearKey::removeSessionData): Deleted. (WebCore::CDMInstanceClearKey::storeRecordOfKeyUsage): Deleted. * platform/encryptedmedia/clearkey/CDMClearKey.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h: * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceFairPlayStreamingAVFObjC::createSession): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::processContentKeyRequestForSession): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::processNextContentKeyRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRenewingRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvidePersistableRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestDidSucceed): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::shouldRetryRequestForReason): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::sessionIdentifierChanged): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::CDMInstanceSessionFairPlayStreamingAVFObjC): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::keyIDs): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::updateLicense): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::loadSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::closeSession): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::removeSessionData): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::storeRecordOfKeyUsage): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::setClient): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::clearClient): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvideRenewingRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didProvidePersistableRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::didFailToProvideRequest): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::requestDidSucceed): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::shouldRetryRequestForReason): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::sessionIdentifierChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::outputObscuredDueToInsufficientExternalProtectionChanged): (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::isLicenseTypeSupported const): (WebCore::CDMInstanceFairPlayStreamingAVFObjC::isLicenseTypeSupported const): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::requestLicense): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::loadSession): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::closeSession): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::removeSessionData): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::storeRecordOfKeyUsage): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::setClient): Deleted. (WebCore::CDMInstanceFairPlayStreamingAVFObjC::clearClient): Deleted. * testing/MockCDMFactory.cpp: (WebCore::MockCDMInstance::keySystem const): (WebCore::MockCDMInstance::createSession): (WebCore::MockCDMInstanceSession::MockCDMInstanceSession): (WebCore::MockCDMInstanceSession::requestLicense): (WebCore::MockCDMInstanceSession::updateLicense): (WebCore::MockCDMInstanceSession::loadSession): (WebCore::MockCDMInstanceSession::closeSession): (WebCore::MockCDMInstanceSession::removeSessionData): (WebCore::MockCDMInstanceSession::storeRecordOfKeyUsage): (WebCore::MockCDMInstance::requestLicense): Deleted. (WebCore::MockCDMInstance::updateLicense): Deleted. (WebCore::MockCDMInstance::loadSession): Deleted. (WebCore::MockCDMInstance::closeSession): Deleted. (WebCore::MockCDMInstance::removeSessionData): Deleted. (WebCore::MockCDMInstance::storeRecordOfKeyUsage): Deleted. * testing/MockCDMFactory.h: (WebCore::MockCDMInstance::factory const): (WebCore::MockCDMInstance::distinctiveIdentifiersAllowed const): (WebCore::MockCDMInstance::persistentStateAllowed const): 2018-09-21 Alicia Boya García <aboya@igalia.com> [MSE] Fix comparsion with uninitialized greatestDecodeDuration https://bugs.webkit.org/show_bug.cgi?id=189805 Reviewed by Michael Catanzaro. This bug was causing greatestDecodeDuration to never be initialized, which in turned caused unintended frame erase as distant appends where not being recognized as distinct coded frame groups. A test reproducing the sequence of appends that caused unintended frame deletion has also been added (media-source-append-out-of-order.html). * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-09-21 Antoine Quint <graouts@apple.com> [Web Animations] Accelerated animations don't get suspended https://bugs.webkit.org/show_bug.cgi?id=189783 <rdar://problem/44652315> Unreviewed, correct a merge error in the previous commit. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::performInvalidationTask): 2018-09-21 Antoine Quint <graouts@apple.com> [Web Animations] Accelerated animations don't get suspended https://bugs.webkit.org/show_bug.cgi?id=189783 <rdar://problem/43033568> Reviewed by Dean Jackson. Test: webanimations/accelerated-animation-suspension.html We used to set the flag that marked the timeline as suspended prior to notifying animations that they need to be suspended. However, since the timeline was marked as suspended, querying the running state of the animations would indicate that the animations weren't running since a suspended timeline would identify its animations as not running. As such we would fail to pause the accelerated animations because they were already not marked as running. We now set the suspended flag on the timeline _after_ suspending its animations. We also fix a bug in the new internals.acceleratedAnimationsForElement() test function so that we read from the actual CA animations and not from a stale list of animations which would not indicate the correct animation speeds. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::suspendAnimations): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::acceleratedAnimationsForTesting): 2018-09-21 Zan Dobersek <zdobersek@igalia.com> TransformationMatrix::toColumnMajorFloatArray() should return a std::array<> object https://bugs.webkit.org/show_bug.cgi?id=189823 Reviewed by Michael Catanzaro. Alias the TransformationMatrix::FloatMatrix4 type to std::array<float, 16>. Instead of filling out the array object that's passed in through a reference parameter, return the std::array<> object from the function. * Modules/webvr/VRFrameData.cpp: (WebCore::matrixToArray): * Modules/webvr/VRStageParameters.cpp: (WebCore::VRStageParameters::sittingToStandingTransform const): * platform/graphics/texmap/TextureMapperShaderProgram.cpp: (WebCore::TextureMapperShaderProgram::setMatrix): * platform/graphics/transforms/TransformationMatrix.cpp: (WebCore::TransformationMatrix::toColumnMajorFloatArray const): * platform/graphics/transforms/TransformationMatrix.h: 2018-09-21 Zan Dobersek <zdobersek@igalia.com> FloatQuad point getters should return const references https://bugs.webkit.org/show_bug.cgi?id=189821 Reviewed by Yusuke Suzuki. Be pedantic and have the FloatQuad point getters return const references to the FloatPoint member variables, instead of technically creating copies of them (though much of this copying is eliminated when the getters are inlined). * platform/graphics/FloatQuad.h: (WebCore::FloatQuad::p1 const): (WebCore::FloatQuad::p2 const): (WebCore::FloatQuad::p3 const): (WebCore::FloatQuad::p4 const): 2018-09-20 Antoine Quint <graouts@apple.com> [Web Animations] DocumentTimeline::updateAnimations() is called endlessly https://bugs.webkit.org/show_bug.cgi?id=189784 <rdar://problem/41705679> Reviewed by Dean Jackson. Test: webanimations/accelerated-animation-interruption-display-none.html We have code that keeps queueing pending accelerated actions for an animation that does not have a renderer until it has one so that we can deal with situations where animations are ready to commited before its composited renderer is available. This code ended up running continuously when an element with an accelerated animation had its renderer removed without the animation being removed itself, such as setting "display: none" on an element with an acceelerated CSS Animation targeting it. We fix this by queueing up a "Stop" accelerated action when updating the accelerated state if there is no renderer for the current animation target. Then, we no longer re-queue pending accelerated actions if the last queued operation is "Stop". This ensures that we no longer queue actions endlessly when there is no longer a visible animation. To test this, we add a new internals.numberOfAnimationTimelineInvalidations() method that indicates the number of times the current document's animation timeline was invalidated. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::updateAnimations): (WebCore::DocumentTimeline::numberOfAnimationTimelineInvalidationsForTesting const): * animation/DocumentTimeline.h: * animation/KeyframeEffectReadOnly.cpp: (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState): If the animation target does not have a renderer and it's still marked as running, enqueue a "Stop" accelerated action. (WebCore::KeyframeEffectReadOnly::addPendingAcceleratedAction): If we enqueue a "Stop" accelerated action, remove any other queued action so that we only process the "Stop" action, which would have superseded all previously queued actions anyway. (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Only re-queue pending accelerated actions when a composited renderer is not yet available if we don't have a "Stop" action queued. * testing/Internals.cpp: (WebCore::Internals::numberOfAnimationTimelineInvalidations const): * testing/Internals.h: * testing/Internals.idl: 2018-09-21 Yacine Bandou <yacine.bandou@softathome.com> [EME] Fix typo in WebM sanitization variable https://bugs.webkit.org/show_bug.cgi?id=189789 Reviewed by Xabier Rodriguez-Calvar. This commit corrects a typo in the name of a local variable, sanitizedBuffer instead of sanitazedBuffer. * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::extractKeyIDsWebM): 2018-09-20 Dean Jackson <dino@apple.com> Restrict the total combined size of backdrop filters https://bugs.webkit.org/show_bug.cgi?id=189812 <rdar://problem/44532782> Reviewed by Simon Fraser. If the total area of all backdrop filters on the page gets too large, the universe collapses in on itself and we enter the Quantum Realm (i.e. crash horribly). Put a hard limit on the total coverage, and ignore any backdrop filters after the limit. This might break some content, but such content is likely not doing things in the most optimal manner. There isn't any reason to have a backdrop larger than the size of the screen, because you'd be better off applying a foreground filter to the main content and showing something above it. Tests: css3/filters/backdrop/resource-use-add-more-layers.html css3/filters/backdrop/resource-use-excessive.html css3/filters/backdrop/resource-use-ok.html css3/filters/backdrop/resource-use-remove-some-layers.html * platform/graphics/ca/GraphicsLayerCA.cpp: Pick a fairly small maximum size. We can consider increasing this if necessary, and as devices with less RAM are upgraded. (WebCore::GraphicsLayerCA::recursiveCommitChanges): Gather the accumulated size of backdrop filters into the commit state as we are recursing through the tree. (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Force any layer with backdrop filters, or any that is removing backdrop filters, into an update. (WebCore::GraphicsLayerCA::updateBackdropFilters): Update the logic to first check if this backdrop layer causes us to exceed the total allowed size, and if it does, forbid it from getting the GraphicsLayer that composits the backdrop. * platform/graphics/ca/GraphicsLayerCA.h: Remove const from some parameters so that we can use the CommitState to hold the accumulated size. 2018-09-20 Benjamin Poulain <benjamin@webkit.org> Adopt safe-area-insets on ImageDocument https://bugs.webkit.org/show_bug.cgi?id=189774 Reviewed by Tim Horton. rdar://problem/44624432 By having the safe-area insets on the image, we ensure that they only grow the document if there is not enough space. This also ensures the image does not have parts under UI elements. * html/ImageDocument.cpp: (WebCore::ImageDocument::createDocumentStructure): (WebCore::ImageDocument::imageUpdated): 2018-09-20 Zalan Bujtas <zalan@apple.com> Release assert under RenderView::pageOrViewLogicalHeight https://bugs.webkit.org/show_bug.cgi?id=189798 <rdar://problem/43659749> Reviewed by Simon Fraser. Only the mainframe's render view is sized to the page while printing. Use the matching check (see RenderView::layout) when accessing m_pageLogicalSize. Test: printing/crash-while-formatting-subframe-for-printing.html * rendering/RenderView.cpp: (WebCore::RenderView::pageOrViewLogicalHeight const): 2018-09-20 Sihui Liu <sihui_liu@apple.com> REGRESSION(r196265): WKWebView fires mouseover, mouseenter, and mouseleave events even when it's in a background window https://bugs.webkit.org/show_bug.cgi?id=187545 <rdar://problem/42401575> Reviewed by Ryosuke Niwa. When the window is not active, we should only update the scrollbar for mouse events. GTK apps have different expectation on this behavior. Test: fast/events/inactive-window-no-mouse-event.html * page/EventHandler.cpp: (WebCore::EventHandler::handleMouseMoveEvent): (WebCore::EventHandler::shouldSendMouseEventsToInactiveWindows const): * page/EventHandler.h: 2018-09-20 Alex Christensen <achristensen@webkit.org> Unreviewed, rolling out r235976. Broke ARM Reverted changeset: "Use a Variant instead of a union in CSSSelector" https://bugs.webkit.org/show_bug.cgi?id=188559 https://trac.webkit.org/changeset/235976 2018-09-20 Oriol Brufau <obrufau@igalia.com> Fix 'border' serialization with both common and uncommon values https://bugs.webkit.org/show_bug.cgi?id=189597 Reviewed by Simon Fraser. Remove CommonValueMode enum and make borderPropertyValue always return null when there are uncommon values (the previous ReturnNullOnUncommonValues mode). Test: fast/css/getPropertyValue-border.html Test: fast/dom/css-shorthand-common-value.html * css/StyleProperties.cpp: (WebCore::StyleProperties::getPropertyValue const): (WebCore::StyleProperties::borderPropertyValue const): (WebCore::StyleProperties::asText const): * css/StyleProperties.h: 2018-09-20 Justin Michaud <justin_michaud@apple.com> Implement CSS Custom Properties and Values Skeleton https://bugs.webkit.org/show_bug.cgi?id=189694 Reviewed by Simon Fraser. Add feature flag, CSS.registerProperty binding and registered property set in Document.h for the css custom properties and values api. Test: css-properties-values-api/registerProperty.html * CMakeLists.txt: * DerivedSources.make: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSRegisteredCustomProperty.h: Added. * css/DOMCSSCustomPropertyDescriptor.h: Added. * css/DOMCSSCustomPropertyDescriptor.idl: Added. * css/DOMCSSNamespace.h: * css/DOMCSSRegisterCustomProperty.cpp: Added. (WebCore::DOMCSSRegisterCustomProperty::registerProperty): (WebCore::DOMCSSRegisterCustomProperty::from): (WebCore::DOMCSSRegisterCustomProperty::supplementName): * css/DOMCSSRegisterCustomProperty.h: Added. * css/DOMCSSRegisterCustomProperty.idl: Added. * css/parser/CSSParserContext.cpp: * dom/Document.cpp: (WebCore::Document::registerCSSProperty): * dom/Document.h: * features.json: * page/RuntimeEnabledFeatures.h: (WebCore::RuntimeEnabledFeatures::setCSSCustomPropertiesAndValuesEnabled): (WebCore::RuntimeEnabledFeatures::cssCustomPropertiesAndValuesEnabled const): 2018-09-20 Justin Michaud <justin_michaud@apple.com> JS bindings generator should support EnabledAtRuntime for static methods https://bugs.webkit.org/show_bug.cgi?id=189729 Reviewed by Chris Dumez. Add support for EnabledAtRuntime to static methods in the JS bindings code generator. * bindings/scripts/CodeGeneratorJS.pm: (GenerateRuntimeEnableConditionalStringForExposed): (GenerateRuntimeEnableConditionalString): (GetRuntimeEnabledStaticProperties): (GenerateConstructorHelperMethods): * bindings/scripts/test/JS/JSTestGlobalObject.cpp: (WebCore::JSTestGlobalObjectConstructor::initializeProperties): (WebCore::JSTestGlobalObject::finishCreation): (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestGlobalObjectConstructorFunctionEnabledAtRuntimeOperationStatic): * bindings/scripts/test/JS/JSTestObj.cpp: (WebCore::JSTestObjConstructor::initializeProperties): (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStaticGetter): (WebCore::jsTestObjConstructorEnabledAtRuntimeAttributeStatic): (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStaticSetter): (WebCore::setJSTestObjConstructorEnabledAtRuntimeAttributeStatic): (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStaticBody): (WebCore::jsTestObjConstructorFunctionEnabledAtRuntimeOperationStatic): * bindings/scripts/test/TestGlobalObject.idl: * bindings/scripts/test/TestObj.idl: 2018-09-20 Per Arne Vollan <pvollan@apple.com> [WebVTT] Update the parser according to the new region syntax. https://bugs.webkit.org/show_bug.cgi?id=189767 Reviewed by Eric Carlson. The majority of the code added in this patch is adopted from the Chromium project, which has added support for the new region syntax. The complete parser specification can be found at https://w3c.github.io/webvtt/#file-parsing. One small difference in behavior is that the new parser will not add regions with empty id. No new tests, covered by existing tests. * html/track/WebVTTParser.cpp: (WebCore::WebVTTParser::getNewRegions): (WebCore::WebVTTParser::parse): (WebCore::WebVTTParser::collectRegionSettings): (WebCore::WebVTTParser::collectWebVTTBlock): (WebCore::WebVTTParser::checkAndRecoverCue): (WebCore::WebVTTParser::checkAndCreateRegion): (WebCore::WebVTTParser::checkAndStoreRegion): (WebCore::WebVTTParser::collectMetadataHeader): Deleted. (WebCore::WebVTTParser::createNewRegion): Deleted. * html/track/WebVTTParser.h: 2018-09-20 Alicia Boya García <aboya@igalia.com> [GStreamer][MSE] Add a default sample duration https://bugs.webkit.org/show_bug.cgi?id=189788 Some WebM files don't provide sample durations, so we need to provide a safe default in order for them to be playable. Reviewed by Michael Catanzaro. * platform/graphics/gstreamer/MediaSampleGStreamer.cpp: (WebCore::MediaSampleGStreamer::MediaSampleGStreamer): 2018-09-20 Alicia Boya García <aboya@igalia.com> [MSE] Use some tolerance when deciding whether a frame should be appended to the decode queue https://bugs.webkit.org/show_bug.cgi?id=189782 Reviewed by Xabier Rodriguez-Calvar. Ideally, container formats should use exact timestamps and frames should not overlap. Unfortunately, there are lots of files out there where this is not always the case. This is particularly a problem in WebM, where timestamps are expressed in a power of 10 timescale, which forces some rounding. This patch makes SourceBuffer allow frames with a small overlaps (<=1ms) as those usually found in WebM. 1 ms is chosen because it's the default time scale of WebM files. * Modules/mediasource/SourceBuffer.cpp: (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample): 2018-09-20 Yacine Bandou <yacine.bandou@softathome.com> [EME] Add WebM sanitization https://bugs.webkit.org/show_bug.cgi?id=189740 Reviewed by Xabier Rodriguez-Calvar. This patch adds support for sanitizing the WebM initialization data, ensures there are no bogus values. See https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest. Tests: imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html * Modules/encryptedmedia/InitDataRegistry.cpp: (WebCore::sanitizeWebM): Added implementation, check if the initialization data doesn't empty and its size should be less than 64KB, return the buffer copy if it is ok, otherwise a nullptr. (WebCore::extractKeyIDsWebM): Added implementation. 2018-09-20 Philippe Normand <pnormand@igalia.com> [GStreamer] Utilities cleanups https://bugs.webkit.org/show_bug.cgi?id=189699 Reviewed by Xabier Rodriguez-Calvar. The GstMappedBuffer now has a move constructor so that it can be easily reused in the webaudiosrc element. The now-unused corresponding buffer-mapping utilities are removed from the code-base. The HTTP source element used to handle a GstBuffer in its private structure but this is no longer required since data is now pushed in chunks, see bug #182829. * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp: (webKitWebAudioSrcLoop): * platform/graphics/gstreamer/GStreamerCommon.cpp: (WebCore::createGstBuffer): Deleted. (WebCore::createGstBufferForData): Deleted. (WebCore::getGstBufferDataPointer): Deleted. (WebCore::mapGstBuffer): Deleted. (WebCore::unmapGstBuffer): Deleted. * platform/graphics/gstreamer/GStreamerCommon.h: (WebCore::GstMappedBuffer::create): New method returning a reference to a newly created GstMappedBuffer instance. * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp: (webKitWebSrcStop): Remove reference to unused GstBuffer. (CachedResourceStreamingClient::dataReceived): Ditto. 2018-09-20 Simon Fraser <simon.fraser@apple.com> Fix crash under FontCache::purgeInactiveFontData() when a memory warning fires https://bugs.webkit.org/show_bug.cgi?id=189722 rdar://problem/44182860 Reviewed by Myles C. Maxfield. Hashing of FontPlatformData for cachedFonts() is somewhat broken because CFEqual() on CTFont can return false when the fonts are actually the same, and have the same CFHash(). This can result in multiple entries in cachedFonts() with the same Font. Then in FontCache::purgeInactiveFontData(), the loop that appends fonts to fontsToDelete gets the value by reference, and WTFMoves it into fontsToDelete. This nulls out all the entries sharing the same value, leaving null entries in the hash table. We later crash at font->hasOneRef() when using one of those null entries. Fix by making a copy of the RefPtr<Font> in the loop, so the WTFMove doesn't nuke the hash table entries. The entries will get removed at cachedFonts().remove() lower down. * platform/graphics/FontCache.cpp: (WebCore::FontCache::purgeInactiveFontData): 2018-09-20 Antoine Quint <graouts@apple.com> [Web Animations] Provide a way to query accelerated animations for internal testing https://bugs.webkit.org/show_bug.cgi?id=189762 Reviewed by Dean Jackson. Expose a new internals.acceleratedAnimationsForElement(element) method to allow layout tests to query the current list of accelerated animations for a given element. Currently only the animated property and animation speed are exposed, which will allow us to identify missing, running and paused accelerated animations. * animation/DocumentTimeline.cpp: (WebCore::DocumentTimeline::acceleratedAnimationsForElement const): * animation/DocumentTimeline.h: * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::acceleratedAnimationsForTesting const): * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: * testing/Internals.cpp: (WebCore::Internals::acceleratedAnimationsForElement): * testing/Internals.h: * testing/Internals.idl: 2018-09-19 Ryosuke Niwa <rniwa@webkit.org> Improve node statistics for rare data https://bugs.webkit.org/show_bug.cgi?id=189775 Reviewed by Simon Fraser. Report reasons we created NodeRareData and ElementRareData in node statistics. Added NodeRareData::useTypes and ElementRareData::useTypes which returns OptionSet<NodeRareData::UseType> indicating which instance member of the rare data is currently in use. * dom/Element.cpp: * dom/Element.h: * dom/ElementRareData.h: (WebCore::defaultMinimumSizeForResizing): (WebCore::ElementRareData::useTypes const): * dom/Node.cpp: (WebCore::stringForRareDataUseType): (WebCore::Node::dumpStatistics): * dom/NodeRareData.cpp: * dom/NodeRareData.h: (WebCore::NodeRareData::useTypes const): 2018-09-19 Ryosuke Niwa <rniwa@webkit.org> REGRESSION(r235917): 2% regression in Dromaeo CSS selector on MacBookPro11,4 https://bugs.webkit.org/show_bug.cgi?id=189738 Reviewed by Yusuke Suzuki. The regression was caused by the regundant walk to the parent element. Removed it to fix the regression. * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate): 2018-09-19 John Wilander <wilander@apple.com> Resource Load Statistics: Add optional cap on partitioned cache max age https://bugs.webkit.org/show_bug.cgi?id=189711 <rdar://problem/39246837> Reviewed by Antti Koivisto and Chris Dumez. Test: http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html * platform/network/NetworkStorageSession.h: * platform/network/cf/NetworkStorageSessionCFNet.cpp: (WebCore::NetworkStorageSession::maxAgeCacheCap): Checks if a max age cap is set and returns it if the request represents a prevalent resource. (WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources): (WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources): New functionality to receive a max age cap setting in the session. 2018-09-19 Youenn Fablet <youenn@apple.com> Layout Test webrtc/video-mute.html is flaky. https://bugs.webkit.org/show_bug.cgi?id=177501 Reviewed by Eric Carlson. Covered by updated test expectation. * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::createBlackPixelBuffer): Make sure the whole buffer is properly initialized. 2018-09-19 David Kilzer <ddkilzer@apple.com> WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc <https://webkit.org/b/189742> <rdar://problem/44589774> Reviewed by Joseph Pecoraro. * platform/network/cocoa/WebCoreNSURLSession.h: (WebCoreNSURLSession._sessionDescription): Change type from NSString * to RetainPtr<NSString>. * platform/network/cocoa/WebCoreNSURLSession.mm: Remove @synthesized statement for sessionDescription so that custom methods can be implemented to handle RetainPtr<NSString>. (-[WebCoreNSURLSession sessionDescription]): Add. (-[WebCoreNSURLSession setSessionDescription:]): Add. 2018-09-19 Youenn Fablet <youenn@apple.com> Implement sender/receiver getStats https://bugs.webkit.org/show_bug.cgi?id=189707 Reviewed by Eric Carlson. Add support for sender and receiver getStats. Also add support for peer connection selector parameter. Add the plumbing of the selector to LibWebRTCMediaEndpoint. Then make use of libwebrtc overloaded methods to retrieve the right stats. Covered by updated/rebased tests. * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCPeerConnection.cpp: (WebCore::RTCPeerConnection::getStats): * Modules/mediastream/RTCPeerConnection.h: * Modules/mediastream/RTCPeerConnection.idl: * Modules/mediastream/RTCRtpReceiver.cpp: (WebCore::RTCRtpReceiver::RTCRtpReceiver): (WebCore::RTCRtpReceiver::getStats): * Modules/mediastream/RTCRtpReceiver.h: (WebCore::RTCRtpReceiver::create): (WebCore::RTCRtpReceiver::backend): * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::create): (WebCore::RTCRtpSender::RTCRtpSender): (WebCore::RTCRtpSender::getStats): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::getStats): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::getStats): (WebCore::backendFromRTPSender): (WebCore::createReceiverForSource): (WebCore::LibWebRTCPeerConnectionBackend::createReceiver): (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver): (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver): (WebCore::LibWebRTCPeerConnectionBackend::addTrack): (WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver): (WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver): * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: 2018-09-19 Jer Noble <jer.noble@apple.com> REGRESSION (r236006): New waitingForKey() requirement breaks Modern EME tests. https://bugs.webkit.org/show_bug.cgi?id=189720 <rdar://problem/44572140> Reviewed by Xabier Rodriguez-Calvar. Always call waitingForKey() after calling initializationDataEncountered(). * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered): 2018-09-19 Philippe Normand <pnormand@igalia.com> [GStreamer] Add support for AV1 decoding https://bugs.webkit.org/show_bug.cgi?id=189647 Tweaked by Xabier Rodriguez Calvar <calvaris@igalia.com>. Reviewed by Žan Doberšek. AV1 can be muxed in MP4 and WebM containers. The test is an adaptation from Chromium's unittest: https://chromium.googlesource.com/chromium/src/+/master/content/browser/media/media_canplaytype_browsertest.cc Test: media/media-can-play-av1.html * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::supportsType): Add AV1 support. The av01 codec has to be explicitely checked, along with the presence of a compatible AV1 decoder. 2018-09-18 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Limit capturing extra metrics for Web Inspector when not required. https://bugs.webkit.org/show_bug.cgi?id=189520 Reviewed by Alex Christensen. Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process time when they are not needed. No new tests because there's no behavior change. * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::getNetworkLoadMetrics): (WebCore::CurlHandle::addExtraNetworkLoadMetrics): * platform/network/curl/CurlContext.h: * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::CurlRequest): (WebCore::CurlRequest::updateNetworkLoadMetrics): * platform/network/curl/CurlRequest.h: (WebCore::CurlRequest::create): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::createCurlRequest): 2018-09-18 Megan Gardner <megan_gardner@apple.com> Support Images Module Level 4's double-position gradient color stop syntax https://bugs.webkit.org/show_bug.cgi?id=186154 <rdar://problem/44158152> Reviewed by Simon Fraser. The CSS spec for all gradients allows for each color stop to have two angles to be used for hints. This makes pie chart and checkerboard conic gradients much simpler to write. Any time you want to have a hard line in a gradient, this syntax simplifies the gradient specification. Test: fast/gradients/conic-two-hints.html Test: fast/gradients/linear-two-hints-angle.html Test: fast/gradients/linear-two-hints.html Test: fast/gradients/radial-two-hints.html * css/parser/CSSPropertyParserHelpers.cpp: (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops): Removed. (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops): 2018-09-18 Simon Fraser <simon.fraser@apple.com> Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers() https://bugs.webkit.org/show_bug.cgi?id=189689 Reviewed by Alex Christensen. enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use a SetForScope<>. * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::flushPendingLayerChanges): (WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted. * rendering/RenderLayerCompositor.h: 2018-09-18 Joseph Pecoraro <pecoraro@apple.com> [macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask https://bugs.webkit.org/show_bug.cgi?id=189685 <rdar://problem/44541974> Reviewed by Per Arne Vollan. * platform/mac/PlatformScreenMac.mm: (WebCore::gpuIDForDisplayMask): 2018-09-18 Youenn Fablet <youenn@apple.com> Implement RTCRtpReceiver getContributingSources/getSynchronizationSources https://bugs.webkit.org/show_bug.cgi?id=189671 Reviewed by Eric Carlson. Introduce implementation of these two methods by calling the libwebrtc corresponding method. Add corresponding IDL as per spec. Covered by rebased WPT tests. * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/RTCRtpContributingSource.h: Added. * Modules/mediastream/RTCRtpContributingSource.idl: Added. * Modules/mediastream/RTCRtpReceiver.h: (WebCore::RTCRtpReceiver::getContributingSources const): (WebCore::RTCRtpReceiver::getSynchronizationSources const): * Modules/mediastream/RTCRtpReceiver.idl: * Modules/mediastream/RTCRtpReceiverBackend.h: (WebCore::RTCRtpReceiverBackend::getContributingSources const): (WebCore::RTCRtpReceiverBackend::getSynchronizationSources const): * Modules/mediastream/RTCRtpSynchronizationSource.h: Added. * Modules/mediastream/RTCRtpSynchronizationSource.idl: Added. * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: (WebCore::fillRTCRtpContributingSource): (WebCore::toRTCRtpContributingSource): (WebCore::toRTCRtpSynchronizationSource): (WebCore::LibWebRTCRtpReceiverBackend::getContributingSources const): (WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const): * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-09-18 Youenn Fablet <youenn@apple.com> Enable Unified Plan by default https://bugs.webkit.org/show_bug.cgi?id=189675 Reviewed by Eric Carlson. RTCRtpTransceiver.currentDirection is now gated by the unified plan runtime flag. This will allow easy feature detection of unified plan support. Covered by updated test. * Modules/mediastream/RTCRtpTransceiver.idl: 2018-09-18 Per Arne Vollan <pvollan@apple.com> [WebVTT] change "middle" to "center" for consistency with CSS https://bugs.webkit.org/show_bug.cgi?id=158478 Reviewed by Eric Carlson. No new tests, covered by existing tests. * html/track/TextTrackCueGeneric.cpp: (WebCore::TextTrackCueGenericBoxElement::applyCSSProperties): * html/track/VTTCue.cpp: (WebCore::centerKeyword): (WebCore::VTTCue::initialize): (WebCore::VTTCue::align const): (WebCore::VTTCue::setAlign): (WebCore::VTTCue::calculateDisplayParameters): (WebCore::VTTCue::setCueSettings): (WebCore::middleKeyword): Deleted. * html/track/VTTCue.h: * html/track/WebVTTParser.cpp: (WebCore::WebVTTTreeBuilder::buildFromString): 2018-09-18 Chris Dumez <cdumez@apple.com> "DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page from PageCache https://bugs.webkit.org/show_bug.cgi?id=189681 <rdar://problem/44526171> Reviewed by Alex Christensen and Zalan Bujtas. The "DidFirstVisuallyNonEmptyLayout" callback was not getting called when restoring a page from PageCache because the FrameView is restored from PageCache and we would fail to restore its flags (such as m_firstVisuallyNonEmptyLayoutCallbackPending) when entering Page Cache. We now call reset those flags that are related to layout miletones when entering PageCache so that layout milestone events properly get sent again when restoring from Page Cache. * history/CachedFrame.cpp: (WebCore::CachedFrame::CachedFrame): 2018-09-18 Manuel Rego Casasnovas <rego@igalia.com> [css-grid] Static position should use content-box, not padding-box https://bugs.webkit.org/show_bug.cgi?id=189698 Reviewed by Javier Fernandez. This is a recent change by the CSSWG: https://github.com/w3c/csswg-drafts/issues/3020 The spec text (https://drafts.csswg.org/css-grid/#static-position): "The static position of an absolutely-positioned child of a grid container is determined as if it were the sole grid item in a grid area whose edges coincide with the content edges of the grid container." Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html * rendering/RenderGrid.cpp: (WebCore::RenderGrid::prepareChildForPositionedLayout): Simple change to use border and padding. 2018-09-18 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME][GStreamer] The current EME implementation doesn't support the waitingforkey event https://bugs.webkit.org/show_bug.cgi?id=185590 Reviewed by Philippe Normand. When decryptors are blocked waiting for the key, instruct the player to run the Wait for key algorithm. As per spec, if we run out of blocks pending to decrypt because we don't have the key, we request running the algorithm again. Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp: (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered): (WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey): * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h: * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): (webkitMediaCommonEncryptionDecryptSinkEventHandler): 2018-09-12 Ryosuke Niwa <rniwa@webkit.org> Update composedPath to match the latest spec https://bugs.webkit.org/show_bug.cgi?id=180378 <rdar://problem/42843004> Reviewed by Darin Adler. This patch makes the check for whether a given node in the event path be included in composedPath pre-determined at the time of the event dispatching per https://github.com/whatwg/dom/issues/525. This was a fix for the issue that if an event listener in a closed shadow tree removes a node in the same tree in the event path, then composedPath called on its shadow host, for example, will include the removed node since it's no longer in the closed shadow tree. Naively, implementing this behavior would require remembering the original document or shadow root of each node in the event path as well as its parent shadow root, or worse which node is disclosed to every other node at the time of computing the event path. This patch takes a more novel and efficient approach to implement the new behavior by adding a single integer indicating the number of closed-mode shadow root ancestors of each node in the event path. In computePathUnclosedToTarget, any node whose *depth* is greater than the context object is excluded. Consider the following example: div ------- ShadowRoot (closed) +- span +- slot If an event is dispatched on span, then the event path would be [span, slot, ShadowRoot, div]. Then the values of integers assigned to each node would be: [0, 1, 1, 0] respectively. When composedPath is called on span or div, slot and ShadowRoot are excluded because they have a greater *depth* value. Unfortunately, this simplistic solution doesn't work when there are multiple shadow roots of the same depth through which an event is dispatched as in: section -- ShadowRoot (closed, SR2) | +- slot (s2) +div ------ ShadowRoot (closed, SR1) +- span +- slot (s1) If an event is dispatched on span, the event path would be [span, s1, SR1, div, s2, SR2, section]. The values of integers assigned are: [0, 1, 1, 0, 1, 1, 0] respectively. When composedPath is called on SR1, the simplistic approach would include s2 and SR2, which would be wrong. To account for this case, in computePathUnclosedToTarget, we traverse the event path upwards (i.e. ancestors) and downwards (i.e. descendants) from the context object and decrease the *allowed depth* of shadow trees when we traverse out of a shadow tree in either direction. When traversing upwards, therefore, moving out of a shadow root to its host would would decrease the allowed depth. When traversing dowards, moving from a slot element to its assigned node would decrease the allowed depth. Note that the depths can be negative when a composed event is dispatched inside a closed shadow tree, and it gets out of its shadow host. Unfortunately, the latest DOM specification has a bug and doesn't match the behavior of Chrome. This patch proposes a new algorithm which can be adopted in https://github.com/whatwg/dom/issues/684. Test: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html * dom/EventContext.cpp: (WebCore::EventContext::EventContext): (WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext): (WebCore::TouchEventContext::TouchEventContext): * dom/EventContext.h: (WebCore::EventContext::closedShadowDepth const): Added. * dom/EventPath.cpp: (WebCore::WindowEventContext::WindowEventContext): (WebCore::EventPath::buildPath): Compute the closed shadow tree's depths for each node in the path. (WebCore::computePathUnclosedToTarget const): Implemented the aforementioned algorithm. (WebCore::EventPath::EventPath): 2018-09-17 Yusuke Suzuki <utatane.tea@gmail.com> [WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t https://bugs.webkit.org/show_bug.cgi?id=185339 Reviewed by Mark Lam. * fileapi/ThreadableBlobRegistry.cpp: (WebCore::ThreadableBlobRegistry::blobSize): * platform/cocoa/NetworkExtensionContentFilter.h: * platform/cocoa/NetworkExtensionContentFilter.mm: (WebCore::NetworkExtensionContentFilter::initialize): (WebCore::NetworkExtensionContentFilter::willSendRequest): (WebCore::NetworkExtensionContentFilter::responseReceived): (WebCore::NetworkExtensionContentFilter::addData): (WebCore::NetworkExtensionContentFilter::finishedAddingData): (WebCore::NetworkExtensionContentFilter::handleDecision): Use per-function BinarySemaphore instead of holding it in NetworkExtensionContentFilter's field. * platform/glib/FileMonitorGLib.cpp: (WebCore::FileMonitor::FileMonitor): (WebCore::FileMonitor::~FileMonitor): * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC): (WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange): (WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange): Use BinarySemaphore. And remove unused dispatch_semaphore_t. * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]): (-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]): (WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC): (WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID): (WebCore::SourceBufferPrivateAVFObjC::abort): (WebCore::SourceBufferPrivateAVFObjC::setCDMSession): (WebCore::SourceBufferPrivateAVFObjC::setCDMInstance): Use Box<Semaphore> and Box<BinarySemaphore>. * platform/graphics/cocoa/WebCoreDecompressionSession.h: * platform/graphics/cocoa/WebCoreDecompressionSession.mm: (WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession): Remove unused dispatch_semaphore_t. * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::platformLoadResourceSynchronously): * platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp: (WebCore::getRunLoop): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse): (WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace): * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h: * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm: (-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]): (-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]): (-[WebCoreResourceHandleAsOperationQueueDelegate dealloc]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]): (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]): Use BinarySemaphore instead. 2018-09-17 Simon Fraser <simon.fraser@apple.com> Many modern media control tests leak documents in testing https://bugs.webkit.org/show_bug.cgi?id=189437 Reviewed by Darin Adler. In order to accurately detect leaks in media controls tests which use lots of SVGImages, we have to: - Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer to clear references to elements. - Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources() to drop the last handle to the CachedResource for an SVGImage. - Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources() to run again after that timer has fired. This should fix most of the spurious leak reports involving SVGImage documents. * page/MemoryRelease.cpp: (WebCore::releaseCriticalMemory): 2018-09-17 Jer Noble <jer.noble@apple.com> Add support for HEVC codec types in Media Capabilities https://bugs.webkit.org/show_bug.cgi?id=189565 Reviewed by Eric Carlson. Test: media/hevc-codec-parameters.html Add some utility methods for parsing HEVC codec strings, and using those parsed values to query the platform for detailed support for HEVC decoding. Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function pointers in the encode/decode factory pair. * Sources.txt: * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/HEVCUtilities.cpp: Added. (WebCore::parseHEVCCodecParameters): * platform/graphics/HEVCUtilities.h: Added. * platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added. (WebCore::validateHEVCParameters): * platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added. * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added. (WebCore::videoCodecTypeFromRFC4281Type): (WebCore::createMediaPlayerDecodingConfigurationCocoa): * platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added. * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: (WebCore::factories): (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration): (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration): * testing/Internals.cpp: (WebCore::Internals::parseHEVCCodecParameters): * testing/Internals.h: * testing/Internals.idl: 2018-09-17 Devin Rousso <drousso@apple.com> Web Inspector: generate CSSKeywordCompletions from backend values https://bugs.webkit.org/show_bug.cgi?id=189041 Reviewed by Joseph Pecoraro. Modified existing test inspector/css/getSupportedCSSProperties.html. * inspector/agents/InspectorCSSAgent.cpp: (WebCore::InspectorCSSAgent::getSupportedCSSProperties): Send alias and longhand information for all properties, and any known keyword values for those applicable. This makes use of `CSSParserFastPaths::isValidKeywordPropertyAndValue` to determine if a given keyword is a valid value for each property. This only generates a list for properties who have no non-keyword values. * css/makeprop.pl: * css/makevalues.pl: Create additional helper functions/constants for retrieving strings of each CSS keyword. * css/CSSProperty.h: (WebCore::CSSProperty::aliasesForProperty): * css/CSSPrimitiveValue.cpp: (WebCore::valueName): * css/CSSValuePool.cpp: (WebCore::CSSValuePool::CSSValuePool): (WebCore::CSSValuePool::createIdentifierValue): 2018-09-17 Youenn Fablet <youenn@apple.com> track.onmute isn't called for a remote MediaStreamTrack when its counter part track is removed from the peer connection https://bugs.webkit.org/show_bug.cgi?id=176281 <rdar://problem/44525674> Reviewed by Eric Carlson. Listen to libwebrtc remove track callbacks. Implement handling as per https://w3c.github.io/webrtc-pc/#process-remote-track-removal. This triggers a mute event on the track. Test: webrtc/remove-track.html * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack): (WebCore::LibWebRTCMediaEndpoint::OnRemoveTrack): * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp: (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const): Drive by fix: Plan B code path does not mandate having an rtc backend for each sender. 2018-09-17 Simon Fraser <simon.fraser@apple.com> Add more Fullscreen logging https://bugs.webkit.org/show_bug.cgi?id=189656 Reviewed by Jer Noble. Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases the fullscreen element. * platform/cocoa/VideoFullscreenModelVideoElement.mm: (VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement): (VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement): (VideoFullscreenModelVideoElement::setVideoElement): 2018-09-14 Simon Fraser <simon.fraser@apple.com> Add support for dumping the GraphicsLayer tree via notifyutil https://bugs.webkit.org/show_bug.cgi?id=189639 Reviewed by Zalan Bujtas. Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints the entire tree for each main frame). It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should be converted in the same way). * page/mac/PageMac.mm: (WebCore::Page::platformInitialize): * platform/graphics/GraphicsLayer.cpp: (showGraphicsLayerTree): * rendering/RenderLayerCompositor.cpp: (showGraphicsLayerTreeForCompositor): * rendering/RenderLayerCompositor.h: * rendering/RenderObject.cpp: (WebCore::printGraphicsLayerTreeForLiveDocuments): * rendering/RenderObject.h: 2018-09-17 Christopher Reid <chris.reid@sony.com> [Curl] Add schema version and enable auto vacuum for cookie database. https://bugs.webkit.org/show_bug.cgi?id=189669 Reviewed by Alex Christensen. Turning on auto incremental vacuuming and adding versioning to the database. Right now we reset tables if there's an unknown schema or if the none is set. There is placeholder logic in place to upgrade databases as the schema changes in the future. Tested by checking the database manually after launching MiniBrowser. * platform/network/curl/CookieJarDB.cpp: (WebCore::CookieJarDB::openDatabase): (WebCore::CookieJarDB::verifySchemaVersion): (WebCore::CookieJarDB::deleteAllTables): (WebCore::CookieJarDB::createPrepareStatement): (WebCore::CookieJarDB::getPrepareStatement): (WebCore::CookieJarDB::executeSimpleSql): * platform/network/curl/CookieJarDB.h: * platform/network/curl/NetworkStorageSessionCurl.cpp: (WebCore::defaultSession): * platform/sql/SQLiteDatabase.cpp: (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): fixed a bug. 2018-09-14 Ryosuke Niwa <rniwa@webkit.org> Re-order Node flags based on semantics https://bugs.webkit.org/show_bug.cgi?id=189643 Reviewed by Simon Fraser. Re-ordered Node flags based on their category and subclasses of Node which use them. * dom/Node.h: 2018-09-17 Simon Fraser <simon.fraser@apple.com> Add more ResourceLoading logging, particularly in MemoryCache code https://bugs.webkit.org/show_bug.cgi?id=189651 Reviewed by Tim Horton. Adding more logging to the ResourceLoading log channel, which I found useful when trying to understand cached SVGImage lifetimes (bug 189437). * loader/cache/CachedResource.cpp: (WebCore::CachedResource::deleteIfPossible): * loader/cache/CachedResourceLoader.cpp: (WebCore::CachedResourceLoader::requestResource): (WebCore::CachedResourceLoader::garbageCollectDocumentResources): * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::add): (WebCore::MemoryCache::pruneLiveResourcesToSize): (WebCore::MemoryCache::pruneDeadResources): (WebCore::MemoryCache::pruneDeadResourcesToSize): (WebCore::MemoryCache::remove): (WebCore::MemoryCache::dumpLRULists const): 2018-09-17 Jer Noble <jer.noble@apple.com> Enable USE_MEDIAREMOTE on iOS https://bugs.webkit.org/show_bug.cgi?id=189096 Reviewed by Eric Carlson. Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the Now Playing implementation on iOS and Mac. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm. (PlatformMediaSessionManager::sharedManager): (PlatformMediaSessionManager::sharedManagerIfExists): (MediaSessionManagerCocoa::updateSessionState): (MediaSessionManagerCocoa::beginInterruption): (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): (MediaSessionManagerCocoa::sessionWillBeginPlayback): (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing): (MediaSessionManagerCocoa::removeSession): (MediaSessionManagerCocoa::sessionWillEndPlayback): (MediaSessionManagerCocoa::clientCharacteristicsChanged): (MediaSessionManagerCocoa::sessionCanProduceAudioChanged): (MediaSessionManagerCocoa::nowPlayingEligibleSession): (MediaSessionManagerCocoa::updateNowPlayingInfo): * platform/audio/ios/MediaSessionManagerIOS.h: (): Deleted. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted. (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted. (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted. (WebCore::MediaSessionManageriOS::removeSession): Deleted. (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted. (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted. * platform/audio/mac/MediaSessionManagerMac.h: Removed. 2018-09-17 Frederic Wang <fwang@igalia.com> Build error in ImageBufferCG when compiled with IOSurfacePool https://bugs.webkit.org/show_bug.cgi?id=189579 Reviewed by Tim Horton. IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing compilation errors when files in the same unified source do not agree on the definition. This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files. Finally some minors changes to explicitly declare/define ImageBuffer are performed in order to prevent future issues with Unified build rotating. No new tests, behavior unchanged. * html/HTMLCanvasElement.cpp: Explicitly include ImageBuffer.h since it's used in this file. * platform/graphics/cg/ImageBufferDataCG.h: Move definition into Platform.h. * platform/graphics/cocoa/IOSurface.h: Forward-declare ImageBuffer since it's used in this header. 2018-09-17 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Respond with requested authentication scheme for authentication challenge. https://bugs.webkit.org/show_bug.cgi?id=189318 Reviewed by Alex Christensen. Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this mode, the round-trip communication between the client and the server is handled by libcurl internally. That's okay for many cases. But when initial request has a credentials (i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because the returned response is not 401. Passes following tests: - http/tests/websocket/tests/hybi/httponly-cookie.pl - http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl - http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl - http/tests/xmlhttprequest/basic-auth-default.html - http/tests/xmlhttprequest/cross-origin-authorization.html - http/tests/xmlhttprequest/logout.html - http/tests/xmlhttprequest/null-auth.php - http/tests/xmlhttprequest/re-login-async.html - http/tests/xmlhttprequest/re-login.html - http/tests/xmlhttprequest/redirect-credentials-responseURL.html - http/tests/xmlhttprequest/remember-bad-password.html * platform/network/ResourceHandle.h: * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::setHttpAuthUserPass): (WebCore::CurlHandle::enableHttpAuthentication): Deleted. * platform/network/curl/CurlContext.h: * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::setAuthenticationScheme): (WebCore::CurlRequest::setupTransfer): * platform/network/curl/CurlRequest.h: * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::didReceiveAuthenticationChallenge): (WebCore::ResourceHandle::receivedCredential): (WebCore::ResourceHandle::getCredential): (WebCore::ResourceHandle::restartRequestWithCredential): (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandle::continueAfterWillSendRequest): 2018-09-17 Youenn Fablet <youenn@apple.com> Enable VCP for iOS and reenable it for MacOS https://bugs.webkit.org/show_bug.cgi?id=189635 <rdar://problem/43621029> Reviewed by Eric Carlson. Covered by exsiting and modified tests. Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient. Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms. * platform/mediastream/RealtimeOutgoingVideoSource.cpp: (WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded): * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: (WebCore::createBlackPixelBuffer): (WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame): * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: (WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame): * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h: * testing/Internals.cpp: (WebCore::Internals::supportsVCPEncoder): * testing/Internals.h: * testing/Internals.idl: 2018-09-17 Chris Dumez <cdumez@apple.com> PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin https://bugs.webkit.org/show_bug.cgi?id=189602 <rdar://problem/44430549> Reviewed by Geoff Garen. * loader/DocumentLoader.cpp: (WebCore::DocumentLoader::setTriggeringAction): * loader/DocumentLoader.h: * loader/FrameLoadRequest.h: * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): (WebCore::FrameLoader::loadWithNavigationAction): (WebCore::FrameLoader::loadWithDocumentLoader): (WebCore::FrameLoader::loadPostRequest): (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy): (WebCore::FrameLoader::loadDifferentDocumentItem): Move NavigationAction's opener setting to loadWithNavigationAction() as this is a better bottleneck. Otherwise, we'd have to set it at several call sites. Also move the NavigationAction around instead of copying it. * loader/FrameLoader.h: (WebCore::FrameLoader::loadWithNavigationAction): * loader/NavigationAction.h: (WebCore::NavigationAction::setShouldOpenExternalURLsPolicy): * loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNavigationPolicy): * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): 2018-09-17 Darin Adler <darin@apple.com> Use OpaqueJSString rather than JSRetainPtr inside WebKit https://bugs.webkit.org/show_bug.cgi?id=189652 Reviewed by Saam Barati. * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create. (WebCore::jsValueWithAVMetadataItemInContext): Use adoptCF. * platform/mac/SerializedPlatformRepresentationMac.mm: (WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create. 2018-09-08 Darin Adler <darin@apple.com> Streamline JSRetainPtr, fix leaks of JSString and JSGlobalContext https://bugs.webkit.org/show_bug.cgi?id=189455 Reviewed by Keith Miller. * Modules/plugins/QuickTimePluginReplacement.mm: (WebCore::jsValueWithDictionaryInContext): Adding a missing JSStringRelease to fix a leak. 2018-09-15 Rob Buis <rbuis@igalia.com> XMLHttpRequest::createResponseBlob() should create a Blob with type for empty response https://bugs.webkit.org/show_bug.cgi?id=189627 Reviewed by Alexey Proskuryakov. Right now we return an empty Blob without type when the response is empty, but it should always include the type [1]. Test: web-platform-tests/xhr/overridemimetype-blob.html [1] https://xhr.spec.whatwg.org/#blob-response * xml/XMLHttpRequest.cpp: (WebCore::XMLHttpRequest::createResponseBlob): 2018-09-14 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Bug fix on some inaccurate values in NetworkLoadMetrics. https://bugs.webkit.org/show_bug.cgi?id=189530 Reviewed by Alex Christensen. Curl port uses the start time libcurl provided. But there's a lug between main thread and Curl thread. Record the start time of request instead of libcurl's start timing and use it to measure the metrics. Also respondEnd was not correctly recorded and fixed. No new tests because it cannot be measured from DRT. * platform/network/ResourceHandleInternal.h: * platform/network/curl/CurlContext.cpp: (WebCore::CurlHandle::getNetworkLoadMetrics): * platform/network/curl/CurlContext.h: * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::start): (WebCore::CurlRequest::setupTransfer): (WebCore::CurlRequest::didCompleteTransfer): (WebCore::CurlRequest::updateNetworkLoadMetrics): * platform/network/curl/CurlRequest.h: (WebCore::CurlRequest::setStartTime): * platform/network/curl/ResourceHandleCurl.cpp: (WebCore::ResourceHandle::start): (WebCore::ResourceHandle::restartRequestWithCredential): (WebCore::ResourceHandle::platformLoadResourceSynchronously): (WebCore::ResourceHandle::willSendRequest): (WebCore::ResourceHandle::continueAfterWillSendRequest): 2018-09-14 Justin Fan <justin_fan@apple.com> WebGL 2 conformance: rgb-format-support.html https://bugs.webkit.org/show_bug.cgi?id=189610 <rdar://problem/44403343> Reviewed by Dean Jackson. Implementing getInternalformatParameter (emulating on macOS) and updating renderbufferStorage{Multisample} for WebGL 2 conformance. Test: webgl/2.0.0/conformance2/rendering/rgb-format-support.html enabled. * html/canvas/WebGL2RenderingContext.cpp: (WebCore::isRenderableInternalformat): (WebCore::WebGL2RenderingContext::getInternalformatParameter): (WebCore::WebGL2RenderingContext::renderbufferStorageMultisample): (WebCore::WebGL2RenderingContext::renderbufferStorage): (WebCore::WebGL2RenderingContext::baseInternalFormatFromInternalFormat): (WebCore::WebGL2RenderingContext::isIntegerFormat): * platform/graphics/GraphicsContext3D.h: * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp: (WebCore::GraphicsContext3D::getInternalformativ): (WebCore::GraphicsContext3D::renderbufferStorageMultisample): 2018-09-14 Justin Michaud <justin_michaud@apple.com> Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms) https://bugs.webkit.org/show_bug.cgi?id=5968 Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now the result of multiplying stop-opacity with the opacity of the color. Reviewed by Simon Fraser. Tests: svg/gradients/spreadMethod-expected.svg svg/gradients/spreadMethod.svg svg/gradients/spreadMethodAlpha-expected.svg svg/gradients/spreadMethodAlpha.svg svg/gradients/spreadMethodClose0-expected-mismatch.svg svg/gradients/spreadMethodClose0.svg svg/gradients/spreadMethodClose1-expected-mismatch.svg svg/gradients/spreadMethodClose1.svg svg/gradients/spreadMethodClose2-expected.svg svg/gradients/spreadMethodClose2.svg svg/gradients/spreadMethodDiagonal-expected.svg svg/gradients/spreadMethodDiagonal.svg svg/gradients/spreadMethodDiagonal2-expected.svg svg/gradients/spreadMethodDiagonal2.svg svg/gradients/spreadMethodDuplicateStop-expected.svg svg/gradients/spreadMethodDuplicateStop.svg svg/gradients/spreadMethodReversed-expected.svg svg/gradients/spreadMethodReversed.svg svg/gradients/stopAlpha-expected.svg svg/gradients/stopAlpha.svg * platform/graphics/cg/GradientCG.cpp: (WebCore::Gradient::paint): * svg/SVGStopElement.cpp: (WebCore::SVGStopElement::stopColorIncludingOpacity const): 2018-09-14 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, attempt to fix the iOSMac build after r236015. * platform/graphics/cv/PixelBufferResizer.mm: (WebCore::PixelBufferResizer::PixelBufferResizer): 2018-09-11 Simon Fraser <simon.fraser@apple.com> Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings https://bugs.webkit.org/show_bug.cgi?id=189521 Reviewed by Tim Horton. Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>. RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>. All the other changes are just to adapt to the new ownership patterns. I verified that no GraphicsLayers were leaked or abandoned after this change. No behavior change. * page/PageOverlayController.cpp: (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::installPageOverlay): (WebCore::PageOverlayController::uninstallPageOverlay): (WebCore::PageOverlayController::setPageOverlayNeedsDisplay): (WebCore::PageOverlayController::didChangeViewSize): (WebCore::PageOverlayController::didChangeDocumentSize): (WebCore::PageOverlayController::didChangeSettings): (WebCore::PageOverlayController::paintContents): (WebCore::PageOverlayController::didChangeOverlayFrame): (WebCore::PageOverlayController::didChangeOverlayBackgroundColor): * page/PageOverlayController.h: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::Highlight::layer const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::Highlight): (WebCore::ServicesOverlayController::Highlight::invalidate): (WebCore::ServicesOverlayController::Highlight::fadeIn): (WebCore::ServicesOverlayController::Highlight::fadeOut): (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation): (WebCore::ServicesOverlayController::determineActiveHighlight): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): (WebCore::GraphicsLayer::willBeDestroyed): (WebCore::GraphicsLayer::setChildren): (WebCore::GraphicsLayer::addChild): (WebCore::GraphicsLayer::addChildAtIndex): (WebCore::GraphicsLayer::addChildBelow): (WebCore::GraphicsLayer::addChildAbove): (WebCore::GraphicsLayer::replaceChild): (WebCore::GraphicsLayer::removeAllChildren): (WebCore::GraphicsLayer::removeFromParent): (WebCore::GraphicsLayer::setMaskLayer): (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants): (WebCore::GraphicsLayer::distributeOpacity): (WebCore::GraphicsLayer::traverse): (WebCore::dumpChildren): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::children const): (WebCore::GraphicsLayer::children): (WebCore::GraphicsLayer::maskLayer const): (WebCore::GraphicsLayer::replicaLayer const): (WebCore::GraphicsLayer::beingDestroyed const): (WebCore::GraphicsLayer:: const): Deleted. * platform/graphics/GraphicsLayerFactory.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayer::create): (WebCore::GraphicsLayerCA::setChildren): (WebCore::GraphicsLayerCA::addChild): (WebCore::GraphicsLayerCA::addChildAtIndex): (WebCore::GraphicsLayerCA::addChildBelow): (WebCore::GraphicsLayerCA::addChildAbove): (WebCore::GraphicsLayerCA::replaceChild): (WebCore::GraphicsLayerCA::setMaskLayer): (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const): (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::GraphicsLayerCA::updateSublayerList): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayer::create): (WebCore::GraphicsLayerTextureMapper::setChildren): (WebCore::GraphicsLayerTextureMapper::addChild): (WebCore::GraphicsLayerTextureMapper::addChildAtIndex): (WebCore::GraphicsLayerTextureMapper::addChildAbove): (WebCore::GraphicsLayerTextureMapper::addChildBelow): (WebCore::GraphicsLayerTextureMapper::replaceChild): (WebCore::GraphicsLayerTextureMapper::setMaskLayer): (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::GraphicsLayer::create): (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect): (WebCore::CoordinatedGraphicsLayer::addChild): (WebCore::CoordinatedGraphicsLayer::addChildAtIndex): (WebCore::CoordinatedGraphicsLayer::addChildAbove): (WebCore::CoordinatedGraphicsLayer::addChildBelow): (WebCore::CoordinatedGraphicsLayer::replaceChild): (WebCore::CoordinatedGraphicsLayer::setMaskLayer): (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers): (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/win/GraphicsLayerDirect2D.cpp: (WebCore::GraphicsLayer::create): (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted. (WebCore::GraphicsLayerDirect2D::initialize): Deleted. (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted. (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted. (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::createGraphicsLayer): (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateInternalHierarchy): (WebCore::RenderLayerBacking::updateMaskingLayer): (WebCore::RenderLayerBacking::updateChildClippingStrategy): (WebCore::RenderLayerBacking::updateScrollingLayers): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::setCompositingParent): (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::parentFrameContentLayers): (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea): (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea): (WebCore::RenderLayerCompositor::updateLayerForHeader): (WebCore::RenderLayerCompositor::updateLayerForFooter): (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): (WebCore::RenderLayerCompositor::ensureRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): * rendering/RenderLayerCompositor.h: 2018-09-14 Eric Carlson <eric.carlson@apple.com> Support arbitrary video resolution in getUserMedia API https://bugs.webkit.org/show_bug.cgi?id=178109 <rdar://problem/35083128> Reviewed by Youenn Fablet. Support arbitrary video resolutions by configuring the camera to capture at the closest larger size it supports and scaling/cropping frames as necessary. No new tests, existing tests updated. * Modules/mediastream/CanvasCaptureMediaStreamTrack.h: * Modules/webaudio/MediaStreamAudioSource.cpp: (WebCore::MediaStreamAudioSource::capabilities): Make non-const, it wasn't helpful. (WebCore::MediaStreamAudioSource::settings): Ditto. (WebCore::MediaStreamAudioSource::capabilities const): Deleted. (WebCore::MediaStreamAudioSource::settings const): Deleted. * Modules/webaudio/MediaStreamAudioSource.h: * SourcesCocoa.txt: Add PixelBufferResizer. * WebCore.xcodeproj/project.pbxproj: Ditto. * platform/cocoa/CoreVideoSoftLink.h: * platform/cocoa/VideoToolboxSoftLink.cpp: * platform/cocoa/VideoToolboxSoftLink.h: * platform/graphics/cv/PixelBufferResizer.h: Added. (WebCore::PixelBufferResizer::canResizeTo): * platform/graphics/cv/PixelBufferResizer.mm: Added. (WebCore::PixelBufferResizer::PixelBufferResizer): (WebCore::PixelBufferResizer::resize): * platform/mediastream/RealtimeIncomingAudioSource.cpp: (WebCore::RealtimeIncomingAudioSource::capabilities): Make non-const, it wasn't helpful. (WebCore::RealtimeIncomingAudioSource::settings): Ditto. (WebCore::RealtimeIncomingAudioSource::capabilities const): Deleted. (WebCore::RealtimeIncomingAudioSource::settings const): Deleted. * platform/mediastream/RealtimeIncomingAudioSource.h: * platform/mediastream/RealtimeIncomingVideoSource.cpp: (WebCore::RealtimeIncomingVideoSource::capabilities): Make non-const, it wasn't helpful. (WebCore::RealtimeIncomingVideoSource::settings): Ditto. (WebCore::RealtimeIncomingVideoSource::capabilities const): Deleted. (WebCore::RealtimeIncomingVideoSource::settings const): Deleted. * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeMediaSource.cpp: (WebCore::RealtimeMediaSource::supportsConstraint): (WebCore::RealtimeMediaSource::supportsConstraint const): Deleted. * platform/mediastream/RealtimeMediaSource.h: * platform/mediastream/RealtimeVideoSource.cpp: (WebCore::RealtimeVideoSource::presets): (WebCore::RealtimeVideoSource::setSupportedPresets): (WebCore::standardVideoSizes): (WebCore::RealtimeVideoSource::updateCapabilities): Make non-const, it wasn't helpful. (WebCore::presetSupportsFrameRate): (WebCore::RealtimeVideoSource::supportsCaptureSize): (WebCore::RealtimeVideoSource::shouldUsePreset): (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): (WebCore::RealtimeVideoSource::setSizeAndFrameRate): (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Deleted. * platform/mediastream/RealtimeVideoSource.h: (WebCore::VideoPresetData::encode const): (WebCore::VideoPresetData::decode): (WebCore::VideoPreset::create): (WebCore::VideoPreset::VideoPreset): (WebCore::RealtimeVideoSource::prefersPreset): (WebCore::RealtimeVideoSource::canResizeVideoFrames const): (WebCore::RealtimeVideoSource::setDefaultSize): (WebCore::RealtimeVideoSource::observedFrameRate const): (WebCore::VideoPreset::encode const): Deleted. (WebCore::VideoPreset::decode): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.h: (WebCore::AVVideoCaptureSource::videoPresets): Deleted. * platform/mediastream/mac/AVVideoCaptureSource.mm: (WebCore::AVVideoPreset::create): (WebCore::AVVideoPreset::AVVideoPreset): (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): (WebCore::AVVideoCaptureSource::settings): (WebCore::AVVideoCaptureSource::capabilities): Make non-const, it wasn't helpful. (WebCore::AVVideoCaptureSource::setFrameRate): (WebCore::AVVideoCaptureSource::prefersPreset): (WebCore::AVVideoCaptureSource::setSizeAndFrameRateWithPreset): (WebCore::AVVideoCaptureSource::frameDurationForFrameRate): (WebCore::AVVideoCaptureSource::setupCaptureSession): (WebCore::AVVideoCaptureSource::processNewFrame): (WebCore::AVVideoCaptureSource::captureOutputDidOutputSampleBufferFromConnection): (WebCore::AVVideoCaptureSource::isFrameRateSupported): (WebCore::AVVideoCaptureSource::generatePresets): (WebCore::updateSizeMinMax): Deleted. (WebCore::updateAspectRatioMinMax): Deleted. (WebCore::AVVideoCaptureSource::settings const): Deleted. (WebCore::AVVideoCaptureSource::capabilities const): Deleted. (WebCore::AVVideoCaptureSource::sizeForPreset): Deleted. (WebCore::AVVideoCaptureSource::setPreset): Deleted. (WebCore::AVVideoCaptureSource::setSizeAndFrameRate): Deleted. (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions): Deleted. (WebCore::AVVideoCaptureSource::supportsSizeAndFrameRate): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.cpp: (WebCore::CoreAudioCaptureSource::capabilities): Make non-const, it wasn't helpful. (WebCore::CoreAudioCaptureSource::settings): Ditto. (WebCore::CoreAudioCaptureSource::capabilities const): Deleted. (WebCore::CoreAudioCaptureSource::settings const): Deleted. * platform/mediastream/mac/CoreAudioCaptureSource.h: * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: (WebCore::DisplayCaptureSourceCocoa::capabilities): Make non-const, it wasn't helpful. (WebCore::DisplayCaptureSourceCocoa::settings): Ditto. (WebCore::DisplayCaptureSourceCocoa::capabilities const): Deleted. (WebCore::DisplayCaptureSourceCocoa::settings const): Deleted. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.h: * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm: (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): (WebCore::MockRealtimeVideoSourceMac::updateSampleBuffer): (WebCore::MockRealtimeVideoSourceMac::setSizeAndFrameRateWithPreset): * platform/mock/MockMediaDevice.h: (WebCore::MockCameraProperties::decode): * platform/mock/MockRealtimeAudioSource.cpp: (WebCore::MockRealtimeAudioSource::settings): Make non-const, it wasn't helpful. (WebCore::MockRealtimeAudioSource::capabilities): Ditto. (WebCore::MockRealtimeAudioSource::settings const): Deleted. (WebCore::MockRealtimeAudioSource::capabilities const): Deleted. * platform/mock/MockRealtimeAudioSource.h: * platform/mock/MockRealtimeMediaSourceCenter.cpp: (WebCore::defaultDevices): Change video device presets to trigger resize code more often. * platform/mock/MockRealtimeVideoSource.cpp: (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): (WebCore::MockRealtimeVideoSource::generatePresets): (WebCore::MockRealtimeVideoSource::capabilities): Make non-const, it wasn't helpful. (WebCore::MockRealtimeVideoSource::settings): Ditto. (WebCore::MockRealtimeVideoSource::capabilities const): Deleted. (WebCore::MockRealtimeVideoSource::settings const): Deleted. * platform/mock/MockRealtimeVideoSource.h: 2018-09-14 Frederic Wang <fwang@igalia.com> Bug 189541 - Build error in FontDescriptionKey::computeHash when compiling FontTaggedSettings and FontCascadeFonts together https://bugs.webkit.org/show_bug.cgi?id=189541 Reviewed by Alex Christensen. FontDescriptionKey::computeHash() from In FontCache.h requires implicit instantiation of the FontTaggedSettings::hash() template function. This instantiation may happen before FontTaggedSettings::hash() is actually fully specialized in FontTaggedSettings.cpp. To avoid compiler errors when FontCache.h and FontTaggedSettings.cpp are in the same translation unit, we declare full specialization of the hash() functions in FontTaggedSettings.h. No new tests, behavior unchanged. * platform/graphics/FontCache.h: Explicitly include FontTaggedSettings to avoid possible future breakage. * platform/graphics/FontTaggedSettings.h: Declare full specialization of FontTaggedSettings::hash(). 2018-09-14 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r235990. Introduced TestWebKitAPI.NowPlayingTest timeouts on iOS Reverted changeset: "Enable USE_MEDIAREMOTE on iOS" https://bugs.webkit.org/show_bug.cgi?id=189096 https://trac.webkit.org/changeset/235990 2018-09-14 Jer Noble <jer.noble@apple.com> Turn SourceBufferChangeTypeEnabled on by default https://bugs.webkit.org/show_bug.cgi?id=189527 Reviewed by Eric Carlson. * page/Settings.yaml: 2018-09-14 Devin Rousso <webkit@devinrousso.com> Web Inspector: Record actions performed on ImageBitmapRenderingContext https://bugs.webkit.org/show_bug.cgi?id=181341 Reviewed by Joseph Pecoraro. Test: inspector/canvas/recording-bitmaprenderer.html * html/canvas/ImageBitmapRenderingContext.idl: * inspector/InspectorCanvas.cpp: (WebCore::shouldSnapshotBitmapRendererAction): (WebCore::InspectorCanvas::recordAction): * inspector/agents/InspectorCanvasAgent.cpp: (WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame): * page/PageConsoleClient.cpp: (canvasRenderingContext): 2018-09-14 David Kilzer <ddkilzer@apple.com> REGRESSION (r235954): Fix build failure on watchOS <https://webkit.org/b/189605> Reviewed by Geoffrey Garen. Remove `using WebCore::IndexedDB::KeyType;` from Source/WebCore/Modules/indexeddb/IDBKey.h and fix all the resulting build failures. * Modules/indexeddb/IDBKey.cpp: (WebCore::IDBKey::IDBKey): (WebCore::IDBKey::isValid const): (WebCore::IDBKey::compare const): * Modules/indexeddb/IDBKey.h: (WebCore::IDBKey::createNumber): (WebCore::IDBKey::createDate): (WebCore::IDBKey::type const): (WebCore::IDBKey::array const): (WebCore::IDBKey::string const): (WebCore::IDBKey::date const): (WebCore::IDBKey::number const): (WebCore::IDBKey::binary const): (WebCore::IDBKey::compareTypes): (WebCore::IDBKey::IDBKey): * Modules/indexeddb/IDBKeyData.cpp: (WebCore::IDBKeyData::IDBKeyData): (WebCore::IDBKeyData::maybeCreateIDBKey const): (WebCore::IDBKeyData::isolatedCopy): (WebCore::IDBKeyData::encode const): (WebCore::IDBKeyData::decode): (WebCore::IDBKeyData::compare const): (WebCore::IDBKeyData::loggingString const): (WebCore::IDBKeyData::setArrayValue): (WebCore::IDBKeyData::setBinaryValue): (WebCore::IDBKeyData::setStringValue): (WebCore::IDBKeyData::setDateValue): (WebCore::IDBKeyData::setNumberValue): (WebCore::IDBKeyData::isValid const): (WebCore::IDBKeyData::operator== const): * Modules/indexeddb/IDBKeyData.h: (WebCore::IDBKeyData::IDBKeyData): (WebCore::IDBKeyData::minimum): (WebCore::IDBKeyData::maximum): (WebCore::IDBKeyData::type const): (WebCore::IDBKeyData::hash const): (WebCore::IDBKeyData::string const): (WebCore::IDBKeyData::date const): (WebCore::IDBKeyData::number const): (WebCore::IDBKeyData::binary const): (WebCore::IDBKeyData::array const): (WebCore::IDBKeyData::encode const): (WebCore::IDBKeyData::decode): * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp: (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey): * bindings/js/IDBBindingUtilities.cpp: (WebCore::toJS): 2018-09-14 Xabier Rodriguez Calvar <calvaris@igalia.com> [EME] Add support the waitingforkey event https://bugs.webkit.org/show_bug.cgi?id=189616 Reviewed by Philippe Normand. Crossplatform support to fire the waitingforkey event from the player to the element. The element implements the W3C specified algorithm. * html/HTMLMediaElement.cpp: (WebCore::HTMLMediaElement::mediaPlayerWaitingForKey): (WebCore::HTMLMediaElement::attemptToResumePlaybackIfNecessary): * html/HTMLMediaElement.h: * platform/graphics/MediaPlayer.cpp: (WebCore::MediaPlayer::waitingForKey): * platform/graphics/MediaPlayer.h: (WebCore::MediaPlayerClient::mediaPlayerWaitingForKey): 2018-09-14 Mike Gorse <mgorse@suse.com> builtins directory causes name conflict on Python 3 https://bugs.webkit.org/show_bug.cgi?id=189552 Reviewed by Michael Catanzaro. No new tests (No behavior change). * CMakeLists.txt: builtins -> wkbuiltins. * DerivedSources.make: builtins -> wkbuiltins. 2018-09-13 Ryosuke Niwa <rniwa@webkit.org> Capturing event listeners are called during bubbling phase for shadow hosts https://bugs.webkit.org/show_bug.cgi?id=174288 <rdar://problem/33530455> Reviewed by Darin Adler. Implemented the new behavior proposed in https://github.com/whatwg/dom/pull/686 [1] to fix the problem that capturing event listeners on a shadow host is invoked during bubbling phase when an event is dispatched within its shadow tree. To see why this is a problem, suppose we fire a composed event at span#target in the following DOM tree: section#hostParent + div#host -- ShadowRoot - p#parent - span#target Then capturing and bubbling event listeners on #target, #parent, #host, and #hostParent are invoked in the following order in WebKit & Chrome right now: 1. #hostParent, capturing, eventPhase: CAPTURING_PHASE 2. #parent, capturing, eventPhase: CAPTURING_PHASE 3. #target, capturing, eventPhase: AT_TARGET 4. #target, non-capturing, eventPhase: AT_TARGET 5. #parent, non-capturing, eventPhase: BUBBLING_PHASE 6. #host, capturing, eventPhase: AT_TARGET 7. #host, non-capturing, eventPhase: AT_TARGET 8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE This is counter-intuitive because capturing event listeners on #host isn't invoked until bubblign phase started. A more natural ordering would be: 1. #hostParent, capturing, eventPhase: CAPTURING_PHASE 2. #host, capturing, eventPhase: AT_TARGET 3. #parent, capturing, eventPhase: CAPTURING_PHASE 4. #target, capturing, eventPhase: AT_TARGET 5. #target, non-capturing, eventPhase: AT_TARGET 6. #parent, non-capturing, eventPhase: BUBBLING_PHASE 7. #host, non-capturing, eventPhase: AT_TARGET 8. #hostParent, non-capturing, eventPhase: BUBBLING_PHASE This also happens to be the order by which Gecko's current shadow DOM implementation invoke event listners. This patch implements this new behavior using the spec-change proposed in [1]. Note that this patch also impacts the invocation order of event listeners when there is no shadow tree. Namely, before this patch, event listeners on the event's target is invoked in the registration order. After this patch, all capturing event listeners are invoked before bubbling event listeners are invoked. To implement this behavior, this patch introduces EventTarget::EventInvokePhase indicating whether we're in the capturing phase or bubbling phase to EventTarget::fireEventListeners. We can't use Event's eventPhase enum because that's set to Event::Phase::AT_TARGET when we're at a shadow host. Test: fast/shadow-dom/capturing-and-bubbling-event-listeners-across-shadow-trees.html * Modules/modern-media-controls/media/media-controller-support.js: (MediaControllerSupport.prototype.enable): Use capturing event listeners so that we can update the states of media controls before author scripts recieve the event. (MediaControllerSupport.prototype.disable): Ditto. * dom/EventContext.cpp: (WebCore::EventContext::handleLocalEvents const): (WebCore::MouseOrFocusEventContext::handleLocalEvents const): (WebCore::TouchEventContext::handleLocalEvents const): * dom/EventContext.h: * dom/EventDispatcher.cpp: (WebCore::dispatchEventInDOM): Invoke capturing event listners even when target and current target are same. This happens when the current target is a shadow host and event's target is in its shadow tree. Also merged the special code path for the event's target with the code in the bubbling phase. * dom/EventPath.cpp: (WebCore::WindowEventContext::handleLocalEvents const): * dom/EventTarget.cpp: (WebCore::EventTarget::dispatchEvent): Invoke capturing and bubbling event listeners in the order. (WebCore::EventTarget::fireEventListeners): (WebCore::EventTarget::innerInvokeEventListeners): Renamed from fireEventListeners to match the spec. Use EventInvokePhase to filter out event listeners so that we can invoke capturing event listners before bubbling event listeners even when eventPhase is Event::Phase::AT_TARGET. * dom/EventTarget.h: * dom/Node.cpp: (WebCore::Node::handleLocalEvents): * dom/Node.h: * html/HTMLFormElement.cpp: (WebCore::HTMLFormElement::handleLocalEvents): * html/HTMLFormElement.h: * page/DOMWindow.cpp: (WebCore::DOMWindow::dispatchEvent): 2018-09-13 Megan Gardner <megan_gardner@apple.com> Fix color stop blending in conic gradients for stops past 1 https://bugs.webkit.org/show_bug.cgi?id=189532 <rdar://problem/44158221> Reviewed by Simon Fraser. Calculation was wrong, fixed it, and wrote a test that failed without the change, and passes with it. Test: fast/gradients/conic-repeating-last-stop.html * css/CSSGradientValue.cpp: (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange): 2018-09-13 Chris Dumez <cdumez@apple.com> Regression(PSON): setting window.opener to null allows process swapping in cases that are not web-compatible https://bugs.webkit.org/show_bug.cgi?id=189590 <rdar://problem/44422725> Reviewed by Geoffrey Garen. Set a flag on the navigation action to indicate if the page was opened via window.open() without 'noopener'. Test: http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html * loader/FrameLoader.cpp: (WebCore::FrameLoader::loadURL): * loader/NavigationAction.h: (WebCore::NavigationAction::openedViaWindowOpenWithOpener const): (WebCore::NavigationAction::setOpenedViaWindowOpenWithOpener): * page/DOMWindow.cpp: (WebCore::DOMWindow::createWindow): * page/Page.h: (WebCore::Page::openedViaWindowOpenWithOpener const): (WebCore::Page::setOpenedViaWindowOpenWithOpener): 2018-09-13 Jer Noble <jer.noble@apple.com> Enable USE_MEDIAREMOTE on iOS https://bugs.webkit.org/show_bug.cgi?id=189096 Reviewed by Eric Carlson. Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the Now Playing implementation on iOS and Mac. * SourcesCocoa.txt: * WebCore.xcodeproj/project.pbxproj: * platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed. * platform/audio/cocoa/MediaSessionManagerCocoa.h: * platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm. (PlatformMediaSessionManager::sharedManager): (PlatformMediaSessionManager::sharedManagerIfExists): (MediaSessionManagerCocoa::updateSessionState): (MediaSessionManagerCocoa::beginInterruption): (MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo): (MediaSessionManagerCocoa::sessionWillBeginPlayback): (MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing): (MediaSessionManagerCocoa::removeSession): (MediaSessionManagerCocoa::sessionWillEndPlayback): (MediaSessionManagerCocoa::clientCharacteristicsChanged): (MediaSessionManagerCocoa::sessionCanProduceAudioChanged): (MediaSessionManagerCocoa::nowPlayingEligibleSession): (MediaSessionManagerCocoa::updateNowPlayingInfo): * platform/audio/ios/MediaSessionManagerIOS.h: (): Deleted. * platform/audio/ios/MediaSessionManagerIOS.mm: (WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted. (WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted. (WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted. (WebCore::MediaSessionManageriOS::removeSession): Deleted. (WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted. (WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted. * platform/audio/mac/MediaSessionManagerMac.h: Removed. 2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com> Remove the workaround for friend class LazyNeverDestroyed<X> statements for MSVC https://bugs.webkit.org/show_bug.cgi?id=189576 Reviewed by Alex Christensen. Old MSVC can't compile "friend class LazyNeverDestroyed<X>" statements, but "friend LazyNeverDestroyed<X>". No new tests (No behavior change). * css/CSSInheritedValue.h: Removed the code for COMPILER(MSVC). Removed 'class' keyword in "friend class LazyNeverDestroyed<X>" statement. * css/CSSInitialValue.h: Ditto. * css/CSSPrimitiveValue.h: Ditto. * css/CSSRevertValue.h: Ditto. * css/CSSUnsetValue.h: Ditto. 2018-09-13 Ms2ger <Ms2ger@igalia.com> [GLib] Fix format string in KeyedEncoderGlib::beginObject(). https://bugs.webkit.org/show_bug.cgi?id=189585 Reviewed by Michael Catanzaro. This appears to fix the following assertion locally: GLib-CRITICAL **: g_variant_builder_add_value: assertion '!GVSB(builder)->expected_type || g_variant_is_of_type (value, GVSB(builder)->expected_type)' failed Covered by existing tests. * platform/glib/KeyedEncoderGlib.cpp: (WebCore::KeyedEncoderGlib::beginObject): 2018-09-13 Ryan Haddad <ryanhaddad@apple.com> Unreviewed, rolling out r235953. Caused layout test crashes under GuardMalloc. Reverted changeset: "Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings" https://bugs.webkit.org/show_bug.cgi?id=189521 https://trac.webkit.org/changeset/235953 2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com> Remove a MSVC workaround in XPath::Step::NodeTest https://bugs.webkit.org/show_bug.cgi?id=189578 Reviewed by Alex Christensen. XPath::Step::NodeTest has a special code for MSVC bug workaround. It has been introduced in 5 years ago in Bug 121082 Comment 19. I think it is safe just to remove the workaround. No new tests (No behavior change). * xml/XPathStep.h: Removed the MSVC workaround. 2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com> Remove a MSVC workaround in InspectorStyle::styleWithProperties https://bugs.webkit.org/show_bug.cgi?id=189577 Reviewed by Alex Christensen. No new tests (No behavior change). * inspector/InspectorStyleSheet.cpp: (WebCore::InspectorStyle::styleWithProperties const): Use 'auto' for the type of 'status'. 2018-09-13 Alex Christensen <achristensen@webkit.org> Use a Variant instead of a union in CSSSelector https://bugs.webkit.org/show_bug.cgi?id=188559 Reviewed by Antti Koivisto. No change in behavior. This just makes some of the existing problems more obvious and easy to fix. I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData. I only have m_isForPage when assertions are enabled because it's only used for an assertion. The rest is pretty straightforward translating union syntax to Variant syntax. I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary. * css/CSSSelector.cpp: (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::createRareData): (WebCore::CSSSelector::setAttribute): (WebCore::CSSSelector::setArgument): (WebCore::CSSSelector::setLangArgumentList): (WebCore::CSSSelector::setSelectorList): (WebCore::CSSSelector::setNth): (WebCore::CSSSelector::matchNth const): (WebCore::CSSSelector::nthA const): (WebCore::CSSSelector::nthB const): (WebCore::CSSSelector::RareData::RareData): * css/CSSSelector.h: (WebCore::CSSSelector::argument const): (WebCore::CSSSelector::langArgumentList const): (WebCore::CSSSelector::selectorList const): (WebCore::CSSSelector::attribute const): (WebCore::CSSSelector::attributeCanonicalLocalName const): (WebCore::CSSSelector::setValue): (WebCore::CSSSelector::CSSSelector): (WebCore::CSSSelector::~CSSSelector): (WebCore::CSSSelector::tagQName const): (WebCore::CSSSelector::tagLowercaseLocalName const): (WebCore::CSSSelector::value const): (WebCore::CSSSelector::serializingValue const): (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const): (WebCore::CSSSelector::RareData::create): Deleted. * css/parser/CSSParserImpl.cpp: (WebCore::CSSParserImpl::parsePageSelector): * css/parser/CSSParserSelector.h: 2018-09-13 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Clang] error: type 'float' cannot be narrowed to 'LONG' (aka 'long') in initializer list in WheelEventWin.cpp https://bugs.webkit.org/show_bug.cgi?id=189575 Reviewed by Alex Christensen. No new tests (No behavior change). * platform/win/WheelEventWin.cpp: (WebCore::PlatformWheelEvent::PlatformWheelEvent): Use flooredIntPoint to convert FloatPoint to POINT. 2018-09-13 Youenn Fablet <youenn@apple.com> Introduce RTCRtpSendParameters https://bugs.webkit.org/show_bug.cgi?id=189563 Reviewed by Eric Carlson. Introduce RTCRtpSendParameters to match the WebRTC specification. Split RTCRtpPrameters fields accordingly and update call sites. Covered by updated test. * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/PeerConnectionBackend.h: * Modules/mediastream/RTCRtpCodingParameters.h: Added * Modules/mediastream/RTCRtpCodingParameters.idl: Added * Modules/mediastream/RTCRtpDecodingParameters.h: Added * Modules/mediastream/RTCRtpDecodingParameters.idl: Added * Modules/mediastream/RTCRtpEncodingParameters.h: * Modules/mediastream/RTCRtpEncodingParameters.idl: * Modules/mediastream/RTCRtpParameters.h: * Modules/mediastream/RTCRtpParameters.idl: * Modules/mediastream/RTCRtpReceiver.cpp: * Modules/mediastream/RTCRtpSendParameters.h: Added. (WebCore::RTCRtpSendParameters::RTCRtpSendParameters): * Modules/mediastream/RTCRtpSendParameters.idl: Added. * Modules/mediastream/RTCRtpSender.cpp: (WebCore::RTCRtpSender::getParameters): (WebCore::RTCRtpSender::setParameters): * Modules/mediastream/RTCRtpSender.h: * Modules/mediastream/RTCRtpSender.idl: * Modules/mediastream/RTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: (WebCore::LibWebRTCRtpSenderBackend::getParameters const): (WebCore::LibWebRTCRtpSenderBackend::setParameters): * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCRtpParameters): (WebCore::toRTCRtpSendParameters): (WebCore::fromRTCRtpSendParameters): * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-09-13 Xabier Rodriguez Calvar <calvaris@igalia.com> [GStreamer][EME] decrypt-key-needed message renamed to drm-cdm-instance-needed https://bugs.webkit.org/show_bug.cgi?id=189547 Reviewed by Philippe Normand. decrypt-key-needed message renamed to drm-cdm-instance-needed. * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Apart from renaming the message, removed the class prefix for dispatchCDMInstance. * platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp: (webkitMediaCommonEncryptionDecryptTransformInPlace): 2018-09-11 Ryosuke Niwa <rniwa@webkit.org> imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion https://bugs.webkit.org/show_bug.cgi?id=189493 Reviewed by Alex Christensen. The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot. When a form (or any other) element has more than one ref inside removeDetachedChildren, addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder. However, when a form associated element of this form element appears later in the tree order, FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot. Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial operations happening in this function so this should be safe. Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html * html/FormAssociatedElement.cpp: (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug. 2018-09-12 Dan Bernstein <mitz@apple.com> [Cocoa] Complete support for Paste as Quotation https://bugs.webkit.org/show_bug.cgi?id=189504 Reviewed by Wenson Hsieh. Tests: editing/pasteboard/4930986-1-paste-as-quotation.html editing/pasteboard/4930986-2-paste-as-quotation.html editing/pasteboard/4930986-3-paste-as-quotation.html * editing/Editor.cpp: Added ClipboardEventKind::PasteAsQuotation. (WebCore::eventNameForClipboardEvent): Map PasteAsQuotation to the "paste" DOM event name. (WebCore::createDataTransferForClipboardEvent): Place the unquoted content in the event. This means that currently event handlers can’t emulate pasting as quotation, because they neither have the quoted content nor knowledge that quoting has been requested. We could change this in the future if needed. (WebCore::Editor::paste): Updated for change in pasteWithPasteboard’s argument type. (WebCore::Editor::pasteAsQuotation): Added. Similar to paste, but passes PasteOption::AsQuotation to pasteWithPasteboard. (WebCore::Editor::quoteFragmentForPasting): Added. Quoting for pasting consists of enclosing the fragment in a blockquote element with the "type" attribute set to "cite" and the "class" attribute set to a well-known value, which is used to trigger special behavior in ReplaceSelectionCommand. The behavior includes removing the "class" attribute in the end, so eventually, we could stop using this form of in-band signaling. * editing/Editor.h: Declared PasteOption enum class to encompass the existing allowPlainText and MailBlockquoteHandling arguments to pasteWithPasteboard as well as the new AsQuotation behavior. * editing/EditorCommand.cpp: (WebCore::executePasteAsQuotation): Added. Similar to executing Paste. (WebCore::createCommandMap): Added an entry for PasteAsQuotation, based on the Paste entry. * editing/cocoa/EditorCocoa.mm: (WebCore::Editor::webContentFromPasteboard): Moved from EditorIOS.mm and EditorMac.mm to here. * editing/gtk/EditorGtk.cpp: (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to quote the fragment if needed. * editing/ios/EditorIOS.mm: (WebCore::Editor::pasteWithPasteboard): Ditto. (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm. * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to quote the fragment if needed. (WebCore::Editor::readSelectionFromPasteboard): Updated for new OptionSet argument to pasteWithPasteboard. (WebCore::Editor::webContentFromPasteboard): Moved to EditorCocoa.mm. * editing/win/EditorWin.cpp: (WebCore::Editor::pasteWithPasteboard): Updated for new OptionSet argument, added a call to quote the fragment if needed. * editing/wpe/EditorWPE.cpp: (WebCore::Editor::pasteWithPasteboard): Ditto. 2018-09-11 Simon Fraser <simon.fraser@apple.com> Make GraphicsLayers ref-counted, so their tree can persist when disconnected from RenderLayerBackings https://bugs.webkit.org/show_bug.cgi?id=189521 Reviewed by Tim Horton. Make GraphicsLayer be RefCounted<GraphicsLayer>. GraphicsLayers own their children, via a Vector<Ref<GraphicsLayer>>. RenderLayerBacking and other holders of GraphicsLayers use RefPtr<GraphicsLayer>. All the other changes are just to adapt to the new ownership patterns. I verified that no GraphicsLayers were leaked or abandoned after this change. No behavior change. * page/PageOverlayController.cpp: (WebCore::PageOverlayController::layerWithDocumentOverlays): (WebCore::PageOverlayController::layerWithViewOverlays): (WebCore::PageOverlayController::installPageOverlay): (WebCore::PageOverlayController::uninstallPageOverlay): (WebCore::PageOverlayController::setPageOverlayNeedsDisplay): (WebCore::PageOverlayController::didChangeViewSize): (WebCore::PageOverlayController::didChangeDocumentSize): (WebCore::PageOverlayController::didChangeSettings): (WebCore::PageOverlayController::paintContents): (WebCore::PageOverlayController::didChangeOverlayFrame): (WebCore::PageOverlayController::didChangeOverlayBackgroundColor): * page/PageOverlayController.h: * page/mac/ServicesOverlayController.h: (WebCore::ServicesOverlayController::Highlight::layer const): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::Highlight): (WebCore::ServicesOverlayController::Highlight::invalidate): (WebCore::ServicesOverlayController::Highlight::fadeIn): (WebCore::ServicesOverlayController::Highlight::fadeOut): (WebCore::ServicesOverlayController::Highlight::didFinishFadeOutAnimation): (WebCore::ServicesOverlayController::determineActiveHighlight): * platform/graphics/GraphicsLayer.cpp: (WebCore::GraphicsLayer::GraphicsLayer): (WebCore::GraphicsLayer::willBeDestroyed): (WebCore::GraphicsLayer::setChildren): (WebCore::GraphicsLayer::addChild): (WebCore::GraphicsLayer::addChildAtIndex): (WebCore::GraphicsLayer::addChildBelow): (WebCore::GraphicsLayer::addChildAbove): (WebCore::GraphicsLayer::replaceChild): (WebCore::GraphicsLayer::removeAllChildren): (WebCore::GraphicsLayer::removeFromParent): (WebCore::GraphicsLayer::setMaskLayer): (WebCore::GraphicsLayer::noteDeviceOrPageScaleFactorChangedIncludingDescendants): (WebCore::GraphicsLayer::distributeOpacity): (WebCore::GraphicsLayer::traverse): (WebCore::dumpChildren): * platform/graphics/GraphicsLayer.h: (WebCore::GraphicsLayer::children const): (WebCore::GraphicsLayer::children): (WebCore::GraphicsLayer::maskLayer const): (WebCore::GraphicsLayer::replicaLayer const): (WebCore::GraphicsLayer::beingDestroyed const): (WebCore::GraphicsLayer:: const): Deleted. * platform/graphics/GraphicsLayerFactory.h: * platform/graphics/ca/GraphicsLayerCA.cpp: (WebCore::GraphicsLayer::create): (WebCore::GraphicsLayerCA::setChildren): (WebCore::GraphicsLayerCA::addChild): (WebCore::GraphicsLayerCA::addChildAtIndex): (WebCore::GraphicsLayerCA::addChildBelow): (WebCore::GraphicsLayerCA::addChildAbove): (WebCore::GraphicsLayerCA::replaceChild): (WebCore::GraphicsLayerCA::setMaskLayer): (WebCore::GraphicsLayerCA::recursiveVisibleRectChangeRequiresFlush const): (WebCore::GraphicsLayerCA::recursiveCommitChanges): (WebCore::GraphicsLayerCA::updateSublayerList): (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes): * platform/graphics/ca/GraphicsLayerCA.h: * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp: (WebCore::GraphicsLayer::create): (WebCore::GraphicsLayerTextureMapper::setChildren): (WebCore::GraphicsLayerTextureMapper::addChild): (WebCore::GraphicsLayerTextureMapper::addChildAtIndex): (WebCore::GraphicsLayerTextureMapper::addChildAbove): (WebCore::GraphicsLayerTextureMapper::addChildBelow): (WebCore::GraphicsLayerTextureMapper::replaceChild): (WebCore::GraphicsLayerTextureMapper::setMaskLayer): (WebCore::GraphicsLayerTextureMapper::updateBackingStoreIncludingSubLayers): * platform/graphics/texmap/GraphicsLayerTextureMapper.h: * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp: (WebCore::GraphicsLayer::create): (WebCore::CoordinatedGraphicsLayer::setShouldUpdateVisibleRect): (WebCore::CoordinatedGraphicsLayer::addChild): (WebCore::CoordinatedGraphicsLayer::addChildAtIndex): (WebCore::CoordinatedGraphicsLayer::addChildAbove): (WebCore::CoordinatedGraphicsLayer::addChildBelow): (WebCore::CoordinatedGraphicsLayer::replaceChild): (WebCore::CoordinatedGraphicsLayer::setMaskLayer): (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers): (WebCore::CoordinatedGraphicsLayer::updateContentBuffersIncludingSubLayers): (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded): * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h: * platform/graphics/win/GraphicsLayerDirect2D.cpp: (WebCore::GraphicsLayer::create): (WebCore::GraphicsLayerDirect2D::GraphicsLayerDirect2D): Deleted. (WebCore::GraphicsLayerDirect2D::initialize): Deleted. (WebCore::GraphicsLayerDirect2D::~GraphicsLayerDirect2D): Deleted. (WebCore::GraphicsLayerDirect2D::setNeedsDisplay): Deleted. (WebCore::GraphicsLayerDirect2D::setNeedsDisplayInRect): Deleted. * rendering/RenderLayerBacking.cpp: (WebCore::RenderLayerBacking::createGraphicsLayer): (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): (WebCore::RenderLayerBacking::updateConfiguration): (WebCore::RenderLayerBacking::updateInternalHierarchy): (WebCore::RenderLayerBacking::updateMaskingLayer): (WebCore::RenderLayerBacking::updateChildClippingStrategy): (WebCore::RenderLayerBacking::updateScrollingLayers): * rendering/RenderLayerBacking.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::updateCompositingLayers): (WebCore::RenderLayerCompositor::appendDocumentOverlayLayers): (WebCore::RenderLayerCompositor::setCompositingParent): (WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): (WebCore::RenderLayerCompositor::parentFrameContentLayers): (WebCore::RenderLayerCompositor::updateLayerForTopOverhangArea): (WebCore::RenderLayerCompositor::updateLayerForBottomOverhangArea): (WebCore::RenderLayerCompositor::updateLayerForHeader): (WebCore::RenderLayerCompositor::updateLayerForFooter): (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): (WebCore::RenderLayerCompositor::ensureRootLayer): (WebCore::RenderLayerCompositor::rootLayerAttachmentChanged): * rendering/RenderLayerCompositor.h: 2018-09-12 Alex Christensen <achristensen@webkit.org> Expose fewer of URL's internal members https://bugs.webkit.org/show_bug.cgi?id=189528 Reviewed by Chris Dumez. * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::urlHostHash): * platform/URL.cpp: (WebCore::URL::hostStart const): (WebCore::protocolHostAndPortAreEqual): (WebCore::hostsAreEqual): * platform/URL.h: (WebCore::URL::hostStart const): Deleted. (WebCore::URL::hostEnd const): Deleted. 2018-09-12 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] Implement correct total received bytes. https://bugs.webkit.org/show_bug.cgi?id=189555 Reviewed by Alex Christensen. Curl port only reported total network received bytes before decoding. No new test. InspectorTest is only available for WebKitTestRunner. * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::didReceiveData): (WebCore::CurlRequest::updateNetworkLoadMetrics): * platform/network/curl/CurlRequest.h: 2018-09-12 Youenn Fablet <youenn@apple.com> Split RTCRtpParameters idl and header file https://bugs.webkit.org/show_bug.cgi?id=189524 Reviewed by Eric Carlson. This will be easier to manage and will allow to more easily introduce sender/receiver parameters. No change of behavior. * CMakeLists.txt: * DerivedSources.make: * Modules/mediastream/RTCDegradationPreference.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCDegradationPreference.idl: Added. * Modules/mediastream/RTCDtxStatus.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCDtxStatus.idl: Added. * Modules/mediastream/RTCPriorityType.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCPriorityType.idl: Added. * Modules/mediastream/RTCRtpCodecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCRtpCodecParameters.idl: Added. * Modules/mediastream/RTCRtpEncodingParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCRtpEncodingParameters.idl: Added. * Modules/mediastream/RTCRtpFecParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCRtpFecParameters.idl: Added. * Modules/mediastream/RTCRtpHeaderExtensionParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCRtpHeaderExtensionParameters.idl: Added. * Modules/mediastream/RTCRtpParameters.h: * Modules/mediastream/RTCRtpParameters.idl: * Modules/mediastream/RTCRtpRtxParameters.h: Copied from Source/WebCore/Modules/mediastream/RTCRtpParameters.h. * Modules/mediastream/RTCRtpRtxParameters.idl: Added. * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCEncodingParameters): (WebCore::fromRTCEncodingParameters): (WebCore::toRTCHeaderExtensionParameters): (WebCore::fromRTCHeaderExtensionParameters): (WebCore::toRTCCodecParameters): (WebCore::toRTCRtpParameters): (WebCore::fromRTCRtpParameters): * Sources.txt: * WebCore.xcodeproj/project.pbxproj: 2018-09-12 Ali Juma <ajuma@chromium.org> [IntersectionObserver] Implement rootMargin expansion https://bugs.webkit.org/show_bug.cgi?id=189525 Reviewed by Simon Fraser. Expand the root intersection rectangle by the observer's rootMargin when computing intersections. Test: imported/w3c/web-platform-tests/intersection-observer/root-margin.html * dom/Document.cpp: (WebCore::expandRootBoundsWithRootMargin): (WebCore::computeIntersectionRects): * page/IntersectionObserver.h: (WebCore::IntersectionObserver::rootMarginBox const): * platform/graphics/FloatRect.h: (WebCore::FloatRect::expand): 2018-09-12 Fujii Hironori <Hironori.Fujii@sony.com> [Win][Clang] error: non-constant-expression cannot be narrowed from type 'int' to 'SHORT' https://bugs.webkit.org/show_bug.cgi?id=189542 Reviewed by Alex Christensen. No new tests (No behavior change). * platform/graphics/win/IntPointWin.cpp: (WebCore::IntPoint::operator POINTS const): Narrowed m_x and m_y by using static_cast. 2018-09-12 Guillaume Emont <guijemont@igalia.com> Add IGNORE_WARNING_.* macros https://bugs.webkit.org/show_bug.cgi?id=188996 Reviewed by Michael Catanzaro. * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h: * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h: * accessibility/mac/AXObjectCacheMac.mm: (WebCore::AXObjectCache::postPlatformNotification): * accessibility/mac/AccessibilityObjectMac.mm: (WebCore::AccessibilityObject::overrideAttachmentParent): (WebCore::AccessibilityObject::accessibilityIgnoreAttachment const): * accessibility/mac/WebAccessibilityObjectWrapperMac.mm: (-[WebAccessibilityObjectWrapper renderWidgetChildren]): (-[WebAccessibilityObjectWrapper convertPointToScreenSpace:]): (-[WebAccessibilityObjectWrapper role]): (-[WebAccessibilityObjectWrapper roleDescription]): * bridge/objc/WebScriptObject.mm: * bridge/objc/objc_class.mm: (JSC::Bindings::ObjcClass::fieldNamed const): * crypto/CommonCryptoUtilities.cpp: (WebCore::getCommonCryptoDigestAlgorithm): * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp: (WebCore::encryptAES_GCM): (WebCore::decyptAES_GCM): * crypto/mac/SerializedCryptoKeyWrapMac.mm: (WebCore::wrapSerializedCryptoKey): (WebCore::unwrapSerializedCryptoKey): * css/makeSelectorPseudoClassAndCompatibilityElementMap.py: * css/makeSelectorPseudoElementsMap.py: * editing/TextIterator.cpp: * editing/mac/EditorMac.mm: (WebCore::Editor::pasteWithPasteboard): (WebCore::Editor::takeFindStringFromSelection): (WebCore::Editor::replaceNodeFromPasteboard): * page/mac/EventHandlerMac.mm: (WebCore::EventHandler::sendFakeEventsAfterWidgetTracking): * page/mac/ServicesOverlayController.mm: (WebCore::ServicesOverlayController::Highlight::paintContents): * platform/LocalizedStrings.cpp: (WebCore::formatLocalizedString): * platform/ScreenProperties.h: (WebCore::ScreenData::decode): * platform/gamepad/mac/HIDGamepadProvider.cpp: (WebCore::HIDGamepadProvider::stopMonitoringInput): * platform/graphics/PlatformDisplay.cpp: (WebCore::PlatformDisplay::sharedDisplay): * platform/graphics/SurrogatePairAwareTextIterator.cpp: * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm: (WebCore::MediaSelectionGroupAVFObjC::updateOptions): * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm: (WebCore::CDMSessionAVStreamSession::update): * platform/graphics/avfoundation/objc/CDMSessionMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: (WebCore::MediaPlayerPrivateAVFoundationObjC::setCurrentTextTrack): (WebCore::MediaPlayerPrivateAVFoundationObjC::languageOfPrimaryAudioTrack const): (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep): * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h: * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm: (WebCore::IGNORE_CLANG_WARNING_END): * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h: * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: (-[WebAVSampleBufferErrorListener beginObservingRenderer:]): (-[WebAVSampleBufferErrorListener stopObservingRenderer:]): (-[WebAVSampleBufferErrorListener observeValueForKeyPath:ofObject:change:context:]): (WebCore::SourceBufferPrivateAVFObjC::trackDidChangeEnabled): (WebCore::IGNORE_CLANG_WARNING_END): * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: (PlatformCALayer::drawLayerContents): * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp: (WebCore::FontCascade::fontForCombiningCharacterSequence const): * platform/graphics/cg/ImageDecoderCG.cpp: (WebCore::ImageDecoderCG::createFrameImageAtIndex): * platform/graphics/cocoa/GraphicsContextCocoa.mm: (WebCore::GraphicsContext::drawLineForDocumentMarker): * platform/graphics/cocoa/WebGLLayer.h: (IGNORE_CLANG_WARNING): * platform/graphics/mac/ComplexTextControllerCoreText.mm: (WebCore::ComplexTextController::collectComplexTextRunsForCharacters): * platform/graphics/mac/IconMac.mm: (WebCore::Icon::Icon): * platform/graphics/mac/PDFDocumentImageMac.mm: (WebCore::PDFDocumentImage::drawPDFPage): * platform/graphics/mac/WebKitNSImageExtras.mm: (-[NSImage _web_lockFocusWithDeviceScaleFactor:]): * platform/ios/DragImageIOS.mm: * platform/mac/DragImageMac.mm: (WebCore::scaleDragImage): (WebCore::createDragImageForLink): * platform/mac/LegacyNSPasteboardTypes.h: * platform/mac/LocalCurrentGraphicsContext.mm: (WebCore::LocalCurrentGraphicsContext::LocalCurrentGraphicsContext): * platform/mac/PasteboardMac.mm: (WebCore::Pasteboard::createForCopyAndPaste): (WebCore::Pasteboard::createForDragAndDrop): (WebCore::setDragImageImpl): * platform/mac/PlatformEventFactoryMac.mm: (WebCore::globalPoint): * platform/mac/SSLKeyGeneratorMac.mm: * platform/mac/ScrollViewMac.mm: (WebCore::ScrollView::platformContentsToScreen const): (WebCore::ScrollView::platformScreenToContents const): * platform/mac/ThemeMac.mm: (WebCore::drawCellFocusRingWithFrameAtTime): * platform/mac/WebPlaybackControlsManager.mm: * platform/mac/WidgetMac.mm: (WebCore::Widget::paint): * platform/mediastream/RealtimeIncomingAudioSource.h: * platform/mediastream/RealtimeIncomingVideoSource.h: * platform/mediastream/RealtimeOutgoingAudioSource.h: * platform/mediastream/RealtimeOutgoingVideoSource.h: * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h: * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: * platform/mediastream/libwebrtc/LibWebRTCProvider.h: * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp: * platform/network/cf/NetworkStorageSessionCFNet.cpp: * platform/network/cf/ResourceHandleCFNet.cpp: (WebCore::ResourceHandle::createCFURLConnection): * platform/network/cf/SocketStreamHandleImplCFNet.cpp: (WebCore::SocketStreamHandleImpl::reportErrorToClient): * platform/network/create-http-header-name-table: * platform/text/TextEncoding.cpp: * testing/MockLibWebRTCPeerConnection.h: * xml/XPathGrammar.cpp: 2018-09-12 Pablo Saavedra <psaavedra@igalia.com> Linking against libWPEWebKit-0.1.so is not posible when WPE is build with ENABLE_VIDEO=OFF and ENABLE_WEB_AUDIO=OFF https://bugs.webkit.org/show_bug.cgi?id=189540 Reviewed by Philippe Normand. Related issues: This issue is related with changes in https://bugs.webkit.org/show_bug.cgi?id=183080 This issue is introduced in https://bugs.webkit.org/show_bug.cgi?id=186547 No new tests, no changes in the functionality. * platform/GStreamer.cmake: * platform/SourcesGLib.txt: * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: (WebCore::LibWebRTCProvider::webRTCAvailable): 2018-09-11 Zan Dobersek <zdobersek@igalia.com> Unreviewed WPE build fix. * platform/network/soup/SocketStreamHandleImplSoup.cpp: Add extra header inclusions to get this code building after the unified sources system shifted it into a different translation unit. 2018-09-11 Basuke Suzuki <Basuke.Suzuki@sony.com> [Curl] WebInspector doesn't display request headers added during processing. https://bugs.webkit.org/show_bug.cgi?id=189531 Reviewed by Alex Christensen. While processing the request, Curl port network layer adds some headers to the request such as cookies. Those headers should be displayed in the WebInspector. Tested on MiniBrowser. * platform/network/curl/CurlRequest.cpp: (WebCore::CurlRequest::didReceiveHeader): (WebCore::CurlRequest::didCompleteTransfer): (WebCore::CurlRequest::updateNetworkLoadMetrics): * platform/network/curl/CurlRequest.h: 2018-09-11 James Savage <james.savage@apple.com> Follow up to: Expose -apple-system-container-border color to internal web views. https://bugs.webkit.org/show_bug.cgi?id=189178. Reviewed by Timothy Hatcher. * rendering/RenderThemeMac.mm: (WebCore::RenderThemeMac::systemColor const): Add a separate #if block for Mojave. When I used CSSValueAppleSystemFindHighlightBackground as a template for this change, I had to write out the condition in the first change, but mistakenly thought I could reuse the block here. Turns out the versions were different, and I could not. 2018-09-11 Youenn Fablet <youenn@apple.com> Remove MediaDevices NoInterfaceObject https://bugs.webkit.org/show_bug.cgi?id=189512 Reviewed by Alex Christensen. Covered by rebased WPT tests. * Modules/mediastream/MediaDevices.idl: 2018-09-11 Jer Noble <jer.noble@apple.com> [MediaCapabilities] Implement MediaEngineConfigurationFactory registration https://bugs.webkit.org/show_bug.cgi?id=189438 Reviewed by Eric Carlson. Implement a mechanism to register platform-specific MediaEngineConfigurationFactory methods, and a mechanism to iterate over those registered factories when createDecodingConfiguration() and createEncodingConfiguration() are called. The Factory has been radically simplified; the concept of MediaEngineDecodingConfiguration and MediaEngineEncodingConfiguration and its subclasess have been removed. Since the primary objects representing video and audio configurations are IDLDictionaries, the native objects are just structs full of POD types (and Strings). Since these have no dependencies on higher-level HTML concepts, they can be moved into platform/ and accessed from there. This patch also converts MediaCapabilitiesInfo to an Interface, so its implementation also can become a struct and live in platform/. The MediaEngineDecodingConfigurationMock and MediaEngineEncodingConfigurationMock have been consolidated in a single class which simply parses MediaDecodingConfiguration and MediaEncodingConifguration objects (now that they live in Platform) and return a MediaCapabilitiesInfo object (now that it does too). * Modules/mediacapabilities/MediaCapabilities.cpp: (WebCore::isValidVideoConfiguration): (WebCore::MediaCapabilities::decodingInfo): (WebCore::MediaCapabilities::encodingInfo): * Modules/mediacapabilities/MediaCapabilitiesInfo.h: Removed. * Modules/mediacapabilities/MediaCapabilitiesInfo.idl: * Modules/mediacapabilities/VideoConfiguration.idl: * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * platform/MediaCapabilitiesInfo.h: Copied from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h. * platform/mediacapabilities/AudioConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/AudioConfiguration.h. * platform/mediacapabilities/MediaConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaConfiguration.h. * platform/mediacapabilities/MediaDecodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingConfiguration.h. * platform/mediacapabilities/MediaDecodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaDecodingType.h. * platform/mediacapabilities/MediaEncodingConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingConfiguration.h. * platform/mediacapabilities/MediaEncodingType.h: Renamed from Source/WebCore/Modules/mediacapabilities/MediaEncodingType.h. * platform/mediacapabilities/MediaEngineConfiguration.cpp: Removed. * platform/mediacapabilities/MediaEngineConfiguration.h: Removed. * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: (WebCore::factories): (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration): (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration): * platform/mediacapabilities/MediaEngineConfigurationFactory.h: * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Removed. * platform/mediacapabilities/VideoConfiguration.h: Renamed from Source/WebCore/Modules/mediacapabilities/VideoConfiguration.h. * platform/mediastream/mac/DisplayCaptureSourceCocoa.h: * platform/mock/MediaEngineConfigurationFactoryMock.cpp: Added. (WebCore::canDecodeMedia): (WebCore::canSmoothlyDecodeMedia): (WebCore::canPowerEfficientlyDecodeMedia): (WebCore::canEncodeMedia): (WebCore::canSmoothlyEncodeMedia): (WebCore::canPowerEfficientlyEncodeMedia): (WebCore::MediaEngineConfigurationFactoryMock::createDecodingConfiguration): (WebCore::MediaEngineConfigurationFactoryMock::createEncodingConfiguration): * platform/mock/MediaEngineConfigurationFactoryMock.h: Renamed from Source/WebCore/platform/mediacapabilities/MediaEngineDecodingConfiguration.h. * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Removed. * platform/mock/MediaEngineDecodingConfigurationMock.h: Removed. * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Removed. * platform/mock/MediaEngineEncodingConfigurationMock.h: Removed. 2018-09-08 Ryosuke Niwa <rniwa@webkit.org> :first-child, :last-child, :nth-child, and :nth-of-type don't work on shadow root's children https://bugs.webkit.org/show_bug.cgi?id=166748 <rdar://problem/29649177> Reviewed by Yusuke Suzuki. Added the support for matching positional pseudo classes. For now, we invalidate whenever a child node of a non-UA ShadowRoot is mutated instead of a fine-grained style invalidation as done for regular elements. Tests: fast/shadow-dom/nth-node-on-shadow-child-invalidation.html fast/shadow-dom/nth-node-on-shadow-child-no-jit.html fast/shadow-dom/nth-node-on-shadow-child.html * css/SelectorChecker.cpp: (WebCore::SelectorChecker::checkOne const): * cssjit/SelectorCompiler.cpp: (WebCore::SelectorCompiler::SelectorCodeGenerator::generateWalkToParentElementOrShadowRoot): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsFirstChild): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsLastChild): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsOnlyChild): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChild): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthChildOf): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChild): (WebCore::SelectorCompiler::SelectorCodeGenerator::generateElementIsNthLastChildOf): * dom/ShadowRoot.cpp: (WebCore::ShadowRoot::childrenChanged): Invalidate the subtree whenever a child node is mutated. * dom/ShadowRoot.h: * domjit/DOMJITHelpers.h: (WebCore::DOMJIT::branchTestIsShadowRootFlagOnNode): Added. (WebCore::DOMJIT::branchTestIsElementOrShadowRootFlagOnNode): Added. 2018-09-11 Per Arne Vollan <pvollan@apple.com> Addressing post-review feedback on r235619. https://bugs.webkit.org/show_bug.cgi?id=187925 Unreviewed. * testing/Internals.cpp: (WebCore::Internals::primaryScreenDisplayID): * testing/Internals.h: 2018-09-11 Wenson Hsieh <wenson_hsieh@apple.com> [macOS] [WK2] Support changing foreground colors via color panel https://bugs.webkit.org/show_bug.cgi?id=189382 <rdar://problem/44227311> Reviewed by Ryosuke Niwa. Small adjustments to support changing foreground text color using NSColorPanel in WebKit2. See comments below. Tested by FontManagerTests.ChangeFontColorWithColorPanel. * editing/EditingStyle.cpp: (WebCore::StyleChange::extractTextStyles): Support setting foreground text color with alpha by using a styled span element rather than a font element with attributes. To do this, only populate `StyleChange::m_applyFontColor` if the color is opaque. This is because the font element does not support `rgba()` syntax, so any font colors here with alpha that are serialized to `rgba()` result in a garbage value for the computed color style. * editing/FontAttributeChanges.cpp: (WebCore::FontAttributeChanges::editAction const): Add a helper to return the relevant EditAction describing this set of FontAttributeChanges. * editing/FontAttributeChanges.h: (WebCore::FontChanges::isEmpty const): 2018-09-11 Yusuke Suzuki <yusukesuzuki@slowstart.org> Shrink size of ResourseResponseBase https://bugs.webkit.org/show_bug.cgi?id=189501 Reviewed by Simon Fraser. We reduce the size of ResourceResponseBase by the following two optimizations. 1. Use bitfields for bool flags and reorder them. 2. Use Markable<> in CacheControlDirectives, which is held by ResourceResponseBase. This patch reduces the size of ResourceResponseBase from 416 to 392 bytes. No behavior change. * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm: (WebCore::WebCoreAVFResourceLoader::responseReceived): (WebCore::WebCoreAVFResourceLoader::fulfillRequestWithResource): * platform/network/CacheValidation.h: (WebCore::CacheControlDirectives::CacheControlDirectives): * platform/network/ResourceResponseBase.cpp: (WebCore::ResourceResponseBase::ResourceResponseBase): (WebCore::ResourceResponseBase::contentRange const): * platform/network/ResourceResponseBase.h: (WebCore::ResourceResponseBase::decode): 2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com> Unreviewed, fix some -Wreturn-type warnings * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp: (WebCore::sourceFromNewReceiver): * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: (WebCore::toRTCRtpTransceiverDirection): (WebCore::fromRTCRtpTransceiverDirection): 2018-09-11 Jiewen Tan <jiewen_tan@apple.com> Unreviewed, a speculative build fix for r235888. * Modules/mediastream/MediaDevices.h: Add class Document forward declaration. 2018-09-11 Woodrow Wang <woodrow_wang@apple.com> Add Web API Statistics Collection https://bugs.webkit.org/show_bug.cgi?id=187773 <rdar://problem/44155162> Reviewed by Brent Fulgham. Added data collection for web API statistics, specifically regarding the canvas, font loads, screen functions, and navigator functions. The data collection code is placed under a runtime enabled feature flag. The statistics are stored in a ResourceLoadStatistics object and written to a plist on disk. Added a new file CanvasActivityRecord.h and CanvasActivityRecord.cpp which includes a struct to keep track of HTML5 canvas element read and writes. Tests: http/tests/webAPIStatistics/canvas-read-and-write-data-collection.html http/tests/webAPIStatistics/font-load-data-collection.html http/tests/webAPIStatistics/navigator-functions-accessed-data-collection.html http/tests/webAPIStatistics/screen-functions-accessed-data-collection.html * Sources.txt: * WebCore.xcodeproj/project.pbxproj: * css/CSSFontFaceSource.cpp: (WebCore::CSSFontFaceSource::load): * css/CSSFontSelector.cpp: (WebCore::CSSFontSelector::fontRangesForFamily): (WebCore::CSSFontSelector::fallbackFontAt): The following are the functions where we'd like to record a canvas read. * html/HTMLCanvasElement.cpp: (WebCore::HTMLCanvasElement::toDataURL): (WebCore::HTMLCanvasElement::toBlob): (WebCore::HTMLCanvasElement::getImageData): (WebCore::HTMLCanvasElement::toMediaSample): (WebCore::HTMLCanvasElement::captureStream): The following are the functions where we'd like to record a canvas write. * html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::measureText): (WebCore::CanvasRenderingContext2D::drawTextInternal): The following files and functions handle the CanvasActivityRecord struct and its respective functions. * loader/CanvasActivityRecord.cpp: Added. (WebCore::CanvasActivityRecord::recordWrittenOrMeasuredText): (WebCore::CanvasActivityRecord::mergeWith): * loader/CanvasActivityRecord.h: Added. (WebCore::CanvasActivityRecord::encode const): (WebCore::CanvasActivityRecord::decode): * loader/DocumentThreadableLoader.cpp: * loader/FrameLoader.cpp: * loader/ResourceLoadObserver.cpp: (WebCore::ResourceLoadObserver::logFontLoad): (WebCore::ResourceLoadObserver::logCanvasRead): (WebCore::ResourceLoadObserver::logCanvasWriteOrMeasure): (WebCore::ResourceLoadObserver::logNavigatorAPIAccessed): (WebCore::ResourceLoadObserver::logScreenAPIAccessed): Before, entries in the ResourceLoadStatistics involving HashSets used "origin" as the key. Now the encodeHashSet function has been generalized to take any key to encode the entries in the HashSet. Also added functionality to encode an OptionSet by converting it to its raw bitmask state. * loader/ResourceLoadObserver.h: * loader/ResourceLoadStatistics.cpp: (WebCore::encodeHashSet): (WebCore::encodeOriginHashSet): (WebCore::encodeOptionSet): (WebCore::encodeFontHashSet): (WebCore::encodeCanvasActivityRecord): (WebCore::ResourceLoadStatistics::encode const): (WebCore::decodeHashSet): (WebCore::decodeOriginHashSet): (WebCore::decodeOptionSet): (WebCore::decodeFontHashSet): (WebCore::decodeCanvasActivityRecord): (WebCore::ResourceLoadStatistics::decode): (WebCore::navigatorAPIEnumToString): (WebCore::screenAPIEnumToString): (WebCore::appendNavigatorAPIOptionSet): (WebCore::appendScreenAPIOptionSet): (WebCore::ResourceLoadStatistics::toString const): (WebCore::ResourceLoadStatistics::merge): * loader/ResourceLoadStatistics.h: * loader/ResourceTiming.cpp: The following are the navigator functions recorded for the web API statistics. * page/Navigator.cpp: (WebCore::Navigator::appVersion const): (WebCore::Navigator::userAgent const): (WebCore::Navigator::plugins): (WebCore::Navigator::mimeTypes): (WebCore::Navigator::cookieEnabled const): (WebCore::Navigator::javaEnabled const): The following are the screen functions recorded for the web API statistics. * page/Screen.cpp: (WebCore::Screen::height const): (WebCore::Screen::width const): (WebCore::Screen::colorDepth const): (WebCore::Screen::pixelDepth const): (WebCore::Screen::availLeft const): (WebCore::Screen::availTop const): (WebCore::Screen::availHeight const): (WebCore::Screen::availWidth const): 2018-09-11 Pablo Saavedra <psaavedra@igalia.com> playbackControlsManagerUpdateTimerFired and m_playbackControlsManagerUpdateTimer must be guarded with ENABLE(VIDEO), otherwise the following error occurs with the VIDEO feature turned off: error: 'MediaElementSession' has not been declared Add missing #if ENABLE(VIDEO) Page.cpp and Page.h https://bugs.webkit.org/show_bug.cgi?id=189500 Reviewed by Anders Carlsson. * page/Page.cpp: (WebCore::Page::Page): (WebCore::Page::schedulePlaybackControlsManagerUpdate): * page/Page.h: 2018-09-11 Frederic Wang <fwang@igalia.com> Refactor filter list checking code https://bugs.webkit.org/show_bug.cgi?id=185087 Reviewed by Antonio Gomes. No new tests, behavior unchanged. * page/animation/KeyframeAnimation.h: Add missing forward-declaration FilterOperations. == Rolled over to ChangeLog-2018-09-11 ==