WebKit-https.git
4 months agoWeb Inspector: Heap: logging an object from a snapshot shouldn't use the "special...
drousso@apple.com [Mon, 15 Apr 2019 18:47:38 +0000 (18:47 +0000)]
Web Inspector: Heap: logging an object from a snapshot shouldn't use the "special" style if the object is reachable
https://bugs.webkit.org/show_bug.cgi?id=196889
<rdar://problem/49870693>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HeapSnapshotInstanceDataGridNode.js:
(WI.HeapSnapshotInstanceDataGridNode.logHeapSnapshotNode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Debugger: deleting a special breakpoint should disable it
drousso@apple.com [Mon, 15 Apr 2019 18:34:51 +0000 (18:34 +0000)]
Web Inspector: Debugger: deleting a special breakpoint should disable it
https://bugs.webkit.org/show_bug.cgi?id=196737
<rdar://problem/49740680>

Reviewed by Timothy Hatcher.

* UserInterface/Views/BreakpointTreeElement.js:
(WI.BreakpointTreeElement.prototype.ondelete):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244274 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoTestRunner::notifyDone() should be safely reentrant
pvollan@apple.com [Mon, 15 Apr 2019 18:27:06 +0000 (18:27 +0000)]
TestRunner::notifyDone() should be safely reentrant
https://bugs.webkit.org/show_bug.cgi?id=196898

Reviewed by Darin Adler.

It is currently possible that TestRunner::notifyDone() will call itself, since
notifyDone() will force a repaint, which can start executing JavaScript, which
may call notifyDone() again. This can lead to test failures and flakiness.
Fix this by setting the m_waitToDump flag before calling the dump() method.

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::notifyDone):
(TestRunner::forceImmediateCompletion):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::notifyDone):
(TestRunner::forceImmediateCompletion):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244273 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Uncaught Exception: null is not an object (evaluating 'this.selectedTr...
drousso@apple.com [Mon, 15 Apr 2019 17:31:46 +0000 (17:31 +0000)]
Web Inspector: Uncaught Exception: null is not an object (evaluating 'this.selectedTreeElement.reveal')
https://bugs.webkit.org/show_bug.cgi?id=196804
<rdar://problem/49800708>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeOutline.js:
(WI.DOMTreeOutline.prototype.update):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244271 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Uncaught Exception: Can't find variable: WebGL2RenderingContext
drousso@apple.com [Mon, 15 Apr 2019 17:29:26 +0000 (17:29 +0000)]
Web Inspector: Uncaught Exception: Can't find variable: WebGL2RenderingContext
https://bugs.webkit.org/show_bug.cgi?id=196874
<rdar://problem/49858912>

Reviewed by Timothy Hatcher.

* UserInterface/Models/Recording.js:
(WI.Recording.prototype.createContext):

* UserInterface/Models/RecordingAction.js:
(WI.RecordingAction.prototype.process.getContent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244270 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modifica...
drousso@apple.com [Mon, 15 Apr 2019 17:27:40 +0000 (17:27 +0000)]
Web Inspector: DOMDebugger: "Attribute Modified" breakpoints pause after the modification occurs for the style attribute
https://bugs.webkit.org/show_bug.cgi?id=196556
<rdar://problem/49570681>

Reviewed by Timothy Hatcher.

Source/WebCore:

Test: inspector/dom-debugger/attribute-modified-style.html

* css/PropertySetCSSStyleDeclaration.h:
* css/PropertySetCSSStyleDeclaration.cpp:
(WebCore::StyleAttributeMutationScope::~StyleAttributeMutationScope):
(WebCore::InlineCSSStyleDeclaration::willMutate): Added.

* dom/StyledElement.cpp:
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::inlineStyleChanged):

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willInvalidateStyleAttr): Added.
(WebCore::InspectorInstrumentation::didInvalidateStyleAttr):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willInvalidateStyleAttrImpl): Added.
(WebCore::InspectorInstrumentation::didInvalidateStyleAttrImpl):

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::didInvalidateStyleAttr):

* inspector/agents/InspectorDOMDebuggerAgent.h:
* inspector/agents/InspectorDOMDebuggerAgent.cpp:
(WebCore::InspectorDOMDebuggerAgent::willInvalidateStyleAttr): Added.
(WebCore::InspectorDOMDebuggerAgent::didInvalidateStyleAttr): Deleted.

LayoutTests:

* inspector/dom-debugger/attribute-modified-style.html: Added.
* inspector/dom-debugger/attribute-modified-style-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244269 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: sidebar panels shouldn't be added as subviews unless visible
drousso@apple.com [Mon, 15 Apr 2019 17:27:27 +0000 (17:27 +0000)]
Web Inspector: sidebar panels shouldn't be added as subviews unless visible
https://bugs.webkit.org/show_bug.cgi?id=196888
<rdar://problem/49870659>

Reviewed by Timothy Hatcher.

* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.insertSidebarPanel):
(WI.Sidebar.prototype.removeSidebarPanel):
(WI.Sidebar.prototype.set selectedSidebarPanel):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244268 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Elements: event listener change events should only be fired for the...
drousso@apple.com [Mon, 15 Apr 2019 17:26:39 +0000 (17:26 +0000)]
Web Inspector: Elements: event listener change events should only be fired for the selected node and it's ancestors
https://bugs.webkit.org/show_bug.cgi?id=196887
<rdar://problem/49870627>

Reviewed by Timothy Hatcher.

Source/WebCore:

Test: inspector/dom/event-listener-add-remove.html
      inspector/dom/event-listener-inspected-node.html

* inspector/agents/InspectorDOMAgent.h:
* inspector/agents/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::setInspectedNode):
(WebCore::InspectorDOMAgent::didAddEventListener):
(WebCore::InspectorDOMAgent::willRemoveEventListener):

Source/WebInspectorUI:

* UserInterface/Models/DOMNode.js:
(WI.DOMNode.prototype.getEventListeners):

LayoutTests:

* inspector/dom/event-listener-inspected-node.html: Added.
* inspector/dom/event-listener-inspected-node-expected.txt: Added.

* inspector/dom/event-listener-add-remove.html:
* inspector/dom/event-listener-add-remove-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244267 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: replace all uses of `this` with `WI` in Main.js/Test.js
drousso@apple.com [Mon, 15 Apr 2019 17:24:54 +0000 (17:24 +0000)]
Web Inspector: replace all uses of `this` with `WI` in Main.js/Test.js
https://bugs.webkit.org/show_bug.cgi?id=196795
<rdar://problem/49796618>

Reviewed by Timothy Hatcher.

* UserInterface/Base/Main.js:
* UserInterface/Test/Test.js:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244266 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: REGRESSION: Heap: snapshots taken manually don't appear in the list
drousso@apple.com [Mon, 15 Apr 2019 17:23:26 +0000 (17:23 +0000)]
Web Inspector: REGRESSION: Heap: snapshots taken manually don't appear in the list
https://bugs.webkit.org/show_bug.cgi?id=196900
<rdar://problem/49880278>

Reviewed by Timothy Hatcher.

* UserInterface/Views/HeapAllocationsTimelineView.js:
(WI.HeapAllocationsTimelineView):
(WI.HeapAllocationsTimelineView.prototype.layout):
(WI.HeapAllocationsTimelineView.prototype._importButtonNavigationItemClicked):
(WI.HeapAllocationsTimelineView.prototype._takeHeapSnapshotClicked):
Drive-by: only show heap snapshots for the selected range.
* UserInterface/Views/TimelineView.js:
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineViewNeedsEntireSelectedRange): Added.
Drive-by: taking (or importing) a heap snapshot should select the entire range so that the
new record will appear in the list of heap snapshots.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244265 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first...
drousso@apple.com [Mon, 15 Apr 2019 17:22:11 +0000 (17:22 +0000)]
Web Inspector: REGRESSION (r244157): Timelines: ruler size appears wrong on first layout
https://bugs.webkit.org/show_bug.cgi?id=196901
<rdar://problem/49880539>

Reviewed by Timothy Hatcher.

* UserInterface/Views/View.js:
(WI.View.prototype._layoutSubtree):
Ensure that the forced override of the layout reason during the initial layout doesn't
affect subviews.

* UserInterface/Views/ConsoleDrawer.js:
(WI.ConsoleDrawer.prototype.sizeDidChange): Added.
(WI.ConsoleDrawer.prototype.layout): Deleted.
* UserInterface/Views/ConsolePrompt.js:
(WI.ConsolePrompt.prototype.sizeDidChange): Added.
(WI.ConsolePrompt.prototype.layout): Deleted.
* UserInterface/Views/DOMTreeContentView.js:
(WI.DOMTreeContentView.prototype.sizeDidChange): Added.
(WI.DOMTreeContentView.prototype.layout):
* UserInterface/Views/NavigationBar.js:
(WI.NavigationBar.prototype.sizeDidChange): Added.
(WI.NavigationBar.prototype.layout):
(WI.NavigationBar.prototype._updateContent): Added.
(WI.NavigationBar.prototype._updateContent.forceItemHidden): Added.
(WI.NavigationBar.prototype._updateContent.isDivider): Added.
(WI.NavigationBar.prototype._updateContent.calculateVisibleItemWidth): Added.
(WI.NavigationBar.prototype.layout.forceItemHidden): Deleted.
(WI.NavigationBar.prototype.layout.isDivider): Deleted.
(WI.NavigationBar.prototype.layout.calculateVisibleItemWidth): Deleted.
* UserInterface/Views/TabBrowser.js:
(WI.TabBrowser.prototype.sizeDidChange): Added.
(WI.TabBrowser.prototype.layout): Deleted.
Move logic in `layout` to `sizeDidChange` where applicable.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoinspector/canvas/recording-webgl-snapshots.html is a flaky failure
sroberts@apple.com [Mon, 15 Apr 2019 17:12:28 +0000 (17:12 +0000)]
inspector/canvas/recording-webgl-snapshots.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196875

Unreviewed test gardening.

* platform/mac/TestExpectations: Updating test expectations

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244263 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoinspector/timeline/timeline-recording.html is a flaky failure
sroberts@apple.com [Mon, 15 Apr 2019 17:06:07 +0000 (17:06 +0000)]
inspector/timeline/timeline-recording.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196915

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations: Updating test expectations for flaky failure

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244262 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoLayout tests
sroberts@apple.com [Mon, 15 Apr 2019 16:52:29 +0000 (16:52 +0000)]
Layout tests
inspector/heap/imported-snapshot.html
inspector/heap/snapshot.html are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=155607

Unreviewed test gardening

* platform/mac/TestExpectations: Updating expectations for flaky failures

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244261 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK][WPE] Add enable-media websetting
philn@webkit.org [Mon, 15 Apr 2019 14:41:17 +0000 (14:41 +0000)]
[GTK][WPE] Add enable-media websetting
https://bugs.webkit.org/show_bug.cgi?id=196863

Reviewed by Michael Catanzaro.

Source/WebKit:

It can be useful for headless browsers, for instance. The setting is enabled by default.

* Shared/WebPreferences.yaml:
* UIProcess/API/glib/WebKitSettings.cpp:
(webKitSettingsSetProperty):
(webKitSettingsGetProperty):
(webkit_settings_class_init):
(webkit_settings_get_enable_media):
(webkit_settings_set_enable_media):
* UIProcess/API/gtk/WebKitSettings.h:
* UIProcess/API/gtk/docs/webkit2gtk-4.0-sections.txt:
* UIProcess/API/wpe/WebKitSettings.h:
* UIProcess/API/wpe/docs/wpe-1.0-sections.txt:

Tools:

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitSettings.cpp:
(testWebKitSettings): Add test for the enable-media web-setting.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244260 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnsure iOS layout traits are used for media controls in modern compatibility mode
graouts@webkit.org [Mon, 15 Apr 2019 11:49:12 +0000 (11:49 +0000)]
Ensure iOS layout traits are used for media controls in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196812
<rdar://problem/47460637>

Unreviewed. Speculative fix for test regressions on open-source bots.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244259 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnsure iOS layout traits are used for media controls in modern compatibility mode
graouts@webkit.org [Mon, 15 Apr 2019 07:11:11 +0000 (07:11 +0000)]
Ensure iOS layout traits are used for media controls in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196812
<rdar://problem/47460637>

Reviewed by Dean Jackson.

Source/WebCore:

Test: media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html

Instead of looking at the UA string, check whether we support touches which is the correct indicator of whether we should
be using the iOS layout traits for media controls.

* Modules/modern-media-controls/media/media-controller.js:
(MediaController.prototype.get layoutTraits):

LayoutTests:

Add a new test that enforces modern compatibility mode and checks that the iOS controls are used.

* media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode-expected.txt: Added.
* media/modern-media-controls/media-controller/ios/media-controller-ios-layout-traits-modern-compatibility-mode.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244253 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAPI test WKAttachmentTests.AddAttachmentToConnectedImageElement is a flaky failure...
wenson_hsieh@apple.com [Mon, 15 Apr 2019 04:47:39 +0000 (04:47 +0000)]
API test WKAttachmentTests.AddAttachmentToConnectedImageElement is a flaky failure on Mac Release builds
https://bugs.webkit.org/show_bug.cgi?id=196905
<rdar://problem/49886096>

Reviewed by Tim Horton.

This flaky test exercises a race condition between when attachment insertion updates are dispatched from the web
process to the UI process, and when script is executed via -[WKWebView evaluateJavaScript:completionHandler:].
Since attachment insertion and removal updates from the web process to the UI process are scheduled on a zero-
delay timer, we end up with this sequence of events in the problematic (failure) case:

(a) [UI]    Run script #1 (which calls `HTMLAttachmentElement.getAttachmentIdentifier`)
    ...IPC from UI to web process...
(b) [Web]   Evaluate script #1 in the web process, which schedules attachment updates on a zero-delay timer
    ...IPC from web to UI process...
(c) [UI]    Invoke completion handler for script #1
(d) [UI]    Run script #2 (which calls `document.querySelector('img').attachmentIdentifier`)
    ...IPC from UI to web process...
(e) [Web]   Evaluate script #2 in the web process
(f) [Web]   Zero-delay timer fires and dispatches attachment updates to the UI process

...which means that script #2 will complete before the UI process has received the attachment updates sent in
step (f). However, in the case where the flaky test succeeds, the zero-delay timer in (f) fires *before* script
#2 is run in step (e).

This patch fixes the flaky test by waiting until attachment insertion updates are guaranteed to be received in
the UI process by waiting on a script message posted by the web process, after attachment updates are
dispatched.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244251 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WinCairo][WKL] Unreviewed test gardening.
Hironori.Fujii@sony.com [Mon, 15 Apr 2019 03:47:39 +0000 (03:47 +0000)]
[WinCairo][WKL] Unreviewed test gardening.

* platform/wincairo-wk1/TestExpectations: Skip animation tests.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244250 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoDisable Flaky API Test WKAttachmentTests.AddAttachmentToConnectedImageElement
aakash_jain@apple.com [Mon, 15 Apr 2019 00:02:05 +0000 (00:02 +0000)]
Disable Flaky API Test WKAttachmentTests.AddAttachmentToConnectedImageElement
https://bugs.webkit.org/show_bug.cgi?id=196909

Reviewed by Wenson Hsieh.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244249 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoLink prefetch not useful for top-level navigation
commit-queue@webkit.org [Sun, 14 Apr 2019 20:52:46 +0000 (20:52 +0000)]
Link prefetch not useful for top-level navigation
https://bugs.webkit.org/show_bug.cgi?id=195623

Patch by Rob Buis <rbuis@igalia.com> on 2019-04-14
Reviewed by Youenn Fablet.

Source/WebCore:

Cache cross-domain top-level prefetches in a dedicated cache and not in the
memory cache. Ignore prefetches for content extension checks.

Tests: http/tests/cache/link-prefetch-main-resource-iframe.html
       http/tests/cache/link-prefetch-main-resource.html

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::prefetchIfNeeded):
* loader/ResourceLoadInfo.cpp:
(WebCore::toResourceType):
* loader/ResourceLoadInfo.h:
* loader/ResourceLoader.cpp:
(WebCore::ResourceLoader::willSendRequestInternal):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):

Source/WebKit:

Cache cross-domain top-level prefetches in a dedicated cache. When a navigation
to the same url is done within a threshold (5 seconds), reuse the
prefetch cache entry, move it to the disk cache and navigate to
the url, meaning no extra network trip is needed. When not used within
the threshold period, the prefetch entry will be erased using a timer.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::lowMemoryHandler):
* NetworkProcess/NetworkProcess.h:
(WebKit::NetworkProcess::prefetchCache):
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
(WebKit::NetworkResourceLoader::didReceiveResponse):
(WebKit::NetworkResourceLoader::didReceiveBuffer):
(WebKit::NetworkResourceLoader::tryStoreAsCacheEntry):
(WebKit::NetworkResourceLoader::isCrossOriginPrefetch const):
* NetworkProcess/NetworkResourceLoader.h:
* NetworkProcess/cache/PrefetchCache.cpp: Added.
(WebKit::PrefetchCache::Entry::Entry):
(WebKit::PrefetchCache::PrefetchCache):
(WebKit::PrefetchCache::~PrefetchCache):
(WebKit::PrefetchCache::clear):
(WebKit::PrefetchCache::take):
(WebKit::PrefetchCache::store):
(WebKit::PrefetchCache::sessionPrefetchMap const):
(WebKit::PrefetchCache::clearExpiredEntries):
* NetworkProcess/cache/PrefetchCache.h: Added.
(WebKit::PrefetchCache::Entry::response const):
(WebKit::PrefetchCache::Entry::releaseBuffer):
* Shared/WebPreferences.yaml:
* Sources.txt:
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

Verify that prefetching a cross-domain top-level main resource
is cached in the prefetch cache and only loaded once, and that non
top-level prefetches keep the old behavior.

* http/tests/cache/link-prefetch-main-resource-expected.txt: Added.
* http/tests/cache/link-prefetch-main-resource-iframe-expected.txt: Added.
* http/tests/cache/link-prefetch-main-resource-iframe.html: Added.
* http/tests/cache/link-prefetch-main-resource.html: Added.
* http/tests/cache/resources/prefetched-main-resource-iframe.php: Added.
* http/tests/cache/resources/prefetched-main-resource.php: Added.
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244248 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoExtract UTI mapping and allow for additions
dino@apple.com [Sun, 14 Apr 2019 20:14:19 +0000 (20:14 +0000)]
Extract UTI mapping and allow for additions
https://bugs.webkit.org/show_bug.cgi?id=196822
<rdar://problem/49822339>

Reviewed by Darin Adler

Post landing feedback on minimizing String constructors.

* platform/network/mac/UTIUtilities.mm:
(WebCore::MIMETypeFromUTITree):
(WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244247 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Cocoa] WKCustomProtocolLoader should store a WeakPtr to its LegacyCustomProtocolMana...
aestes@apple.com [Sun, 14 Apr 2019 16:08:23 +0000 (16:08 +0000)]
[Cocoa] WKCustomProtocolLoader should store a WeakPtr to its LegacyCustomProtocolManagerProxy
https://bugs.webkit.org/show_bug.cgi?id=196893
<rdar://problem/48318983>

Reviewed by Anders Carlsson.

In addition to manually invalidating each WKCustomProtocolLoader's _customProtocolManagerProxy
pointer when the LegacyCustomProtocolManagerClient is invalidated, use a WeakPtr in case the
LegacyCustomProtocolManagerProxy is ever destroyed without first invalidating the client.
Also add null pointer checks to NSURLConnectionDelegate methods, which might be called after
the LegacyCustomProtocolManagerProxy has been destroyed.

* UIProcess/Cocoa/LegacyCustomProtocolManagerClient.mm:
(-[WKCustomProtocolLoader initWithLegacyCustomProtocolManagerProxy:customProtocolID:request:]):
(-[WKCustomProtocolLoader cancel]):
(-[WKCustomProtocolLoader connection:didFailWithError:]):
(-[WKCustomProtocolLoader connection:didReceiveResponse:]):
(-[WKCustomProtocolLoader connection:didReceiveData:]):
(-[WKCustomProtocolLoader connection:willSendRequest:redirectResponse:]):
(-[WKCustomProtocolLoader connectionDidFinishLoading:]):
(WebKit::LegacyCustomProtocolManagerClient::startLoading):
(WebKit::LegacyCustomProtocolManagerClient::invalidate):
(-[WKCustomProtocolLoader customProtocolManagerProxyDestroyed]): Deleted.
* UIProcess/Network/CustomProtocols/LegacyCustomProtocolManagerProxy.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244246 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
don.olmstead@sony.com [Sun, 14 Apr 2019 13:50:01 +0000 (13:50 +0000)]
[CMake] JavaScriptCore derived sources should only be referenced inside JavaScriptCore
https://bugs.webkit.org/show_bug.cgi?id=196742

Reviewed by Konstantin Tokarev.

.:

Migrate to using JavaScriptCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_JAVASCRIPTCORE_DIR
to support moving the JavaScriptCore derived sources outside of a shared directory.
This is in support of the target oriented design refactoring.

WinCairo is explicitly overriding the value as a canary for this setup.

Also move JavaScriptCore_SCRIPTS_DIR to WebKitFS to remove logic setting it in other projects.

* Source/PlatformWin.cmake:
* Source/cmake/OptionsAppleWin.cmake:
* Source/cmake/OptionsWinCairo.cmake:
* Source/cmake/WebKitFS.cmake:

Source/JavaScriptCore:

Migrate to using JavaScriptCore_DERIVED_SOURCES_DIR instead of DERIVED_SOURCES_JAVASCRIPTCORE_DIR
to support moving the JavaScriptCore derived sources outside of a shared directory.

Also use JavaScriptCore_DERIVED_SOURCES_DIR instead of DERIVED_SOUCES_DIR.

* CMakeLists.txt:

Source/WebCore:

Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.

* CMakeLists.txt:

Source/WebDriver:

Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.

* CMakeLists.txt:

Source/WebKit:

Don't set JavaScriptCore_SCRIPTS_DIR now that it is set within WebKitFS.

* CMakeLists.txt:
* PlatformWin.cmake:

Remove use of DERIVED_SOURCES_JAVASCRIPTCORE_DIR.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244245 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[bmalloc][Linux] Add support for memory status calculation
zandobersek@gmail.com [Sun, 14 Apr 2019 06:46:17 +0000 (06:46 +0000)]
[bmalloc][Linux] Add support for memory status calculation
https://bugs.webkit.org/show_bug.cgi?id=195938

Reviewed by Carlos Garcia Campos.

Memory status and under-memory-pressure capabilities in bmalloc can be
implemented on Linux by reading and parsing the statm file under the
proc filesystem.

We retrieve the resident set size from the statm file and multiply it
with the page size. This gives an upper-bound estimate of the memory
that's being consumed by the process.

The statm-based estimate seems preferable to other alternatives. One
such alternative would be reading and parsing more-detailed smaps file,
also exposed under the proc filesystem. This is at the moment being done
in WTF's MemoryFootprint implementation for Linux systems, but on Linux
ports this operation is being throttled to only execute once per second
because of the big computing expense required to read and parse out the
data. A future MemoryFootprint implementation could simply retrieve the
memory footprint value from bmalloc.

Another alternative is the Linux taskstats interface. This one would
require utilizing a netlink socket to retrieve the necessary statistics,
but it requires the process to have elevated privileges, which is a
blocker.

* bmalloc/AvailableMemory.cpp:
(bmalloc::LinuxMemory::singleton):
(bmalloc::LinuxMemory::footprint const):
(bmalloc::computeAvailableMemory):
(bmalloc::memoryStatus):
* bmalloc/AvailableMemory.h:
(bmalloc::isUnderMemoryPressure):
* bmalloc/bmalloc.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244244 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ Mac Debug ] TestWebKitAPI.ProcessSwap.ReuseSuspendedProcessForRegularNavigationReta...
cdumez@apple.com [Sun, 14 Apr 2019 04:22:34 +0000 (04:22 +0000)]
[ Mac Debug ] TestWebKitAPI.ProcessSwap.ReuseSuspendedProcessForRegularNavigationRetainBundlePage is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=196548
<rdar://problem/49567254>

Reviewed by Darin Adler.

Update ProvisionalPageProxy methods to more consistently ignore unexpected IPC from the process. Previously,
some of the methods were doing this, but some other like didFailProvisionalLoadForFrame() weren't and this
was leading to this flaky crash. The issue is that if we do the load in an existing process that was recently
doing, there may be leftover IPC for the same pageID and this IPC gets received by the ProvisionalPageProxy
even though it is from a previous navigation. For this reason, the ProvisionalPageProxy should ignore all
incoming IPC that is not for its associated navigation.

* UIProcess/ProvisionalPageProxy.cpp:
(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::didPerformServerRedirect):
(WebKit::ProvisionalPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::ProvisionalPageProxy::decidePolicyForNavigationActionSync):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244243 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, try to fix the internal build after r244239
wenson_hsieh@apple.com [Sat, 13 Apr 2019 19:44:47 +0000 (19:44 +0000)]
Unreviewed, try to fix the internal build after r244239

Force the bots to regenerate WKWebpagePreferences.h by touching the file. Adds a `Foundation/Foundation.h`
import that was missing anyways.

* UIProcess/API/Cocoa/WKWebpagePreferences.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244242 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoCodeCache should check that the UnlinkedCodeBlock was successfully created before...
tzagallo@apple.com [Sat, 13 Apr 2019 08:54:19 +0000 (08:54 +0000)]
CodeCache should check that the UnlinkedCodeBlock was successfully created before caching it
https://bugs.webkit.org/show_bug.cgi?id=196880

Reviewed by Yusuke Suzuki.

JSTests:

* stress/bytecode-cache-syntax-error.js: Added.
(catch):

Source/JavaScriptCore:

CodeCache should not tell the SourceProvider to cache the bytecode if it failed
to create the UnlinkedCodeBlock.

* runtime/CodeCache.cpp:
(JSC::CodeCache::getUnlinkedGlobalCodeBlock):

Tools:

Add a new function for bytecode cache tests that does not forceDiskCache
for the second run: runBytecodeCacheNoAssetion. This is necessary for the
test added in this patch, since the code is invalid and therefore won't be
cached. It should also be useful for tests that evaluate dynamically
generated code.

* Scripts/jsc-stress-test-helpers/bytecode-cache-test-helper.sh:
* Scripts/run-jsc-stress-tests:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244241 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoProvide a quirk to disable Pointer Events
graouts@webkit.org [Sat, 13 Apr 2019 08:00:44 +0000 (08:00 +0000)]
Provide a quirk to disable Pointer Events
https://bugs.webkit.org/show_bug.cgi?id=196877
<rdar://problem/49863470>

Reviewed by Dean Jackson.

Add a quirk to disable Pointer Events. We also opt a website that has compatibility issues with Pointer Events into this new quirk.

* dom/PointerEvent.idl:
* page/Quirks.cpp:
(WebCore::Quirks::shouldDisablePointerEventsQuirk const):
* page/Quirks.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::absoluteEventTrackingRegionsForFrame const):
* style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::resolveElement):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244240 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoEnable modern compatibility mode by default in WKWebView on some devices
wenson_hsieh@apple.com [Sat, 13 Apr 2019 03:54:10 +0000 (03:54 +0000)]
Enable modern compatibility mode by default in WKWebView on some devices
https://bugs.webkit.org/show_bug.cgi?id=196883
<rdar://problem/49864527>

Reviewed by Tim Horton.

Source/WebCore:

Add a new helper function to determine whether an app is pre-installed on iOS, for the purposes of ensuring
compatibility with existing Apple apps that are not affected by linked-on-or-after. This involves all apps with
a bundle ID that begins with "com.apple.".

* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::setApplicationBundleIdentifier):
(WebCore::applicationBundleStartsWith):
(WebCore::IOSApplication::isAppleApplication):

Source/WebKit:

Make some minor adjustments to new API.

* Shared/WebCompatibilityMode.h:

Rename WebCompatibilityMode::Default to WebCompatibilityMode::Recommended.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.h:

Now that the role of the UseModernCompatibilityModeByDefault debug preference is limited to bypassing linked-on-
or-after and app bundle compatibility hacks, we no longer make this default to true in iOSMac.

* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/Cocoa/WKNavigationDelegate.h:

Rename the withPreferences: label to just preferences:.

* UIProcess/API/Cocoa/WKWebViewConfiguration.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):
* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/ios/WebPageProxyIOS.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244239 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agor244079 logically broke shouldSpeculateInt52
sbarati@apple.com [Sat, 13 Apr 2019 03:04:18 +0000 (03:04 +0000)]
r244079 logically broke shouldSpeculateInt52
https://bugs.webkit.org/show_bug.cgi?id=196884

Reviewed by Yusuke Suzuki.

JSTests:

* microbenchmarks/int52-rand-function.js: Added.
(Math.random):

Source/JavaScriptCore:

In r244079, I changed shouldSpeculateInt52 to only return true
when the prediction is isAnyInt52Speculation(). However, it was
wrong to not to include SpecInt32 in this for two reasons:

1. We diligently write code that first checks if we should speculate Int32.
For example:
if (shouldSpeculateInt32()) ...
else if (shouldSpeculateInt52()) ...

It would be wrong not to fall back to Int52 if we're dealing with the union of
Int32 and Int52.

It would be a performance mistake to not include Int32 here because
data flow can easily tell us that we have variables that are the union
of Int32 and Int52 values. It's better to speculate Int52 than Double
in that situation.

2. We also write code where we ask if the inputs can be Int52, e.g, if
we know via profiling that an Add overflows, we may not emit an Int32 add.
However, we only emit such an add if both inputs can be Int52, and Int32
can trivially become Int52.

       This patch recovers the 0.5-1% regression r244079 caused on JetStream 2.

* bytecode/SpeculatedType.h:
(JSC::isInt32SpeculationForArithmetic):
(JSC::isInt32OrBooleanSpeculationForArithmetic):
(JSC::isInt32OrInt52Speculation):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::observeUseKindOnNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::shouldSpeculateInt52):
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGVariableAccessData.cpp:
(JSC::DFG::VariableAccessData::couldRepresentInt52Impl):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244238 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed. Build fix after r244233.
sbarati@apple.com [Sat, 13 Apr 2019 00:05:27 +0000 (00:05 +0000)]
Unreviewed. Build fix after r244233.

* assembler/CPU.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244237 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWebDriver: fix typo in EnterFullscreen.js in error-handling code
bburg@apple.com [Fri, 12 Apr 2019 23:45:20 +0000 (23:45 +0000)]
WebDriver: fix typo in EnterFullscreen.js in error-handling code
https://bugs.webkit.org/show_bug.cgi?id=196882
<rdar://problem/49867122>

Reviewed by Devin Rousso.

* UIProcess/Automation/atoms/EnterFullscreen.js:
(enterFullscreen):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244236 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
justin_fan@apple.com [Fri, 12 Apr 2019 23:40:53 +0000 (23:40 +0000)]
[Web GPU] Prevent narrowing conversions during Metal function calls on 32-bit platforms
https://bugs.webkit.org/show_bug.cgi?id=196793

Reviewed by Darin Adler.

On 32-bit platforms, NSUInteger is 32-bit, which limits certain Web GPU parameters.
Ensure that valid parameters are properly converted to NSUInteger for Metal calls, regardless of platform.

* platform/graphics/gpu/GPUBuffer.h:
(WebCore::GPUBuffer::byteLength const):
* platform/graphics/gpu/cocoa/GPUBindGroupMetal.mm:
(WebCore::tryGetResourceAsBufferBinding):
(WebCore::setBufferOnEncoder):
* platform/graphics/gpu/cocoa/GPUBufferMetal.mm:
(WebCore::GPUBuffer::validateBufferUsage):
(WebCore::GPUBuffer::tryCreate):
(WebCore::GPUBuffer::GPUBuffer):
(WebCore::GPUBuffer::setSubData):
* platform/graphics/gpu/cocoa/GPUCommandBufferMetal.mm:
(WebCore::GPUCommandBuffer::copyBufferToBuffer):
(WebCore::GPUCommandBuffer::copyBufferToTexture):
(WebCore::GPUCommandBuffer::copyTextureToBuffer):
* platform/graphics/gpu/cocoa/GPURenderPassEncoderMetal.mm:
(WebCore::GPURenderPassEncoder::drawIndexed):
* platform/graphics/gpu/cocoa/GPURenderPipelineMetal.mm:
(WebCore::trySetInputStateForPipelineDescriptor):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244235 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed fix for non-unified build.
ross.kirsling@sony.com [Fri, 12 Apr 2019 23:32:38 +0000 (23:32 +0000)]
Unreviewed fix for non-unified build.

Source/WebCore:

* dom/ScriptedAnimationController.h:
Add missing include from r244182.

Source/WebKit:

* Shared/PrintInfo.cpp:
Add missing include from r244202.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244234 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSometimes we need to user fewer CPUs in our threading calculations
sbarati@apple.com [Fri, 12 Apr 2019 23:26:43 +0000 (23:26 +0000)]
Sometimes we need to user fewer CPUs in our threading calculations
https://bugs.webkit.org/show_bug.cgi?id=196794
<rdar://problem/49389497>

Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* assembler/CPU.cpp: Added.
(JSC::isKernTCSMAvailable):
(JSC::enableKernTCSM):
(JSC::kernTCSMAwareNumberOfProcessorCores):
* assembler/CPU.h:
(JSC::isKernTCSMAvailable):
(JSC::enableKernTCSM):
(JSC::kernTCSMAwareNumberOfProcessorCores):
* heap/MachineStackMarker.h:
(JSC::MachineThreads::addCurrentThread):
* runtime/JSLock.cpp:
(JSC::JSLock::didAcquireLock):
* runtime/Options.cpp:
(JSC::computeNumberOfWorkerThreads):
(JSC::computePriorityDeltaOfWorkerThreads):
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::Worklist):

Source/WebKit:

* WebProcess/com.apple.WebProcess.sb.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244233 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WinCairo][WKL] Unreviewed test gardening.
ross.kirsling@sony.com [Fri, 12 Apr 2019 22:31:07 +0000 (22:31 +0000)]
[WinCairo][WKL] Unreviewed test gardening.

* platform/wincairo-wk1/TestExpectations:
r244182 causes all animations tests to time out.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244231 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWebDriver: evaluating javascript shouldn't fail if a dialog is shown
drousso@apple.com [Fri, 12 Apr 2019 20:46:55 +0000 (20:46 +0000)]
WebDriver: evaluating javascript shouldn't fail if a dialog is shown
https://bugs.webkit.org/show_bug.cgi?id=196847
<rdar://problem/49609396>

Reviewed by Brian Burg.

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::willShowJavaScriptDialog):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244230 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWebThread should run at a higher priority than user initiated
rniwa@webkit.org [Fri, 12 Apr 2019 20:37:38 +0000 (20:37 +0000)]
WebThread should run at a higher priority than user initiated
https://bugs.webkit.org/show_bug.cgi?id=196849
<rdar://problem/46851062>

Reviewed by Geoffrey Garen.

Use QOS_CLASS_USER_INTERACTIVE on WebThread with -10 relative priority so that WebThread
won't wait for other threads with priority 30-37 but does not content with the main thread.

Also removed the call to pthread_attr_setschedparam which disables QoS.

This improves the blocked time in StartWebThread from 2~3ms to 250μs while cold launching
iBooks to an opened book.

* platform/ios/wak/WebCoreThread.mm:
(StartWebThread): Replaced 200 * 4096 by 800 * KB for a better readability.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244229 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS WK2] Make -webkit-overflow-scrolling be a no-op
simon.fraser@apple.com [Fri, 12 Apr 2019 18:52:01 +0000 (18:52 +0000)]
[iOS WK2] Make -webkit-overflow-scrolling be a no-op
https://bugs.webkit.org/show_bug.cgi?id=196803
rdar://problem/49078202

Reviewed by Antti Koivisto.

Source/WebKit:

Flip LegacyOverflowScrollingTouchEnabled to false.

* Shared/WebPreferences.yaml:

LayoutTests:

Rebase some tests, if I thought that non-stacking context overflow was interesting.
For others, make overflow be stacking context by adding z-index.
Add <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] --> to those that
need it.

* compositing/overflow/scrolling-content-clip-to-viewport.html:
* compositing/rtl/rtl-scrolling-with-transformed-descendants.html:
* fast/scrolling/ios/change-scrollability-on-content-resize-nested.html:
* fast/scrolling/ios/overflow-scroll-inherited-expected.txt:
* fast/scrolling/ios/overflow-scrolling-ancestor-clip-size.html:
* fast/scrolling/ios/overflow-scrolling-ancestor-clip.html:
* fast/scrolling/ios/reconcile-layer-position-recursive-expected.txt:
* fast/scrolling/ios/reconcile-layer-position-recursive.html:
* fast/scrolling/ios/scrolling-content-clip-to-viewport.html:
* fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor.html:
* fast/scrolling/ios/touch-scroll-pointer-events-none.html:
* fast/scrolling/ios/touch-scroll-visibility-hidden.html:
* platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
* platform/ios/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor.html:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed.html:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor.html:
* scrollingcoordinator/scrolling-tree/coordinated-frame.html:
* scrollingcoordinator/scrolling-tree/resources/doc-with-sticky.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244228 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed test gardening for Windows.
ryanhaddad@apple.com [Fri, 12 Apr 2019 18:34:43 +0000 (18:34 +0000)]
Unreviewed test gardening for Windows.

* platform/win/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244227 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd CSS Shadow Parts as a feature under consideration
rniwa@webkit.org [Fri, 12 Apr 2019 18:26:44 +0000 (18:26 +0000)]
Add CSS Shadow Parts as a feature under consideration
https://bugs.webkit.org/show_bug.cgi?id=196835

Reviewed by Antti Koivisto.

This feature is under consideration.

* features.json:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244226 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
ross.kirsling@sony.com [Fri, 12 Apr 2019 18:18:25 +0000 (18:18 +0000)]
WebKit should build successfully even with -DENABLE_UNIFIED_BUILDS=OFF
https://bugs.webkit.org/show_bug.cgi?id=196845

Reviewed by Ryosuke Niwa.

Source/WebCore:

* html/canvas/CanvasRenderingContext2DBase.cpp:
(WebCore::CanvasRenderingContext2DBase::FontProxy::initialize):
(WebCore::CanvasRenderingContext2DBase::FontProxy::fontMetrics const):
(WebCore::CanvasRenderingContext2DBase::FontProxy::fontDescription const):
(WebCore::CanvasRenderingContext2DBase::FontProxy::width const):
(WebCore::CanvasRenderingContext2DBase::FontProxy::drawBidiText const):
(WebCore::CanvasRenderingContext2DBase::beginCompositeLayer):
(WebCore::CanvasRenderingContext2DBase::endCompositeLayer):
Remove inline specifier to address linking errors (regardless of CMake platform).
Doing this in a .cpp file interferes with symbol creation.

* Modules/mediastream/MediaStreamTrack.cpp:
* Modules/webvr/VREyeParameters.cpp:
* Modules/webvr/VRFrameData.cpp:
* Modules/webvr/VRPose.cpp:
* accessibility/AccessibilityList.cpp:
* accessibility/isolatedtree/AXIsolatedTree.cpp:
* accessibility/isolatedtree/AXIsolatedTreeNode.cpp:
* bindings/js/JSDOMConvertWebGL.cpp:
* bindings/js/JSHistoryCustom.cpp:
* bindings/js/JSIDBCursorWithValueCustom.cpp:
* bindings/js/JSPerformanceObserverCustom.cpp:
* bindings/js/WindowProxy.cpp:
* platform/ColorData.gperf:
* platform/mediastream/RealtimeMediaSourceSettings.cpp:
* platform/network/DNSResolveQueue.cpp:
* workers/service/ServiceWorkerClientQueryOptions.h:
* workers/service/ServiceWorkerContainer.cpp:
Add missing includes to address compiler errors on GTK.

Source/WebKit:

* NetworkProcess/Classifier/ResourceLoadStatisticsDatabaseStore.h:
* NetworkProcess/NetworkCORSPreflightChecker.cpp:
* NetworkProcess/NetworkDataTask.cpp:
* NetworkProcess/NetworkHTTPSUpgradeChecker.cpp:
* NetworkProcess/NetworkHTTPSUpgradeChecker.h: Include wtf/Forward.h for String and CompletionHandler fwd decls.
* NetworkProcess/NetworkProcess.cpp:
* NetworkProcess/NetworkResourceLoadMap.cpp:
* NetworkProcess/NetworkResourceLoadMap.h:
* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/PingLoad.h:
* Shared/WebCompiledContentRuleListData.cpp:
* Shared/gtk/WebEventFactory.cpp:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/Downloads/DownloadProxyMap.cpp:
* UIProcess/InspectorTargetProxy.cpp:
* UIProcess/PageClient.h:
* UIProcess/ProcessAssertion.cpp:
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageInspectorTargetAgent.h:
* UIProcess/geoclue/GeoclueGeolocationProvider.cpp:
* WebProcess/Cache/WebCacheStorageConnection.cpp:
(WebKit::WebCacheStorageConnection::updateQuotaBasedOnSpaceUsage):
* WebProcess/InjectedBundle/API/c/WKBundle.cpp:
(WKBundleSetDatabaseQuota):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
Add missing includes / forward declarations to address compiler errors on GTK / WinCairo.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244225 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch...
zalan@apple.com [Fri, 12 Apr 2019 18:14:21 +0000 (18:14 +0000)]
REGRESSION (r244098): [ Mac WK1 ] Layout Test fast/dynamic/paused-event-dispatch.html is Timing out
https://bugs.webkit.org/show_bug.cgi?id=196789
<rdar://problem/49855255>

Reviewed by Tim Horton.

Disable auto-sizing mode at the start of each test.

* testing/Internals.cpp:
(WebCore::Internals::resetToConsistentState):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244224 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUpdate AudioSession route sharing policy
eric.carlson@apple.com [Fri, 12 Apr 2019 18:04:56 +0000 (18:04 +0000)]
Update AudioSession route sharing policy
https://bugs.webkit.org/show_bug.cgi?id=196776
<rdar://problem/46501611>

Reviewed by Jer Noble.

Source/WebCore:

No new tests, updated an API test.

* platform/audio/AudioSession.cpp:
(WebCore::convertEnumerationToString):
* platform/audio/AudioSession.h:
(WTF::LogArgument<WebCore::RouteSharingPolicy>::toString):
(WTF::LogArgument<WebCore::AudioSession::CategoryType>::toString):
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::updateSessionState):
* platform/audio/ios/AudioSessionIOS.mm:
(WebCore::AudioSession::setCategory):
(WebCore::AudioSession::routeSharingPolicy const):
* platform/audio/mac/AudioSessionMac.cpp:
(WebCore::AudioSession::setCategory):

Source/WebKit:

* UIProcess/ios/forms/WKAirPlayRoutePicker.mm:
(-[WKAirPlayRoutePicker showFromView:routeSharingPolicy:routingContextUID:hasVideo:]):

Source/WTF:

* wtf/Platform.h: Define HAVE_ROUTE_SHARING_POLICY_LONG_FORM_VIDEO.

Tools:

* TestWebKitAPI/Tests/WebKitLegacy/ios/AudioSessionCategoryIOS.mm:
(TestWebKitAPI::routeSharingPolicyLongFormVideo):
(TestWebKitAPI::routeSharingPolicyLongFormAudio):
(TestWebKitAPI::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244223 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUse padding at end of ArrayBuffer
rmorisset@apple.com [Fri, 12 Apr 2019 18:02:20 +0000 (18:02 +0000)]
Use padding at end of ArrayBuffer
https://bugs.webkit.org/show_bug.cgi?id=196823

Reviewed by Filip Pizlo.

* runtime/ArrayBuffer.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWebsitePolicies doesn't copy its media source policy in WebsitePolicies::copy
wenson_hsieh@apple.com [Fri, 12 Apr 2019 17:59:05 +0000 (17:59 +0000)]
WebsitePolicies doesn't copy its media source policy in WebsitePolicies::copy
https://bugs.webkit.org/show_bug.cgi?id=196862

Reviewed by Darin Adler.

Add a missing bit of code to copy m_mediaSourcePolicy over when making a copy of WebsitePolicies. This doesn't
have any observable effect, since m_mediaSourcePolicy isn't currently exposed as SPI on WKWebpagePreferences.

* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244221 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS] Software keyboard is shown too frequently on some websites
wenson_hsieh@apple.com [Fri, 12 Apr 2019 17:30:00 +0000 (17:30 +0000)]
[iOS] Software keyboard is shown too frequently on some websites
https://bugs.webkit.org/show_bug.cgi?id=195856
<rdar://problem/49191395>

Reviewed by Darin Adler.

Source/WebCore/PAL:

Declare new GraphicsServices SPI.

* pal/spi/ios/GraphicsServicesSPI.h:

Source/WebKit:

On some websites, hidden editable elements are very frequently focused upon user interaction. Currently, this
causes the software keyboard to pop in and out unexpectedly; luckily, these same sites also apply
inputmode="none" to the hidden editable element, which ought to ensure that the software keyboard doesn't appear
when the element is focused.

However, since we disabled support for inputmode="none" in r240497, the software keyboard is no longer
suppressed, and becomes a big nuissance. r240497 removed support for this feature because, when using a hardware
keyboard, pressing the globe key no longer showed UI for switching languages. However, support for inputmode
none makes a much larger impact when a software keyboard is used (since the entire software keyboard animates in
and out), whereas a hardware keyboard only displays an input accessory view. For this reason, we can mitigate
this bug without reintroducing <rdar://problem/47406553> by re-enabling inputmode="none", but only when a
hardware keyboard is not attached.

* UIProcess/API/Cocoa/WKWebView.mm:
(hardwareKeyboardAvailabilityChangedCallback):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView shouldShowAutomaticKeyboardUI]):

Don't show the keyboard if inputmode is none and a hardware keyboard is not attached.

(-[WKContentView _hardwareKeyboardAvailabilityChanged]):

Reload input views if the inputmode is none to ensure that if a hardware keyboard is attached while editing an
element with inputmode="none", we'll show the input accessory view once again.

Tools:

Add support for attaching or detaching the hardware keyboard on iOS in layout tests.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::setHardwareKeyboardAttached):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::setHardwareKeyboardAttached):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/Configurations/WebKitTestRunnerApp.xcconfig:

Additionally link against GraphicsServices in WebKitTestRunner.

* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::TestController::platformResetStateToConsistentValues):
(WTR::UIScriptController::setHardwareKeyboardAttached):

WebKitLibraries:

Add a symbol for GSEventSetHardwareKeyboardAttached.

* WebKitPrivateFrameworkStubs/iOS/12/GraphicsServices.framework/GraphicsServices.tbd:

LayoutTests:

Fix a failing layout test, which (among other reasons) is currently failing because support for inputmode="none"
is disabled.

* fast/forms/ios/inputmode-none-expected.txt:
* fast/forms/ios/inputmode-none.html:
* resources/ui-helper.js:

Add a UIHelper method for attaching or detaching the hardware keyboard.

(window.UIHelper.setHardwareKeyboardAttached):
(window.UIHelper):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244220 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceH...
ryanhaddad@apple.com [Fri, 12 Apr 2019 17:12:37 +0000 (17:12 +0000)]
[macOS WK1] ASSERTION FAILED: formData in WebCore::ResourceRequest::doUpdateResourceHTTPBody()
https://bugs.webkit.org/show_bug.cgi?id=196864

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations: Skip test since it consistently crashes, update bug number.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244219 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoOpt some websites into the simulated mouse events dispatch quirk when in modern compa...
graouts@webkit.org [Fri, 12 Apr 2019 16:52:35 +0000 (16:52 +0000)]
Opt some websites into the simulated mouse events dispatch quirk when in modern compatibility mode
https://bugs.webkit.org/show_bug.cgi?id=196830
<rdar://problem/49124313>

Reviewed by Wenson Hsieh.

Source/WebCore:

We add a new policy to determine whether simulated mouse events dispatch are allowed and use it to determine whether the
simulated mouse events dispatch quirk can be used for a given website. We then check the domain name for the current page's
document to see if it matches some known websites that require this quirk.

We needed to add some calls into Quirks::shouldDispatchSimulateMouseEvents() where we used to only consult the RuntimeEnabledFeature
flag to ensure we correctly created touch regions for simulated mouse events.

* dom/EventNames.h:
(WebCore::EventNames::isTouchRelatedEventType const):
* dom/Node.cpp:
(WebCore::Node::moveNodeToNewDocument):
(WebCore::tryAddEventListener):
(WebCore::tryRemoveEventListener):
(WebCore::Node::defaultEventHandler):
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::simulatedMouseEventsDispatchPolicy const):
(WebCore::DocumentLoader::setSimulatedMouseEventsDispatchPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
* page/Quirks.cpp:
(WebCore::Quirks::shouldDispatchSimulatedMouseEvents const):
(WebCore::Quirks::shouldDispatchSimulateMouseEvents const): Deleted.
* page/Quirks.h:

Source/WebKit:

We add a new policy to determine whether simulated mouse events dispatch are allowed.

* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):
(WebKit::WebsitePoliciesData::applyToDocumentLoader):
* Shared/WebsitePoliciesData.h:
* Shared/WebsiteSimulatedMouseEventsDispatchPolicy.h: Added.
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::copy const):
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* WebKit.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244218 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websoc...
cdumez@apple.com [Fri, 12 Apr 2019 16:11:46 +0000 (16:11 +0000)]
[iOS Sim Debug] ASSERTION FAILED: m_downloads.isEmpty() Layout Test http/tests/websocket/tests/hybi/network-process-crash-error.html is a flaky crash
https://bugs.webkit.org/show_bug.cgi?id=196781
<rdar://problem/49789381>

Reviewed by Darin Adler.

When the network process gets terminated by the client, the NetworkProcessProxy object (and thus its DownloadProxyMap member) get
destroyed right away, before we get a call to didClose(IPC::Connection&). As a result, if there are ongoing downloads at the time
of the termination, we will hit the assertion above. To address the issue, update the NetworkProcessProxy destructor to invalidate
its DownloadProxyMap member, similator to what it does in didClose(IPC::Connection&).

* UIProcess/Downloads/DownloadProxyMap.cpp:
(WebKit::DownloadProxyMap::invalidate):
(WebKit::DownloadProxyMap::processDidClose): Deleted.
* UIProcess/Downloads/DownloadProxyMap.h:
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::~NetworkProcessProxy):
(WebKit::NetworkProcessProxy::didClose):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoImport WPT preload tests
commit-queue@webkit.org [Fri, 12 Apr 2019 15:54:11 +0000 (15:54 +0000)]
Import WPT preload tests
https://bugs.webkit.org/show_bug.cgi?id=196439

Patch by Rob Buis <rbuis@igalia.com> on 2019-04-12
Reviewed by Youenn Fablet.

* web-platform-tests/preload/avoid-delaying-onload-link-preload-expected.txt: Added.
* web-platform-tests/preload/avoid-delaying-onload-link-preload.html: Added.
* web-platform-tests/preload/delaying-onload-link-preload-after-discovery-expected.txt: Added.
* web-platform-tests/preload/delaying-onload-link-preload-after-discovery.html: Added.
* web-platform-tests/preload/dynamic-adding-preload-expected.txt: Added.
* web-platform-tests/preload/dynamic-adding-preload.html: Added.
* web-platform-tests/preload/preload-csp.sub-expected.txt: Added.
* web-platform-tests/preload/preload-csp.sub.html: Added.
* web-platform-tests/preload/preload-default-csp.sub-expected.txt: Added.
* web-platform-tests/preload/preload-default-csp.sub.html: Added.
* web-platform-tests/preload/resources/dummy.css: Added.
* web-platform-tests/preload/resources/dummy.css.sub.headers: Added.
* web-platform-tests/preload/resources/dummy.js: Added.
* web-platform-tests/preload/resources/dummy.js.sub.headers: Added.
* web-platform-tests/preload/resources/dummy.xml: Added.
* web-platform-tests/preload/resources/dummy.xml.sub.headers: Added.
* web-platform-tests/preload/resources/foo.vtt: Added.
* web-platform-tests/preload/resources/preload_helper.js: Added.
(verifyPreloadAndRTSupport):
(getAbsoluteURL):
(verifyNumberOfResourceTimingEntries):
(verifyLoadedAndNoDoubleDownload):
* web-platform-tests/preload/resources/sound_5.oga: Added.
* web-platform-tests/preload/resources/square.png: Added.
* web-platform-tests/preload/resources/white.mp4: Added.
* web-platform-tests/preload/single-download-late-used-preload-expected.txt: Added.
* web-platform-tests/preload/single-download-late-used-preload.html: Added.
* web-platform-tests/preload/single-download-preload-expected.txt: Added.
* web-platform-tests/preload/single-download-preload.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244216 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overf...
simon.fraser@apple.com [Fri, 12 Apr 2019 14:54:12 +0000 (14:54 +0000)]
[iOS WK2] Wrong scrolling behavior for nested absolute position elements inside overflow scroll
https://bugs.webkit.org/show_bug.cgi?id=196146

Reviewed by Antti Koivisto.

Source/WebCore:

computeCoordinatedPositioningForLayer() failed to handle nested positions elements
inside overflow scroll, because it only walked up to the first containing block of
a nested position:absolute. We need to walk all the way up the ancestor layer chain,
looking at containing block, scroller and composited ancestor relationships.

Make this code easier to understand by writing it in terms of "is foo scrolled by bar", rather than
trying to collapse all the logic into a single ancestor walk, which was really hard. This is a few
more ancestor traversals, but we now only run this code if there's composited scrolling
in the ancestor chain.

Tests: scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html
       scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html
       scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html
       scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::enclosingCompositedScrollingLayer):
(WebCore::isScrolledByOverflowScrollLayer):
(WebCore::isNonScrolledLayerInsideScrolledCompositedAncestor):
(WebCore::RenderLayerCompositor::layerContainingBlockCrossesCoordinatedScrollingBoundary):
(WebCore::collectStationaryLayerRelatedOverflowNodes):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):
(WebCore::collectRelatedCoordinatedScrollingNodes):
(WebCore::layerParentedAcrossCoordinatedScrollingBoundary): Deleted.

LayoutTests:

Dump the scrolling tree for various configurations of positioned, overflow and stacking context
elements.

* fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt: Progressed results.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt: Added.
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-absolute-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-relative-in-overflow.html: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-absolute-in-sc-overflow.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK][WPE] Fix pacman install-dependencies packages
commit-queue@webkit.org [Fri, 12 Apr 2019 13:29:42 +0000 (13:29 +0000)]
[GTK][WPE] Fix pacman install-dependencies packages
https://bugs.webkit.org/show_bug.cgi?id=196817

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-04-12
Reviewed by Žan Doberšek.

python3-setuptools is called python-setuptools
ruby-highline is only available on AUR
libv4l-devel is incorporated in v4l-utils

* gtk/install-dependencies:
* wpe/install-dependencies:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244214 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[css-flex][css-grid] Fix synthesized baseline
rego@igalia.com [Fri, 12 Apr 2019 12:04:20 +0000 (12:04 +0000)]
[css-flex][css-grid] Fix synthesized baseline
https://bugs.webkit.org/show_bug.cgi?id=196312

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

Imported some tests from WPT css-align test suite that are fixed with this patch.

* resources/import-expectations.json:
* web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001-expected.txt: Added.
* web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html: Added.
* web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001-expected.txt: Added.
* web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html: Added.
* web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001-expected.txt: Added.
* web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html: Added.
* web-platform-tests/css/css-align/baseline-rules/w3c-import.log: Added.

Source/WebCore:

When a flex or grid container has no baseline,
its baseline should be synthesized from the border edges.
The same happens for flex and grid items.

Right now we were using the content box in some cases
and even using the margin box in a particular scenario.
The patch fixes this.

At the same time this is also fixing the baseline for
inline flex/grid containers to make it interoperable with Firefox.
Inline blocks have a special behavior per legacy reasons,
which applies to inline flex/grid containers when they have no items;
otherwise the items should be used to compute its baseline.
See more at: https://github.com/w3c/csswg-drafts/issues/3416

Note that we need to keep current behavior for buttons,
as the flexbox spec doesn't apply to them.

Tests: css3/flexbox/flexbox-baseline-margins.html
       fast/css-grid-layout/grid-baseline-margins-1.html
       fast/css-grid-layout/grid-baseline-margins-2.html
       imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-flexbox-001.html
       imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-grid-001.html
       imported/w3c/web-platform-tests/css/css-align/baseline-rules/synthesized-baseline-inline-block-001.html

* rendering/RenderButton.cpp:
(WebCore::synthesizedBaselineFromContentBox):
(WebCore::RenderButton::baselinePosition const):
* rendering/RenderButton.h:
* rendering/RenderFlexibleBox.cpp:
(WebCore::synthesizedBaselineFromBorderBox):
(WebCore::RenderFlexibleBox::baselinePosition const):
(WebCore::RenderFlexibleBox::firstLineBaseline const):
(WebCore::RenderFlexibleBox::inlineBlockBaseline const):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::baselinePosition const):
(WebCore::RenderGrid::inlineBlockBaseline const):

LayoutTests:

Some of the tests were not checking the right behavior changed them to test the expected one.
We need new rebaselines for some tests.

* TestExpectations:
* css3/flexbox/flexbox-baseline-margins.html:
* fast/css-grid-layout/grid-baseline-expected.html:
* fast/css-grid-layout/grid-baseline-margins-1-expected.html: Renamed from LayoutTests/fast/css-grid-layout/grid-baseline-margins-expected.html.
* fast/css-grid-layout/grid-baseline-margins-1.html: Renamed from LayoutTests/fast/css-grid-layout/grid-baseline-margins.html.
* fast/css-grid-layout/grid-baseline-margins-2-expected.html: Added.
* fast/css-grid-layout/grid-baseline-margins-2.html: Added.
* fast/css-grid-layout/grid-baseline.html: This test is modified and split in two parts as it doesn't fit in the viewport.
* platform/gtk/css3/flexbox/flexbox-baseline-margins-expected.png:
* platform/gtk/css3/flexbox/flexbox-baseline-margins-expected.txt:
* platform/ios/css3/flexbox/flexbox-baseline-margins-expected.png: Added.
* platform/ios/css3/flexbox/flexbox-baseline-margins-expected.txt:
* platform/mac/css3/flexbox/flexbox-baseline-margins-expected.png: Added.
* platform/mac/css3/flexbox/flexbox-baseline-margins-expected.txt:
* platform/win/css3/flexbox/flexbox-baseline-margins-expected.png: Added.
* platform/win/css3/flexbox/flexbox-baseline-margins-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK] REGRESSION(r243860): Many tests failing
carlosgc@webkit.org [Fri, 12 Apr 2019 08:46:57 +0000 (08:46 +0000)]
[GTK] REGRESSION(r243860): Many tests failing
https://bugs.webkit.org/show_bug.cgi?id=196791

Reviewed by Joanmarie Diggs.

Source/WebKit:

Calling updateAccessibilityTree() on document loaded was causing a re-layout because of the backing store update
that confused all those tests. We shouldn't need to update the accessibility tree on document load, it should
happen automatically when root object is attached/detached. This patch emits children-changed::add when the root
object wrapper is attached and children-changed::remove when the root object is detached. That way ATs are
notified of the changes in the accessibility tree.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidFinishDocumentLoad): Remove call to WebPage::updateAccessibilityTree().
* WebProcess/WebPage/WebPage.h: Remove updateAccessibilityTree().
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.cpp:
(coreRootObjectWrapperDetachedCallback): Emit children-changed::remove.
(rootWebAreaWrapper): Helper to get the root WebArea wrapper.
(accessibilityRootObjectWrapper): Set the parent here when root object is created and emit children-changed::add.
(webkitWebPageAccessibilityObjectRefChild): Dot no set the parent here, it's now set when the root object is created.
* WebProcess/WebPage/atk/WebKitWebPageAccessibilityObject.h: Remove webkitWebPageAccessibilityObjectRefresh().
* WebProcess/WebPage/gtk/WebPageGtk.cpp:

Tools:

Rework the accessibility unit test to use DBus for the communication with the server. This way we can load
multiple documents and check that accessibility hierarchy is updated after a navigation.

* TestWebKitAPI/Tests/WebKitGtk/AccessibilityTestServer.cpp:
(loadChangedCallback):
* TestWebKitAPI/Tests/WebKitGtk/TestWebKitAccessibility.cpp:
(AccessibilityTest::AccessibilityTest):
(AccessibilityTest::~AccessibilityTest):
(AccessibilityTest::loadHTMLAndWaitUntilFinished):
(AccessibilityTest::findTestServerApplication):
(AccessibilityTest::findDocumentWeb):
(AccessibilityTest::findRootObject):
(AccessibilityTest::waitUntilChildrenRemoved):
(AccessibilityTest::ensureProxy):
(testAtspiBasicHierarchy):
(beforeAll):
(afterAll):

LayoutTests:

Remove expectations for tests that pass now.

* platform/gtk/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[JSC] op_has_indexed_property should not assume subscript part is Uint32
ysuzuki@apple.com [Fri, 12 Apr 2019 06:35:17 +0000 (06:35 +0000)]
[JSC] op_has_indexed_property should not assume subscript part is Uint32
https://bugs.webkit.org/show_bug.cgi?id=196850

Reviewed by Saam Barati.

JSTests:

* stress/has-indexed-property-should-accept-non-int32.js: Added.
(foo):

Source/JavaScriptCore:

op_has_indexed_property assumed that subscript part is always Uint32. However, this is just a load from non-constant RegisterID,
DFG can store it in double format and can perform OSR exit. op_has_indexed_property should not assume that.
In this patch, instead, we check it with isAnyInt and get uint32_t from AnyInt.

* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_has_indexed_property):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_has_indexed_property):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244211 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoFix flaky LayoutTests/fast/events/autoscroll-when-input-is-offscreen.html
megan_gardner@apple.com [Fri, 12 Apr 2019 06:02:50 +0000 (06:02 +0000)]
Fix flaky LayoutTests/fast/events/autoscroll-when-input-is-offscreen.html
https://bugs.webkit.org/show_bug.cgi?id=196840

Reviewed by Tim Horton.

Use more stable test infrastructure to conduct input tests.

* fast/events/autoscroll-when-input-is-offscreen.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244210 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAvoid doing positioned scrolling tree node work for layers not inside overflow:scroll
simon.fraser@apple.com [Fri, 12 Apr 2019 05:28:50 +0000 (05:28 +0000)]
Avoid doing positioned scrolling tree node work for layers not inside overflow:scroll
https://bugs.webkit.org/show_bug.cgi?id=196848

Reviewed by Zalan Bujtas.

Maintain a bit on RenderLayer which says if a layer has a composited scrolling ancestor
in the layer tree. We only need to do work related to making positioned scrolling tree nodes
for layers which are layer tree descendants of overflow:scroll.

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::RenderLayer):
(WebCore::RenderLayer::updateLayerPositions):
(WebCore::outputPaintOrderTreeLegend):
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason const):
(WebCore::RenderLayerCompositor::isViewportConstrainedFixedOrStickyLayer const):
(WebCore::RenderLayerCompositor::fixedLayerIntersectsViewport const):
(WebCore::RenderLayerCompositor::computeCoordinatedPositioningForLayer const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244209 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoTry to fix Windows build.
zalan@apple.com [Fri, 12 Apr 2019 01:55:24 +0000 (01:55 +0000)]
Try to fix Windows build.

* page/PrintContext.cpp:
(WebCore::PrintContext::computedPageMargin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244208 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ews-build] Handle bug titles with unicode characters
aakash_jain@apple.com [Fri, 12 Apr 2019 01:52:45 +0000 (01:52 +0000)]
[ews-build] Handle bug titles with unicode characters
https://bugs.webkit.org/show_bug.cgi?id=196802

Reviewed by Dewei Zhu.

* BuildSlaveSupport/ews-build/steps.py:
(ValidatePatch._is_bug_closed):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244207 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRemove invalid assertion in operationInstanceOfCustom
sbarati@apple.com [Fri, 12 Apr 2019 01:04:32 +0000 (01:04 +0000)]
Remove invalid assertion in operationInstanceOfCustom
https://bugs.webkit.org/show_bug.cgi?id=196842
<rdar://problem/49725493>

Reviewed by Michael Saboff.

JSTests:

* stress/operationInstanceOfCustom-bad-assertion.js: Added.

Source/JavaScriptCore:

In the generated JIT code, we go to the slow path when the incoming function
isn't the Node's CodeOrigin's functionProtoHasInstanceSymbolFunction. However,
in the JIT operation, we were asserting against exec->lexicalGlobalObject()'s
functionProtoHasInstanceSymbolFunction. That assertion might be wrong when
inlining across global objects as exec->lexicalGlobalObject() uses the machine
frame for procuring the global object. There is no harm when this assertion fails
as we just execute the slow path. This patch removes the assertion. (However, this
does shed light on the deficiency in our exec->lexicalGlobalObject() function with
respect to inlining. However, this isn't new -- we've known about this for a while.)

* jit/JITOperations.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244206 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUpdate 'Save Image' to more clear instructions
megan_gardner@apple.com [Fri, 12 Apr 2019 00:58:50 +0000 (00:58 +0000)]
Update 'Save Image' to more clear instructions
https://bugs.webkit.org/show_bug.cgi?id=196833
<rdar://problem/47446845>

Reviewed by Wenson Hsieh.

Source/WebCore:

Not testable, UI change only.

* en.lproj/Localizable.strings:

Source/WebKit:

Just updating to a new string.

* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction _elementActionWithType:customTitle:assistant:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244205 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoImprove the Inline Cache Stats code
msaboff@apple.com [Fri, 12 Apr 2019 00:53:12 +0000 (00:53 +0000)]
Improve the Inline Cache Stats code
https://bugs.webkit.org/show_bug.cgi?id=196836

Reviewed by Saam Barati.

Source/JavaScriptCore:

Needed to handle the case where the Identifier could be null, for example with InstanceOfAddAccessCase
and InstanceOfReplaceWithJump.

Added the ability to log the location of a GetBy and PutBy property as either on self or up the
protocol chain.

* jit/ICStats.cpp:
(JSC::ICEvent::operator< const):
(JSC::ICEvent::dump const):
* jit/ICStats.h:
(JSC::ICEvent::ICEvent):
(JSC::ICEvent::hash const):
* jit/JITOperations.cpp:
* jit/Repatch.cpp:
(JSC::tryCacheGetByID):
(JSC::tryCachePutByID):
(JSC::tryCacheInByID):

Tools:

Added a new script to consolidate and arrange the output of --useICStats option.

This script merges the output from every group into one large table and sorts it from most common to
least common.  It also counts the slow path GetById and PutById variants and then calculates the
percentage of gets or puts for each unique base,property pair compared to all the gets and puts.
Put together, this is useful to see what property accesses are not getting cached.

* Scripts/ic-stats.py: Added.
(ICStats):
(ICStats.__init__):
(ICStats.parse):
(ICStats.dumpStats):
(usage):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244204 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnable to run system Safari with trunk WebKit
cdumez@apple.com [Thu, 11 Apr 2019 23:43:10 +0000 (23:43 +0000)]
Unable to run system Safari with trunk WebKit
https://bugs.webkit.org/show_bug.cgi?id=196777
<rdar://problem/49784574>

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
Add a linkedOnAfter check so that throwing exceptions when related web views use a different
data store only happens for apps rebuilt using recent SDK.

* UIProcess/Cocoa/VersionChecks.h:
* UIProcess/Cocoa/VersionChecks.mm:
(WebKit::linkedOnOrAfter):
- By default, linkedOnOrAfter assumed Safari / MobileSafari is always linked-on-after. To satisfy my
  use cases, I introduced a new AssumeSafariIsAlwaysLinkedOnAfter parameter so that this behavior can
  be controlled by the caller.
- In the header, DYLD_IOS_VERSION_* / DYLD_MACOS_VERSION_* constants are 0 when building with the
  non-internal SDK. As a result, the check instead linkedOnOrAfter() would cause us to always return
  true, which was wrong. I therefore updated the check inside linkedOnOrAfter() to special-case the
  0 value for sdkVersion.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244203 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd @page margin support
zalan@apple.com [Thu, 11 Apr 2019 23:33:41 +0000 (23:33 +0000)]
Add @page margin support
https://bugs.webkit.org/show_bug.cgi?id=196680
<rdar://problem/45217707>

Reviewed by Tim Horton.

Source/WebCore:

This patch adds support for @page margin. This feature is currently behind a runtime flag and is off by default.
We resolve the @page margin values in the WebProcess (currently no pseudo class is supported) and transfer them to the UIProcess through computedPagesCallback.
UIProcess is responsible for applying these new values on the printer. We also re-compute the available width/height for the current printing context
in the WebProcess if needed (see PrintInfo for current printer margins).

Tests: printing/page-with-10mm-left-margin.html
       printing/page-with-zero-margin.html

* page/PrintContext.cpp:
(WebCore::PrintContext::computedPageMargin):
(WebCore::PrintContext::computedPageSize):
* page/PrintContext.h:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::pageAtRuleSupportEnabled const):
(WebCore::RuntimeEnabledFeatures::setPageAtRuleSupportEnabled):

Source/WebKit:

* Shared/PrintInfo.cpp:
(WebKit::PrintInfo::encode const):
(WebKit::PrintInfo::decode):
* Shared/PrintInfo.h:
* Shared/WebPreferences.yaml:
* Shared/gtk/PrintInfoGtk.cpp:
(WebKit::PrintInfo::PrintInfo):
* Shared/mac/PrintInfoMac.mm:
(WebKit::PrintInfo::PrintInfo):
* UIProcess/API/C/WKPage.cpp:
(WKPageComputePagesForPrinting):
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPageAtRuleSupportEnabled):
(WKPreferencesGetPageAtRuleSupportEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* UIProcess/GenericCallback.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::computedPagesCallback):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WKPrintingView.mm:
(pageDidComputePageRects):
(-[WKPrintingView _askPageToComputePageRects]):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::beginPrinting):
(WebKit::WebPage::computePagesForPrinting):
(WebKit::WebPage::computePagesForPrintingImpl):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::computePagesForPrintingAndDrawToPDF):

LayoutTests:

* printing/page-with-10mm-left-margin-expected.pdf: Added.
* printing/page-with-10mm-left-margin.html: Added.
* printing/page-with-zero-margin-expected.pdf: Added.
* printing/page-with-zero-margin.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244202 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoExtract UTI mapping and allow for additions
dino@apple.com [Thu, 11 Apr 2019 23:13:44 +0000 (23:13 +0000)]
Extract UTI mapping and allow for additions
https://bugs.webkit.org/show_bug.cgi?id=196822
<rdar://problem/49822339>

Reviewed by Tim Horton.

Source/WebCore:

Add an ADDITIONAL_SYSTEM_PREVIEW_TYPES macro to the list
of accepted MIME types. And add a new helper to map
MIME types to UTI types when the system was unable to
find an existing type.

* platform/MIMETypeRegistry.cpp:
(WebCore::MIMETypeRegistry::systemPreviewMIMETypes):
* platform/network/mac/UTIUtilities.mm:
(WebCore::UTIFromUnknownMIMEType):
(WebCore::UTIFromMIMETypeCachePolicy::createValueForKey):

Source/WebKit:

Use the new helper to map MIME type to UTI.

* UIProcess/Cocoa/SystemPreviewControllerCocoa.mm:
(-[_WKPreviewControllerDataSource previewController:previewItemAtIndex:]):
* UIProcess/ios/WKSystemPreviewView.mm:
(getUTIForSystemPreviewMIMEType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244201 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS] Moving backwards by word granularity does not work if the previous line was...
rniwa@webkit.org [Thu, 11 Apr 2019 22:57:02 +0000 (22:57 +0000)]
[iOS] Moving backwards by word granularity does not work if the previous line was inside another block element
https://bugs.webkit.org/show_bug.cgi?id=196670

Reviewed by Wenson Hsieh.

Source/WebCore:

The bug was ultimately caused by two reasons:
 1. On iOS, previousWordPositionBoundary would identify a blank line as a word boundary.
 2. SimplifiedBackwardsTextIterator generates a new line character (\n) between two block elements.

When moving backwards by word granularity, therefore, previousBoundary would encounter a new line created by (2)
and then previousWordPositionBoundary would identify it as a word boundary.

Fixed the bug (2) by adding the same check as TextIterator::exitNode has to avoid generating an extra new line
character following an exiting new line character. Also added internals.rangeAsTextUsingBackwardsTextIterator
to make SimplifiedBackwardsTextIterator directly testable in layout tests.

This fix unveiled an unrelated bug when moving backwards with sentence granularity at the beginning of a line.
In this case, WebKit was previously feeding ICU with the previous line's content followed by two new lines,
which constituted a new sentence. However after the fix, ICU no longer detects a new sentence after the end
of the prevous line. This patch, therefore, introduces a new optional argument to previousBoundary which forces
the succeeding paragraph's content (i.e. the content of the line from which we're moving backwards with sentence
granularity) to be fed to ICU. This fixes the bug that we were previously not being able to move backwards
with sentence granularity at the beginning of a line as indicated by the new tests.

Tests: editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html
       editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html
       editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html
       editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html
       editing/text-iterator/backwards-text-iterator-basic.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::previousBoundary): Fixed the bug that moving backwards with sentence granularity at
the beginning of a line does not work like we did in VisibleUnits. See the description below. It's tested by
an existing layout test accessibility/mac/text-marker-sentence-nav.html, which would fail without this fix.
(WebCore::AXObjectCache::startCharacterOffsetOfSentence):
* accessibility/AXObjectCache.h:
(WebCore::CharacterOffset::isEqual const):
* editing/TextIterator.cpp:
(WebCore::SimplifiedBackwardsTextIterator::handleNonTextNode): Fixed the bug that we were generating two line
lines between block elements. This fixes the bug that moving backwards with word granularity at the beginning
of a line fails on iOS.
(WebCore::plainTextUsingBackwardsTextIteratorForTesting): Added.
* editing/TextIterator.h:
* editing/VisibleUnits.cpp:
(WebCore::previousBoundary): Added the code to extract the succeeding paragraph's content as context for ICU.
This fixes the bug that moving backwards with sentence granularity at the beginning of a line fails.
Limit the length of backwards iteration at the current position to avoid traversing backwards beyond
the current position, and fixed a bug that an early return for the text node was not taking the suffix length
into account when deciding whether next position resides in the starting container node or not.
(WebCore::startSentenceBoundary):
(WebCore::startOfSentence):
* testing/Internals.cpp:
(WebCore::Internals::rangeAsTextUsingBackwardsTextIterator): Added.
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

Added a test for moving and extending backwards from the beginning of a line with word & sentence granularities,
and a basic set of tests forSimplifiedBackwardsTextIterator.

* editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity-expected.txt: Added.
* editing/selection/extend-selection-backward-at-beginning-of-line-by-sentence-granularity.html: Added.
* editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity-expected.txt: Added.
* editing/selection/extend-selection-backward-at-beginning-of-line-by-word-granularity.html: Added.
* editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity-expected.txt: Added.
* editing/selection/move-selection-backward-at-beginning-of-line-by-sentence-granularity.html: Added.
* editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity-expected.txt: Added.
* editing/selection/move-selection-backward-at-beginning-of-line-by-word-granularity.html: Added.
* editing/text-iterator/backwards-text-iterator-basic-expected.txt: Added.
* editing/text-iterator/backwards-text-iterator-basic.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244200 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: REGRESSION(r244195): Timelines: unable to take heap snapshot
drousso@apple.com [Thu, 11 Apr 2019 22:56:40 +0000 (22:56 +0000)]
Web Inspector: REGRESSION(r244195): Timelines: unable to take heap snapshot
https://bugs.webkit.org/show_bug.cgi?id=196832
<rdar://problem/49828862>

Reviewed by Simon Fraser.

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._addRecord):
Heap snapshots can be taken outside of a timeline recording, so remove the early return (and
assertion) that checks for an active recording before adding the heap snapshot record.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244199 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r244182): RemoteLayerTreeDrawingArea::flushLayers() should not be reentrant
commit-queue@webkit.org [Thu, 11 Apr 2019 22:51:43 +0000 (22:51 +0000)]
REGRESSION (r244182): RemoteLayerTreeDrawingArea::flushLayers() should not be reentrant
https://bugs.webkit.org/show_bug.cgi?id=196825

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-11
Reviewed by Simon Fraser.

Ensure the layer transactions IDs are sequential. So bail out of
RemoteLayerTreeDrawingArea::flushLayers() if reentrancy is detected.

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244198 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAllow the MediaSource API to be enabled via website policy
wenson_hsieh@apple.com [Thu, 11 Apr 2019 22:15:01 +0000 (22:15 +0000)]
Allow the MediaSource API to be enabled via website policy
https://bugs.webkit.org/show_bug.cgi?id=196429
<rdar://problem/48774333>

Reviewed by Tim Horton.

Source/WebCore:

Add support in DocumentLoader for adjusting page settings using its per-site policies. See WebKit ChangeLog for
more detail (in particular, the implementation of applyToDocumentLoader).

Test: fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::applyPoliciesToSettings const):
(WebCore::DocumentLoader::attachToFrame):
* loader/DocumentLoader.h:

Add an enum class for MediaSource policies; while we're at it, make all of these enum values 8 bits wide.

(WebCore::DocumentLoader::mediaSourcePolicy const):
(WebCore::DocumentLoader::setMediaSourcePolicy):

Source/WebKit:

Adds support for using WebsitePolicies to determine whether to enable the MediaSource API.

* Shared/WebPreferences.yaml:

Disengage the mediaSourceEnabled internal preference from the corresponding WebCore setting; to ensure that
setting the preference to `true` still results in enabling the MediaSource API, we instead make it such that
turning on mediaSourceEnabled causes WebsitePolicies to set its WebsiteMediaSourcePolicy to Enable.

In the future, we should deprecate and remove this preference, in favor of simply setting preferred
compatibility mode on WKWebpagePreferences.

* Shared/WebPreferences.yaml:
* Shared/WebsiteMediaSourcePolicy.h: Copied from Source/WebKit/Shared/WebsitePoliciesData.h.
* Shared/WebsitePoliciesData.cpp:
(WebKit::WebsitePoliciesData::encode const):
(WebKit::WebsitePoliciesData::decode):

Add plumbing for m_mediaSourcePolicy in the set of website policies.

(WebKit::WebsitePoliciesData::applyToDocumentLoader):

Update the document loader with the given media source policy. There are two possibilities when applying the set
of policies to the document loader; either the document loader is already attached to a Frame, or the document
loader is yet to be attached to a Frame.

In the first case, we update Frame's settings on the spot, by calling the new applyPoliciesToSettings helper
method. In the second scenario, we stash the policy state on DocumentLoader; when the DocumentLoader is attached
to a Frame, we'll then update the Frame's settings using DocumentLoader's policy.

* Shared/WebsitePoliciesData.h:
* UIProcess/API/APIWebsitePolicies.cpp:
(API::WebsitePolicies::data):
* UIProcess/API/APIWebsitePolicies.h:
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::decidePolicyForNavigationAction):

Move code that adjusts website policies after deciding policies for the navigation action from NavigationClient
::decidePolicyForNavigationAction to the completion handler of the policy listener. This allows us to respect
default website policies on the web view configuration, even when using the C API to set the navigation client,
and also allows us to have a single call site for adjustPoliciesForCompatibilityMode. This also enables our
layout tests to opt into modern compatibility mode by default, when specifying modern compatibility mode on
webpage preferences.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::adjustPoliciesForCompatibilityMode):
* UIProcess/WebPageProxy.h:
* WebKit.xcodeproj/project.pbxproj:

LayoutTests:

Add an on-device layout test to ensure that enabling modern compability mode also enables MSE.

* TestExpectations:
* fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode-expected.txt: Added.
* fast/media/ios/ipad/enable-MediaSource-API-in-modern-compatibility-mode.html: Added.
* platform/ios-simulator/TestExpectations:
* platform/ios/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244197 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSupport RTCDataChannel blob binaryType
youenn@apple.com [Thu, 11 Apr 2019 21:51:10 +0000 (21:51 +0000)]
Support RTCDataChannel blob binaryType
https://bugs.webkit.org/show_bug.cgi?id=196821

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCDataChannel-send-expected.txt:

Source/WebCore:

Add support for receiving blobs.
Default value is still left to 'arraybuffer' which is not spec compliant.
Covered by rebased test.

* Modules/mediastream/RTCDataChannel.cpp:
(WebCore::RTCDataChannel::setBinaryType):
(WebCore::RTCDataChannel::didReceiveRawData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244196 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: Timelines: can't reliably stop/start a recording
drousso@apple.com [Thu, 11 Apr 2019 21:06:47 +0000 (21:06 +0000)]
Web Inspector: Timelines: can't reliably stop/start a recording
https://bugs.webkit.org/show_bug.cgi?id=196778
<rdar://problem/47606798>

Reviewed by Timothy Hatcher.

Source/JavaScriptCore:

* inspector/protocol/ScriptProfiler.json:
* inspector/protocol/Timeline.json:
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* inspector/protocol/CPUProfiler.json:
* inspector/protocol/Memory.json:
Send an end timestamp to match other instruments.

* inspector/JSGlobalObjectConsoleClient.cpp:
(Inspector::JSGlobalObjectConsoleClient::startConsoleProfile):
(Inspector::JSGlobalObjectConsoleClient::stopConsoleProfile):

* inspector/agents/InspectorScriptProfilerAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::trackingComplete):
(Inspector::InspectorScriptProfilerAgent::programmaticCaptureStarted): Deleted.
(Inspector::InspectorScriptProfilerAgent::programmaticCaptureStopped): Deleted.

Source/WebCore:

* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::startProgrammaticCapture):
(WebCore::InspectorTimelineAgent::stopProgrammaticCapture):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* inspector/agents/InspectorCPUProfilerAgent.cpp:
(WebCore::InspectorCPUProfilerAgent::stopTracking):
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::stopTracking):
Send an end timestamp to match other instruments.

Source/WebInspectorUI:

Rather than have a binary state of capturing/not-capturing, we should use a four state:
 1. inactive (when the backend has stopped capturing)
 2. starting (when the frontend requests capturing to start)
 3. active (when the backend has started capturing)
 4. stopping (when the frontend requests capturing to stop)

Capturing is considered "on" when not in an "inactive" state. Prevent the frontend from
starting/stopping capturing unless we're in a "stable" ("inactive" or "active") state, not a
"transition" ("starting" or "stopping") state.

One "side effect" of this change is that since the capturing is considered active until the
backend has stopped capturing, we will continue to process records in the frontend even if
the frontend has requested to stop capturing. <https://webkit.org/b/152904>

* UserInterface/Controllers/TimelineManager.js:
(WI.TimelineManager):
(WI.TimelineManager.prototype.get capturingState): Added.
(WI.TimelineManager.prototype.reset):
(WI.TimelineManager.prototype.get activeRecording):
(WI.TimelineManager.prototype.set autoCaptureOnPageLoad):
(WI.TimelineManager.prototype.isCapturing):
(WI.TimelineManager.prototype.startCapturing):
(WI.TimelineManager.prototype.stopCapturing):
(WI.TimelineManager.prototype.processJSON):
(WI.TimelineManager.prototype.capturingStarted):
(WI.TimelineManager.prototype.capturingStopped):
(WI.TimelineManager.prototype.autoCaptureStarted):
(WI.TimelineManager.prototype.eventRecorded):
(WI.TimelineManager.prototype.pageDOMContentLoadedEventFired):
(WI.TimelineManager.prototype.pageLoadEventFired):
(WI.TimelineManager.prototype.cpuProfilerTrackingUpdated):
(WI.TimelineManager.prototype.cpuProfilerTrackingCompleted):
(WI.TimelineManager.prototype.memoryTrackingUpdated):
(WI.TimelineManager.prototype.memoryTrackingCompleted):
(WI.TimelineManager.prototype.heapTrackingStarted):
(WI.TimelineManager.prototype.heapTrackingCompleted):
(WI.TimelineManager.prototype.heapSnapshotAdded):
(WI.TimelineManager.prototype._updateCapturingState): Added.
(WI.TimelineManager.prototype._processRecord):
(WI.TimelineManager.prototype._processEvent):
(WI.TimelineManager.prototype._loadNewRecording):
(WI.TimelineManager.prototype._addRecord):
(WI.TimelineManager.prototype._attemptAutoCapturingForFrame):
(WI.TimelineManager.prototype._legacyAttemptStartAutoCapturingForFrame):
(WI.TimelineManager.prototype._stopAutoRecordingSoon):
(WI.TimelineManager.prototype._resetAutoRecordingDeadTimeTimeout):
(WI.TimelineManager.prototype._resourceWasAdded):
(WI.TimelineManager.prototype._garbageCollected):
(WI.TimelineManager.prototype._memoryPressure):
(WI.TimelineManager.prototype._handleTimelinesAutoStopSettingChanged):
(WI.TimelineManager.prototype.scriptProfilerTrackingCompleted):
(WI.TimelineManager.prototype._handleDOMNodeDidFireEvent):
(WI.TimelineManager.prototype._handleDOMNodeLowPowerChanged):
(WI.TimelineManager.prototype.unloadRecording): Deleted.
(WI.TimelineManager.prototype.programmaticCaptureStarted): Deleted.
(WI.TimelineManager.prototype.programmaticCaptureStopped): Deleted.
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStarted): Deleted.
(WI.TimelineManager.prototype.scriptProfilerProgrammaticCaptureStopped): Deleted.

* UserInterface/Protocol/ScriptProfilerObserver.js:
(WI.ScriptProfilerObserver.prototype.trackingComplete):
(WI.ScriptProfilerObserver.prototype.programmaticCaptureStarted):
(WI.ScriptProfilerObserver.prototype.programmaticCaptureStopped):
* UserInterface/Protocol/TimelineObserver.js:
(WI.TimelineObserver.prototype.programmaticCaptureStarted):
(WI.TimelineObserver.prototype.programmaticCaptureStopped):
It is possible to determine when programmatic capturing starts/stops in the frontend based
on the state when the backend causes the state to change, such as if the state is "inactive"
when the frontend is told that the backend has started capturing.

* UserInterface/Protocol/CPUProfilerObserver.js:
(WI.CPUProfilerObserver.prototype.trackingComplete):
* UserInterface/Protocol/MemoryObserver.js:
(WI.MemoryObserver.prototype.trackingComplete):
Send an end timestamp to match other instruments.

* UserInterface/Controllers/DebuggerManager.js:
(WI.DebuggerManager):
(WI.DebuggerManager.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DebuggerManager.prototype._timelineCapturingWillStart): Deleted.
(WI.DebuggerManager.prototype._timelineCapturingStopped): Deleted.
* UserInterface/Models/DefaultDashboard.js:
(WI.DefaultDashboard):
(WI.DefaultDashboard.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DefaultDashboard.prototype._capturingStopped): Deleted.
* UserInterface/Views/DebuggerSidebarPanel.js:
(WI.DebuggerSidebarPanel):
(WI.DebuggerSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
(WI.DebuggerSidebarPanel.prototype._timelineCapturingWillStart): Deleted.
(WI.DebuggerSidebarPanel.prototype._timelineCapturingStopped): Deleted.
* UserInterface/Views/SourcesNavigationSidebarPanel.js:
(WI.SourcesNavigationSidebarPanel):
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStateChanged): Added.
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingWillStart): Deleted.
(WI.SourcesNavigationSidebarPanel.prototype._handleTimelineCapturingStopped): Deleted.
* UserInterface/Views/TimelineOverview.js:
(WI.TimelineOverview):
(WI.TimelineOverview.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineOverview.prototype._capturingStarted): Deleted.
(WI.TimelineOverview.prototype._capturingStopped): Deleted.
* UserInterface/Views/TimelineRecordingContentView.js:
(WI.TimelineRecordingContentView):
(WI.TimelineRecordingContentView.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineRecordingContentView.prototype._recordingUnloaded):
(WI.TimelineRecordingContentView.prototype._capturingStarted): Deleted.
(WI.TimelineRecordingContentView.prototype._capturingStopped): Deleted.
* UserInterface/Views/TimelineTabContentView.js:
(WI.TimelineTabContentView):
(WI.TimelineTabContentView.prototype._handleTimelineCapturingStateChanged): Added.
(WI.TimelineTabContentView.prototype._capturingStartedOrStopped): Deleted.
Use the new single event for all Timelines capture state changes.
Prevent the record button from being clicked when capturing is in a transition state.

LayoutTests:

* inspector/timeline/debugger-paused-while-recording.html:
* inspector/timeline/exception-in-injected-script-while-recording.html:
* inspector/timeline/line-column.html:
* inspector/timeline/recording-start-stop-timestamps.html:
* inspector/timeline/resources/timeline-event-utilities.js:
* inspector/timeline/setInstruments-programmatic-capture.html:
* inspector/timeline/setInstruments-programmatic-capture-expected.txt:
* inspector/timeline/timeline-recording.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244195 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRename SetArgument to SetArgumentDefinitely
sbarati@apple.com [Thu, 11 Apr 2019 20:47:16 +0000 (20:47 +0000)]
Rename SetArgument to SetArgumentDefinitely
https://bugs.webkit.org/show_bug.cgi?id=196828

Reviewed by Yusuke Suzuki.

This is in preparation for https://bugs.webkit.org/show_bug.cgi?id=196712
where we will introduce a node named SetArgumentMaybe. Doing this refactoring
first will make reviewing that other patch easier.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleVarargsInlining):
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCPSRethreadingPhase.cpp:
(JSC::DFG::CPSRethreadingPhase::freeUnnecessaryNodes):
(JSC::DFG::CPSRethreadingPhase::canonicalizeGetLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeFlushOrPhantomLocalFor):
(JSC::DFG::CPSRethreadingPhase::canonicalizeLocalsInBlock):
(JSC::DFG::CPSRethreadingPhase::specialCaseArguments):
(JSC::DFG::CPSRethreadingPhase::propagatePhis):
(JSC::DFG::CPSRethreadingPhase::computeIsFlushed):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGCommon.h:
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::methodOfGettingAValueProfileFor):
* dfg/DFGGraph.h:
* dfg/DFGInPlaceAbstractState.cpp:
(JSC::DFG::InPlaceAbstractState::initialize):
(JSC::DFG::InPlaceAbstractState::endBasicBlock):
* dfg/DFGLiveCatchVariablePreservationPhase.cpp:
(JSC::DFG::LiveCatchVariablePreservationPhase::handleBlockForTryCatch):
* dfg/DFGMaximalFlushInsertionPhase.cpp:
(JSC::DFG::MaximalFlushInsertionPhase::treatRegularBlock):
(JSC::DFG::MaximalFlushInsertionPhase::treatRootBlock):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::hasVariableAccessData):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertPhantomToPhantomLocal):
* dfg/DFGNodeType.h:
* dfg/DFGOSREntrypointCreationPhase.cpp:
(JSC::DFG::OSREntrypointCreationPhase::run):
* dfg/DFGPhantomInsertionPhase.cpp:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSSAConversionPhase.cpp:
(JSC::DFG::SSAConversionPhase::run):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::checkArgumentTypes):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGTypeCheckHoistingPhase.cpp:
(JSC::DFG::TypeCheckHoistingPhase::run):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244193 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoo...
antti@apple.com [Thu, 11 Apr 2019 18:09:56 +0000 (18:09 +0000)]
REGRESSION: changing iPad orientation on blogger.com crashes under RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations()
https://bugs.webkit.org/show_bug.cgi?id=196813
<rdar://problem/49393264>

Reviewed by Simon Fraser.

No test, can't repro.

* UIProcess/RemoteLayerTree/ios/RemoteScrollingCoordinatorProxyIOS.mm:
(WebKit::RemoteScrollingCoordinatorProxy::establishLayerTreeScrollingRelations):

Null check the nodes.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244192 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, rolling out r244158.
tsavell@apple.com [Thu, 11 Apr 2019 17:45:05 +0000 (17:45 +0000)]
Unreviewed, rolling out r244158.

Casued 8 inspector/timeline/ test failures.

Reverted changeset:

"Web Inspector: Timelines: can't reliably stop/start a
recording"
https://bugs.webkit.org/show_bug.cgi?id=196778
https://trac.webkit.org/changeset/244158

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244191 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUpdated Spanish translation
mcatanzaro@igalia.com [Thu, 11 Apr 2019 15:49:26 +0000 (15:49 +0000)]
Updated Spanish translation
https://bugs.webkit.org/show_bug.cgi?id=196810

Patch by Álvaro Torralba <donfrutosgomez@gmail.com> on 2019-04-11
Rubber-stamped by Michael Catanzaro.

* es.po:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244189 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[WPE] Build error with ENABLE_VIDEO=OFF after r244078
commit-queue@webkit.org [Thu, 11 Apr 2019 13:30:01 +0000 (13:30 +0000)]
[WPE] Build error with ENABLE_VIDEO=OFF after r244078
https://bugs.webkit.org/show_bug.cgi?id=196811

createGenericCue() is only defined when VIDEO_TRACK is enabled.

Patch by Pablo Saavedra <psaavedra@igalia.com> on 2019-04-11
Reviewed by Eric Carlson.

* testing/Internals.cpp:
(WebCore::Internals::createGenericCue):
* testing/Internals.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244188 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after...
carlosgc@webkit.org [Thu, 11 Apr 2019 08:25:36 +0000 (08:25 +0000)]
[GTK] Layout test accessibility/aria-hidden-false-works-in-subtrees.html fails after r184890
https://bugs.webkit.org/show_bug.cgi?id=146718
<rdar://problem/21722487>

Reviewed by Joanmarie Diggs.

Source/WebCore:

Allow to get the text under element for nodes hidden in DOM but explicitly exposed to accessibility with
aria-hidden="false".

Fixes: accessibility/aria-hidden-false-works-in-subtrees.html

* accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::textUnderElement const):
* accessibility/atk/WebKitAccessible.cpp:
(roleIsTextType): Also consider ApplicationGroup role as text elements, so that <div>text</div> is equivalent to
<div role="roup">test</div>.

LayoutTests:

Update test to ATK behavior, rebaseline it and remove the expectations.

* accessibility/aria-hidden-false-works-in-subtrees.html:
* platform/gtk/TestExpectations:
* platform/gtk/accessibility/aria-hidden-false-works-in-subtrees-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244187 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRegression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
cdumez@apple.com [Thu, 11 Apr 2019 06:48:20 +0000 (06:48 +0000)]
Regression(r244144) ProcessSwap.ReuseSuspendedProcessLoadHTMLString API test is flaky
https://bugs.webkit.org/show_bug.cgi?id=196784

Reviewed by Antti Koivisto.

When we enter accelerated compositing mode in the new process, we supposed to *close* the last
SuspendedPageProxy, not destroy it. This was causing flakiness in the test because it was testing
that we were using the SuspendedPageProxy's process for a cross-site link navigation, which is
an optimization. This optimization was partly broken by r244144 as the SuspendedPageProxy would
not sometimes be gone by the time we need it.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::pageEnteredAcceleratedCompositingMode):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244186 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAbstractValue::validateOSREntryValue is wrong for Int52 constants
sbarati@apple.com [Thu, 11 Apr 2019 06:26:37 +0000 (06:26 +0000)]
AbstractValue::validateOSREntryValue is wrong for Int52 constants
https://bugs.webkit.org/show_bug.cgi?id=196801
<rdar://problem/49771122>

Reviewed by Yusuke Suzuki.

JSTests:

* stress/abstract-value-int52-constant-validation-should-not-care-about-representation.js: Added.

Source/JavaScriptCore:

validateOSREntryValue should not care about the format of the incoming
value for Int52s. This patch normalizes the format of m_value and
the incoming value when comparing them.

* dfg/DFGAbstractValue.h:
(JSC::DFG::AbstractValue::validateOSREntryValue const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244185 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWKNavigationResponse._downloadAttribute should be nil when no download attribute...
commit-queue@webkit.org [Thu, 11 Apr 2019 06:16:01 +0000 (06:16 +0000)]
WKNavigationResponse._downloadAttribute should be nil when no download attribute is present
https://bugs.webkit.org/show_bug.cgi?id=196809
<rdar://49800762>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-10
Reviewed by Brady Eidson.

Source/WebKit:

* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse _downloadAttribute]):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244184 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoREGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List...
timothy_horton@apple.com [Thu, 11 Apr 2019 06:08:40 +0000 (06:08 +0000)]
REGRESSION (r241734): ⌥⌘↑ and ⌥⌘↓ no longer navigate to previous/next Reading List article
https://bugs.webkit.org/show_bug.cgi?id=196797
<rdar://problem/48484715>

Reviewed by Simon Fraser.

* UIProcess/ios/WKKeyboardScrollingAnimator.mm:
(-[WKKeyboardScrollingAnimator keyboardScrollForEvent:]):
Validate the set of modifier keys pressed when handling a key event for scrolling:
Ignore key events with multiple modifier keys pressed.
Ignore key events with an invalid modifier key pressed for a given primary key.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244183 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agorequestAnimationFrame should execute before the next frame
commit-queue@webkit.org [Thu, 11 Apr 2019 05:44:13 +0000 (05:44 +0000)]
requestAnimationFrame should execute before the next frame
https://bugs.webkit.org/show_bug.cgi?id=177484

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-04-10
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

Add trace points for the page RenderingUpdate.

* web-platform-tests/resize-observer/resources/resizeTestHelper.js:
Change ResizeTestHelper.TIMEOUT to be 1 second instead of 100 ms which
is too short for layout tests.

Source/WebCore:

This change fixes these issues with animation timing:

1. Calling the requestAnimationFrame callbacks would have happened when
   the DisplayLink fires. This may have happened even if the frame is
   missed and no display is committed.

2. Style changes and layout triggered by script could trigger painting
   at more than 60fps. CoreAnimation commits could happen at more than
   60fps, although WindowServer will throttle those, and only some will
   be shown on the screen.

This change introduces a new paint scheduling model where painting is
driven by a "RenderingUpdateScheduler", which only triggers paints once
per 16.7ms frame.

Code that previously scheduled a compositing layer flush now schedules a
"RenderingUpdate", and that update is driven by a DisplayRefreshMonitor
callback. When the render happens, we service requestAnimationFrame callbacks,
Web Animations, intersection observations and resize observations per the
"Update the rendering" step of the HTML Event Loop specification:
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.

In the future, more rendering steps will be added to this code.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::platformHandleFocusedUIElementChanged):
Fix layout tests by adding null check.

* animation/DocumentAnimationScheduler.cpp: Removed.
* animation/DocumentAnimationScheduler.h: Removed.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::DocumentTimeline):
(WebCore::DocumentTimeline::updateThrottlingState):
(WebCore::DocumentTimeline::suspendAnimations):
(WebCore::DocumentTimeline::resumeAnimations):
(WebCore::DocumentTimeline::liveCurrentTime const):
(WebCore::DocumentTimeline::currentTime):
(WebCore::DocumentTimeline::cacheCurrentTime):
(WebCore::DocumentTimeline::animationTimingDidChange):
(WebCore::DocumentTimeline::scheduleAnimationResolution):
(WebCore::DocumentTimeline::unscheduleAnimationResolution):
(WebCore::DocumentTimeline::updateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::internalUpdateAnimationsAndSendEvents):
(WebCore::DocumentTimeline::scheduleNextTick):
(WebCore::DocumentTimeline::updateListOfElementsWithRunningAcceleratedAnimationsForElement):
Simplify this function by handling the case of no-animations separately.

(WebCore::DocumentTimeline::resolveAnimationsForElement):
Simplify the loop and delete hasPendingAcceleratedAnimations because it
is initialized to true and is not changed inside the loop.

(WebCore::DocumentTimeline::scheduleAnimationResolutionIfNeeded): Deleted.
(WebCore::DocumentTimeline::animationResolutionTimerFired): Deleted.
* animation/DocumentTimeline.h:
* dom/Document.cpp:
(WebCore::Document::resolveStyle):
There is no need to force update in resolveStyle(). notifyFlushRequired()
will be called eventually which will scheduleRenderingUpdate().

(WebCore::Document::prepareForDestruction):
(WebCore::Document::updateAnimationsAndSendEvents):
(WebCore::Document::serviceRequestAnimationFrameCallbacks):
(WebCore::Document::windowScreenDidChange):
(WebCore::Document::scheduleRenderingUpdate):
(WebCore::Document::updateIntersectionObservations):
(WebCore::Document::addResizeObserver):
(WebCore::Document::updateResizeObservations):
(WebCore::Document::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Document::scheduleResizeObservations): Deleted.
(WebCore::Document::animationScheduler): Deleted.
No need to schedule web-animations, intersection observations and resize
observations updates separately. All of them will be updated through the
"Update the rendering" step, i.e. Page::updateRendering().

* dom/Document.h:
(WebCore::Document::numberOfIntersectionObservers const):
* dom/ScriptedAnimationController.cpp:
(WebCore::ScriptedAnimationController::serviceRequestAnimationFrameCallbacks):
(WebCore::ScriptedAnimationController::scheduleAnimation):
(WebCore::ScriptedAnimationController::animationTimerFired):
(WebCore::ScriptedAnimationController::serviceScriptedAnimations): Deleted.
(WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire): Deleted.
* dom/ScriptedAnimationController.h:
* page/FrameView.cpp:
(WebCore::FrameView::didLayout):
(WebCore::FrameView::viewportContentsChanged):
* page/FrameViewLayoutContext.cpp:
(WebCore::FrameViewLayoutContext::layoutTimerFired):
* page/IntersectionObserver.cpp:
(WebCore::IntersectionObserver::observe):
* page/Page.cpp:
(WebCore::Page::Page):
(WebCore::Page::layoutIfNeeded):
(WebCore::Page::updateRendering):
(WebCore::Page::renderingUpdateScheduler):
(WebCore::Page::willDisplayPage): Deleted.
(WebCore::Page::addDocumentNeedingIntersectionObservationUpdate): Deleted.
(WebCore::Page::updateIntersectionObservations): Deleted.
(WebCore::Page::scheduleForcedIntersectionObservationUpdate): Deleted.
(WebCore::Page::hasResizeObservers const): Deleted.
(WebCore::Page::gatherDocumentsNeedingResizeObservationCheck): Deleted.
(WebCore::Page::checkResizeObservations): Deleted.
(WebCore::Page::scheduleResizeObservations): Deleted.
(WebCore::Page::notifyResizeObservers): Deleted.
* page/Page.h:
(WebCore::Page::setNeedsCheckResizeObservations): Deleted.
(WebCore::Page::needsCheckResizeObservations const): Deleted.
The IntersectionObserver and the ResizeObserver do not need to schedule
their own timers. The RenderingUpdateScheduler will schedule the "Update
the rendering" step in which these obverses will be served.

* page/PageOverlayController.cpp:
(WebCore::PageOverlayController::didChangeViewExposedRect):
(WebCore::PageOverlayController::notifyFlushRequired):
Force committing the layers to be 60 fps at maximum.

* page/RenderingUpdateScheduler.cpp: Added.
(WebCore::RenderingUpdateScheduler::RenderingUpdateScheduler):
(WebCore::RenderingUpdateScheduler::scheduleRenderingUpdate):
(WebCore::RenderingUpdateScheduler::isScheduled const):
(WebCore::RenderingUpdateScheduler::startTimer):
(WebCore::RenderingUpdateScheduler::clearScheduled):
(WebCore::RenderingUpdateScheduler::createDisplayRefreshMonitor const):
(WebCore::RenderingUpdateScheduler::windowScreenDidChange):
(WebCore::RenderingUpdateScheduler::displayRefreshFired):
(WebCore::RenderingUpdateScheduler::scheduleCompositingLayerFlush):
* page/RenderingUpdateScheduler.h: Added.
(WebCore::RenderingUpdateScheduler::create):
* page/ResizeObserver.cpp:
(WebCore::ResizeObserver::observe):
(WebCore::ResizeObserver::scheduleObservations): Deleted.
* page/ResizeObserver.h:
(WebCore::ResizeObserver::hasActiveObservations const):
* page/ios/ContentChangeObserver.h:
* page/mac/ServicesOverlayController.mm:
(WebCore::ServicesOverlayController::Highlight::notifyFlushRequired):
* page/scrolling/ScrollingStateTree.cpp:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::scheduleLayerFlushNow):
(WebCore::RenderLayerCompositor::layerTreeAsText):

Source/WebKit:

Replace the calls to Page::layoutIfNeeded() and willDisplayPage() by
a single call to Page::updateRendering(). This new function implements
"Update the rendering" step of the HTML Event Loop specification
<https://html.spec.whatwg.org/multipage/webappapis.html#update-the-rendering>.

* WebProcess/WebPage/CoordinatedGraphics/DrawingAreaCoordinatedGraphics.cpp:
(WebKit::DrawingAreaCoordinatedGraphics::scheduleCompositingLayerFlush):
(WebKit::DrawingAreaCoordinatedGraphics::updateBackingStoreState):
(WebKit::DrawingAreaCoordinatedGraphics::display):
* WebProcess/WebPage/CoordinatedGraphics/LayerTreeHost.cpp:
(WebKit::LayerTreeHost::layerFlushTimerFired):

* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::flushLayers):
-- Call Page::updateRendering() to make sure that "Update the rendering"
   happens immediately before updating the page.

-- Move the call to RemoteLayerBackingStoreCollection::willFlushLayers()
   to be exactly before flushing the layers. This fixes the assertion
   ASSERT(m_inLayerFlush) which was firing when running a layout test.
   RemoteLayerTreeDrawingArea::flushLayers() now can call itself through
   TestRunner::notifyDone(). flushLayers() was calling willFlushLayers()
   twice before calling didFlushLayers().

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::layoutIfNeeded):
(WebKit::WebPage::updateRendering):
(WebKit::WebPage::willDisplayPage): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _viewWillDrawInternal]):
(-[WebView _flushCompositingChanges]):
Call Page::updateRendering() which implements "Update the rendering"
step of the HTML Event Loop specification.

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::updateBackingStore):
(WebView::flushPendingGraphicsLayerChangesSoon):
(WebView::flushPendingGraphicsLayerChanges):
Call Page::updateRendering() which implements "Update the rendering"
step of the HTML Event Loop specification.

Source/WTF:

Add trace points for the page RenderingUpdate.

* wtf/SystemTracing.h:

Tools:

Add trace points for the page RenderingUpdate.

* Tracing/SystemTracePoints.plist:

LayoutTests:

* TestExpectations:
There is a slight difference between the actual DRT and the expected DRT
due to animation timing change. But these two tests are not animating
correctly if they are opened in Safari with web animation turned on.

* accessibility/mac/selection-notification-focus-change-expected.txt:
* accessibility/mac/selection-notification-focus-change.html:
Remove the debug statements form notificationCallback() since the number
of times this function is called back and the order of notifications are
not defined. This test has been flaky and some trials were made to make
it more reliable. With this change it became flaky again.

* animations/animation-multiple-callbacks-timestamp.html:
Fix variable names used by an error message.

* animations/no-style-recalc-during-accelerated-animation-expected.txt:
* animations/no-style-recalc-during-accelerated-animation.html:
One extra styleReclc was incurred due to the document styleRecalcTimer.
I think this timer is not needed anymore. I will look at removing it in
a separate patch.

* animations/resources/animation-test-helpers.js:
(waitForAnimationToStart):
The expectation that animation will start at the beginning of the next
event loop is not true anymore. The animation will start at the time the
requestAnimationFrame fires.

* compositing/video/video-clip-change-src.html:
This test loads a video data and pushes it to the encoder. Originally it
used to wait 150 ms after receiving the second canplaythrough. I had to
change this timing to 250 ms.

* css3/filters/composited-during-animation.html:
Ditto. setTimeout({...}, 0) versus requestAnimationFrame.

* media/media-controls-accessibility.html:
Updating the accessibility button happens asynchronously, see
[WebAccessibilityObjectWrapper accessibilityPerformPressAction]. Due to
changing the page update timing, this test became flaky. Originally it used
to setTimeout({...}, 10) to ensure the stringValue of the mutate button
was changed after it was pressed. The fix is to loop using rAF till the
stringValue changes.

* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt: Removed.
The number of time notificationCallback() is called and the order of
notifications are not defined. And this is why we have two expected files:
one for WK1 and the other for WK2. Since the test is now simplified, we
can get rid of this duplication. We will test the minimum reliable thing
we can test.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244182 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoNullptr crash in CompositeEditCommand::moveParagraphs when root editable element...
rniwa@webkit.org [Thu, 11 Apr 2019 02:12:56 +0000 (02:12 +0000)]
Nullptr crash in CompositeEditCommand::moveParagraphs when root editable element goes away
https://bugs.webkit.org/show_bug.cgi?id=193027

Reviewed by Wenson Hsieh.

Source/WebCore:

Added an early exit when the root editable element (editing host in HTML5 spec terminology) is null
during CompositeEditCommand::moveParagraphs. This could happen when the website does something crazy
like removing contenteditable content attribute during DOM mutations or when the destination becomes
disconnected (orphaned) from the document due to bugs elsewhere in the codebase.

Test: editing/deleting/merge-paragraphs-null-root-editable-element-crash.html

* editing/CompositeEditCommand.cpp:
(WebCore::CompositeEditCommand::moveParagraphs): Added an early exit.

LayoutTests:

Added a regression test. Note that the test works around debug assertions in moveParagraphs.
These assertions are generally correct & useful unless the website does something crazy like
removing the contenteditable content attribute during editing operations.

* editing/deleting/merge-paragraphs-null-root-editable-element-crash-expected.txt: Added.
* editing/deleting/merge-paragraphs-null-root-editable-element-crash.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: save sheet should be anchored underneath the tab bar when detached
drousso@apple.com [Thu, 11 Apr 2019 02:04:57 +0000 (02:04 +0000)]
Web Inspector: save sheet should be anchored underneath the tab bar when detached
https://bugs.webkit.org/show_bug.cgi?id=196722
<rdar://problem/49613280>

Reviewed by Timothy Hatcher.

Source/WebCore:

No web observable change.

* inspector/InspectorFrontendClient.h:
(WebCore::InspectorFrontendClient::changeSheetRect): Added.

* inspector/InspectorFrontendClientLocal.h:
* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::changeSheetRect): Added.

* inspector/InspectorFrontendHost.idl:
* inspector/InspectorFrontendHost.h:
* inspector/InspectorFrontendHost.cpp:
(WebCore::InspectorFrontendHost::setSheetRect): Added.

* testing/Internals.cpp:
(WebCore::InspectorStubFrontend::setSheetRect): Added.

Source/WebInspectorUI:

* UserInterface/Base/Main.js:
(WI.contentLoaded):

Source/WebKit:

* WebProcess/WebPage/WebInspectorUI.h:
* WebProcess/WebPage/WebInspectorUI.cpp:
(WebKit::WebInspectorUI::changeSheetRect): Added.
* UIProcess/WebInspectorProxy.messages.in:
* UIProcess/WebInspectorProxy.h:
(WebKit::WebInspectorProxy::sheetRect const): Added.
* UIProcess/WebInspectorProxy.cpp:
(WebKit::WebInspectorProxy::setSheetRect): Added.
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/gtk/WebInspectorProxyGtk.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/mac/WebInspectorProxyMac.mm:
(-[WKWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/win/WebInspectorProxyWin.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/wpe/WebInspectorProxyWPE.cpp:
(WebKit::WebInspectorProxy::platformSetSheetRect): Added.

* WebProcess/WebPage/RemoteWebInspectorUI.h:
* WebProcess/WebPage/RemoteWebInspectorUI.cpp:
(WebKit::RemoteWebInspectorUI::changeSheetRect): Added.
* UIProcess/RemoteWebInspectorProxy.messages.in:
* UIProcess/RemoteWebInspectorProxy.h:
(WebKit::RemoteWebInspectorProxy::sheetRect const): Added.
* UIProcess/RemoteWebInspectorProxy.cpp:
(WebKit::RemoteWebInspectorProxy::setSheetRect): Added.
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/gtk/RemoteWebInspectorProxyGtk.cpp:
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.
* UIProcess/mac/RemoteWebInspectorProxyMac.mm:
(-[WKRemoteWebInspectorProxyObjCAdapter window:willPositionSheet:usingRect:]): Added.
(WebKit::RemoteWebInspectorProxy::platformCreateFrontendPageAndWindow):
(WebKit::RemoteWebInspectorProxy::platformSetSheetRect): Added.

Source/WebKitLegacy/ios:

* WebCoreSupport/WebInspectorClientIOS.mm:
(WebInspectorFrontendClient::setSheetRect): Added.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebInspectorClient.h:
(WebInspectorFrontendClient::sheetRect const): Added.
* WebCoreSupport/WebInspectorClient.mm:
(-[WebInspectorWindowController window:willPositionSheet:usingRect:]):
(WebInspectorFrontendClient::setSheetRect): Added.

Source/WebKitLegacy/win:

* WebCoreSupport/WebInspectorClient.h:
* WebCoreSupport/WebInspectorClient.cpp:
(WebInspectorFrontendClient::setSheetRect): Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244180 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[GTK] Unreviewed test gardening
aboya@igalia.com [Thu, 11 Apr 2019 01:43:24 +0000 (01:43 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=196800

* platform/gtk/TestExpectations:
* platform/gtk/fast/forms/auto-fill-button/input-auto-fill-button-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoArithSub over Int52 has shouldCheckOverflow as always true
sbarati@apple.com [Thu, 11 Apr 2019 01:31:51 +0000 (01:31 +0000)]
ArithSub over Int52 has shouldCheckOverflow as always true
https://bugs.webkit.org/show_bug.cgi?id=196796

Reviewed by Yusuke Suzuki.

AI was checking for ArithSub over Int52 if !shouldCheckOverflow. However,
shouldCheckOverflow is always true, so !shouldCheckOverflow is always
false. We shouldn't check something we assert against.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244178 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[iOS] Let PDFHostViewController specify the background color to use for WKPDFView
aestes@apple.com [Thu, 11 Apr 2019 01:22:19 +0000 (01:22 +0000)]
[iOS] Let PDFHostViewController specify the background color to use for WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=196785
<rdar://problem/48240051>

Reviewed by Tim Horton.

* UIProcess/ios/WKPDFView.mm:
(-[WKPDFView web_initWithFrame:webView:mimeType:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[PlayStation] Specify byte order clearly on Remote Inspector Protocol
basuke.suzuki@sony.com [Thu, 11 Apr 2019 01:19:28 +0000 (01:19 +0000)]
[PlayStation] Specify byte order clearly on Remote Inspector Protocol
https://bugs.webkit.org/show_bug.cgi?id=196790

Reviewed by Ross Kirsling.

Original implementation lacks byte order specification. Network byte order is the
good candidate if there's no strong reason to choose other.
Currently no client exists for PlayStation remote inspector protocol, so we can
change the byte order without care.

* inspector/remote/playstation/RemoteInspectorMessageParserPlayStation.cpp:
(Inspector::MessageParser::createMessage):
(Inspector::MessageParser::parse):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244176 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoSource/JavaScriptCore:
drousso@apple.com [Thu, 11 Apr 2019 00:33:29 +0000 (00:33 +0000)]
Source/JavaScriptCore:
       Web Inspector: Inspector: lazily create the agent
       https://bugs.webkit.org/show_bug.cgi?id=195971
       <rdar://problem/49039645>

       Reviewed by Joseph Pecoraro.

       * inspector/JSGlobalObjectInspectorController.cpp:
       (Inspector::JSGlobalObjectInspectorController::JSGlobalObjectInspectorController):
       (Inspector::JSGlobalObjectInspectorController::connectFrontend):
       (Inspector::JSGlobalObjectInspectorController::appendExtraAgent):
       (Inspector::JSGlobalObjectInspectorController::createLazyAgents):

       * inspector/agents/InspectorAgent.h:
       * inspector/agents/InspectorAgent.cpp:

Source/WebCore:
Web Inspector: Inspector: lazily create the agent
https://bugs.webkit.org/show_bug.cgi?id=195971
<rdar://problem/49039645>

Reviewed by Joseph Pecoraro.

No change in functionality.

* inspector/InspectorController.h:
* inspector/InspectorController.cpp:
(WebCore::InspectorController::InspectorController):
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::evaluateForTestInFrontend):
(WebCore::InspectorController::ensureInspectorAgent):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244172 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[Win] Use a bundled vswhere.exe instead of downloading by update-vswhere.py
Hironori.Fujii@sony.com [Thu, 11 Apr 2019 00:08:34 +0000 (00:08 +0000)]
[Win] Use a bundled vswhere.exe instead of downloading by update-vswhere.py
https://bugs.webkit.org/show_bug.cgi?id=196760

Reviewed by Don Olmstead.

vswhere.exe has been bundled since Visual Studio 2017 version
15.2. We shouldn't download vswhere.exe.

* Scripts/build-jsc: Do not call update-vswhere.py.
* Scripts/build-webkit: Ditto.
* Scripts/update-vswhere.py: Removed.
* Scripts/webkitdirs.pm:
(requireModulesForVSWhere): Deleted.
(pickCurrentVisualStudioInstallation): Deleted.
(visualStudioInstallDirVSWhere): Return the latest installed VS
installation path by using the bundled vswhere.exe.
(setupCygwinEnv): Removed a unused variable $visualStudioPath.
(visualStudioInstallDirFallback): Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244171 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoUnreviewed, rolling out r244146.
cdumez@apple.com [Wed, 10 Apr 2019 23:57:30 +0000 (23:57 +0000)]
Unreviewed, rolling out r244146.

Caused a few DeviceOrientation API test failures on iOS

Reverted changeset:

"Unable to run system Safari with trunk WebKit"
https://bugs.webkit.org/show_bug.cgi?id=196777
https://trac.webkit.org/changeset/244146

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244170 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoRemove unneeded extern C
megan_gardner@apple.com [Wed, 10 Apr 2019 23:35:52 +0000 (23:35 +0000)]
Remove unneeded extern C
https://bugs.webkit.org/show_bug.cgi?id=196786

Reviewed by Tim Horton.

No tests needed, just needs to compile.

Removing staging hack for Reveal framework.

* editing/cocoa/DictionaryLookup.mm:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244169 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ Mojave WK2 iOS Sim ] Layout Test http/wpt/cache-storage/quota-third-party.https...
youenn@apple.com [Wed, 10 Apr 2019 23:18:29 +0000 (23:18 +0000)]
[ Mojave WK2 iOS Sim ] Layout Test http/wpt/cache-storage/quota-third-party.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=196358
<rdar://problem/49388128>

Unreviewed.

* platform/ios-simulator-wk2/TestExpectations:
Mark test as slow.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244168 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWeb Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can...
drousso@apple.com [Wed, 10 Apr 2019 23:15:08 +0000 (23:15 +0000)]
Web Inspector: REGRESSION: lazy agents used outside of frontend/instrumentation can be accessed before being created
https://bugs.webkit.org/show_bug.cgi?id=196725
<rdar://problem/49669810>

Reviewed by Timothy Hatcher.

Source/WebCore:

Move the logic for creating the `InspectorPageAgent` and `InspectorDOMAgent` into separate
functions so that callers into `InspectorController` can be guaranteed to have a valid
instance of the agent.

This doesn't interfere with the `Page.enable` command, as it doesn't clear any saved state.
There is no `DOM.enable` command, so there's no issue there either.

* inspector/InspectorController.h:
(WebCore::InspectorController::pageAgent): Deleted.
* inspector/InspectorController.cpp:
(WebCore::InspectorController::createLazyAgents):
(WebCore::InspectorController::inspect):
(WebCore::InspectorController::hideHighlight):
(WebCore::InspectorController::ensureDOMAgent): Added.
(WebCore::InspectorController::ensurePageAgent): Added.

* inspector/InspectorFrontendClientLocal.cpp:
(WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):

Source/WebKit:

* WebProcess/WebPage/WebInspector.cpp:
(WebKit::WebInspector::showMainResourceForFrame):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244167 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months ago[ews-build] PrintConfiguration should display Xcode version instead of SDKVersion
aakash_jain@apple.com [Wed, 10 Apr 2019 23:04:14 +0000 (23:04 +0000)]
[ews-build] PrintConfiguration should display Xcode version instead of SDKVersion
https://bugs.webkit.org/show_bug.cgi?id=196780

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/ews-build/steps.py:
* BuildSlaveSupport/ews-build/steps_unittest.py:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244164 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoWork around an arm64_32 LLVM miscompile bug
sbarati@apple.com [Wed, 10 Apr 2019 23:02:11 +0000 (23:02 +0000)]
Work around an arm64_32 LLVM miscompile bug
https://bugs.webkit.org/show_bug.cgi?id=196788

Reviewed by Yusuke Suzuki.

* runtime/CachedTypes.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244163 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoClear Cache Storage structures before removing all related files
youenn@apple.com [Wed, 10 Apr 2019 22:59:14 +0000 (22:59 +0000)]
Clear Cache Storage structures before removing all related files
https://bugs.webkit.org/show_bug.cgi?id=196650

Reviewed by Alex Christensen.

Previously, we were clearing files in parallel to clearing the internal CacheStorage structures.
To make things more deterministic, clear files/folders directly
after CachesStorage structures have finished being cleared.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearAllCaches):
(WebKit::CacheStorage::Engine::clearCachesForOrigin):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244162 268f45cc-cd09-0410-ab3c-d52691b4dbfc

4 months agoAdd SPI WKNavigationResponse._downloadAttribute
commit-queue@webkit.org [Wed, 10 Apr 2019 22:56:35 +0000 (22:56 +0000)]
Add SPI WKNavigationResponse._downloadAttribute
https://bugs.webkit.org/show_bug.cgi?id=196755
<rdar://49587365>

Patch by Alex Christensen <achristensen@webkit.org> on 2019-04-10
Reviewed by Brady Eidson.

Source/WebCore:

Covered by an API test that validates the attribute is correctly sent through the FrameLoader to the API.
When a user clicks on a link with a download attribute, the download attribute should be used as the suggested filename sometimes.
The application needs this information after it has received the response in order to make fully informed decisions about downloads.
In order to get this attribute to the decidePolicyForNavigationResponse, we need to store the attribute on the DocumentLoader
from the FrameLoadRequest then send it from the DocumentLoader when the response is received.

* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setDownloadAttribute):
(WebCore::DocumentLoader::downloadAttribute const):
* loader/EmptyFrameLoaderClient.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkContentPolicy):
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadPostRequest):
* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/FrameLoaderClient.h:

Source/WebKit:

* UIProcess/API/APINavigationResponse.h:
* UIProcess/API/Cocoa/WKNavigationResponse.mm:
(-[WKNavigationResponse _downloadAttribute]):
* UIProcess/API/Cocoa/WKNavigationResponsePrivate.h:
* UIProcess/ProvisionalPageProxy.cpp:
(WebKit::ProvisionalPageProxy::decidePolicyForResponse):
* UIProcess/ProvisionalPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::decidePolicyForResponseShared):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.h:
* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):

Source/WebKitLegacy/win:

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::dispatchDecidePolicyForResponse):
* WebCoreSupport/WebFrameLoaderClient.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/WKNavigationResponse.mm:
(-[NavigationResponseTestDelegate navigationResponse]):
(-[NavigationResponseTestDelegate waitForNavigationResponseCallback]):
(-[NavigationResponseTestDelegate waitForNavigationFinishedCallback]):
(-[NavigationResponseTestDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[NavigationResponseTestDelegate webView:didFinishNavigation:]):
(-[NavigationResponseTestDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(readRequest):
(writeResponse):
(TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244161 268f45cc-cd09-0410-ab3c-d52691b4dbfc