WebKit.git
23 months agoXMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header;...
dbates@webkit.org [Tue, 3 Oct 2017 23:12:34 +0000 (23:12 +0000)]
XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
duplicate logic to check for a forbidden XHR header field
https://bugs.webkit.org/show_bug.cgi?id=177829
<rdar://problem/34798441>

LayoutTests/imported/w3c:

Update expected result now that we match the XHR standard, <https://xhr.spec.whatwg.org> (09/08/2017).

We no longer consider Content-Transfer-Encoding and User-Agent forbidden headers as per
the standard.

* web-platform-tests/XMLHttpRequest/setrequestheader-header-allowed-expected.txt:

LayoutTests:

Update tests and expected results now that we match the XHR standard, <https://xhr.spec.whatwg.org> (09/08/2017).

We no longer consider Content-Transfer-Encoding and User-Agent forbidden headers as per
the standard.

* fast/xmlhttprequest/set-dangerous-headers-expected.txt:
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html:
* fast/xmlhttprequest/set-dangerous-headers.html:
* http/tests/xmlhttprequest/check-combining-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers.html:

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

23 months agoFix missing import for BenchmarkRunner.
dewei_zhu@apple.com [Tue, 3 Oct 2017 23:08:27 +0000 (23:08 +0000)]
Fix missing import for BenchmarkRunner.
https://bugs.webkit.org/show_bug.cgi?id=177842

Reviewed by Ryosuke Niwa.

'show_results' requires BenchmarkRunner.

* Scripts/webkitpy/benchmark_runner/run_benchmark.py:

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

23 months agoShare code to determine a forbidden method
dbates@webkit.org [Tue, 3 Oct 2017 22:40:35 +0000 (22:40 +0000)]
Share code to determine a forbidden method
https://bugs.webkit.org/show_bug.cgi?id=177833

Reviewed by Andy Estes.

Currently we duplicate code in XMLHttpRequest and FetchRequest to determine if a method is
forbidden. We should add a common helper function and update both classes to make use of it.

No functionality changed. So, no new tests.

* Modules/fetch/FetchRequest.cpp:
(WebCore::setMethod): Modified to use WebCore::isForbiddenMethod().
* platform/network/HTTPParsers.cpp:
(WebCore::isForbiddenMethod): Added.
* platform/network/HTTPParsers.h:
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open): Modified to use WebCore::isForbiddenMethod().
(WebCore::XMLHttpRequest::isAllowedHTTPMethod): Deleted.
* xml/XMLHttpRequest.h:

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

23 months agoRenderMenuList should not hold raw pointers
zalan@apple.com [Tue, 3 Oct 2017 22:39:49 +0000 (22:39 +0000)]
RenderMenuList should not hold raw pointers
https://bugs.webkit.org/show_bug.cgi?id=177836

Reviewed by Antti Koivisto.

While both m_buttonText and m_innerBlock are child renderers of
the RenderMenuList, so the their lifecycles are supposed to tied
to the parent object, this patch removes some manual raw pointer managing.

Covered by existing tests.

* rendering/RenderMenuList.cpp:
(WebCore::RenderMenuList::RenderMenuList):
(WebCore::RenderMenuList::createInnerBlock):
(RenderMenuList::takeChild):
(RenderMenuList::setText):
* rendering/RenderMenuList.h:

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

23 months agoAdd long press and drag test
megan_gardner@apple.com [Tue, 3 Oct 2017 22:12:37 +0000 (22:12 +0000)]
Add long press and drag test
https://bugs.webkit.org/show_bug.cgi?id=177289

Reviewed by Wenson Hsieh.

Adding a test to test the long press and then drag functionality of selection.
Also add additional helper functions to basic gestures, so that this and other
tests can be written. Mostly deals with not lifting between gestures.

* fast/events/touch/ios/long-press-then-drag-to-select-text-expected.txt: Added.
* fast/events/touch/ios/long-press-then-drag-to-select-text.html: Added.
* fast/events/touch/ios/resources/basic-gestures.js:
(longPressAndHoldAtPoint):
(touchAndDragFromPointToPoint):

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

23 months agoInclude a few widespread WTF headers in WebCorePrefix.h
timothy_horton@apple.com [Tue, 3 Oct 2017 21:56:53 +0000 (21:56 +0000)]
Include a few widespread WTF headers in WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=173481

* WebCorePrefix.h:
Turn this off on Windows because it doesn't work; needs further investigation.

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

23 months agoSkip imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https...
ryanhaddad@apple.com [Tue, 3 Oct 2017 21:27:36 +0000 (21:27 +0000)]
Skip imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html on iOS.
https://bugs.webkit.org/show_bug.cgi?id=177832

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

23 months agoInclude a few widespread WTF headers in WebCorePrefix.h
timothy_horton@apple.com [Tue, 3 Oct 2017 21:12:38 +0000 (21:12 +0000)]
Include a few widespread WTF headers in WebCorePrefix.h
https://bugs.webkit.org/show_bug.cgi?id=173481

Reviewed by Alex Christensen.

* WebCorePrefix.h:
These are four of the headers that contribute the most pre-processed
source to the WebCore build. They (and their dependents) change infrequently
enough that a world rebuild of WebCore when they change seems like an
acceptable tradeoff for the ~9% reduction in WebCore build time that I
measure from this change.

We can't do this on macOS 10.12 because of https://bugs.llvm.org/show_bug.cgi?id=33520.

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

23 months agoFix API tests after r222794.
achristensen@apple.com [Tue, 3 Oct 2017 21:10:49 +0000 (21:10 +0000)]
Fix API tests after r222794.
https://bugs.webkit.org/show_bug.cgi?id=177825

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willGoToBackForwardListItem):
Sometimes there's no navigation client.

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

23 months agoLayout Test http/tests/inspector/network/beacon-type.html is flaky.
joepeck@webkit.org [Tue, 3 Oct 2017 21:10:24 +0000 (21:10 +0000)]
Layout Test http/tests/inspector/network/beacon-type.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=177834

Unreviewed test gardening.

* http/tests/inspector/network/beacon-type.html:
* http/tests/inspector/network/ping-type.html:
Don't wait for the resource to finish loading if it has already finished loading.
Logs showed the resource had already finished loading earlier, before this
promise microtask started running.

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

23 months agoXMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header;...
dbates@webkit.org [Tue, 3 Oct 2017 20:55:59 +0000 (20:55 +0000)]
XMLHttpRequest.setRequestHeader() should allow Content-Transfer-Encoding header; remove
duplicate logic to check for a forbidden XHR header field
https://bugs.webkit.org/show_bug.cgi?id=177829

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Use isForbiddenHeaderName() (defined in HTTPParsers.h) to check if the header field specified
to XMLHttpRequest.setRequestHeader() is allowed. Among other benefits this makes the behavior
of XMLHttpRequest.setRequestHeader() more closely aligned with the behavior of this method in
the XHR standard, <https://xhr.spec.whatwg.org> (8 September 2017). In particular, XMLHttpRequest.setRequestHeader()
no longer forbids setting the header Content-Transfer-Encoding. This header has not been
considered a forbidden header since <https://www.w3.org/TR/2012/WD-XMLHttpRequest-20121206/>.

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):
(WebCore::isForbiddenRequestHeader): Deleted.
(WebCore::XMLHttpRequest::isAllowedHTTPHeader): Deleted.
* xml/XMLHttpRequest.h:

LayoutTests:

Update tests and test results now that we no longer consider Content-Transfer-Encoding a
forbidden header.

* fast/xmlhttprequest/set-dangerous-headers-expected.txt:
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html:
* fast/xmlhttprequest/set-dangerous-headers.html:
* http/tests/xmlhttprequest/set-dangerous-headers-expected.txt:
* http/tests/xmlhttprequest/set-dangerous-headers.html:

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

23 months agoUnreviewed, rolling out r222686, r222695, and r222698.
ryanhaddad@apple.com [Tue, 3 Oct 2017 20:51:00 +0000 (20:51 +0000)]
Unreviewed, rolling out r222686, r222695, and r222698.
https://bugs.webkit.org/show_bug.cgi?id=177835

Caused LayoutTests to crash in
WebCore::TimerBase::setNextFireTime (Requested by ryanhaddad
on #webkit).

Reverted changesets:

"[Settings] Replace SettingsMacros.h with a generated base
class for Settings"
https://bugs.webkit.org/show_bug.cgi?id=177681
http://trac.webkit.org/changeset/222686

"[Settings] Enums should not be passed by const reference"
https://bugs.webkit.org/show_bug.cgi?id=177727
http://trac.webkit.org/changeset/222695

"[Settings] Move remaining simple settings to Settings.in"
https://bugs.webkit.org/show_bug.cgi?id=177730
http://trac.webkit.org/changeset/222698

Patch by Commit Queue <commit-queue@webkit.org> on 2017-10-03

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

23 months agoUnreviewed test gardening. Add debugging to flakey test.
joepeck@webkit.org [Tue, 3 Oct 2017 20:36:22 +0000 (20:36 +0000)]
Unreviewed test gardening. Add debugging to flakey test.

* http/tests/inspector/network/beacon-type.html:
Add some debugging to try and understand why this test times out.

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

23 months ago[WPE] Bump deps to add support for xdg-shell-unstable-v6 protocol
commit-queue@webkit.org [Tue, 3 Oct 2017 20:32:00 +0000 (20:32 +0000)]
[WPE] Bump deps to add support for xdg-shell-unstable-v6 protocol
https://bugs.webkit.org/show_bug.cgi?id=177820

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-03
Reviewed by Žan Doberšek.

gnome-shell does not advertize the xdg-shell protocol anymore, but xdg-shell-unstable-v6 instead.
Support has been added in WPEBackend-mesa, we need to update the requirements.
wayland-1.10 is needed for wl_proxy_get_version(), used in the generated headers.

* wpe/jhbuild.modules:

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

23 months agoImplement quality-of-service tiers in WebCoreDecompressionSession
jer.noble@apple.com [Tue, 3 Oct 2017 19:56:34 +0000 (19:56 +0000)]
Implement quality-of-service tiers in WebCoreDecompressionSession
https://bugs.webkit.org/show_bug.cgi?id=177769

Reviewed by Dean Jackson.

VTDecompressionSession will suggest quality-of-service tiers to be used when decompression
can't keep up with playback speed. Use a simple exponential-moving-average heuristic to
determine when to move up and down the tiers.

Drive-by fix: When frames are so late that they miss the display deadline, mark them as
dropped rather than just delayed.

* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample):
(WebCore::WebCoreDecompressionSession::decodeSample):
(WebCore::WebCoreDecompressionSession::handleDecompressionOutput):
(WebCore::WebCoreDecompressionSession::automaticDequeue):
(WebCore::WebCoreDecompressionSession::enqueueDecodedSample):
(WebCore::WebCoreDecompressionSession::resetQosTier):
(WebCore::WebCoreDecompressionSession::increaseQosTier):
(WebCore::WebCoreDecompressionSession::decreaseQosTier):
(WebCore::WebCoreDecompressionSession::updateQosWithDecodeTimeStatistics):
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:

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

23 months agoAdd ObjC equivalent of WKPageLoaderClient.pluginDidFail
achristensen@apple.com [Tue, 3 Oct 2017 19:23:27 +0000 (19:23 +0000)]
Add ObjC equivalent of WKPageLoaderClient.pluginDidFail
https://bugs.webkit.org/show_bug.cgi?id=177787
<rdar://problem/22387633>

Reviewed by Tim Horton.

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::didFailToInitializePlugin):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::canHandleDidFailToInitializePlugIn const):
(API::NavigationClient::didFailToInitializePlugIn):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::canHandleDidFailToInitializePlugIn const):
(WebKit::NavigationState::NavigationClient::didFailToInitializePlugIn):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didFailToInitializePlugin):

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

23 months agoWeb Inspector: Layers tab sidebar's DOM highlight should be by row hover, not row...
commit-queue@webkit.org [Tue, 3 Oct 2017 19:21:54 +0000 (19:21 +0000)]
Web Inspector: Layers tab sidebar's DOM highlight should be by row hover, not row selection
https://bugs.webkit.org/show_bug.cgi?id=177690

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-03
Reviewed by Devin Rousso.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel):
(WI.LayerDetailsSidebarPanel.prototype._buildDataGrid):
(WI.LayerDetailsSidebarPanel.prototype._dataGridSelectedNodeChanged):
(WI.LayerDetailsSidebarPanel.prototype._dataGridMouseMove):
(WI.LayerDetailsSidebarPanel.prototype._dataGridMouseLeave):
(WI.LayerDetailsSidebarPanel.prototype._hideDOMNodeHighlight):
(WI.LayerDetailsSidebarPanel.prototype._dataGridFocused): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._dataGridBlurred): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._highlightSelectedNode): Deleted.

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

23 months ago[GTK] Support the "system" CSS font family
aperez@igalia.com [Tue, 3 Oct 2017 19:21:19 +0000 (19:21 +0000)]
[GTK] Support the "system" CSS font family
https://bugs.webkit.org/show_bug.cgi?id=177755

Reviewed by Carlos Garcia Campos.

Obtain the system UI font from the GtkSettings::gtk-font-name property

Source/WebCore:

Test: platform/gtk/fonts/systemFont.html

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFamilyNameStringFromFamily): Use defaultGtkSystemFont()
to handle -webkit-system-font and -webkit-system-ui.
(WebCore::isCommonlyUsedGenericFamily): Handle -webkit-system-font and
-webkit-system-ui as generic family names.
* platform/graphics/gtk/GtkUtilities.cpp:
(WebCore::defaultGtkSystemFont): Added.
* platform/graphics/gtk/GtkUtilities.h: Add prototype for defaultGtkSystemFont().

LayoutTests:

* platform/gtk/fonts/systemFont-expected.html: Added.
* platform/gtk/fonts/systemFont.html: Added.

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

23 months agoWeb Inspector: Styles Redesign: support editing of rule selectors
nvasilyev@apple.com [Tue, 3 Oct 2017 19:17:23 +0000 (19:17 +0000)]
Web Inspector: Styles Redesign: support editing of rule selectors
https://bugs.webkit.org/show_bug.cgi?id=177012

Reviewed by Matt Baker.

Clicking or focusing (by tabbing from another field) on a CSS selector should select the text and make the selector
field editable.

Keyboard behavior while editing:
- Enter should commit changes.
- Escape should discard changes.
- Tab should commit changes and navigate to the first property name.
- Shift-Tab should commit changes and navigate to the last rule's property value, if there's one.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetStyleProperty.prototype._update):
Add tabIndex so the keyboard navigation (Tab & Shift-Tab) to and from selectors works as expected.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.css:
(.spreadsheet-css-declaration .selector:focus,):
(.spreadsheet-css-declaration .selector.spreadsheet-selector-field):
(.spreadsheet-css-declaration .selector.spreadsheet-selector-field.editing):
* UserInterface/Views/SpreadsheetCSSStyleDeclarationSection.js:
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.get selectorEditable):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.initialLayout):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.layout):
Split layout into _renderOrigin and _renderSelector, so selector field can be updated separately
from everything else.

(WI.SpreadsheetCSSStyleDeclarationSection.prototype.cssStyleDeclarationTextEditorFocused):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidChange):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype.spreadsheetSelectorFieldDidDiscard):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._discardSelectorChange):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderSelector):
(WI.SpreadsheetCSSStyleDeclarationSection.prototype._renderOrigin):

(WI.SpreadsheetSelectorField):
(WI.SpreadsheetSelectorField.prototype.get editing):
(WI.SpreadsheetSelectorField.prototype.startEditing):
(WI.SpreadsheetSelectorField.prototype.stopEditing):
(WI.SpreadsheetSelectorField.prototype._handleClick):
(WI.SpreadsheetSelectorField.prototype._handleFocus):
(WI.SpreadsheetSelectorField.prototype._handleBlur):
(WI.SpreadsheetSelectorField.prototype._handleKeyDown):

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

23 months ago[GTK] Prefer -webkit-system-font
aperez@igalia.com [Tue, 3 Oct 2017 19:02:35 +0000 (19:02 +0000)]
[GTK] Prefer -webkit-system-font
https://bugs.webkit.org/show_bug.cgi?id=177814

Reviewed by Carlos Garcia Campos.

Use "font-family: -webkit-system-font" instead of "font: menu".

* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest): Edited HTML snippet.

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

23 months ago[XHR] Only exempt Dashboard widgets from XHR header restrictions
dbates@webkit.org [Tue, 3 Oct 2017 18:54:30 +0000 (18:54 +0000)]
[XHR] Only exempt Dashboard widgets from XHR header restrictions
https://bugs.webkit.org/show_bug.cgi?id=177824
<rdar://problem/34384301>

Reviewed by Alexey Proskuryakov.

Source/WebCore:

Currently we allow file URLs to set arbitrary XHR headers. In contrast, non-file URLs are
restricted from setting some XHR headers (e.g. COOKIE). Historically the relaxation for file
URL was for backwards compatibility to allow Dashboard widgets to work. Instead we should
apply the non-file URL policy to all URLs and only relax the policy for Dashboard widgets.

Tests: fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
       fast/xmlhttprequest/set-dangerous-headers.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):

LayoutTests:

Add tests to ensure that file URLs are forbidden from setting the same set of blacklisted
headers as non-file URLs except when running in Dashboard compatibility mode.

* TestExpectations: Mark test fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
as WontFix on all platforms. We will selectively enable this test on Mac because it is the
only platform that supports Dashboard widgets.
* fast/xmlhttprequest/set-dangerous-headers-expected.txt: Added.
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard-expected.txt: Added.
* fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html: Added.
* fast/xmlhttprequest/set-dangerous-headers.html: Added. Derived from LayoutTests/http/tests/xmlhttprequest/set-dangerous-headers.html.
* platform/mac/TestExpectations: Enable test fast/xmlhttprequest/set-dangerous-headers-in-dashboard.html
on Mac.

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

23 months agoAdd ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
achristensen@apple.com [Tue, 3 Oct 2017 18:54:11 +0000 (18:54 +0000)]
Add ObjC SPI equivalent to WKPageLoaderClient.willGoToBackForwardListItem
https://bugs.webkit.org/show_bug.cgi?id=177825
<rdar://problem/22387505>

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/API/APILoaderClient.h:
(API::LoaderClient::willGoToBackForwardListItem):
* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::canHandleWillGoToBackForwardListItem const):
(API::NavigationClient::willGoToBackForwardListItem):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageLoaderClient):
* UIProcess/API/Cocoa/WKNavigationDelegatePrivate.h:
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::setNavigationDelegate):
(WebKit::NavigationState::NavigationClient::canHandleWillGoToBackForwardListItem const):
(WebKit::NavigationState::NavigationClient::willGoToBackForwardListItem):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::willGoToBackForwardListItem):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::shouldGoToHistoryItem const):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/Navigation.mm:
(-[BackForwardDelegate _webView:willGoToBackForwardListItem:inPageCache:]):
(-[BackForwardDelegate webView:didFinishNavigation:]):
(TEST):

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

23 months agoAllow assigning WeakPtr<Derived> to WeakPtr<Base>
antti@apple.com [Tue, 3 Oct 2017 18:48:57 +0000 (18:48 +0000)]
Allow assigning WeakPtr<Derived> to WeakPtr<Base>
https://bugs.webkit.org/show_bug.cgi?id=177817

Reviewed by Geoff Garen.

Source/WTF:

Add templated copy/move constructors/assignment operators, similar to RefPtr.

* wtf/WeakPtr.h:
(WTF::WeakPtrFactory::createWeakPtr const):
(WTF::weak_reference_upcast):
(WTF::weak_reference_downcast):
(WTF::WeakPtr<T>::WeakPtr):
(WTF::=):
(WTF::makeWeakPtr):

Tools:

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::Base::weakPtrFactory):
(TestWebKitAPI::TEST):

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

23 months agoREGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
commit-queue@webkit.org [Tue, 3 Oct 2017 18:39:30 +0000 (18:39 +0000)]
REGRESSION(r221909): Failing fast/text/international/iso-8859-8.html
https://bugs.webkit.org/show_bug.cgi?id=177364

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-03
Reviewed by Carlos Garcia Campos.

Source/WebCore:

Range.getClientRects returned an incorrect rect for a last
collapsed space of RenderText in HarfBuzz port.

HarfBuzzShaper::selectionRect needs to return a valid value even
if the arguments 'from' and 'to' point to the just after the end
of the text run.

Tests: fast/text/international/iso-8859-8.html

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::shape): Do not check the return value of
fillGlyphBuffer.
(WebCore::HarfBuzzShaper::fillGlyphBuffer): Change the return
value type from bool to void.
(WebCore::HarfBuzzShaper::selectionRect): Set the rightmost
position to fromX if foundFromX is false.
* platform/graphics/harfbuzz/HarfBuzzShaper.h: Change the return
value type of fillGlyphBuffer from bool to void.

LayoutTests:

* platform/gtk/TestExpectations: Unmark fast/text/international/iso-8859-8.html.

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

23 months agoWebAssembly: no VM / JS version of everything but Instance
jfbastien@apple.com [Tue, 3 Oct 2017 18:33:14 +0000 (18:33 +0000)]
WebAssembly: no VM / JS version of everything but Instance
https://bugs.webkit.org/show_bug.cgi?id=177473

Reviewed by Filip Pizlo.

JSTests:

- Exceeding max on memory growth now returns a range error as per
spec. This is a (very minor) breaking change: it used to throw OOM
error. Update the corresponding test.

* wasm/js-api/memory-grow.js:
(assertEq):
* wasm/js-api/table.js:
(assert.throws):

Source/JavaScriptCore:

This change entails cleaning up and splitting a bunch of code which we had
intertwined between C++ classes which represent JS objects, and pure C++
implementation objects. This specific change goes most of the way towards
allowing JSC's WebAssembly to work without VM / JS, up to but excluding
JSWebAssemblyInstance (there's Wasm::Instance, but it's not *the* thing
yet). Because of this we still have a few FIXME identifying places that need to
change. A follow-up change will go the rest of the way.

I went about this change in the simplest way possible: grep the
JavaScriptCore/wasm directory for "JS[^C_]" as well as "VM" and exclude the /js/
sub-directory (which contains the JS implementation of WebAssembly).

None of this change removes the need for a JIT entitlement to be able to use
WebAssembly. We don't have an interpreter, the process therefore still needs to
be allowed to JIT to use these pure-C++ APIs.

Interesting things to note:

  - Remove VM from Plan and associated places. It can just live as a capture in
    the callback lambda if it's needed.
  - Wasm::Memory shouldn't require a VM. It was only used to ask the GC to
    collect. We now instead pass two lambdas at construction time for this
    purpose: one to notify of memory pressure, and the other to ask for
    syncrhonous memory reclamation. This allows whoever creates the memory to
    dictate how to react to both these cases, and for a JS embedding that's to
    call the GC (async or sync, respectively).
  - Move grow logic from JSWebAssemblyMemory to Wasm::Memory::grow. Use Expected
    there, with an enum class for failure types.
  - Exceeding max on memory growth now returns a range error as per spec. This
    is a (very minor) breaking change: it used to throw OOM error. Update the
    corresponding test.
  - When generating the grow_memory opcode, no need to get the VM. Instead,
    reach directly for Wasm::Memory and grow it.
  - JSWebAssemblyMemory::grow can now always throw on failure, because it's only
    ever called from JS (not from grow_memory as before).
  - Wasm::Memory now takes a callback for successful growth. This allows JS
    wrappers to register themselves when growth succeeds without Wasm::Memory
    knowning anything about JS. It'll also allow creating a list of callbacks
    for when we add thread support (we'll want to notify many wrappers, all
    under a lock).
  - Wasm::Memory is now back to being the source of truth about address / size,
    used directly by generated code instead of JSWebAssemblyMemory.
  - Move wasmToJS from the general WasmBinding header to its own header under
    wasm/js. It's only used by wasm/js/JSWebAssemblyCodeBlock.cpp, and uses VM,
    and therefore isn't general WebAssembly.
  - Make Wasm::Context an actual type (just a struct holding a
    JSWebAssemlyInstance for now) instead of an alias for that. Notably this
    doesn't add anything to the Context and doesn't change what actually gets
    passed around in JIT code (fast TLS or registers) because these changes
    potentially impact performance. The entire purpose of this change is to
    allow passing Wasm::Context around without having to know about VM. Since VM
    contains a Wasm::Context the JS embedding is effectively the same, but with
    this setup a non-JS embedding is much better off.
  - Move JSWebAssembly into the JS folder.
  - OMGPlan: use Wasm::CodeBlock directly instead of JSWebAssemblyCodeBlock.
  - wasm->JS stubs are now on Wasm::CodeBlock's tail as raw pointers, instead of
    being on JSWebAssemblyCodeBlock, and are now called wasm->Embedder
    stubs. The owned reference is still on JSWebAssemblyCodeBlock, and is still
    called wasm->JS stub. This move means that the embedder must, after creating
    a Wasm::CodeBlock, somehow create the stubs to call back into the
    embedder. This isn't adding any indirection to the generated code because
    the B3 IR generator now reaches for Wasm::CodeBlock instead of
    JSWebAssemblyCodeBlock.
  - Move more CodeBlock things. Compilation completion is now marked by its own
    atomic<bool> flag instead of a nullptr plan: that required using a lock, and
    was causing a deadlock in stack-trace.js because before my changes
    JSWebAssemblyCodeBlock did its own completion checking separately from
    Wasm::CodeBlock, without getting the lock. Now that everything points to
    Wasm::CodeBlock and there's no cached completion marker, the lock was being
    acquired in a sanity-check assertion.
  - Embedder -> Wasm wrappers are now generated through a function that's passed
    in at compilation time, instead of being hard-coded as a JS -> Wasm wrapper.
  - WasmMemory doens't need to know about fault handling thunks. Only the IR
    generator should know, and should make sure that the exception throwing
    thunk is generated if any memory is present (note: with signal handling not
    all of them generate an exception check).
  - Make exception throwing pluggable: instead of having a hard-coded
    JS-specific lambda we now have a regular C++ function being called from JIT
    code when a WebAssembly exception is thrown. This allows any embedder to get
    called as they wish. For now a process can only have a single of these
    functions (i.e. only one embedder per process) because the trap handler is a
    singleton. That can be fixed in in #177475.
  - Create WasmEmbedder.h where all embedder plugging will live.
  - Split up JSWebAssemblyTable into Wasm::Table which is
    refcounted. JSWebAssemblyTable now only contains the JS functions in the
    table, and Wasm::Table is what's used by the JIT code to lookup where to
    call and do the instance check (for context switch). Note that this creates
    an extra allocation for all the instances in Wasm::Table, and in exchange
    removes an indirection in JIT code because the instance used to be obtained
    off of the JS function. Also note that it's the embedder than keeps the
    instances alive, not Wasm::Table (which holds a dumb pointer to the
    instance), because doing otherwise would cause reference cycles.
  - Add WasmInstance. It doesn't do much for now, owns globals.
  - JSWebAssembly instance now doesn't just contain the imported functions as
    JSObjects, it also has the corresponding import's instance and wasm
    entrypoint. This triples the space allocated per instance's imported
    function, but there shouldn't be that many imports. This has two upsides: it
    creates smaller and faster code, and makes is easier to disassociate
    embedder-specific things from embedder-neutral things. The small / faster
    win is in two places: B3 IR generator only needs offsetOfImportFunction for
    the call opcode (when the called index is an import) to know whether the
    import is wasm->wasm or wasm->embedder (this isn't known at compile-time
    because it's dependent on the import object), this is now done by seeing if
    that import function has an associated target instance (only wasm->wasm
    does); the other place is wasmBinding which uses offsetOfImportFunction to
    figure out the wasm->wasm target instance, and then gets
    WebAssemblyFunction::offsetOfWasmEntrypointLoadLocation to do a tail
    call. The disassociation comes because the target instance can be
    Wasm::Instance once we change what the Context is, and
    WasmEntrypointLoadLocation is already embedder-independent. As a next step I
    can move this tail allocation from JSWebAssemblyInstance to Wasm::Instance,
    and leave importFunction in as an opaque pointer which is embedder-specific,
    and in JS will remain WriteBarrier<JSObject>.
  - Rename VMEntryFrame to EntryFrame, and in many places pass a pointer to it
    around instead of VM. This is a first step in allowing entry frames which
    aren't stored on VM, but which are instead stored in an embedder-specific
    location. That change won't really affect JS except through code churn, but
    will allow WebAssembly to use some machinery in a generic manner without
    having a VM.

* JavaScriptCore.xcodeproj/project.pbxproj:
* Sources.txt:
* bytecode/PolymorphicAccess.cpp:
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
* debugger/Debugger.cpp:
(JSC::Debugger::stepOutOfFunction):
(JSC::Debugger::returnEvent):
(JSC::Debugger::unwindEvent):
(JSC::Debugger::didExecuteProgram):
* dfg/DFGJITCompiler.cpp:
(JSC::DFG::JITCompiler::compileExceptionHandlers):
* dfg/DFGOSREntry.cpp:
(JSC::DFG::prepareOSREntry):
* dfg/DFGOSRExit.cpp:
(JSC::DFG::OSRExit::compileOSRExit):
(JSC::DFG::OSRExit::compileExit):
* dfg/DFGThunks.cpp:
(JSC::DFG::osrEntryThunkGenerator):
* ftl/FTLCompile.cpp:
(JSC::FTL::compile):
* ftl/FTLLink.cpp:
(JSC::FTL::link):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::lower):
* ftl/FTLOSRExitCompiler.cpp:
(JSC::FTL::compileStub):
* interpreter/CallFrame.cpp:
(JSC::CallFrame::wasmAwareLexicalGlobalObject):
(JSC::CallFrame::callerFrame):
(JSC::CallFrame::unsafeCallerFrame):
* interpreter/CallFrame.h:
(JSC::ExecState::callerFrame const):
(JSC::ExecState::callerFrameOrEntryFrame const):
(JSC::ExecState::unsafeCallerFrameOrEntryFrame const):
* interpreter/FrameTracers.h:
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):
(JSC::NativeCallFrameTracerWithRestore::NativeCallFrameTracerWithRestore):
(JSC::NativeCallFrameTracerWithRestore::~NativeCallFrameTracerWithRestore):
* interpreter/Interpreter.cpp:
(JSC::UnwindFunctor::operator() const):
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
(JSC::Interpreter::unwind):
* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::StackVisitor):
(JSC::StackVisitor::gotoNextFrame):
(JSC::StackVisitor::readNonInlinedFrame):
(JSC::StackVisitor::Frame::dump const):
* interpreter/StackVisitor.h:
(JSC::StackVisitor::Frame::callerIsEntryFrame const):
* interpreter/VMEntryRecord.h:
(JSC::VMEntryRecord::prevTopEntryFrame):
(JSC::VMEntryRecord::unsafePrevTopEntryFrame):
(JSC::EntryFrame::vmEntryRecordOffset):
* jit/AssemblyHelpers.cpp:
(JSC::AssemblyHelpers::restoreCalleeSavesFromEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::loadWasmContextInstance):
(JSC::AssemblyHelpers::storeWasmContextInstance):
(JSC::AssemblyHelpers::loadWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::storeWasmContextInstanceNeedsMacroScratchRegister):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBufferImpl):
* jit/AssemblyHelpers.h:
(JSC::AssemblyHelpers::copyCalleeSavesToVMEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesToEntryFrameCalleeSavesBuffer):
(JSC::AssemblyHelpers::copyCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer):
* jit/JIT.cpp:
(JSC::JIT::emitEnterOptimizationCheck):
(JSC::JIT::privateCompileExceptionHandlers):
* jit/JITExceptions.cpp:
(JSC::genericUnwind):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
(JSC::JIT::emitSlow_op_loop_hint):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_throw):
(JSC::JIT::emit_op_catch):
* jit/JITOperations.cpp:
* jit/ThunkGenerators.cpp:
(JSC::throwExceptionFromCallSlowPathGenerator):
(JSC::nativeForGenerator):
* jsc.cpp:
(functionDumpCallFrame):
* llint/LLIntSlowPaths.cpp:
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
* llint/LLIntThunks.cpp:
(JSC::vmEntryRecord):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:
* runtime/Options.cpp:
(JSC::recomputeDependentOptions):
* runtime/Options.h:
* runtime/SamplingProfiler.cpp:
(JSC::FrameWalker::FrameWalker):
(JSC::FrameWalker::advanceToParentFrame):
(JSC::SamplingProfiler::processUnverifiedStackTraces):
* runtime/ThrowScope.cpp:
(JSC::ThrowScope::~ThrowScope):
* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
* runtime/VM.h:
(JSC::VM::topEntryFrameOffset):
* runtime/VMTraps.cpp:
(JSC::isSaneFrame):
(JSC::VMTraps::tryInstallTrapBreakpoints):
(JSC::VMTraps::invalidateCodeBlocksOnStack):
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::restoreWasmContextInstance):
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
(JSC::Wasm::parseAndCompile):
* wasm/WasmB3IRGenerator.h:
* wasm/WasmBBQPlan.cpp:
(JSC::Wasm::BBQPlan::BBQPlan):
(JSC::Wasm::BBQPlan::compileFunctions):
(JSC::Wasm::BBQPlan::complete):
* wasm/WasmBBQPlan.h:
* wasm/WasmBBQPlanInlines.h:
(JSC::Wasm::BBQPlan::initializeCallees):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmBinding.h:
* wasm/WasmCodeBlock.cpp:
(JSC::Wasm::CodeBlock::create):
(JSC::Wasm::CodeBlock::CodeBlock):
(JSC::Wasm::CodeBlock::compileAsync):
(JSC::Wasm::CodeBlock::setCompilationFinished):
* wasm/WasmCodeBlock.h:
(JSC::Wasm::CodeBlock::offsetOfImportStubs):
(JSC::Wasm::CodeBlock::allocationSize):
(JSC::Wasm::CodeBlock::importWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::offsetOfImportWasmToEmbedderStub):
(JSC::Wasm::CodeBlock::wasmToJSCallStubForImport):
(JSC::Wasm::CodeBlock::compilationFinished):
(JSC::Wasm::CodeBlock::jsEntrypointCalleeFromFunctionIndexSpace):
(JSC::Wasm::CodeBlock::wasmEntrypointCalleeFromFunctionIndexSpace):
* wasm/WasmContext.cpp:
(JSC::Wasm::Context::useFastTLS):
(JSC::Wasm::Context::load const):
(JSC::Wasm::Context::store):
* wasm/WasmContext.h:
* wasm/WasmEmbedder.h: Copied from Source/JavaScriptCore/wasm/WasmContext.h.
* wasm/WasmFaultSignalHandler.cpp:
* wasm/WasmFaultSignalHandler.h:
* wasm/WasmFormat.h:
* wasm/WasmInstance.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::~Instance):
(JSC::Wasm::Instance::extraMemoryAllocated const):
* wasm/WasmInstance.h: Added.
(JSC::Wasm::Instance::create):
(JSC::Wasm::Instance::finalizeCreation):
(JSC::Wasm::Instance::module):
(JSC::Wasm::Instance::codeBlock):
(JSC::Wasm::Instance::memory):
(JSC::Wasm::Instance::table):
(JSC::Wasm::Instance::loadI32Global const):
(JSC::Wasm::Instance::loadI64Global const):
(JSC::Wasm::Instance::loadF32Global const):
(JSC::Wasm::Instance::loadF64Global const):
(JSC::Wasm::Instance::setGlobal):
(JSC::Wasm::Instance::offsetOfCachedStackLimit):
(JSC::Wasm::Instance::cachedStackLimit const):
(JSC::Wasm::Instance::setCachedStackLimit):
* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::Memory):
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::grow):
* wasm/WasmMemory.h:
(JSC::Wasm::Memory::offsetOfMemory):
(JSC::Wasm::Memory::offsetOfSize):
* wasm/WasmMemoryInformation.cpp:
(JSC::Wasm::PinnedRegisterInfo::get):
(JSC::Wasm::PinnedRegisterInfo::PinnedRegisterInfo):
* wasm/WasmMemoryInformation.h:
(JSC::Wasm::PinnedRegisterInfo::toSave const):
* wasm/WasmMemoryMode.cpp: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
(JSC::Wasm::makeString):
* wasm/WasmMemoryMode.h: Copied from Source/JavaScriptCore/wasm/WasmFaultSignalHandler.h.
* wasm/WasmModule.cpp:
(JSC::Wasm::makeValidationCallback):
(JSC::Wasm::Module::validateSync):
(JSC::Wasm::Module::validateAsync):
(JSC::Wasm::Module::getOrCreateCodeBlock):
(JSC::Wasm::Module::compileSync):
(JSC::Wasm::Module::compileAsync):
* wasm/WasmModule.h:
* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parseTableHelper):
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::OMGPlan):
(JSC::Wasm::OMGPlan::runForIndex):
* wasm/WasmOMGPlan.h:
* wasm/WasmPageCount.h:
(JSC::Wasm::PageCount::isValid const):
* wasm/WasmPlan.cpp:
(JSC::Wasm::Plan::Plan):
(JSC::Wasm::Plan::runCompletionTasks):
(JSC::Wasm::Plan::addCompletionTask):
(JSC::Wasm::Plan::tryRemoveContextAndCancelIfLast):
* wasm/WasmPlan.h:
(JSC::Wasm::Plan::dontFinalize):
* wasm/WasmSignature.cpp:
* wasm/WasmSignature.h:
* wasm/WasmTable.cpp: Added.
(JSC::Wasm::Table::create):
(JSC::Wasm::Table::~Table):
(JSC::Wasm::Table::Table):
(JSC::Wasm::Table::grow):
(JSC::Wasm::Table::clearFunction):
(JSC::Wasm::Table::setFunction):
* wasm/WasmTable.h: Copied from Source/JavaScriptCore/wasm/js/JSWebAssemblyTable.h.
(JSC::Wasm::Table::maximum const):
(JSC::Wasm::Table::size const):
(JSC::Wasm::Table::offsetOfSize):
(JSC::Wasm::Table::offsetOfFunctions):
(JSC::Wasm::Table::offsetOfInstances):
(JSC::Wasm::Table::isValidSize):
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
(JSC::Wasm::Thunks::setThrowWasmException):
(JSC::Wasm::Thunks::throwWasmException):
* wasm/WasmThunks.h:
* wasm/WasmWorklist.cpp:
(JSC::Wasm::Worklist::stopAllPlansForContext):
* wasm/WasmWorklist.h:
* wasm/js/JSToWasm.cpp: Added.
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSToWasm.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/JSWebAssembly.cpp: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.cpp.
* wasm/js/JSWebAssembly.h: Renamed from Source/JavaScriptCore/wasm/JSWebAssembly.h.
* wasm/js/JSWebAssemblyCodeBlock.cpp:
(JSC::JSWebAssemblyCodeBlock::create):
(JSC::JSWebAssemblyCodeBlock::JSWebAssemblyCodeBlock):
* wasm/js/JSWebAssemblyCodeBlock.h:
* wasm/js/JSWebAssemblyInstance.cpp:
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance):
(JSC::JSWebAssemblyInstance::finishCreation):
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h:
(JSC::JSWebAssemblyInstance::instance):
(JSC::JSWebAssemblyInstance::context const):
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::webAssemblyToJSCallee):
(JSC::JSWebAssemblyInstance::setMemory):
(JSC::JSWebAssemblyInstance::offsetOfTail):
(JSC::JSWebAssemblyInstance::importFunctionInfo):
(JSC::JSWebAssemblyInstance::offsetOfTargetInstance):
(JSC::JSWebAssemblyInstance::offsetOfWasmEntrypoint):
(JSC::JSWebAssemblyInstance::offsetOfImportFunction):
(JSC::JSWebAssemblyInstance::importFunction):
(JSC::JSWebAssemblyInstance::internalMemory):
(JSC::JSWebAssemblyInstance::wasmCodeBlock const):
(JSC::JSWebAssemblyInstance::offsetOfWasmTable):
(JSC::JSWebAssemblyInstance::offsetOfCallee):
(JSC::JSWebAssemblyInstance::offsetOfGlobals):
(JSC::JSWebAssemblyInstance::offsetOfWasmCodeBlock):
(JSC::JSWebAssemblyInstance::offsetOfWasmMemory):
(JSC::JSWebAssemblyInstance::cachedStackLimit const):
(JSC::JSWebAssemblyInstance::setCachedStackLimit):
(JSC::JSWebAssemblyInstance::wasmMemory):
(JSC::JSWebAssemblyInstance::wasmModule):
(JSC::JSWebAssemblyInstance::allocationSize):
(JSC::JSWebAssemblyInstance::module const):
* wasm/js/JSWebAssemblyMemory.cpp:
(JSC::JSWebAssemblyMemory::create):
(JSC::JSWebAssemblyMemory::adopt):
(JSC::JSWebAssemblyMemory::JSWebAssemblyMemory):
(JSC::JSWebAssemblyMemory::grow):
(JSC::JSWebAssemblyMemory::growSuccessCallback):
* wasm/js/JSWebAssemblyMemory.h:
* wasm/js/JSWebAssemblyModule.cpp:
(JSC::JSWebAssemblyModule::moduleInformation const):
(JSC::JSWebAssemblyModule::exportSymbolTable const):
(JSC::JSWebAssemblyModule::signatureIndexFromFunctionIndexSpace const):
(JSC::JSWebAssemblyModule::callee const):
(JSC::JSWebAssemblyModule::codeBlock):
(JSC::JSWebAssemblyModule::module):
* wasm/js/JSWebAssemblyModule.h:
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::create):
(JSC::JSWebAssemblyTable::JSWebAssemblyTable):
(JSC::JSWebAssemblyTable::visitChildren):
(JSC::JSWebAssemblyTable::grow):
(JSC::JSWebAssemblyTable::getFunction):
(JSC::JSWebAssemblyTable::clearFunction):
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/JSWebAssemblyTable.h:
(JSC::JSWebAssemblyTable::isValidSize):
(JSC::JSWebAssemblyTable::maximum const):
(JSC::JSWebAssemblyTable::size const):
(JSC::JSWebAssemblyTable::table):
* wasm/js/WasmToJS.cpp: Copied from Source/JavaScriptCore/wasm/WasmBinding.cpp.
(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::wasmToJSException):
* wasm/js/WasmToJS.h: Copied from Source/JavaScriptCore/wasm/WasmBinding.h.
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyMemoryConstructor.cpp:
(JSC::constructJSWebAssemblyMemory):
* wasm/js/WebAssemblyMemoryPrototype.cpp:
(JSC::webAssemblyMemoryProtoFuncGrow):
* wasm/js/WebAssemblyModuleConstructor.cpp:
(JSC::constructJSWebAssemblyModule):
(JSC::WebAssemblyModuleConstructor::createModule):
* wasm/js/WebAssemblyModuleConstructor.h:
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::webAssemblyCompileFunc):
(JSC::instantiate):
(JSC::compileAndInstantiate):
(JSC::webAssemblyValidateFunc):
* wasm/js/WebAssemblyTableConstructor.cpp:
(JSC::constructJSWebAssemblyTable):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::create):

Source/WebCore:

* ForwardingHeaders/wasm/WasmModule.h: Added. This used to be
included in JSWebAssemblyModule.h.
* bindings/js/SerializedScriptValue.cpp: Update postMessage code
according to C++ API changes.

Source/WTF:

* wtf/StdLibExtras.h:
(WTF::default_construct_at): this makes code in WasmTable much
more readable, and is generally useful for generic code

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

23 months ago[AX] Do not trigger redundant layout on tables.
zalan@apple.com [Tue, 3 Oct 2017 18:24:44 +0000 (18:24 +0000)]
[AX] Do not trigger redundant layout on tables.
https://bugs.webkit.org/show_bug.cgi?id=177781
<rdar://problem/34777030>

Reviewed by Antti Koivisto.

Source/WebCore:

RenderTable::forceSectionsRecalc() marks the RenderTable dirty and schedules a layout.
Every time AccessibilityTable asks for the table element (including during construction),
we end up triggering a layout. This call was added (r191357) to ensure RenderTable's m_firstBody is always
up-to-date (in case of anonymous wrapper table renderer). Instead of relying on the m_firstBody,
let's just use the first child to find the table element. The first child always points to a valid
renderer (or nullptr), while m_firstBody is the result of section computation.

Covered by existing tests.

* accessibility/AccessibilityTable.cpp:
(WebCore::AccessibilityTable::tableElement const):

LayoutTests:

* TestExpectations: see webkit.org/b/177799

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

23 months agoRemove no longer needed WebRTC build infrastructure
commit-queue@webkit.org [Tue, 3 Oct 2017 18:09:29 +0000 (18:09 +0000)]
Remove no longer needed WebRTC build infrastructure
https://bugs.webkit.org/show_bug.cgi?id=177756

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-03
Reviewed by Alejandro G. Castro.

Source/ThirdParty/libwebrtc:

* WebKit/project.json: Removed.
* WebKit/rtc_sdk_framework_objc_info_plist.plist: Removed.

Tools:

* Scripts/generate-libwebrtc-cmake: Removed.
* Scripts/webkitpy/libwebrtc/__init__.py: Removed.
* Scripts/webkitpy/libwebrtc/generate_cmake.py: Removed.

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

23 months ago[CSP] Check policy before opening a new window to a JavaScript URL
dbates@webkit.org [Tue, 3 Oct 2017 18:03:02 +0000 (18:03 +0000)]
[CSP] Check policy before opening a new window to a JavaScript URL
https://bugs.webkit.org/show_bug.cgi?id=176815
<rdar://problem/34400057>

Reviewed by Brent Fulgham.

Source/WebCore:

Ensure that the Content Security Policy of the page allows navigation to a JavaScript URL
before opening a new window to it.

Test: http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html

* loader/FrameLoader.cpp:
(WebCore::createWindow):

LayoutTests:

* http/tests/security/contentSecurityPolicy/resources/window-open-javascript-url-blocked.js: Added.
* http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/window-open-javascript-url-blocked.html: Added.

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

23 months agoAX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
jdiggs@igalia.com [Tue, 3 Oct 2017 17:56:50 +0000 (17:56 +0000)]
AX: [ATK] ARIA drag-and-drop attribute values should be exposed via AtkObject attributes
https://bugs.webkit.org/show_bug.cgi?id=177763

Reviewed by Chris Fleizach.

Source/WebCore:

Expose the values of aria-grabbed and aria-dropeffect via the "grabbed" and "dropeffect"
AtkObject attributes.

Test: accessibility/gtk/aria-drag-and-drop.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):

Tools:

Implement ariaIsGrabbed() and ariaDropEffects() for ATK.

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::ariaIsGrabbed const):
(WTR::AccessibilityUIElement::ariaDropEffects const):

LayoutTests:

* accessibility/gtk/aria-drag-and-drop-expected.txt: Added.
* accessibility/gtk/aria-drag-and-drop.html: Added.

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

23 months agoUnreviewed test fix after r222779.
bfulgham@apple.com [Tue, 3 Oct 2017 17:29:12 +0000 (17:29 +0000)]
Unreviewed test fix after r222779.

* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Setting NSSecureCoding in this test code should be
done based on build system, just like it is in the actual WebArchive handling code.

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

23 months agoClean-up RealtimeIncomingVideoSource
commit-queue@webkit.org [Tue, 3 Oct 2017 16:26:14 +0000 (16:26 +0000)]
Clean-up RealtimeIncomingVideoSource
https://bugs.webkit.org/show_bug.cgi?id=177782

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-03
Reviewed by Alejandro G. Castro.

No change of behavior.
Removing code that is no longer needed.

* platform/mediastream/mac/RealtimeIncomingVideoSource.cpp:
(WebCore::RealtimeIncomingVideoSource::create):
(WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
* platform/mediastream/mac/RealtimeIncomingVideoSource.h:

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

23 months agoUnreviewed test gardening.
cturner@igalia.com [Tue, 3 Oct 2017 16:25:02 +0000 (16:25 +0000)]
Unreviewed test gardening.

* platform/gtk/TestExpectations:

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

23 months agoMove payment-request TestExpectations to ios-wk2.
ryanhaddad@apple.com [Tue, 3 Oct 2017 16:16:31 +0000 (16:16 +0000)]
Move payment-request TestExpectations to ios-wk2.

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:

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

23 months agoWeb Inspector: Add View layout tests, make views more testable
mattbaker@apple.com [Tue, 3 Oct 2017 16:12:26 +0000 (16:12 +0000)]
Web Inspector: Add View layout tests, make views more testable
https://bugs.webkit.org/show_bug.cgi?id=161274
<rdar://problem/28038615>

Reviewed by Devin Rousso.

Source/WebInspectorUI:

This patch adds support for View testing. Since view layouts are scheduled
using requestAnimationFrame, FrontendTestHarness now provides a timer-based
polyfill, to allow nonintrusive testing of the frontend View hierarchy.

* UserInterface/Test.html:
Make WI.View available to tests.

* UserInterface/Test/FrontendTestHarness.js:
(FrontendTestHarness.prototype.redirectRequestAnimationFrame):

* UserInterface/Views/View.js:
(WI.View.rootView):
(WI.View.prototype.replaceSubview):
(WI.View.prototype._didMoveToWindow):
(WI.View._cancelScheduledLayoutForView):
Fixed issues caught while writing tests for the expected View behavior.

LayoutTests:

Add tests for creating views, adding and removing subviews, and layout
operations. These tests rely on a mock requestAnimationFrame, which is
enabled with FrontendTestHarness.redirectRequestAnimationFrame.

* inspector/view/asynchronous-layout-expected.txt: Added.
* inspector/view/asynchronous-layout.html: Added.
* inspector/view/basics-expected.txt: Added.
* inspector/view/basics.html: Added.
* inspector/view/synchronous-layout-expected.txt: Added.
* inspector/view/synchronous-layout.html: Added.

* inspector/view/resources/test-view.js: Added.
(TestPage.registerInitializer.WI.TestView):
(TestPage.registerInitializer.WI.TestView.prototype.get initialLayoutCount):
(TestPage.registerInitializer.WI.TestView.prototype.get layoutCount):
(TestPage.registerInitializer.WI.TestView.prototype.evaluateAfterLayout):
(TestPage.registerInitializer.WI.TestView.prototype.initialLayout):
(TestPage.registerInitializer.WI.TestView.prototype.layout):
(TestPage.registerInitializer):
Register an instrumentation subclass of View. TestView counts calls to
protected methods and accepts callbacks to execute when a layout completes.

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

23 months agoUpdate iOS TestExpectations for payment-request tests.
ryanhaddad@apple.com [Tue, 3 Oct 2017 16:05:30 +0000 (16:05 +0000)]
Update iOS TestExpectations for payment-request tests.
https://bugs.webkit.org/show_bug.cgi?id=177786

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

23 months agoSkip JSC test stress/regress-159779-2.js on debug.
ryanhaddad@apple.com [Tue, 3 Oct 2017 16:05:27 +0000 (16:05 +0000)]
Skip JSC test stress/regress-159779-2.js on debug.
https://bugs.webkit.org/show_bug.cgi?id=177204

Unreviewed test gardening.

* stress/regress-159779-2.js:

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

23 months ago[Mac] Use safer decoding practices for NSKeyedUnarchiver
bfulgham@apple.com [Tue, 3 Oct 2017 16:00:55 +0000 (16:00 +0000)]
[Mac] Use safer decoding practices for NSKeyedUnarchiver
https://bugs.webkit.org/show_bug.cgi?id=175887
<rdar://problem/33435281>

Reviewed by Daniel Bates.

Source/WebCore:

* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
(WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.

LayoutTests:

Mark two tests as flaky for now, until the relevant CFNetwork changes are available on the test systems.
1. webarchive/loading/cache-expired-subresource.html
2. webarchive/loading/test-loading-archive-subresource-null-mimetype.html

* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

23 months agoRemove some duplicated canvas toDataURL tests.
Ms2ger@igalia.com [Tue, 3 Oct 2017 15:41:03 +0000 (15:41 +0000)]
Remove some duplicated canvas toDataURL tests.
https://bugs.webkit.org/show_bug.cgi?id=177805

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

This copy of the canvas test suite was added in bug 138324 (r176144).
At that point there already was an older copy, that was added in
bug 20553 (r59954). A newer copy was added in bug 148822 (r189394) and
has been kept up-to-date with upstream since.

I have verified that the latest tests cover everything the older copies
do. There seems to be no reason to keep the older copies around.

* canvas/resources/toDataURL.jpeg.alpha.png: Removed.
* canvas/resources/toDataURL.jpeg.primarycolours.png: Removed.
* canvas/resources/toDataURL.jpeg.quality.basic.png: Removed.
* canvas/resources/toDataURL.png.complexcolours.png: Removed.
* canvas/resources/toDataURL.png.primarycolours.png: Removed.
* canvas/toDataURL.arguments.1-expected.txt: Removed.
* canvas/toDataURL.arguments.1.html: Removed.
* canvas/toDataURL.arguments.2-expected.txt: Removed.
* canvas/toDataURL.arguments.2.html: Removed.
* canvas/toDataURL.arguments.3-expected.txt: Removed.
* canvas/toDataURL.arguments.3.html: Removed.
* canvas/toDataURL.bogustype-expected.txt: Removed.
* canvas/toDataURL.bogustype.html: Removed.
* canvas/toDataURL.default-expected.txt: Removed.
* canvas/toDataURL.default.html: Removed.
* canvas/toDataURL.jpeg.alpha.html: Removed.
* canvas/toDataURL.jpeg.primarycolours.html: Removed.
* canvas/toDataURL.jpeg.quality.basic.html: Removed.
* canvas/toDataURL.jpeg.quality.notnumber-expected.txt: Removed.
* canvas/toDataURL.jpeg.quality.notnumber.html: Removed.
* canvas/toDataURL.jpeg.quality.outsiderange-expected.txt: Removed.
* canvas/toDataURL.jpeg.quality.outsiderange.html: Removed.
* canvas/toDataURL.lowercase.ascii-expected.txt: Removed.
* canvas/toDataURL.lowercase.ascii.html: Removed.
* canvas/toDataURL.lowercase.unicode-expected.txt: Removed.
* canvas/toDataURL.lowercase.unicode.html: Removed.
* canvas/toDataURL.nocontext-expected.txt: Removed.
* canvas/toDataURL.nocontext.html: Removed.
* canvas/toDataURL.png-expected.txt: Removed.
* canvas/toDataURL.png.complexcolours.html: Removed.
* canvas/toDataURL.png.html: Removed.
* canvas/toDataURL.png.primarycolours.html: Removed.
* canvas/toDataURL.unrecognised-expected.txt: Removed.
* canvas/toDataURL.unrecognised.html: Removed.
* canvas/toDataURL.zerosize-expected.txt: Removed.
* canvas/toDataURL.zerosize.html: Removed.

LayoutTests:

This copy of the canvas test suite was added in bug 20553 (r59954).
Another one-time import was done in bug 138324 (r176144). Yet another
copy was added in bug 148822 (r189394) and this one has been kept
up-to-date with upstream since.

I have verified that the latest tests cover everything the older copies
do. There seems to be no reason to keep the older copies around.

* TestExpectations: Removed reference to removed test.
* canvas/philip/tests/toDataURL.arguments.1-expected.txt: Removed.
* canvas/philip/tests/toDataURL.arguments.1.html: Removed.
* canvas/philip/tests/toDataURL.arguments.2-expected.txt: Removed.
* canvas/philip/tests/toDataURL.arguments.2.html: Removed.
* canvas/philip/tests/toDataURL.arguments.3-expected.txt: Removed.
* canvas/philip/tests/toDataURL.arguments.3.html: Removed.
* canvas/philip/tests/toDataURL.bogustype-expected.txt: Removed.
* canvas/philip/tests/toDataURL.bogustype.html: Removed.
* canvas/philip/tests/toDataURL.default-expected.txt: Removed.
* canvas/philip/tests/toDataURL.default.html: Removed.
* canvas/philip/tests/toDataURL.jpeg.alpha-expected.txt: Removed.
* canvas/philip/tests/toDataURL.jpeg.alpha.html: Removed.
* canvas/philip/tests/toDataURL.jpeg.alpha.png: Removed.
* canvas/philip/tests/toDataURL.jpeg.primarycolours-expected.txt: Removed.
* canvas/philip/tests/toDataURL.jpeg.primarycolours.html: Removed.
* canvas/philip/tests/toDataURL.jpeg.primarycolours.png: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.basic-expected.txt: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.basic.html: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.basic.png: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.notnumber-expected.txt: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.notnumber.html: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.outsiderange-expected.txt: Removed.
* canvas/philip/tests/toDataURL.jpeg.quality.outsiderange.html: Removed.
* canvas/philip/tests/toDataURL.lowercase.ascii-expected.txt: Removed.
* canvas/philip/tests/toDataURL.lowercase.ascii.html: Removed.
* canvas/philip/tests/toDataURL.lowercase.unicode-expected.txt: Removed.
* canvas/philip/tests/toDataURL.lowercase.unicode.html: Removed.
* canvas/philip/tests/toDataURL.nocontext-expected.txt: Removed.
* canvas/philip/tests/toDataURL.nocontext.html: Removed.
* canvas/philip/tests/toDataURL.png-expected.txt: Removed.
* canvas/philip/tests/toDataURL.png.complexcolours-expected.txt: Removed.
* canvas/philip/tests/toDataURL.png.complexcolours.html: Removed.
* canvas/philip/tests/toDataURL.png.complexcolours.png: Removed.
* canvas/philip/tests/toDataURL.png.html: Removed.
* canvas/philip/tests/toDataURL.png.primarycolours-expected.txt: Removed.
* canvas/philip/tests/toDataURL.png.primarycolours.html: Removed.
* canvas/philip/tests/toDataURL.png.primarycolours.png: Removed.
* canvas/philip/tests/toDataURL.unrecognised-expected.txt: Removed.
* canvas/philip/tests/toDataURL.unrecognised.html: Removed.
* canvas/philip/tests/toDataURL.zerosize-expected.txt: Removed.
* canvas/philip/tests/toDataURL.zerosize.html: Removed.
* platform/ios-device/TestExpectations: Removed reference to removed test.

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

23 months agoUnreviewed, rolling out r222760.
ryanhaddad@apple.com [Tue, 3 Oct 2017 15:19:01 +0000 (15:19 +0000)]
Unreviewed, rolling out r222760.

This change caused LayoutTest crashes.

Reverted changeset:

"[Mac] Use safer decoding practices for NSKeyedUnarchiver"
https://bugs.webkit.org/show_bug.cgi?id=175887
http://trac.webkit.org/changeset/222760

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

23 months agoREGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event...
mcatanzaro@igalia.com [Tue, 3 Oct 2017 09:50:06 +0000 (09:50 +0000)]
REGRESSION(r222392): [WPE][GTK] Many forms tests are failing due to broken event timestamps
https://bugs.webkit.org/show_bug.cgi?id=177449

Reviewed by Chris Dumez.

Source/WebCore:

* platform/gtk/GtkUtilities.cpp:
(WebCore::wallTimeForEvent):
* platform/gtk/GtkUtilities.h:
(WebCore::wallTimeForEvent):
* platform/gtk/PlatformKeyboardEventGtk.cpp:
(WebCore::PlatformKeyboardEvent::PlatformKeyboardEvent):
* platform/gtk/PlatformMouseEventGtk.cpp:
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/gtk/PlatformWheelEventGtk.cpp:
(WebCore::PlatformWheelEvent::PlatformWheelEvent):

Source/WebKit:

* Shared/gtk/WebEventFactory.cpp:
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebTouchEvent):
* Shared/wpe/WebEventFactory.cpp:
(WebKit::wallTimeForEventTime):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::WebEventFactory::createWebWheelEvent):
(WebKit::WebEventFactory::createWebTouchEvent):

LayoutTests:

* platform/gtk/TestExpectations:

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

23 months agoBuild libwebrtc unit tests executables
commit-queue@webkit.org [Tue, 3 Oct 2017 09:43:47 +0000 (09:43 +0000)]
Build libwebrtc unit tests executables
https://bugs.webkit.org/show_bug.cgi?id=177211

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-03
Reviewed by Alex Christensen.

.:

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme:

Source/ThirdParty/libwebrtc:

Adding support for a new target called unittests that will be several executables.
Each executable run unit tests dedicated to a part of libwebrtc.

Adding one target/executable per unit test suite.
Adding one composite target to build all unit test targets.
Adding a target to build a static libwebrtctest library.
The static libwebrtctest library is then linked to each unit test executable which is also linked to libwebrtc dylib.

Some unit tests require a default codec (VP8) that is disabled in libwebrtc.
This ends up making some tests crashing.
An additional work should follow to execute only the meaningful subset of tests.

* Configurations/libwebrtc-base.xcconfig: Added.
* Configurations/libwebrtc-test-static.xcconfig: Added.
* Configurations/rtc_pc_unittests.xcconfig: Added.
* Source/third_party/gflags/gen/posix/include/private/config.h:
* Source/webrtc/modules/audio_coding/neteq/tools/neteq_test.cc: Replacing FATAL by RTC_FATAL.
* Source/webrtc/sdk/objc/Framework/Classes/Common/helpers.mm: Removing UIKit dependency.
* Source/webrtc/test/gmock.h: Using googletest version instead of checking in testing folder.
* Source/webrtc/test/gtest.h: Ditto.
* Source/webrtc/test/rtp_file_reader.cc: Replacing FATAL by RTC_FATAL.
* libwebrtc.xcodeproj/project.pbxproj:

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

23 months agoUse vector map routine in WebCore CacheStorage implementation
commit-queue@webkit.org [Tue, 3 Oct 2017 09:35:07 +0000 (09:35 +0000)]
Use vector map routine in WebCore CacheStorage implementation
https://bugs.webkit.org/show_bug.cgi?id=177002

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-03
Reviewed by Darin Adler.

No change of behavior.
Replacing use of reserveInitialCapacity/uncheckedAppend by use of map.

* Modules/cache/CacheStorage.cpp:
(WebCore::copyCache):
(WebCore::CacheStorage::match):
(WebCore::CacheStorage::retrieveCaches):
(WebCore::CacheStorage::keys):
(WebCore::copyCaches): Deleted.
* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::matchAll):
(WebCore::copyRequestRef):
(WebCore::DOMCache::keys):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::isolateCacheInfo):
(WebCore::DOMCacheEngine::CacheInfos::isolatedCopy):
* Modules/cache/WorkerCacheStorageConnection.cpp:
(WebCore::recordsDataFromRecords):
(WebCore::recordsFromRecordsData):

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

23 months agoW3C tests importer should not import the whole tools directory
carlosgc@webkit.org [Tue, 3 Oct 2017 08:58:06 +0000 (08:58 +0000)]
W3C tests importer should not import the whole tools directory
https://bugs.webkit.org/show_bug.cgi?id=177351

Reviewed by Youenn Fablet.

Only wptserve and its dependencies are needed to run the layout tests. It seems we already tried to avoid
importing pytest for example, but the wrong path is used in import-expectations.json. Instead of skipping what
we don't want, I think it's better to skip tools and import only what we need, that way if new directories are
added upstream we won't import them. This will reduce a lot the size of the tools directory, and will avoid
duplication with the WebDriver tests importer that needs wptrunner, webdriver and pytest from tools directory.

* resources/TestRepositories:
* resources/import-expectations.json:
* web-platform-tests/tools/OWNERS: Removed.
* web-platform-tests/tools/appveyor.yml: Removed.
* web-platform-tests/tools/browserutils: Removed.
* web-platform-tests/tools/certs: Removed.
* web-platform-tests/tools/ci: Removed.
* web-platform-tests/tools/conftest.py: Removed.
* web-platform-tests/tools/gitignore: Removed.
* web-platform-tests/tools/html5lib: Removed.
* web-platform-tests/tools/lint: Removed.
* web-platform-tests/tools/py: Removed.
* web-platform-tests/tools/pytest.ini: Removed.
* web-platform-tests/tools/pytest: Removed.
* web-platform-tests/tools/runner: Removed.
* web-platform-tests/tools/scripts: Removed.
* web-platform-tests/tools/six: Removed.
* web-platform-tests/tools/tox.ini: Removed.
* web-platform-tests/tools/w3c-import.log:
* web-platform-tests/tools/webdriver: Removed.
* web-platform-tests/tools/wpt: Removed.
* web-platform-tests/tools/wptrunner: Removed.

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

23 months ago[GTK][WPE] WebProcess should run cleanup on quit to release resources
carlosgc@webkit.org [Tue, 3 Oct 2017 08:12:19 +0000 (08:12 +0000)]
[GTK][WPE] WebProcess should run cleanup on quit to release resources
https://bugs.webkit.org/show_bug.cgi?id=168126

Reviewed by Michael Catanzaro.

Do not call exit on sync message send failure for GTK and WPE ports.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeConnection):

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

23 months agoMove LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
mmaxfield@apple.com [Tue, 3 Oct 2017 06:42:22 +0000 (06:42 +0000)]
Move LineEnding.{h,cpp} from WebCore/platform/text to wtf/text
https://bugs.webkit.org/show_bug.cgi?id=176575

Reviewed by Alex Christensen.

Source/WebCore:

No new tests because there is no behavior change.

* WebCore.xcodeproj/project.pbxproj:
* fileapi/BlobBuilder.cpp:
* html/FormDataList.cpp:

Source/WTF:

As part of the PAL effort, we're trying to move everything out of WebCore/platform, one-by-one.
These LineEnding files belong in WTF.

* WTF.xcodeproj/project.pbxproj:
* wtf/text/LineEnding.cpp: Renamed from Source/WebCore/platform/text/LineEnding.cpp.
(WTF::normalizeLineEndingsToCRLF):
* wtf/text/LineEnding.h: Renamed from Source/WebCore/platform/text/LineEnding.h.

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

23 months agoMake WSL demo compatible with Microsoft Edge
mmaxfield@apple.com [Tue, 3 Oct 2017 06:36:56 +0000 (06:36 +0000)]
Make WSL demo compatible with Microsoft Edge
https://bugs.webkit.org/show_bug.cgi?id=177643

Reviewed by Saam Barati.

This patch does two things. The first is it migrates a loop over ParentNode.children to a legacy style loop
because Microsoft Edge throws an exception when trying to use a for...of loop with it. This patch also hides
the compilation behind a setTimeout(0) so there is some indication that something is happening during a
compile.

* Tools/WebGPUShadingLanguageRI/index.html:

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

23 months agoWeb Inspector: Rename methods ending in *Json() as *JSON()
commit-queue@webkit.org [Tue, 3 Oct 2017 05:31:19 +0000 (05:31 +0000)]
Web Inspector: Rename methods ending in *Json() as *JSON()
https://bugs.webkit.org/show_bug.cgi?id=177793

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-02
Reviewed by Matt Baker.

* inspector/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForCachedResource):
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::didReceiveResponse):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::resourceTypeJSON):
(WebCore::InspectorPageAgent::cachedResourceTypeJSON):
(WebCore::InspectorPageAgent::buildObjectForFrameTree):
(WebCore::InspectorPageAgent::resourceTypeJson): Deleted.
(WebCore::InspectorPageAgent::cachedResourceTypeJson): Deleted.
* inspector/InspectorPageAgent.h:

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

23 months agoREGRESSION(r222595): Intermittent crash while accessing DataTransferItemList
wenson_hsieh@apple.com [Tue, 3 Oct 2017 05:10:29 +0000 (05:10 +0000)]
REGRESSION(r222595): Intermittent crash while accessing DataTransferItemList
https://bugs.webkit.org/show_bug.cgi?id=177791
<rdar://problem/34781456>

Reviewed by Ryosuke Niwa.

Source/WebCore:

DataTransfer::moveDragState() currently attempts to move the other DataTransfer's DataTransferItemList and
DragImageLoader as members of its own. This is incorrect, since both of these entities hold raw references of
some form to the other DataTransfer, yet they are held as unique_ptrs in the new DataTransfer. To fix this, we
(1) remove the line of code that moves the item list, since item lists will be lazily generated on the new
DataTransfer anyways, and (2) update the DataTransfer pointer on the old DataTransfer's DragImageLoader after
moving it to the new DataTransfer.

Test: editing/pasteboard/drag-end-crash-accessing-item-list.html

* dom/DataTransfer.cpp:
(WebCore::DragImageLoader::moveToDataTransfer):
(WebCore::DataTransfer::moveDragState):

LayoutTests:

Add a new layout test that simulates the crash encountered in this bug by forcing a garbage collection sweep
right before accessing the pasteboard in a "dragend" event handler.

* TestExpectations:
* editing/pasteboard/drag-end-crash-accessing-item-list-expected.txt: Added.
* editing/pasteboard/drag-end-crash-accessing-item-list.html: Added.
* platform/mac-wk1/TestExpectations:

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

23 months agoRename computeSharedStringHash() overload taking a URL to computedVisitedLinkHash()
cdumez@apple.com [Tue, 3 Oct 2017 04:35:28 +0000 (04:35 +0000)]
Rename computeSharedStringHash() overload taking a URL to computedVisitedLinkHash()
https://bugs.webkit.org/show_bug.cgi?id=177776

Reviewed by Alex Christensen.

* dom/VisitedLinkState.cpp:
(WebCore::linkHashForElement):
(WebCore::VisitedLinkState::determineLinkStateSlowCase):
* html/HTMLAnchorElement.h:
(WebCore::HTMLAnchorElement::visitedLinkHash const):
* platform/SharedStringHash.cpp:
(WebCore::computeVisitedLinkHash):
* platform/SharedStringHash.h:

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

23 months agoMerge three Blink test cases
bfulgham@apple.com [Tue, 3 Oct 2017 03:07:05 +0000 (03:07 +0000)]
Merge three Blink test cases
https://bugs.webkit.org/show_bug.cgi?id=177797
<rdar://problem/27331975>

Unreviewed merge of Blink test cases.

Merge three test cases from the following Blink change:
    https://chromium.googlesource.com/chromium/blink/+/17c5b48f130e4ebb796f9db89628f887624db4ef

Relevant fixes had been made in WebKit over the years, but we did not include proper
test coverage.

* fast/dom/assertion-on-node-removal-expected.txt: Added.
* fast/dom/assertion-on-node-removal.html: Added.
* fast/forms/control-detach-crash-expected.txt: Added.
* fast/forms/control-detach-crash.html: Added.
* svg/custom/assert-on-node-removal-expected.txt: Added.
* svg/custom/assert-on-node-removal.html: Added.

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

23 months agoAX: [ATK] The value of aria-level is not exposed on non-heading roles
jdiggs@igalia.com [Tue, 3 Oct 2017 01:02:47 +0000 (01:02 +0000)]
AX: [ATK] The value of aria-level is not exposed on non-heading roles
https://bugs.webkit.org/show_bug.cgi?id=177775

Reviewed by Chris Fleizach.

Source/WebCore:

Expose the value of aria-level via the "level" AtkObject attribute, as is currently
done for headings.

Test: accessibility/gtk/aria-level.html

* accessibility/atk/WebKitAccessibleWrapperAtk.cpp:
(webkitAccessibleGetAttributes):

Tools:

* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::hierarchicalLevel const):

LayoutTests:

* accessibility/gtk/aria-level-expected.txt: Added.
* accessibility/gtk/aria-level.html: Added.

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

23 months agoWeakPtr should have a move constructor
ggaren@apple.com [Tue, 3 Oct 2017 00:42:05 +0000 (00:42 +0000)]
WeakPtr should have a move constructor
https://bugs.webkit.org/show_bug.cgi?id=177789

Reviewed by Chris Dumez.

Source/WTF:

* wtf/WeakPtr.h: Now that we just have a RefPtr data member,
the default operators are sufficient.

Tools:

Chris made me write an API test. It wasn't that painful.

* TestWebKitAPI/Tests/WTF/WeakPtr.cpp:
(TestWebKitAPI::TEST):

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

23 months ago[Payment Request] Validate payment method identifiers
aestes@apple.com [Tue, 3 Oct 2017 00:37:50 +0000 (00:37 +0000)]
[Payment Request] Validate payment method identifiers
https://bugs.webkit.org/show_bug.cgi?id=177794

Reviewed by Sam Weinig.

LayoutTests/imported/w3c:

* web-platform-tests/payment-request/payment-request-ctor-pmi-handling.https-expected.txt:

Source/WebCore:

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::isValidStandardizedPaymentMethodIdentifier):
(WebCore::isValidURLBasedPaymentMethodIdentifier):
(WebCore::convertAndValidatePaymentMethodIdentifier):
(WebCore::PaymentRequest::create):
* Modules/paymentrequest/PaymentRequest.h:

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

23 months agoWeb Inspector: Escape more characters in posix string conversion
commit-queue@webkit.org [Tue, 3 Oct 2017 00:29:00 +0000 (00:29 +0000)]
Web Inspector: Escape more characters in posix string conversion
https://bugs.webkit.org/show_bug.cgi?id=177761
<rdar://problem/34506832>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-02
Reviewed by Brian Burg.

* UserInterface/Models/Resource.js:
(WI.Resource.prototype.generateCURLCommand.escapeStringPosix):
Escape '!' to '\041' in posix strings ($'...') since '!' may have special behavior at times.

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

23 months agoMove more code into PasteboardCustomData
rniwa@webkit.org [Tue, 3 Oct 2017 00:22:17 +0000 (00:22 +0000)]
Move more code into PasteboardCustomData
https://bugs.webkit.org/show_bug.cgi?id=177795

Reviewed by Wenson Hsieh.

Source/WebCore:

Moved sharedBufferFromCustomData, customDataFromSharedBuffer, and customWebKitPasteboardDataType into
PasteboardCustomData as createSharedBuffer, fromSharedBuffer, and cocoaType respectively.

* platform/Pasteboard.cpp:
(WebCore::PasteboardCustomData::createSharedBuffer const): Renamed from sharedBufferFromCustomData.
(WebCore::PasteboardCustomData::fromSharedBuffer): Renamed from customDataFromSharedBuffer.
* platform/Pasteboard.h:
* platform/StaticPasteboard.cpp:
(WebCore::StaticPasteboard::commitToPasteboard): Now initializes with an empty origin string.
* platform/cocoa/PasteboardCocoa.mm:
(WebCore::PasteboardCustomData::cocoaType): Moved here from Pasteboard.h
(WebCore::Pasteboard::readStringInCustomData):
* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
(WebCore::PlatformPasteboard::write):
* platform/ios/WebItemProviderPasteboard.mm:
(-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):
(WebCore::PlatformPasteboard::write):

Source/WebKit:

Added the support for encoding and decoding the origin string in PasteboardCustomData.

* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<PasteboardCustomData>::encode):
(IPC::ArgumentCoder<PasteboardCustomData>::decode):

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

23 months ago[Mac] Use safer decoding practices for NSKeyedUnarchiver
bfulgham@apple.com [Tue, 3 Oct 2017 00:13:13 +0000 (00:13 +0000)]
[Mac] Use safer decoding practices for NSKeyedUnarchiver
https://bugs.webkit.org/show_bug.cgi?id=175887
<rdar://problem/33435281>

Reviewed by Daniel Bates.

Source/WebCore:

* loader/archive/cf/LegacyWebArchiveMac.mm:
(WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Use NSSecureCoding to unarchive.
(WebCore::LegacyWebArchive::createPropertyListRepresentation): Ditto for archiving.
* testing/cocoa/WebArchiveDumpSupport.mm:
(WebCoreTestSupport::createCFURLResponseFromResponseData): Update to use NSSecureCoding if possible.

LayoutTests:

Mark two tests as flaky for now, until the relevant CFNetwork changes are available on the test systems.
1. webarchive/loading/cache-expired-subresource.html
2. webarchive/loading/test-loading-archive-subresource-null-mimetype.html

* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

23 months agoWeb Inspector: Selecting child layers with keyboard causes Compositing Reason popover...
commit-queue@webkit.org [Mon, 2 Oct 2017 23:55:19 +0000 (23:55 +0000)]
Web Inspector: Selecting child layers with keyboard causes Compositing Reason popover to become misaligned
https://bugs.webkit.org/show_bug.cgi?id=150551

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-02
Reviewed by Matt Baker.

`content` setter should only be used when NOT repositioning the popover.
`presentNewContentWithFrame` exists to update content and position at once.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel.prototype._showPopoverForSelectedNode):
(WI.LayerDetailsSidebarPanel.prototype._presentPopover):
Fix new sidebar.

* UserInterface/Views/LayerTreeDetailsSidebarPanel.js:
(WI.LayerTreeDetailsSidebarPanel.prototype._updatePopoverForSelectedNode):
Fix legacy sidebar.

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

23 months agoUse InlineTextBox::lineFont() in more places
dbates@webkit.org [Mon, 2 Oct 2017 23:44:37 +0000 (23:44 +0000)]
Use InlineTextBox::lineFont() in more places
https://bugs.webkit.org/show_bug.cgi?id=177749

Reviewed by Zalan Bujtas.

Currently InlineTextBox::paint() calls InlineTextBox::lineFont() to compute the font for the
line and then passes this value to various paint helper functions. The computation is not
expensive and it is sufficient to have the individual paint helper functions compute it
directly. We should have the individual paint helper functions compute it directly. This
will help towards sharing more code throughout InlineTextBox by reducing the noise of
passing the font for the line.

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
(WebCore::InlineTextBox::paintSelection):
(WebCore::InlineTextBox::paintTextSubrangeBackground):
(WebCore::InlineTextBox::paintCompositionBackground):
(WebCore::InlineTextBox::paintTextMatchMarker):
(WebCore::InlineTextBox::paintDecoration):
(WebCore::InlineTextBox::paintDocumentMarker):
(WebCore::InlineTextBox::paintDocumentMarkers):
* rendering/InlineTextBox.h:

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

23 months ago[Curl] Implement missing async method in RecourceHandle and make it actually async
commit-queue@webkit.org [Mon, 2 Oct 2017 23:34:18 +0000 (23:34 +0000)]
[Curl] Implement missing async method in RecourceHandle and make it actually async
https://bugs.webkit.org/show_bug.cgi?id=173964

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-02
Reviewed by Alex Christensen.

* platform/network/ResourceHandle.cpp:
(WebCore::ResourceHandle::continueWillSendRequest): Deleted.
(WebCore::ResourceHandle::continueDidReceiveResponse): Deleted.
(WebCore::ResourceHandle::continueCanAuthenticateAgainstProtectionSpace): Deleted.
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::suspend):
(WebCore::CurlRequest::resume):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::didCancelTransfer):
(WebCore::CurlRequest::finalizeTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::invokeDidReceiveResponse):
(WebCore::CurlRequest::completeDidReceiveResponse):
(WebCore::CurlRequest::setRequestPaused):
(WebCore::CurlRequest::setCallbackPaused):
(WebCore::CurlRequest::pausedStatusChanged):
(WebCore::CurlRequest::setPaused): Deleted.
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::needToInvokeDidReceiveResponse const):
(WebCore::CurlRequest::isPaused const):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::receivedRequestToContinueWithoutCredential):
(WebCore::ResourceHandle::continueDidReceiveResponse):
(WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::continueDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::platformContinueSynchronousDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::continueAfterDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
* platform/network/curl/ResourceHandleCurlDelegate.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::shouldRedirect):
(WebCore::ResourceResponse::isMovedPermanently const):
(WebCore::ResourceResponse::isFound const):
(WebCore::ResourceResponse::isSeeOther const):
(WebCore::ResourceResponse::isNotModified const):
(WebCore::ResourceResponse::isUnauthorized const):

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

23 months ago[Payment Request] Update payment-request imported tests
aestes@apple.com [Mon, 2 Oct 2017 23:04:45 +0000 (23:04 +0000)]
[Payment Request] Update payment-request imported tests
https://bugs.webkit.org/show_bug.cgi?id=177786

Reviewed by Zalan Bujtas.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* web-platform-tests/payment-request/PaymentAddress/attributes-and-toJSON-method-manual.https.html: Added.
* web-platform-tests/payment-request/PaymentAddress/w3c-import.log: Added.
* web-platform-tests/payment-request/algorithms-manual.https.html: Added.
* web-platform-tests/payment-request/change-shipping-option-manual.https.html: Added.
* web-platform-tests/payment-request/payment-request-canmakepayment-method.https.html:
* web-platform-tests/payment-request/payment-request-constructor.https-expected.txt:
* web-platform-tests/payment-request/payment-request-constructor.https.html:
* web-platform-tests/payment-request/payment-request-ctor-pmi-handling.https.html:
* web-platform-tests/payment-request/payment-response/complete-method-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/helpers.js:
(async.runManualTest):
* web-platform-tests/payment-request/payment-response/methodName-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/payerEmail-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/payerName-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/payerPhone-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/requestId-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/shippingAddress-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/payment-response/shippingOption-attribute-manual.https.html: Added.
* web-platform-tests/payment-request/rejects_if_not_active.https.html: Added.
* web-platform-tests/payment-request/shipping-address-changed-manual.https.html: Added.
* web-platform-tests/payment-request/updateWith-method-pmi-handling-manual.https.html: Added.
* web-platform-tests/payment-request/user-abort-algorithm-manual.https.html: Added.
* web-platform-tests/payment-request/user-accepts-payment-request-algo-manual.https.html: Added.
* web-platform-tests/payment-request/w3c-import.log:

LayoutTests:

* platform/mac-wk2/TestExpectations:

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

23 months agoAdditional rebaselining of js/dom/global-constructors-attributes.html.
jlewis3@apple.com [Mon, 2 Oct 2017 22:28:03 +0000 (22:28 +0000)]
Additional rebaselining of js/dom/global-constructors-attributes.html.

Unreviewed test gardening.

* platform/mac-sierra-wk1/js/dom/global-constructors-attributes-expected.txt: Renamed from LayoutTests/platform/mac-sierra-wk2/js/dom/global-constructors-attributes-expected.txt.
* platform/mac-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-wk2/js/dom/global-constructors-attributes-expected.txt: Removed.

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

23 months agoNULL WeakPtr should not malloc!
ggaren@apple.com [Mon, 2 Oct 2017 22:21:12 +0000 (22:21 +0000)]
NULL WeakPtr should not malloc!
https://bugs.webkit.org/show_bug.cgi?id=177773

Reviewed by Antti Koivisto.

Translating NULL into malloc is... inefficient.

* wtf/WeakPtr.h:
(WTF::WeakPtr::WeakPtr):
(WTF::WeakPtr::operator=):
(WTF::WeakPtr::clear): Make m_ref lazy so that a NULL m_ref can represent
a NULL pointer. Normal dereference is no slower because we can rely on
the fact that dereference of NULL should crash. operator bool() and get()
incur an extra branch. That's probably worth it to avoid malloc
for NULL.

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

23 months agoWSL ^ should be *
fpizlo@apple.com [Mon, 2 Oct 2017 22:10:43 +0000 (22:10 +0000)]
WSL ^ should be *
https://bugs.webkit.org/show_bug.cgi?id=177705

Rubber stamped by Keith Miller.

When I first wrote the prototype, I thought it would be cool to use ^ for pointers. Nobody agrees. I've
gotten so much feedback to use *. This changes pointers to use *.

* WebGPUShadingLanguageRI/DereferenceExpression.js:
(DereferenceExpression.prototype.toString):
(DereferenceExpression):
* WebGPUShadingLanguageRI/Intrinsics.js:
(Intrinsics):
* WebGPUShadingLanguageRI/Parse.js:
(parseType):
(parsePossiblePrefix):
* WebGPUShadingLanguageRI/PtrType.js:
(PtrType.prototype.toString):
(PtrType):
* WebGPUShadingLanguageRI/StandardLibrary.js:
* WebGPUShadingLanguageRI/Test.js:
(tests.simpleDereference):
(tests.dereferenceStore):
(tests.simpleMakePtr):
(tests.loadNull):
(tests.storeNull):
(tests.returnNull):
(tests.dereferenceDefaultNull):
(tests.defaultInitializedNull):
(tests.passNullToPtrMonomorphic):
(tests.passNullToPtrPolymorphic):
(tests.passNullAndNotNull):
(tests.passNullAndNotNullFullPoly):
(tests.passNullAndNotNullFullPolyReverse):
(tests.chainGeneric):
(tests.chainStruct):
(tests.chainStructNewlyValid):
(tests.chainStructDevice):
(tests.paramChainStructDevice):
(tests.simpleProtocolExtends):
(tests.protocolExtendsTwo):
(tests.overrideSubscriptStruct):
(tests.overrideSubscriptStructAndDoStores):
(tests.overrideSubscriptStructAndUsePointers):
(tests.overrideSubscriptStructAndUsePointersIncorrectly):
(tests.makeArrayRefFromPointer):
(tests.nonArrayRefArrayLengthFail):
(tests.constexprIsNotLValuePtr):
(tests.genericAccessors):
(tests.nestedSubscriptLValueEmulationSimple):
(tests.nestedSubscriptLValueEmulationGeneric):
(tests.shaderTypes):
(tests.enumPtrBase):
(tests.mutuallyRecursiveStructWithPointersBroken):
(tests.mutuallyRecursiveStructWithPointers):
(tests.linkedList):
(tests.pointerToPointer):
(tests.pointerGetter):
(tests.operatorCastWithTypeVariableInferredFromReturnType):
(tests.loneSetterPointer):
(tests.anderWithNothingWrong):
(tests.anderWithWrongNumberOfArguments):
(tests.anderDoesntReturnPointer):
(tests.anderDoesntTakeReference):
(tests.anderWithArrayRef):
(tests.pointerIndexGetter):
(tests.loneIndexSetterPointer):
(tests.indexAnderWithNothingWrong):
(tests.indexAnderWithWrongNumberOfArguments):
(tests.indexAnderDoesntReturnPointer):
(tests.indexAnderDoesntTakeReference):
(tests.indexAnderWithArrayRef):
(tests.devicePtrPtr):
(tests.threadgroupPtrPtr):
(tests.constantPtrPtr):
(tests.pointerIndexGetterInProtocol):
(tests.loneIndexSetterPointerInProtocol):
(tests.indexAnderWithNothingWrongInProtocol):
(tests.indexAnderWithWrongNumberOfArgumentsInProtocol):
(tests.indexAnderDoesntReturnPointerInProtocol):
(tests.indexAnderDoesntTakeReferenceInProtocol):
(tests.indexAnderWithArrayRefInProtocol):
(tests.andReturnedArrayRef):

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

23 months agoWSL should be fine with &foo()[i] if foo() returns a []
fpizlo@apple.com [Mon, 2 Oct 2017 22:01:02 +0000 (22:01 +0000)]
WSL should be fine with &foo()[i] if foo() returns a []
https://bugs.webkit.org/show_bug.cgi?id=177704

Reviewed by Saam Barati.

Previously, we'd determine if a property access expression (base.field or base[index]) was an lvalue by
asking if its base was an lvalue. This is right in all cases except if the base is of type []. Then, the
property access expression is an lvalue so long as there is a setter or ander.

This fixes the issue and adds a test.

Also, this makes error messages in the case that something is not an lvalue a lot better. If something
is not an lvalue because we could not find anders or setters, then we will tell you why we could not
find them.

* WebGPUShadingLanguageRI/Checker.js:
(Checker.prototype.visitAssignment):
(Checker.prototype.visitReadModifyWriteExpression):
(Checker.prototype.visitMakePtrExpression):
(Checker.prototype._finishVisitingPropertyAccess):
* WebGPUShadingLanguageRI/DotExpression.js:
(DotExpression.prototype.get fieldName):
(DotExpression.prototype.get isLValue): Deleted.
(DotExpression.prototype.get addressSpace): Deleted.
* WebGPUShadingLanguageRI/IndexExpression.js:
(IndexExpression.prototype.get index):
(IndexExpression.prototype.get isLValue): Deleted.
(IndexExpression.prototype.get addressSpace): Deleted.
* WebGPUShadingLanguageRI/PropertyAccessExpression.js:
(PropertyAccessExpression):
(PropertyAccessExpression.prototype.get isLValue):
(PropertyAccessExpression.prototype.set isLValue):
* WebGPUShadingLanguageRI/PropertyResolver.js:
(PropertyResolver.prototype._visitRValuesWithinLValue.RValueFinder.prototype.visitMakeArrayRefExpression):
(PropertyResolver.prototype._visitRValuesWithinLValue.RValueFinder):
(PropertyResolver.prototype._visitRValuesWithinLValue):
* WebGPUShadingLanguageRI/Test.js:
(tests.storeNullArrayRef):
(tests.andReturnedArrayRef):

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

23 months ago[GTK] Do not hardcode font family in served remote inspector HTML snippets
aperez@igalia.com [Mon, 2 Oct 2017 22:00:58 +0000 (22:00 +0000)]
[GTK] Do not hardcode font family in served remote inspector HTML snippets
https://bugs.webkit.org/show_bug.cgi?id=177742

Reviewed by Carlos Garcia Campos.

Instead of hardcoding Cantarell as the font used for the HTML snippets served
by the remote inspector handler, use "font: menu" to obtain the system UI
font, plus a "font-size" rule for adjusting the size.

* UIProcess/API/gtk/WebKitRemoteInspectorProtocolHandler.cpp:
(WebKit::RemoteInspectorProtocolHandler::handleRequest): Change the
CSS rules in the served snippet.

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

23 months agoVMTraps shouldn't crash if it sees an exception it doesn't understand.
keith_miller@apple.com [Mon, 2 Oct 2017 21:58:50 +0000 (21:58 +0000)]
VMTraps shouldn't crash if it sees an exception it doesn't understand.
https://bugs.webkit.org/show_bug.cgi?id=177780

Reviewed by Mark Lam.

VMTraps could see a JIT breakpoint (SegV) for any number of
reasons it doesn't understand. e.g.  a bug in JIT code, Wasm OOB,
etc. This patch makes it handle that case gracefully. It's worth
noting that this means there's no way to know if, due to a bug, we
didn't accurately track all the VMTraps we installed. I'm not sure
if there is a good solution to that problem though.

* runtime/VMTraps.cpp:

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

23 months ago[Win] Link error: cannot open file 'WebKitGUID.lib'
pvollan@apple.com [Mon, 2 Oct 2017 21:46:09 +0000 (21:46 +0000)]
[Win] Link error: cannot open file 'WebKitGUID.lib'
https://bugs.webkit.org/show_bug.cgi?id=177759

Reviewed by Alex Christensen.

For backward compatibility reasons, this library should not be renamed from
WebKitGUID.lib to WebKitLegacyGUID.lib.

* PlatformWin.cmake:

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

23 months agoPasteImage tests are failing on debug builds
rniwa@webkit.org [Mon, 2 Oct 2017 21:44:05 +0000 (21:44 +0000)]
PasteImage tests are failing on debug builds
https://bugs.webkit.org/show_bug.cgi?id=177778

Reviewed by Wenson Hsieh.

After r222702, PlatformPasteboard is no longer responsible for adding "Files" as a type"
as DataTransfer takes care of it now. Removed the code to do this from PlatformPasteboardIOS.mm
and PlatformPasteboardMac.mm so that we don't fail assertions in debug builds.

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
(WebCore::PlatformPasteboard::typesSafeForDOMToReadAndWrite const):

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

23 months agoNo need to truncate text after calling InlineTextBox::text()
dbates@webkit.org [Mon, 2 Oct 2017 21:42:19 +0000 (21:42 +0000)]
No need to truncate text after calling InlineTextBox::text()
https://bugs.webkit.org/show_bug.cgi?id=177748

Reviewed by Zalan Bujtas.

Following r222670 it is no longer necessary to explicitly truncate the text run length
as InlineTextBox::text() returns a text run with respect to the truncation of the text box.

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):

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

23 months agoUnreviewed. Add missing exception check for the custom-get-set-inline-caching-one...
sbarati@apple.com [Mon, 2 Oct 2017 21:40:19 +0000 (21:40 +0000)]
Unreviewed. Add missing exception check for the custom-get-set-inline-caching-one-level-up-proto-chain.js
test that I added. It uncovered a pre-existing missing exception check.

* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):

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

23 months agoGuard iOS webkitGetAsEntry API tests on older iOS versions
wenson_hsieh@apple.com [Mon, 2 Oct 2017 21:31:46 +0000 (21:31 +0000)]
Guard iOS webkitGetAsEntry API tests on older iOS versions

Unreviewed test gardening. After r222688, these tests require custom pasteboard data to be enabled by default,
so don't run them against shipping iOS.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:

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

23 months agoWeb Inspector: Ensure popovers are not malformed on window resize.
commit-queue@webkit.org [Mon, 2 Oct 2017 21:31:35 +0000 (21:31 +0000)]
Web Inspector: Ensure popovers are not malformed on window resize.
https://bugs.webkit.org/show_bug.cgi?id=177771

Patch by Ross Kirsling <ross.kirsling@sony.com> on 2017-10-02
Reviewed by Joseph Pecoraro.

* UserInterface/Views/Popover.js:
Ensure stale `arrow-*` CSS classes are removed on update, even if our content didn't change.

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

23 months agoAdd makeWeakPtr variant that takes pointer
antti@apple.com [Mon, 2 Oct 2017 21:31:16 +0000 (21:31 +0000)]
Add makeWeakPtr variant that takes pointer
https://bugs.webkit.org/show_bug.cgi?id=177767

Reviewed by Zalan Bujtas.

Source/WebCore:

Use it.

* rendering/SelectionRangeData.h:
(WebCore::SelectionRangeData::Context::Context):

Source/WTF:

* wtf/WeakPtr.h:
(WTF::makeWeakPtr):

This version deals with the nullptr.

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

23 months agoMake RenderPtr a type alias of std::unique_ptr
antti@apple.com [Mon, 2 Oct 2017 21:06:32 +0000 (21:06 +0000)]
Make RenderPtr a type alias of std::unique_ptr
https://bugs.webkit.org/show_bug.cgi?id=177739

Reviewed by Sam Weinig.

It just needs a custom deleter.

* page/FrameView.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::insertChildInternal):
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::fragmentedFlowDescendantInserted):
(WebCore::RenderMultiColumnFlow::handleSpannerRemoval):
* rendering/RenderObject.cpp:
(WebCore::RenderObjectDeleter::operator() const):
(WebCore::RenderObject::willBeDestroyed):
* rendering/RenderPtr.h:
(WebCore::createRenderer):
(WebCore::static_pointer_cast):

    Make this safer with downcast.

(WebCore::RenderPtr::RenderPtr): Deleted.
(WebCore::RenderPtr::~RenderPtr): Deleted.
(WebCore::RenderPtr::get const): Deleted.
(WebCore::RenderPtr::operator* const): Deleted.
(WebCore::RenderPtr::operator-> const): Deleted.
(WebCore::RenderPtr::operator! const): Deleted.
(WebCore::RenderPtr::operator UnspecifiedBoolType const): Deleted.
(WebCore::RenderPtr::operator=): Deleted.
(WebCore::RenderPtr::swap): Deleted.
(WebCore::RenderPtr::operator==): Deleted.
(WebCore::RenderPtr::operator!=): Deleted.
(WebCore::RenderPtr<T>::clear): Deleted.
(WebCore::RenderPtr<T>::leakPtr): Deleted.
(WebCore::RenderPtr<T>::RenderPtr): Deleted.
(WebCore::=): Deleted.
(WebCore::swap): Deleted.
(WebCore::operator==): Deleted.
(WebCore::operator!=): Deleted.
(WebCore::getPtr): Deleted.
(WTF::HashTraits<WebCore::RenderPtr<T>>::emptyValue): Deleted.
(WTF::HashTraits<WebCore::RenderPtr<T>>::peek): Deleted.

    We already have hash traits for std::unique_ptr.

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

23 months agoWeb Inspector: Include Beacon and Ping requests in Network tab
joepeck@webkit.org [Mon, 2 Oct 2017 20:24:10 +0000 (20:24 +0000)]
Web Inspector: Include Beacon and Ping requests in Network tab
https://bugs.webkit.org/show_bug.cgi?id=177641
<rdar://problem/33086839>

Reviewed by Chris Dumez.

Source/JavaScriptCore:

* inspector/protocol/Page.json:
Include new "Beacon" and "Ping" resource types.

Source/WebCore:

Tests: http/tests/inspector/network/beacon-type.html
       http/tests/inspector/network/ping-type.html

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
Fix a typo.

* loader/PingLoader.cpp:
(WebCore::PingLoader::startPingLoad):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
Include InspectorInstrumentation hooks for ping network loads.

* loader/LoaderStrategy.h:
* platform/network/PingHandle.h:
Include an optional ResourceResponse in the ping load completion callback.
If available this will be enough for Web Inspector to include details such
as the response statusCode.

* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willSendRequestOfTypeImpl):
(WebCore::InspectorInstrumentation::continueAfterPingLoaderImpl): Deleted.
* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::willSendRequestOfType):
(WebCore::InspectorInstrumentation::continueAfterPingLoader): Deleted.
* inspector/InspectorNetworkAgent.cpp:
(WebCore::resourceTypeForCachedResource):
(WebCore::resourceTypeForLoadType):
(WebCore::InspectorNetworkAgent::willSendRequest):
(WebCore::InspectorNetworkAgent::willSendRequestOfType):
* inspector/InspectorNetworkAgent.h:
Make a general willSendRequestOfType hook when sending a request that does
not go through normal CachedResource loading. The Ping and Beacon requests
go through this process, we may also use this path for Preflight requests.

* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::resourceTypeJson):
(WebCore::InspectorPageAgent::cachedResourceType):
* inspector/InspectorPageAgent.h:
Small refactoring.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:
New strings for Beacon/Ping.

* UserInterface/Images/Beacon.svg: Added.
* UserInterface/Views/ResourceIcons.css:
(.resource-icon.resource-type-ping .icon,):
(body:not(.mac-platform, .windows-platform) .resource-icon.resource-type-ping .icon,):
(body:not(.mac-platform, .windows-platform) .large .resource-icon.resource-type-ping .icon,):
New icon for Beacon/Ping. They share an icon since they are similiar in concept:
a request that is sent and the page doesn't expect a response.

* UserInterface/Controllers/FrameResourceManager.js:
(WI.FrameResourceManager.prototype._addNewResourceToFrameOrTarget):
When a sub-resource and a main-resource have the same URL we were not
distinguishing them. Use the resource type to distinguish them better.

* UserInterface/Models/SourceCode.js:
(WI.SourceCode.prototype._processContent):
Safer handling if the body was base64 encoded but an empty string.

* UserInterface/Models/Resource.js:
(WI.Resource.displayNameForType):
* UserInterface/Models/ResourceCollection.js:
(WI.ResourceCollection.verifierForType):
* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
* UserInterface/Views/ResourceClusterContentView.js:
(WI.ResourceClusterContentView.prototype.get responseContentView):
New resource types.

* UserInterface/Views/ResourceContentView.js:
(WI.ResourceContentView.prototype.showMessage):
* UserInterface/Views/TextResourceContentView.js:
(WI.TextResourceContentView.prototype._contentDidPopulate):
Nicer display for empty content, which may be common for these requests.

Source/WebKit:

* NetworkProcess/NetworkConnectionToWebProcess.cpp:
(WebKit::NetworkConnectionToWebProcess::loadPing):
(WebKit::NetworkConnectionToWebProcess::didFinishPingLoad):
* NetworkProcess/NetworkConnectionToWebProcess.h:
* NetworkProcess/PingLoad.cpp:
(WebKit::PingLoad::PingLoad):
(WebKit::PingLoad::didFinish):
(WebKit::PingLoad::didReceiveResponseNetworkSession):
* NetworkProcess/PingLoad.h:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::didFinishPingLoad):
* WebProcess/Network/NetworkProcessConnection.h:
* WebProcess/Network/NetworkProcessConnection.messages.in:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::networkProcessCrashed):
(WebKit::WebLoaderStrategy::startPingLoad):
(WebKit::WebLoaderStrategy::didFinishPingLoad):
* WebProcess/Network/WebLoaderStrategy.h:
Pass an optional ResourceResponse back to the ping completion handler.

LayoutTests:

* http/tests/inspector/network/beacon-type-expected.txt: Added.
* http/tests/inspector/network/beacon-type.html: Added.
* http/tests/inspector/network/ping-type-expected.txt: Added.
* http/tests/inspector/network/ping-type.html: Added.
* http/tests/inspector/network/resources/beacon.php: Added.
* http/tests/inspector/network/resources/ping.php: Added.
Test for Beacon and Ping resource loads.

* platform/mac-wk1/TestExpectations:
* platform/mac-wk2/TestExpectations:
* platform/win/TestExpectations:
Skip beacon tests where beacon is not supported.

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

23 months agoSelectionRangeData should not hold raw RenderObject pointers
zalan@apple.com [Mon, 2 Oct 2017 20:06:06 +0000 (20:06 +0000)]
SelectionRangeData should not hold raw RenderObject pointers
https://bugs.webkit.org/show_bug.cgi?id=177677
<rdar://problem/34763060>

Reviewed by Sam Weinig.

SelectionRangeData::Context start and end renderers' lifetime is not strictly tied
to the lifetime of SelectionRangeData.

Covered by existing tests.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::updateAppearance):
* platform/DragImage.cpp:
(WebCore::createDragImageForRange):
* rendering/SelectionRangeData.cpp:
(WebCore::isValidRendererForSelection):
(WebCore::collect):
(WebCore::SelectionRangeData::set):
(WebCore::SelectionRangeData::clear):
(WebCore::SelectionRangeData::repaint const):
(WebCore::SelectionRangeData::collectBounds const):
(WebCore::SelectionRangeData::apply):
* rendering/SelectionRangeData.h:
(WebCore::SelectionRangeData::Context::Context):
(WebCore::SelectionRangeData::Context::start const):
(WebCore::SelectionRangeData::Context::end const):
(WebCore::SelectionRangeData::Context::startPosition const):
(WebCore::SelectionRangeData::Context::endPosition const):
(WebCore::SelectionRangeData::Context::operator== const):
(WebCore::SelectionRangeData::start const):
(WebCore::SelectionRangeData::end const):
(WebCore::SelectionRangeData::startPosition const):
(WebCore::SelectionRangeData::endPosition const):

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

23 months ago[WPE] Remove GnuTLS dependency
commit-queue@webkit.org [Mon, 2 Oct 2017 20:00:03 +0000 (20:00 +0000)]
[WPE] Remove GnuTLS dependency
https://bugs.webkit.org/show_bug.cgi?id=177750

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

libgcrypt is used by default instead of GnuTLS.
See bug 163125

.:

* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

* PlatformWPE.cmake:

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

23 months agoREGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessD...
achristensen@apple.com [Mon, 2 Oct 2017 19:49:55 +0000 (19:49 +0000)]
REGRESSION: API tests WebKit.ProcessDidTerminateRequestedByClient and WebKit.ProcessDidTerminateWithReasonCrash are timing out
https://bugs.webkit.org/show_bug.cgi?id=177764

Reviewed by Chris Dumez.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
I shouldn't have reverted the A API telling the listener to continue if there's no client function.

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

23 months ago[WPE][GTK] Crash in webkit_web_resource_get_data_finish()
carlosgc@webkit.org [Mon, 2 Oct 2017 19:48:37 +0000 (19:48 +0000)]
[WPE][GTK] Crash in webkit_web_resource_get_data_finish()
https://bugs.webkit.org/show_bug.cgi?id=177107

Reviewed by Michael Catanzaro.

Source/WebKit:

Handle errors in webkit_web_resource_get_data() callback.

* UIProcess/API/glib/WebKitWebResource.cpp:
(resourceDataCallback):
(webkit_web_resource_get_data):

Tools:

Add a test case to check we handle errors when webkit_web_resource_get_data() fails.

* TestWebKitAPI/Tests/WebKitGLib/TestResources.cpp:
(webViewloadChanged):
(testWebResourceGetDataError):
(beforeAll):

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

23 months agoMark imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worke...
jiewen_tan@apple.com [Mon, 2 Oct 2017 19:40:45 +0000 (19:40 +0000)]
Mark imported/w3c/web-platform-tests/WebCryptoAPI/generateKey/successes_RSA-PSS.worker.html as slow
https://bugs.webkit.org/show_bug.cgi?id=177615

Unreviewed test gardening.

* TestExpectations:
* platform/mac-wk2/TestExpectations:

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

23 months agoAddressing post-review comments after r222621
zalan@apple.com [Mon, 2 Oct 2017 19:34:42 +0000 (19:34 +0000)]
Addressing post-review comments after r222621
https://bugs.webkit.org/show_bug.cgi?id=177610

Reviewed by Darin Adler.

* rendering/RenderMenuList.cpp:
(RenderMenuList::didUpdateActiveOption):

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

23 months agoRemove length argument from TextPainter::paint()
dbates@webkit.org [Mon, 2 Oct 2017 19:23:38 +0000 (19:23 +0000)]
Remove length argument from TextPainter::paint()
https://bugs.webkit.org/show_bug.cgi?id=177758

Reviewed by Alex Christensen.

Have TextPainter.paint() use the length of the specified TextRun as opposed to
taking an explicit argument for the length of the TextRun.

Following r222670 InlineTextBox creates a TextRun with respect to the truncated
line. Prior to r222670 InlineTextBox did not do this and hence it had to pass both
the TextRun and truncated length to TextPainter.paint() to have the line painted.
Code that needs to paint a substring of a TextRun can still do so by using TextPainter.paintRange().

No functionality changed. So, no new tests.

* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paint):
* rendering/SimpleLineLayoutFunctions.cpp:
(WebCore::SimpleLineLayout::paintFlow):
* rendering/TextPainter.cpp:
(WebCore::TextPainter::paint):
* rendering/TextPainter.h:

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

23 months ago[Linux] Enable Gigacage in x64 Linux environment
utatane.tea@gmail.com [Mon, 2 Oct 2017 19:20:00 +0000 (19:20 +0000)]
[Linux] Enable Gigacage in x64 Linux environment
https://bugs.webkit.org/show_bug.cgi?id=177745

Reviewed by Carlos Garcia Campos.

This patch enables Gigacage in x64 Linux environment.
Gigacage enforces a caged pointer to reference to the
specific memory region. This reduces the effectiveness
of some types of attacks setting a pointer to ArrayBuffer
and modifying arbitrary memory region.

* bmalloc/Gigacage.h:

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

23 months ago[curl] Crashes in CurlRequest::setupPUT()
commit-queue@webkit.org [Mon, 2 Oct 2017 19:04:09 +0000 (19:04 +0000)]
[curl] Crashes in CurlRequest::setupPUT()
https://bugs.webkit.org/show_bug.cgi?id=177733

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-02
Reviewed by Alex Christensen.

Tests: http/tests/xmlhttprequest/xmlhttprequest-open-method-allowed.html

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupPUT): Null-check the result of request.httpBody().

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

23 months ago[WPE] Fix UIProcess build with GStreamer and without VIDEO
commit-queue@webkit.org [Mon, 2 Oct 2017 19:02:27 +0000 (19:02 +0000)]
[WPE] Fix UIProcess build with GStreamer and without VIDEO
https://bugs.webkit.org/show_bug.cgi?id=177753

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

GStreamer builds fail when WebAudio is enabled but VIDEO disabled.
This is the WPE counterpart of bug 153135.

* UIProcess/API/wpe/PageClientImpl.h:

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

23 months ago[CURL] Should handle redirects in WebCore
commit-queue@webkit.org [Mon, 2 Oct 2017 19:00:17 +0000 (19:00 +0000)]
[CURL] Should handle redirects in WebCore
https://bugs.webkit.org/show_bug.cgi?id=21242

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-02
Reviewed by Alex Christensen.

* platform/network/ResourceHandle.cpp:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::enableAutoReferer): Deleted.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didReceiveHeader):
(WebCore::CurlRequest::didReceiveData):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::continueDidReceiveResponse):
(WebCore::ResourceHandle::continueWillSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::curlDidReceiveResponse):
(WebCore::ResourceHandleCurlDelegate::shouldRedirectAsGET):
(WebCore::ResourceHandleCurlDelegate::willSendRequest):
(WebCore::ResourceHandleCurlDelegate::continueWillSendRequest):
(WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.h:
* platform/network/curl/ResourceResponse.h:
* platform/network/curl/ResourceResponseCurl.cpp:
(WebCore::ResourceResponse::shouldRedirect):
(WebCore::ResourceResponse::isMovedPermanently const):
(WebCore::ResourceResponse::isFound const):
(WebCore::ResourceResponse::isSeeOther const):
(WebCore::ResourceResponse::isRedirection const): Deleted.

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

23 months ago[WPE] Do not require XSLT if disabled
commit-queue@webkit.org [Mon, 2 Oct 2017 18:58:07 +0000 (18:58 +0000)]
[WPE] Do not require XSLT if disabled
https://bugs.webkit.org/show_bug.cgi?id=177752

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

* Source/cmake/OptionsWPE.cmake: libxslt is not a hard dep

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

23 months agoCrashes with guard malloc under RenderFullScreen::unwrapRenderer
antti@apple.com [Mon, 2 Oct 2017 18:29:25 +0000 (18:29 +0000)]
Crashes with guard malloc under RenderFullScreen::unwrapRenderer
https://bugs.webkit.org/show_bug.cgi?id=177760

Unreviewed.

* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::unwrapRenderer):

The assert accesses 'this' after it has been deleted. It is not very valuable so remove the assert.

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

23 months agoGraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
zandobersek@gmail.com [Mon, 2 Oct 2017 18:17:51 +0000 (18:17 +0000)]
GraphicsContext: remove unused ENABLE(3D_TRANSFORMS) && USE(TEXTURE_MAPPER)
https://bugs.webkit.org/show_bug.cgi?id=177757

Reviewed by Michael Catanzaro.

Remove three methods from the GraphicsContext class that were conditioned
with the ENABLE(3D_TRANSFORMS) and USE(TEXTURE_MAPPER) guards. These aren't
used anywhere at this point, but apparently used to be in the TextureMapper
implementation.

* platform/graphics/GraphicsContext.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::get3DTransform const): Deleted.
(WebCore::GraphicsContext::concat3DTransform): Deleted.
(WebCore::GraphicsContext::set3DTransform): Deleted.

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

23 months agoChakraCore/test/Function/apply3.js is resulting wrong result in x86_64
ticaiolima@gmail.com [Mon, 2 Oct 2017 18:15:09 +0000 (18:15 +0000)]
ChakraCore/test/Function/apply3.js is resulting wrong result in x86_64
https://bugs.webkit.org/show_bug.cgi?id=175642

Reviewed by Darin Adler.

JSTests:

* ChakraCore/test/Function/apply3.baseline-jsc:

Source/JavaScriptCore:

According JS spec, the ToLength operation[1] has a range of 0..(2^53)
- 1. In Interpreter.cpp::sizeFrameForVarargs, the call to
sizeOfVarargs() was being assigned to "unsigned length", forcing a
type cast that results in different value among architectures JSC supports.
For instance, in x86_64 "4294967295 + 1" results in 0, while in ARMv6 it
results 4294967295. This patch is changing "sizeOfVarargs" to clamp the
result from "toLength" to unsigned and then get desired behavior for
all supported platforms.

[1] - https://tc39.github.io/ecma262/#sec-tolength

* interpreter/Interpreter.cpp:
(JSC::sizeOfVarargs):
* interpreter/Interpreter.h:

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

23 months ago[GLib] NetworkStateNotifier implementation missing
commit-queue@webkit.org [Mon, 2 Oct 2017 18:08:06 +0000 (18:08 +0000)]
[GLib] NetworkStateNotifier implementation missing
https://bugs.webkit.org/show_bug.cgi?id=177741

Patch by Gustavo Noronha Silva <gustavo.noronha@collabora.co.uk> on 2017-10-02
Reviewed by Carlos Garcia Campos.

No new tests. The DOM support is already being tested, but we would need a way
of simulating a network outage to test GNetworkMonitor.

* PlatformGTK.cmake: add new file.
* PlatformWPE.cmake: add new file.
* platform/network/NetworkStateNotifier.cpp: no longer need the empty implementations, all platforms covered.
* platform/network/NetworkStateNotifier.h:
* platform/network/glib/NetworkStateNotifierGLib.cpp: Added.
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying): update the network state using GNetworkMonitor's availability.
(WebCore::NetworkStateNotifier::networkChangedCallback): when network-changed is emitted, trigger a state update.
(WebCore::NetworkStateNotifier::startObserving): watch GNetworkMonitor's network-changed signal.

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

23 months agoRebaseline of js/dom/global-constructors-attributes-dedicated-worker.html after r222692.
jlewis3@apple.com [Mon, 2 Oct 2017 18:04:01 +0000 (18:04 +0000)]
Rebaseline of js/dom/global-constructors-attributes-dedicated-worker.html after r222692.

Unreviewed test gardening.

* platform/mac-wk1/js/dom/global-constructors-attributes-dedicated-worker-expected.txt:

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

23 months agoFix build with MathML disabled
commit-queue@webkit.org [Mon, 2 Oct 2017 17:59:36 +0000 (17:59 +0000)]
Fix build with MathML disabled
https://bugs.webkit.org/show_bug.cgi?id=177744

Patch by Olivier Blin <olivier.blin@softathome.com> on 2017-10-02
Reviewed by Michael Catanzaro.

These are regressions from r217549 (StyleResolver) and r221379 (RenderBlockFlow), which do not guard MathML usage.

* css/StyleResolver.cpp:
(WebCore::hasEffectiveDisplayNoneForDisplayContents):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::willCreateColumns const):

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

23 months agoUnreviewed WPE gardening.
zandobersek@gmail.com [Mon, 2 Oct 2017 17:58:49 +0000 (17:58 +0000)]
Unreviewed WPE gardening.

* platform/wpe/TestExpectations: Unskip some more tests, and add
failure expectations for whatever is still failing from that subset.

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

23 months agoUse ThreadIdentifier instead of thread::this_thread::get_id
utatane.tea@gmail.com [Mon, 2 Oct 2017 17:52:52 +0000 (17:52 +0000)]
Use ThreadIdentifier instead of thread::this_thread::get_id
https://bugs.webkit.org/show_bug.cgi?id=177729

Reviewed by Sam Weinig.

We can use WTF::ThreadIdentifier instead of thread::this_thread::get_id
to make use of ThreadIdentifier consistent in WebKit. In the other places,
we use ThreadIdentifier for this debugging purpose. And this is the only
place using thread::this_thread::get_id for the exact same purpose.
Furthermore, thread::this_thread::get_id in Windows platform. So we prefer
using ThreadIdentifier than thread::this_thread::get_id.

* Modules/webdatabase/DatabaseDetails.h:
(WebCore::DatabaseDetails::DatabaseDetails):
(WebCore::DatabaseDetails::threadID const):
* Modules/webdatabase/DatabaseManager.cpp:
(WebCore::DatabaseManager::detailsForNameAndOrigin):

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

23 months agoFix build after r222715
achristensen@apple.com [Mon, 2 Oct 2017 17:35:10 +0000 (17:35 +0000)]
Fix build after r222715
https://bugs.webkit.org/show_bug.cgi?id=177697

* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):
Use the public API instead of the removed SPI.

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

23 months agoAdd a WebKit Build Archives page
jond@apple.com [Mon, 2 Oct 2017 17:26:38 +0000 (17:26 +0000)]
Add a WebKit Build Archives page
https://bugs.webkit.org/show_bug.cgi?id=177654

Reviewed by Alexey Proskuryakov.

* wp-content/themes/webkit/build-archives.php: Added.

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

23 months agoRebaseline of js/dom/global-constructors-attributes.html after r222692.
jlewis3@apple.com [Mon, 2 Oct 2017 17:22:48 +0000 (17:22 +0000)]
Rebaseline of js/dom/global-constructors-attributes.html after r222692.

Unreviewed test gardening.

* platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-sierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:

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

23 months agoExpose more WKPreferences SPI to match C SPI
achristensen@apple.com [Mon, 2 Oct 2017 17:13:22 +0000 (17:13 +0000)]
Expose more WKPreferences SPI to match C SPI
https://bugs.webkit.org/show_bug.cgi?id=177697

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _javaEnabledForLocalFiles]):
(-[WKPreferences _setPlugInsEnabled:]): Deleted.
(-[WKPreferences _plugInsEnabled]): Deleted.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:
_javaEnabledForLocalFiles should return the correct value.
_plugInsEnabled has public API.  This SPI is not needed.

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

23 months agoREGRESSION(r214201): WebProcess hangs during policy decisions
achristensen@apple.com [Mon, 2 Oct 2017 17:09:30 +0000 (17:09 +0000)]
REGRESSION(r214201): WebProcess hangs during policy decisions
https://bugs.webkit.org/show_bug.cgi?id=177590
<rdar://problem/33362929>

Reviewed by Andy Estes.

Source/WebKit:

This is like r222431 but for trunk instead of a branch.
It includes the same regression API test so I don't make the same mistake again.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponseSync):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForResponse):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNewWindowAction):
(WebKit::WebFrameLoaderClient::applyToDocumentLoader):
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebPage/WebDocumentLoader.cpp:
(WebKit::WebDocumentLoader::setNavigationID):
* WebProcess/WebPage/WebFrame.cpp:
(WebKit::WebFrame::setUpPolicyListener):
(WebKit::WebFrame::invalidatePolicyListener):
(WebKit::WebFrame::didReceivePolicyDecision):
* WebProcess/WebPage/WebFrame.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::didReceivePolicyDecision):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/JavaScriptDuringNavigation.mm: Added.
(-[JSNavigationDelegate webView:didFinishNavigation:]):
(-[JSNavigationDelegate webView:decidePolicyForNavigationAction:decisionHandler:]):
(-[JSNavigationDelegate webView:decidePolicyForNavigationResponse:decisionHandler:]):
(-[JSNavigationDelegate webView:runJavaScriptAlertPanelWithMessage:initiatedByFrame:completionHandler:]):
(TEST):

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