WebKit-https.git
2 years agoIntroduce and adopt HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
timothy_horton@apple.com [Sat, 24 Mar 2018 00:00:32 +0000 (00:00 +0000)]
Introduce and adopt HAVE(AUDIO_TOOLBOX_AUDIO_SESSION)
https://bugs.webkit.org/show_bug.cgi?id=183954
<rdar://problem/38808858>

Reviewed by Dan Bernstein.

* wtf/Platform.h:

* WebView/WebPreferences.mm:
(-[WebPreferences setAudioSessionCategoryOverride:]):

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

2 years agoUpdate WPT tools to a1ec330
youenn@apple.com [Fri, 23 Mar 2018 23:49:58 +0000 (23:49 +0000)]
Update WPT tools to a1ec330
https://bugs.webkit.org/show_bug.cgi?id=183934

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* resources/config.json:
* resources/import-expectations.json:
* web-platform-tests/config.default.json:
* web-platform-tests/tools/: Refreshed.

Tools:

Update script to run WPT server  according updated WPT tools.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_launcher.py:
(main):
* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(base_http_url):
(base_https_url):

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

2 years agoResource Load Statistics: Pick up ITP debug mode flag from defaults
wilander@apple.com [Fri, 23 Mar 2018 23:48:23 +0000 (23:48 +0000)]
Resource Load Statistics: Pick up ITP debug mode flag from defaults
https://bugs.webkit.org/show_bug.cgi?id=183956
<rdar://problem/38559574>

Reviewed by Brent Fulgham.

* UIProcess/Cocoa/WebResourceLoadStatisticsStoreCocoa.mm:
(WebKit::WebResourceLoadStatisticsStore::registerUserDefaultsIfNeeded):

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

2 years agoNetworkStateNotifier::updateStateWithoutNotifying() is inefficient
cdumez@apple.com [Fri, 23 Mar 2018 23:46:50 +0000 (23:46 +0000)]
NetworkStateNotifier::updateStateWithoutNotifying() is inefficient
https://bugs.webkit.org/show_bug.cgi?id=183760
<rdar://problem/37093299>

Reviewed by Ryosuke Niwa.

Update NetworkStateNotifier::updateStateWithoutNotifying() to stop calling
SCDynamicStoreCopyKeyList(). SCDynamicStoreCopyKeyList() is expensive as it
expects its key parameter to be a regular expression and it can match several
keys. It is also unnecessary in our case since we already have an exact key.
We now call the more efficient SCDynamicStoreCopyValue() instead, which is
the right thing to call when we have an exact key.

This change was suggested by the SC team.

This was tested manually as there is no easy way to write an automated test
for this.

In a follow-up, I also plan to call this code in the UIProcess (or NetworkProcess)
to avoid calling it once per WebProcess.

* platform/network/mac/NetworkStateNotifierMac.cpp:
(WebCore::NetworkStateNotifier::updateStateWithoutNotifying):

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

2 years agoUnreviewed attempt to fix Windows build after r229926.
cdumez@apple.com [Fri, 23 Mar 2018 23:41:59 +0000 (23:41 +0000)]
Unreviewed attempt to fix Windows build after r229926.

* WebView.cpp:

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

2 years agoUnreviewed, rolling out r229868.
dbates@webkit.org [Fri, 23 Mar 2018 23:37:13 +0000 (23:37 +0000)]
Unreviewed, rolling out r229868.

Caused media controls tests to timeout. Will investigate
offline.

Reverted changeset:

"CSS mask images should be retrieved using potentially CORS-
enabled fetch"
https://bugs.webkit.org/show_bug.cgi?id=179983
https://trac.webkit.org/changeset/229868

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

2 years agoWeb Inspector: add WebKitAdditions hooks for WebInspectorUI
bburg@apple.com [Fri, 23 Mar 2018 23:35:03 +0000 (23:35 +0000)]
Web Inspector: add WebKitAdditions hooks for WebInspectorUI
https://bugs.webkit.org/show_bug.cgi?id=183940
<rdar://problem/38796310>

Reviewed by Timothy Hatcher.

* Scripts/combine-resources.pl:
(debugLog): Added. Leave in the logging I used to debug this.

(concatenateIncludedFilesMatchingPattern):
(stripIncludedFilesMatchingPattern):
(concatenateFiles): Deleted.
This function tried to do too many things. Split it into
two functions, one for stripping includes and one for concatenating
files referenced by includes.

Lastly, add a negative lookahead clause for 'WebKitAdditions' so includes
containing that string are not combined when no input directory is passed
to the script.

* Scripts/copy-user-interface-resources.pl:
WebKitAdditions is computed either from BUILT_PRODUCTS_DIR or SDKROOT,
depending on the build style. Just try them in order and use the first
one that exists. WebInspectorUI files are in their own directory, so
we can assume there are files to process if that directory exists.

Copy Main.html to derived sources before doing any processing on it.
This makes all combining phases have the same --input-html argument.

(debugLog): Added. Leave in the logging I used to debug this.

(combineOrStripResourcesForWebKitAdditions):
(stripResourcesForWebKitAdditions):
(combineResourcesForWebKitAdditions):
Determine if WebKitAdditions exists and whether there are any
resources for WebInspectorUI present that need to be processed.

* UserInterface/Main.html:
Add stub .js and .css WebKitAdditions files. We can add more later
if it makes sense but this is good enough to validate the build machinery.

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

2 years agoAdd pointer profiling hooks to the CSS JIT.
mark.lam@apple.com [Fri, 23 Mar 2018 23:28:05 +0000 (23:28 +0000)]
Add pointer profiling hooks to the CSS JIT.
https://bugs.webkit.org/show_bug.cgi?id=183947
<rdar://problem/38803593>

Reviewed by JF Bastien.

No new tests needed.  Covered by existing tests.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
- Added a missing application of WTF_PREPARE_VTBL_POINTER_FOR_INSPECTION().

* bindings/scripts/test/JS/JSInterfaceName.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactions.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCallTracer.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestEventTarget.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestGlobalObject.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestIterable.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestNode.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPluginInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerialization.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifier.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
(WebCore::toJSNewlyCreated):
* bindings/scripts/test/JS/JSTestTypedefs.cpp:
(WebCore::toJSNewlyCreated):
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::ruleMatches):
* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::compile):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateSelectorChecker):
* cssjit/SelectorCompiler.h:
(WebCore::SelectorCompiler::ruleCollectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::querySelectorSimpleSelectorCheckerFunction):
(WebCore::SelectorCompiler::ruleCollectorSelectorCheckerFunctionWithCheckingContext):
(WebCore::SelectorCompiler::querySelectorSelectorCheckerFunctionWithCheckingContext):
* dom/SelectorQuery.cpp:
(WebCore::SelectorDataList::executeCompiledSingleMultiSelectorData const):
(WebCore::SelectorDataList::execute const):

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

2 years agoAdopt WK_PLATFORM_NAME in WebKitLegacy
timothy_horton@apple.com [Fri, 23 Mar 2018 22:47:48 +0000 (22:47 +0000)]
Adopt WK_PLATFORM_NAME in WebKitLegacy
https://bugs.webkit.org/show_bug.cgi?id=183948
<rdar://problem/38803908>

Reviewed by Dan Bernstein.

Source/WebKitLegacy:

* WebKitLegacy.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

* Configurations/WebKitLegacy.xcconfig:
* MigrateHeaders.make:
* postprocess-headers.sh:

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

2 years agoLocal storage getItem() for an empty string returned UNDEFINED value.
commit-queue@webkit.org [Fri, 23 Mar 2018 22:41:40 +0000 (22:41 +0000)]
Local storage getItem() for an empty string returned UNDEFINED value.
https://bugs.webkit.org/show_bug.cgi?id=69138
<rdar://problem/13410974>

Patch by Sihui Liu <sihui_liu@apple.com> on 2018-03-23
Reviewed by Brady Eidson.

Source/WebCore:

* platform/sql/SQLiteStatement.cpp:
(WebCore::SQLiteStatement::getColumnBlobAsString):

Tools:

Add API test coverage.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/LocalStoragePersistence.mm: Added.
(-[LocalStorageMessageHandler userContentController:didReceiveScriptMessage:]):
(TEST):
* TestWebKitAPI/Tests/WebKitCocoa/localstorage-empty-string-value.html: Added.

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

2 years ago[Extra zoom mode] Adopt list view controller UI for select menus
wenson_hsieh@apple.com [Fri, 23 Mar 2018 22:35:38 +0000 (22:35 +0000)]
[Extra zoom mode] Adopt list view controller UI for select menus
https://bugs.webkit.org/show_bug.cgi?id=183944
<rdar://problem/38799062>

Reviewed by Tim Horton.

Move UIProcess/WKSelectMenuListViewController.* to UIProcess/ios/forms, where it was intended to go.

* UIProcess/ios/forms/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.h.
* UIProcess/ios/forms/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/WKSelectMenuListViewController.mm.
* WebKit.xcodeproj/project.pbxproj:

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

2 years agoPromptly terminate service worker processes when they are no longer needed
cdumez@apple.com [Fri, 23 Mar 2018 22:16:25 +0000 (22:16 +0000)]
Promptly terminate service worker processes when they are no longer needed
https://bugs.webkit.org/show_bug.cgi?id=183873
<rdar://problem/38676995>

Reviewed by Youenn Fablet.

Source/WebCore:

The StorageProcess now keeps track of service worker clients for each security
origin. When there is no longer any clients for a given security origin, the
StorageProcess asks the service worker process for the given origin to terminate
and severs its connection to it.

Change is covered by API test.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::markAllWorkersForOriginAsTerminated):
Pass the security origin since this is called when a service worker process
crashes. When a service worker process for origin A crashes, we only want
to mark service workers in origin A as terminated, not ALL of them.

(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::needsServerToContextConnectionForOrigin const):
Tweak logic so that we only relaunch a service worker process if we still
have clients for its security origin.

* workers/service/server/SWServer.h:
(WebCore::SWServer::disableServiceWorkerProcessTerminationDelay):
Add a way to disable the service worker termination delay to facilitate
testing.

* workers/service/server/SWServerToContextConnection.h:

Source/WebKit:

The StorageProcess now keeps track of service worker clients for each security
origin. When there is no longer any clients for a given security origin, the
StorageProcess asks the service worker process for the given origin to terminate
and severs its connection to it.

* Shared/Storage/StorageProcessCreationParameters.h:
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.cpp:
(WebKit::WebSWServerToContextConnection::connectionMayNoLongerBeNeeded):
(WebKit::WebSWServerToContextConnection::terminate):
* StorageProcess/ServiceWorker/WebSWServerToContextConnection.h:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::connectionToContextProcessWasClosed):
(WebKit::StorageProcess::needsServerToContextConnectionForOrigin const):
(WebKit::StorageProcess::initializeWebsiteDataStore):
(WebKit::StorageProcess::swServerForSession):
(WebKit::StorageProcess::swContextConnectionMayNoLongerBeNeeded):
(WebKit::StorageProcess::disableServiceWorkerProcessTerminationDelay):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _disableServiceWorkerProcessTerminationDelay]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::disableServiceWorkerProcessTerminationDelay):
* UIProcess/WebProcessPool.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateProcess):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

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

2 years agoGo to back/forward list items after a process-swapped navigation.
beidson@apple.com [Fri, 23 Mar 2018 22:15:23 +0000 (22:15 +0000)]
Go to back/forward list items after a process-swapped navigation.
<rdar://problem/38690544> and https://bugs.webkit.org/show_bug.cgi?id=183920

Reviewed by Andy Estes.

Source/WebCore:

Covered by new API test.

Most of the changes to WebCore are teaching HistoryItem navigations to know when they should
do a policy check or not.

* WebCore.xcodeproj/project.pbxproj:

* history/BackForwardController.cpp:
(WebCore::BackForwardController::goBackOrForward):
(WebCore::BackForwardController::goBack):
(WebCore::BackForwardController::goForward):

* history/HistoryItem.cpp:
(WebCore::HistoryItem::setStateObject): Actually push state object changes to the UIProcess.
  This was a long standing bug that made it difficult to effectively test this change.

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURLIntoChildFrame):
(WebCore::FrameLoader::loadDifferentDocumentItem):
(WebCore::FrameLoader::loadItem):
(WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
* loader/FrameLoader.h:
* loader/FrameLoaderTypes.h:

* loader/HistoryController.cpp:
(WebCore::HistoryController::goToItem):
(WebCore::HistoryController::setDefersLoading):
(WebCore::HistoryController::recursiveGoToItem):
* loader/HistoryController.h:

* loader/NavigationPolicyCheck.h:

* page/Page.cpp:
(WebCore::Page::goToItem):
* page/Page.h:

Source/WebKit:

This takes the initial work of "process swap a normal navigation" and extends it to
process swapping for back/forward item navigations.

* Scripts/webkit/messages.py:

Make sure state objects are serialized to the UI Process back/forward list items, as otherwise
they will be lost in process-swap scenarios:
* Shared/SessionState.cpp:
(WebKit::PageState::encode const):
(WebKit::PageState::decode):
* Shared/SessionState.h:

Make a new variant of APINavigation specifically for back/forward list items.
* UIProcess/API/APINavigation.cpp:
(API::Navigation::Navigation):
(API::Navigation::loggingURL const):
* UIProcess/API/APINavigation.h:
(API::Navigation::create):
(API::Navigation::backForwardListItem):
(API::Navigation::backForwardFrameLoadType const):

* UIProcess/API/C/WKPage.cpp:
(WKPageGoToBackForwardListItem):

* UIProcess/API/Cocoa/WKBrowsingContextController.mm:
(-[WKBrowsingContextController goToBackForwardListItem:]):

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView goToBackForwardListItem:]):

* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::createLoadRequestNavigation):
(WebKit::WebNavigationState::createBackForwardNavigation):
* UIProcess/WebNavigationState.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcessForReload):
(WebKit::WebPageProxy::reattachToWebProcessWithItem):
(WebKit::WebPageProxy::goForward):
(WebKit::WebPageProxy::goBack):
(WebKit::WebPageProxy::goToBackForwardItem):
(WebKit::WebPageProxy::receivedPolicyDecision):
(WebKit::WebPageProxy::continueNavigationInNewProcess): Handle back/forward navigations differently than others.
(WebKit::WebPageProxy::restoreFromSessionState):
* UIProcess/WebPageProxy.h:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::addOrUpdateBackForwardItem): Renamed from "addBackForwardItem" for clarity
(WebKit::WebProcessProxy::addBackForwardItem): Deleted.
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:

* UIProcess/ios/ViewGestureControllerIOS.mm:
(WebKit::ViewGestureController::endSwipeGesture):

* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::endSwipeGesture):

* WebProcess/WebCoreSupport/SessionStateConversion.cpp:
(WebKit::toPageState):
(WebKit::toHistoryItem):

* WebProcess/WebPage/WebBackForwardListProxy.cpp:
(WebKit::updateBackForwardItem):

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::goToBackForwardItem): Combined "goBack" and "goForward" with this method,
  passing the appropriate FrameLoadType around as needed to remember the specific type.
(WebKit::WebPage::goForward): Deleted.
(WebKit::WebPage::goBack): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(-[WebView _loadBackForwardListFromOtherView:]):
(-[WebView goToBackForwardItem:]):

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::goToBackForwardItem):
(WebView::loadBackForwardListFromOtherView):

Tools:

Add a new API test that does some process-swapping navigations (including a back navigation)
and verifies the state of the engine afterwards.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:
(-[PSONMessageHandler userContentController:didReceiveScriptMessage:]):
(-[PSONScheme initWithBytes:]):
(-[PSONScheme webView:startURLSchemeTask:]):
(log):
(function):
(TEST): Deleted.

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

2 years agoMark accessibility/row-with-aria-role-in-native-table.html as failing on Windows.
pvollan@apple.com [Fri, 23 Mar 2018 22:07:01 +0000 (22:07 +0000)]
Mark accessibility/row-with-aria-role-in-native-table.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183955

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agoMark some CSS animations tests as failing on Windows.
pvollan@apple.com [Fri, 23 Mar 2018 22:02:53 +0000 (22:02 +0000)]
Mark some CSS animations tests as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183953

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years agofix
youenn@apple.com [Fri, 23 Mar 2018 22:01:43 +0000 (22:01 +0000)]
fix

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

2 years agoWeb Inspector: Styles Redesign: flashing when switching between nodes
nvasilyev@apple.com [Fri, 23 Mar 2018 21:35:34 +0000 (21:35 +0000)]
Web Inspector: Styles Redesign: flashing when switching between nodes
https://bugs.webkit.org/show_bug.cgi?id=179291
<rdar://problem/35352660>

Reviewed by Matt Baker.

Flashing was happening because the layout was a two-step process:
1. Append empty sections.
2. Layout everything inside of the section on requestAnimationFrame.

SpreadsheetRulesStyleDetailsPanel was converted to use layout method,
so both steps happen on requestAnimationFrame.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.refresh):
(WI.SpreadsheetRulesStyleDetailsPanel.prototype.layout):
The removed lines from the refresh method moved to the layout method without any changes.

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

2 years agoLint web-platform-tests changes with the wpt linter before exporting
commit-queue@webkit.org [Fri, 23 Mar 2018 21:19:37 +0000 (21:19 +0000)]
Lint web-platform-tests changes with the wpt linter before exporting
https://bugs.webkit.org/show_bug.cgi?id=183796

Patch by Brendan McLoughlin <brendan@bocoup.com> on 2018-03-23
Reviewed by Youenn Fablet.

* Scripts/webkitpy/w3c/test_exporter.py:
(TestExporter.__init__):
(TestExporter.do_export):
* Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.MockWPTLinter):
(TestExporterTest.MockWPTLinter.__init__):
(TestExporterTest.MockWPTLinter.lint):
(TestExporterTest.test_export):
(TestExporterTest.test_export_with_specific_branch):
* Scripts/webkitpy/w3c/wpt_linter.py: Added.
(WPTLinter):
(WPTLinter.__init__):
(WPTLinter.lint):

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

2 years agoAdd support for VCP encoder on MacOS and iOS
youenn@apple.com [Fri, 23 Mar 2018 21:18:56 +0000 (21:18 +0000)]
Add support for VCP encoder on MacOS and iOS
https://bugs.webkit.org/show_bug.cgi?id=183924

Reviewed by Eric Carlson.

Soft-Link VideoProcessing functions and use them in H264 encoder.
This is conditional on recent MacOS and iOS platforms.

* Source/webrtc/sdk/WebKit/EncoderUtilities.h: Added.
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.cpp: Added.
* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h: Added.
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm:
(webrtc::createVideoToolboxEncoderFactory):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 encode:codecSpecificInfo:frameTypes:]):
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
(-[RTCVideoEncoderH264 destroyCompressionSession]):
* WebKit/0001-Using-VCP.patch: Added.
* libwebrtc.xcodeproj/project.pbxproj:

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

2 years agoResource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
wilander@apple.com [Fri, 23 Mar 2018 21:03:36 +0000 (21:03 +0000)]
Resource Load Statistics: Fix decoder key isPrevalentResource->isVeryPrevalentResource
https://bugs.webkit.org/show_bug.cgi?id=183950
<rdar://problem/38806275>

Reviewed by Brent Fulgham.

* loader/ResourceLoadStatistics.cpp:
(WebCore::ResourceLoadStatistics::decode):
    Now isVeryPrevalentResource is decoded to the correct field.

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

2 years agoDon't use the presence of a textSelectionAssistant as a proxy for if we are in conten...
megan_gardner@apple.com [Fri, 23 Mar 2018 21:00:02 +0000 (21:00 +0000)]
Don't use the presence of a textSelectionAssistant as a proxy for if we are in content editable.
https://bugs.webkit.org/show_bug.cgi?id=183804

Reviewed by Tim Horton.

We need to stop using the presence of a textSelectionAssistant as a proxy for if we are selecting in a content editable
or not. As we are planning on switching to only using a textSelectionAssistant for selection, these checks need to
be more direct in checking what we actually need to know i.e. are we selecting in a content editable.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(hasAssistedNode):
(-[WKContentView inputView]):
(-[WKContentView _selectionClipRect]):
(-[WKContentView gestureRecognizer:canBePreventedByGestureRecognizer:]):
(-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]):
(-[WKContentView gestureRecognizerShouldBegin:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView webSelectionRects]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):
(-[WKContentView _autofillContext]):

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

2 years agoWebProcessPool should not ask to register all clients for each service worker process...
youenn@apple.com [Fri, 23 Mar 2018 20:53:01 +0000 (20:53 +0000)]
WebProcessPool should not ask to register all clients for each service worker process creation
https://bugs.webkit.org/show_bug.cgi?id=183941

Reviewed by Chris Dumez.

Source/WebCore:

Covered by existing unit tests.
Register all Documents of a process no matter its session ID when asked to.
Make sure that whenever a WebProcess is asked to do so, any further Document will be registered
by calling setMayHaveRegisteredServiceWorkers().
This ensures that a WebProcess created before any service worker but empty at the time a service worker is created
will actually register all its future clients.

Add some assertions to ensure that a client is not registered twice.

* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registerServiceWorkerClient):

Source/WebKit:

Call registerServiceWorkerClients when there is no service worker process.
Update service worker clients to register all of them no matter the session ID.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::registerServiceWorkerClients):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

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

2 years ago[Extra zoom mode] Adopt list view controller UI for select menus
wenson_hsieh@apple.com [Fri, 23 Mar 2018 20:47:19 +0000 (20:47 +0000)]
[Extra zoom mode] Adopt list view controller UI for select menus
https://bugs.webkit.org/show_bug.cgi?id=183944
<rdar://problem/38799062>

Reviewed by Andy Estes.

Rename WKSelectMenuViewController to WKSelectMenuListViewController, and also rename the relevant
WebKitAdditions harness files. See corresponding changes for more details.

* UIProcess/WKSelectMenuListViewController.h: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.h.
* UIProcess/WKSelectMenuListViewController.mm: Renamed from Source/WebKit/UIProcess/ios/forms/WKSelectMenuViewController.mm.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView presentSelectMenuViewController:]):
(-[WKContentView dismissSelectMenuViewController:]):
(-[WKContentView selectMenu:didSelectItemAtIndex:]):
(-[WKContentView numberOfItemsInSelectMenu:]):
(-[WKContentView selectMenu:displayTextForItemAtIndex:]):
(-[WKContentView selectMenu:didCheckItemAtIndex:checked:]):
(-[WKContentView selectMenuUsesMultipleSelection:]):
(-[WKContentView selectMenu:hasSelectedOptionAtIndex:]):
(-[WKContentView _wheelChangedWithEvent:]):

Overriding wheel events and re-dispatching them is no longer needed after r229437, so we can just remove special
handling for select menus here.

(-[WKContentView didCancelSelectionInSelectMenu:]): Deleted.
(-[WKContentView selectMenuSupportsMultipleSelection:]): Deleted.
(-[WKContentView selectMenu:hasCheckedOptionAtIndex:]): Deleted.
(-[WKContentView startingIndexForSelectMenu:]): Deleted.

The starting index for a select menu is no longer relevant when using list view controllers for input, so we can
just remove this delegate hook altogether.

* WebKit.xcodeproj/project.pbxproj:

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

2 years agoHTMLElement factory doesn't need to call MediaPlayer::isAvailable
eric.carlson@apple.com [Fri, 23 Mar 2018 20:11:52 +0000 (20:11 +0000)]
HTMLElement factory doesn't need to call MediaPlayer::isAvailable
https://bugs.webkit.org/show_bug.cgi?id=183946
<rdar://problem/38802687>

Reviewed by Youenn Fablet.

Source/WebCore:

Test: media/media-disabled.html

* dom/make_names.pl:
(printConstructorInterior):
* page/Settings.yaml:
* page/SettingsDefaultValues.h:

LayoutTests:

* media/media-disabled-expected.txt: Added.
* media/media-disabled.html: Added.

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

2 years agoCacheStorage::Caches should clear m_caches when clearing its representation even...
youenn@apple.com [Fri, 23 Mar 2018 19:54:01 +0000 (19:54 +0000)]
CacheStorage::Caches should clear m_caches when clearing its representation even though it is not yet initialized
https://bugs.webkit.org/show_bug.cgi?id=183945

Reviewed by Chris Dumez.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::clearMemoryRepresentation):
In case we clear Caches in the middle of the initialization, m_caches might not be empty
but m_isInitialized is not yet set to true since we are computing the Caches size.
Update the assertion and clear m_caches in that case.

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

2 years agoStop using dispatch_set_target_queue()
ddkilzer@apple.com [Fri, 23 Mar 2018 19:06:35 +0000 (19:06 +0000)]
Stop using dispatch_set_target_queue()
<https://webkit.org/b/183908>
<rdar://problem/33553533>

Reviewed by Daniel Bates.

Source/ThirdParty/libwebrtc:

* Source/webrtc/rtc_base/task_queue_gcd.cc: Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().
* WebKit/0009-Remove-dispatch_set_target_queue.patch: Add patch.
Filed this to track upstreaming the change:
<https://bugs.chromium.org/p/webrtc/issues/detail?id=9055>
* WebKit/patch-libwebrtc: Delete empty patch file.

Source/WebCore:

No new tests since no change in behavior.

* platform/mediastream/mac/AVMediaCaptureSource.mm:
(WebCore::globaVideoCaptureSerialQueue): Remove use of
dispatch_set_target_queue() by changing dispatch_queue_create()
to dispatch_queue_create_with_target().

Source/WebKit:

* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::IOChannel): Remove the call to
dispatch_set_target_queue() since this is handled in the
dispatch_io_create() call above.

Source/WTF:

* wtf/cocoa/WorkQueueCocoa.cpp:
(WTF::WorkQueue::platformInitialize): Remove !HAVE(QOS_CLASSES)
code path since it's never used now that HAVE(QOS_CLASSES) is
equivalent to PLATFORM(COCOA) in <wtf/Platform.h>.

Tools:

* Scripts/webkitpy/style/checkers/cpp.py:
(check_language): Add check for use of
dispatch_set_target_queue().
(CppChecker): Add 'runtime/dispatch_set_target_queue' category.
* Scripts/webkitpy/style/checkers/cpp_unittest.py:
(CppStyleTest): Add test.

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

2 years agoLLInt TypeArray pointer poisoning should not pick its poison dynamically.
mark.lam@apple.com [Fri, 23 Mar 2018 18:55:26 +0000 (18:55 +0000)]
LLInt TypeArray pointer poisoning should not pick its poison dynamically.
https://bugs.webkit.org/show_bug.cgi?id=183942
<rdar://problem/38798018>

Reviewed by JF Bastien.

1. Move the LLInt TypedArray unpoisoning to just before the array access after
   all the branches.
2. Renamed FirstArrayType to FirstTypedArrayType to match the symbol in C++ code.
3. Remove a useless instruction in the implementation of emitX86Lea for a global
   label.

* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/x86.rb:

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

2 years agoAdd more support for pointer profiling.
mark.lam@apple.com [Fri, 23 Mar 2018 18:44:17 +0000 (18:44 +0000)]
Add more support for pointer profiling.
https://bugs.webkit.org/show_bug.cgi?id=183943
<rdar://problem/38799068>

Reviewed by JF Bastien.

* assembler/ARM64Assembler.h:
(JSC::ARM64Assembler::linkJumpOrCall):
* assembler/AbstractMacroAssembler.h:
(JSC::AbstractMacroAssembler::repatchNearCall):
(JSC::AbstractMacroAssembler::tagReturnAddress):
(JSC::AbstractMacroAssembler::untagReturnAddress):

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

2 years agoOnly enable LayoutTest fast/css/apple-system-control-colors.html on macOS.
ryanhaddad@apple.com [Fri, 23 Mar 2018 18:34:50 +0000 (18:34 +0000)]
Only enable LayoutTest fast/css/apple-system-control-colors.html on macOS.

Unreviewed test gardening.

* TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed WPE gardening.
aperez@igalia.com [Fri, 23 Mar 2018 18:32:20 +0000 (18:32 +0000)]
Unreviewed WPE gardening.

Removed imported/mathml-in-html5 from WPE test expectations, as the
path does not exit anymore after r229601

* platform/wpe/TestExpectations: Removd imported/mathml-in-html5

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

2 years agoUse libwebrtc ObjectiveC H264 encoder and decoder
youenn@apple.com [Fri, 23 Mar 2018 18:20:47 +0000 (18:20 +0000)]
Use libwebrtc ObjectiveC H264 encoder and decoder
https://bugs.webkit.org/show_bug.cgi?id=183912

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Add utilities inside libwebrtc to be used by WebKit:
- Create ObjectiveC encoder/decoder factories
- Notify of application status to invalidate encoders/decoders when in background
Implement RTCUIApplicationStatusObserver as a simple boolean that is set by WebCore.
This allows limiting the changes made to libwebrtc codec implementations.

Minor modifications done to libwebrtc to fix compilation.
Add Block_copy/Block_release to codec callbacks.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/sdk/WebKit/WebKitUtilities.h: Added.
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm: Added.
(+[RTCUIApplicationStatusObserver sharedInstance]):
(+[RTCUIApplicationStatusObserver prepareForUse]):
(-[RTCUIApplicationStatusObserver setActive]):
(-[RTCUIApplicationStatusObserver setInactive]):
(-[RTCUIApplicationStatusObserver isApplicationActive]):
(webrtc::setApplicationStatus):
(webrtc::createVideoToolboxEncoderFactory):
(webrtc::createVideoToolboxDecoderFactory):
(webrtc::setH264HardwareEncoderAllowed):
(webrtc::isH264HardwareEncoderAllowed):
(webrtc::pixelBufferFromFrame):
* Source/webrtc/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm:
(-[RTCCVPixelBuffer dealloc]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm:
(-[RTCVideoDecoderH264 dealloc]):
(-[RTCVideoDecoderH264 setCallback:]):
(-[RTCVideoDecoderH264 releaseDecoder]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 dealloc]):
(-[RTCVideoEncoderH264 setCallback:]):
(-[RTCVideoEncoderH264 releaseEncoder]):
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* WebKit/0001-Adapting-libwebrtc-H264-codec.patch: Added.
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

No observable change of behavior.
Made use of libwebrtc WebKit utilities.
Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.

* Configurations/WebCore.xcconfig:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
(WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* testing/Internals.cpp: Removed commented out include.

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

2 years agoDocumentThreadableLoader should send credentials after redirections and preflight...
youenn@apple.com [Fri, 23 Mar 2018 18:06:34 +0000 (18:06 +0000)]
DocumentThreadableLoader should send credentials after redirections and preflight if fetch option credentials is include
https://bugs.webkit.org/show_bug.cgi?id=183928

Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.js: Added.
* web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html: Added.
* web-platform-tests/fetch/api/resources/inspect-headers.py:
* web-platform-tests/fetch/api/resources/redirect.py:

Source/WebCore:

Tests: imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.html
       imported/w3c/web-platform-tests/fetch/api/cors/cors-cookies-redirect.any.worker.html

In case mode is include, keep sending credentials even after redirection with preflight.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::redirectReceived):

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

2 years agoFix the build after r229858
timothy_horton@apple.com [Fri, 23 Mar 2018 18:06:08 +0000 (18:06 +0000)]
Fix the build after r229858

* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:

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

2 years agoAllow fully whitelisted plug-ins to match non HTTP URLs
youenn@apple.com [Fri, 23 Mar 2018 18:04:00 +0000 (18:04 +0000)]
Allow fully whitelisted plug-ins to match non HTTP URLs
https://bugs.webkit.org/show_bug.cgi?id=183938
rdar://problem/38534312

Reviewed by Chris Dumez.

Source/WebCore:

Covered by manual testing and unit testing.

* platform/URL.cpp:
(WebCore::URL::isMatchingDomain const):

Tools:

* TestWebKitAPI/Tests/WebCore/URL.cpp:
(TestWebKitAPI::TEST_F):

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

2 years agoCacheStorage::Engine should not ref itself when hopping to a background thread
youenn@apple.com [Fri, 23 Mar 2018 18:02:30 +0000 (18:02 +0000)]
CacheStorage::Engine should not ref itself when hopping to a background thread
https://bugs.webkit.org/show_bug.cgi?id=183925
<rdar://problem/38580483>

Reviewed by Chris Dumez.

Add support for weak pointers to CacheStorage Engine.
Use weak pointer when hopping to background threads.
Store callbacks in CacheStorage::Engine maps to keep them being destroyed in the main thread only.
Made some callbacks CompletionHandler as a bonus.

Made sure to use just one Engine for all private sessions.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::~Engine):
(WebKit::CacheStorage::Engine::from):
(WebKit::CacheStorage::Engine::initialize):
(WebKit::CacheStorage::Engine::writeFile):
(WebKit::CacheStorage::Engine::readFile):
* NetworkProcess/cache/CacheStorageEngine.h:
(WebKit::CacheStorage::Engine::weakPtrFactory):

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

2 years agoActiveDOMObject should assert that they are destroyed in the thread they are created
youenn@apple.com [Fri, 23 Mar 2018 17:48:46 +0000 (17:48 +0000)]
ActiveDOMObject should assert that they are destroyed in the thread they are created
https://bugs.webkit.org/show_bug.cgi?id=183671

Reviewed by Chris Dumez.

No change of behavior.
Moved MessagePort assertion to ActiveDOMObject.

* dom/ActiveDOMObject.cpp:
(WebCore::ActiveDOMObject::~ActiveDOMObject):
* dom/ActiveDOMObject.h:
* dom/MessagePort.cpp:
(WebCore::MessagePort::~MessagePort):
* dom/MessagePort.h:

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

2 years agodump-class-layout is just wrong
jfbastien@apple.com [Fri, 23 Mar 2018 17:07:47 +0000 (17:07 +0000)]
dump-class-layout is just wrong
https://bugs.webkit.org/show_bug.cgi?id=183939

Reviewed by Yusuke Suzuki.

Looks like r229291 contained a half-renamed variable in it, so it
just doesn't work.

* Scripts/dump-class-layout:
(verify_type):
(verify_type_recursive):

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

2 years agoSafari WebKitWebRTCAudioModule crash during <video> tag update when audio track prese...
youenn@apple.com [Fri, 23 Mar 2018 16:55:10 +0000 (16:55 +0000)]
Safari WebKitWebRTCAudioModule crash during <video> tag update when audio track present in MediaStream
https://bugs.webkit.org/show_bug.cgi?id=181180
<rdar://problem/36302375>

Reviewed by Eric Carlson.

Source/WebCore:

Test: webrtc/video-update-often.html

AudioTrackPrivateMediaStreamCocoa needs to be destroyed in the main thread since it owns a Ref to its MediaStreamTrackPrivate.
We can still ref it on a background thread but we always deref it on the main thread.

* platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
(WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
(WebCore::AudioTrackPrivateMediaStreamCocoa::render):

LayoutTests:

* webrtc/video-update-often-expected.txt: Added.
* webrtc/video-update-often.html: Added.

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

2 years ago[css-grid] Fix auto repeat tracks computation with definite min sizes
svillar@igalia.com [Fri, 23 Mar 2018 16:44:27 +0000 (16:44 +0000)]
[css-grid] Fix auto repeat tracks computation with definite min sizes
https://bugs.webkit.org/show_bug.cgi?id=183933

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

The relevant test for this change is just grid-inline-auto-repeat-001.html. The other ones
were pulled in by the import. The unique change in those tests is the location of a
stylesheet. Since we're using it in the new test it seems sensible to use this same commit
to import those changes too. There is one important change in testing-utils.js which is
also required by the new test.

* resources/import-expectations.json:
* web-platform-tests/css/css-grid/grid-definition/grid-change-fit-content-argument-001.html:
* web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001-expected.txt: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html: Added.
* web-platform-tests/css/css-grid/grid-definition/grid-template-columns-fit-content-001-expected.html:
* web-platform-tests/css/css-grid/grid-definition/grid-template-columns-fit-content-001.html:
* web-platform-tests/css/css-grid/grid-definition/grid-template-rows-fit-content-001-expected.html:
* web-platform-tests/css/css-grid/grid-definition/grid-template-rows-fit-content-001.html:
* web-platform-tests/css/css-grid/grid-definition/support/grid.css: Added.
(.grid):
(.inline-grid):
(.firstRowFirstColumn):
(.onlyFirstRowOnlyFirstColumn):
(.firstRowSecondColumn):
(.onlyFirstRowOnlySecondColumn):
(.secondRowFirstColumn):
(.onlySecondRowOnlyFirstColumn):
(.secondRowSecondColumn):
(.onlySecondRowOnlySecondColumn):
(.endSecondRowEndSecondColumn):
(.thirdRowSecondColumn):
(.firstRowThirdColumn):
(.secondRowThirdColumn):
(.firstRowFourthColumn):
(.secondRowFourthColumn):
(.firstAutoRowSecondAutoColumn):
(.autoLastRowAutoLastColumn):
(.autoSecondRowAutoFirstColumn):
(.firstRowBothColumn):
(.secondRowBothColumn):
(.bothRowFirstColumn):
(.bothRowSecondColumn):
(.bothRowBothColumn):
(.autoRowAutoColumn):
(.firstRowAutoColumn):
(.secondRowAutoColumn):
(.thirdRowAutoColumn):
(.autoRowFirstColumn):
(.autoRowSecondColumn):
(.autoRowThirdColumn):
(.autoRowAutoColumnSpanning2):
(.autoRowSpanning2AutoColumn):
(.autoRowSpanning2AutoColumnSpanning3):
(.autoRowSpanning3AutoColumnSpanning2):
(.autoRowFirstColumnSpanning2):
(.autoRowSecondColumnSpanning2):
(.firstRowSpanning2AutoColumn):
(.secondRowSpanning2AutoColumn):
(.gridAutoFlowColumnSparse):
(.gridAutoFlowColumnDense):
(.gridAutoFlowRowSparse):
(.gridAutoFlowRowDense):
(.constrainedContainer):
(.unconstrainedContainer):
(.sizedToGridArea):
(.verticalRL):
(.verticalLR):
(.horizontalTB):
(.directionRTL):
(.directionLTR):
* web-platform-tests/css/css-grid/grid-definition/support/testing-utils.js:
(checkGridTemplateRows): Convert the passed computed style to an Array in case it is just an string.
* web-platform-tests/css/css-grid/grid-definition/support/w3c-import.log:
* web-platform-tests/css/css-grid/grid-definition/w3c-import.log:

Source/WebCore:

Indefinitely sized containers use the specified definite min-size (if any) as available
space in order to compute the number of auto repeat tracks to create. A bug in that code was
causing the grid to be one track larger than expected. That was only happening in the case
of the free space being a multiple of the total size of the autorepeat tracks.

Test: imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-inline-auto-repeat-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::computeAutoRepeatTracksCount const):

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

2 years agoUnreviewed build fix.
ryanhaddad@apple.com [Fri, 23 Mar 2018 16:38:09 +0000 (16:38 +0000)]
Unreviewed build fix.

* UIProcess/API/Cocoa/WKWebViewPrivate.h:

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

2 years ago[GTK][WPE] Avoid software color conversion inside BitmapTextureGL
magomez@igalia.com [Fri, 23 Mar 2018 15:29:30 +0000 (15:29 +0000)]
[GTK][WPE] Avoid software color conversion inside BitmapTextureGL
https://bugs.webkit.org/show_bug.cgi?id=183892

Source/WebCore:

Reviewed by Žan Doberšek.

Always use RGBA format on BitmapTextureGL (when no other format is specifically requested). When
the texture is updated from BGRA content, use a flag to indicate the shader to perform a color
conversion during the painting. This way we don't need to swap the R and B components on the CPU.
Also, remove one of the lists in BitmapTexturePool as now all of them have the same format, and
remove the UpdateContentsFlag as we never need to modify the original image data.

Covered by existent tests.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::updateTexture):
* platform/graphics/texmap/BitmapTexture.cpp:
(WebCore::BitmapTexture::updateContents):
* platform/graphics/texmap/BitmapTexture.h:
* platform/graphics/texmap/BitmapTextureGL.cpp:
(WebCore::BitmapTextureGL::BitmapTextureGL):
(WebCore::BitmapTextureGL::didReset):
(WebCore::BitmapTextureGL::updateContents):
(WebCore::BitmapTextureGL::applyFilters):
(WebCore::swizzleBGRAToRGBA): Deleted.
(WebCore::BitmapTextureGL::updateContentsNoSwizzle): Deleted.
* platform/graphics/texmap/BitmapTextureGL.h:
(WebCore::BitmapTextureGL::colorConvertFlags const):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::acquireTexture):
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::updateBackingStoreIfNeeded):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::TextureMapperContextAttributes::get):
* platform/graphics/texmap/TextureMapperContextAttributes.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::drawNumber):
(WebCore::TextureMapperGL::drawTexture):
* platform/graphics/texmap/TextureMapperGL.h:
* platform/graphics/texmap/TextureMapperLayer.cpp:
(WebCore::TextureMapperLayer::paintIntoSurface):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::paintToTextureMapper):
* platform/graphics/texmap/TextureMapperTile.cpp:
(WebCore::TextureMapperTile::updateContents):
* platform/graphics/texmap/TextureMapperTile.h:
* platform/graphics/texmap/TextureMapperTiledBackingStore.cpp:
(WebCore::TextureMapperTiledBackingStore::updateContentsFromImageIfNeeded):
(WebCore::TextureMapperTiledBackingStore::updateContents):
* platform/graphics/texmap/TextureMapperTiledBackingStore.h:

Source/WebKit:

Remove the UpdateContentsFlag parameter when calling BitmapTexture::updateContents().

Reviewed by Žan Doberšek.

* Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp:
(WebKit::CoordinatedBackingStoreTile::swapBuffers):

Source/WebKitLegacy/win:

Remove the UpdateContentsFlag parameter as it's not used anymore.

Reviewed by Žan Doberšek.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::acceleratedCompositingAvailable):

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

2 years agoWebProcess memory monitor thresholds should be better tuned for embedded systems.
clopez@igalia.com [Fri, 23 Mar 2018 12:41:44 +0000 (12:41 +0000)]
WebProcess memory monitor thresholds should be better tuned for embedded systems.
https://bugs.webkit.org/show_bug.cgi?id=183773

Reviewed by Yusuke Suzuki.

Take into account the total system RAM for the thresholds calculation.

For systems with more than 3GB the conservative and strict thresholds remain as they are,
but for systems with less RAM the thresholds are dynamically configured as follows:

- Conservative threshold (release non critical memory) if WebProcess using more than 33% of the total RAM.
- Strict threshold (release all possible memory) if WebProcess using more than 50% of the total RAM.

The Kill threshold is also modified. Now it is capped at 90% of the total RAM.

* wtf/MemoryPressureHandler.cpp:
(WTF::thresholdForMemoryKillWithProcessState):
(WTF::thresholdForPolicy):
(WTF::MemoryPressureHandler::shrinkOrDie):

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

2 years ago[WTF] Add standard containers with FastAllocator specialization
utatane.tea@gmail.com [Fri, 23 Mar 2018 12:34:08 +0000 (12:34 +0000)]
[WTF] Add standard containers with FastAllocator specialization
https://bugs.webkit.org/show_bug.cgi?id=183789

Reviewed by Darin Adler.

Source/JavaScriptCore:

* b3/air/testair.cpp:
* b3/testb3.cpp:
(JSC::B3::testDoubleLiteralComparison):
(JSC::B3::testFloatEqualOrUnorderedFoldingNaN):
* dfg/DFGGraph.h:
* dfg/DFGIntegerCheckCombiningPhase.cpp:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::switchStringSlow):
* runtime/FunctionHasExecutedCache.h:
* runtime/TypeLocationCache.h:

Source/WebCore:

* Modules/indexeddb/IDBKeyData.h:
* Modules/mediasource/SampleMap.h:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/webauthn/cbor/CBORValue.h:
It did not use FastAllocator for its container.

* page/WheelEventTestTrigger.h:
* platform/audio/PlatformMediaSessionManager.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.h:
* platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::YCbCrToRGBMatrixForRangeAndTransferFunction):
* platform/mock/mediasource/MockSourceBufferPrivate.cpp:
* platform/wpe/PlatformPasteboardWPE.cpp:
* rendering/OrderIterator.h:

Source/WTF:

Sometimes we want standard containers due to various reasons.
For example, WTF::HashMap lacks the ability to hold all the
integer keys since it uses 0 for empty value and -1 for deleted
value. However, using std::containers use std::allocator without
specialization.

This patch introduces WTF::{StdMap, StdSet, StdList, StdUnorderedMap, StdUnorderedSet}.
They are standard containers with FastAllocator specialization.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/StdList.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdUnorderedMap.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.
* wtf/StdUnorderedSet.h: Copied from Source/JavaScriptCore/runtime/TypeLocationCache.h.

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

2 years ago[FTL] Fix ArrayPush(ArrayStorage)'s abstract heap
utatane.tea@gmail.com [Fri, 23 Mar 2018 12:32:40 +0000 (12:32 +0000)]
[FTL] Fix ArrayPush(ArrayStorage)'s abstract heap
https://bugs.webkit.org/show_bug.cgi?id=182960

Reviewed by Saam Barati.

This patch fixes ArrayPush(ArrayStorage)'s abstract heap.
It should always touch ArrayStorage_vector. To unify
vector setting code for the real ArrayStorage_vector and
ScratchBuffer, we use ArrayStorage_vector.atAnyIndex() to
annotate this.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileArrayPush):

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

2 years ago[Web Animations] infinite repeat counts aren't reflected for CSS Animations
graouts@webkit.org [Fri, 23 Mar 2018 11:49:04 +0000 (11:49 +0000)]
[Web Animations] infinite repeat counts aren't reflected for CSS Animations
https://bugs.webkit.org/show_bug.cgi?id=183932

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions of Mozilla tests.

* css-animations/test_animation-computed-timing-expected.txt:
* css-animations/test_animation-finish-expected.txt:

Source/WebCore:

The "infinite" value for animation-repeat-count is reflected as a special value which resolves to -1. We need to check
for this special value before setting the iterations count on the AnimationEffectTimingReadOnly object.

* animation/CSSAnimation.cpp:
(WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):

LayoutTests:

One of the Mozilla tests now passes completely and reliably.

* TestExpectations:

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

2 years ago[Web Animations] Correctly cancel animations when a parent gets a "display: none...
graouts@webkit.org [Fri, 23 Mar 2018 11:47:26 +0000 (11:47 +0000)]
[Web Animations] Correctly cancel animations when a parent gets a "display: none" style or when an element is removed
https://bugs.webkit.org/show_bug.cgi?id=183919

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

A number of tests now pass thanks to correctly canceling animations when a parent element in the hierarchy gets a
"display: none" style or if an element with animations is removed.

* css-animations/test_animation-cancel-expected.txt:
* css-animations/test_document-get-animations-expected.txt:
* css-animations/test_effect-target-expected.txt:
* css-transitions/test_animation-cancel-expected.txt:
* css-transitions/test_effect-target-expected.txt:

Source/WebCore:

The old CSSAnimationController provided a cancelAnimations(Element&) method that allowed for animations for a given element
to be canceled when a parent element in the hierarchy gets a "display: none" style or if an element with animations is removed.
We add a similar cancelAnimationsForElement(Element&) method on AnimationTimeline and update CSSAnimationController::cancelAnimations()
call sites to use AnimationTimeline::cancelAnimationsForElement() when the flag to use Web Animations is on.

* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::cancelAnimationsForElement): Iterate over all animations for the provided element and call cancel() on them.
* animation/AnimationTimeline.h:
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::animatedStyleForRenderer): Drive-by fix while I was reviewed call sites to animationsForElement() to make
sure we don't create extra RefPtr<> objects.
* dom/Element.cpp:
(WebCore::Element::removedFromAncestor): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when an
element is removed.
* dom/PseudoElement.cpp:
(WebCore::PseudoElement::clearHostElement): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on when
a pseudo-element is removed.
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers): Call AnimationTimeline::cancelAnimationsForElement() if the Web Animations flag is on
for all children elements when an element gets a "display: none" style.

LayoutTests:

Three of the imported Mozilla tests now pass reliably, removing them from the list of flaky failure and timeout tests.

* TestExpectations:

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

2 years ago[Web Animations] Animated transform styles are ignored when calling getComputedStyle()
graouts@webkit.org [Fri, 23 Mar 2018 11:45:40 +0000 (11:45 +0000)]
[Web Animations] Animated transform styles are ignored when calling getComputedStyle()
https://bugs.webkit.org/show_bug.cgi?id=183918

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

We obtain one more PASS by correctly serializing the transform property on getComputedStyle().

* css-animations/test_animation-cancel-expected.txt:

LayoutTests/imported/w3c:

We obtain a number of progressions by correctly serializing the transform property on getComputedStyle().

* web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:
* web-platform-tests/web-animations/animation-model/keyframe-effects/effect-value-iteration-composite-operation-expected.txt:
* web-platform-tests/web-animations/interfaces/Animation/cancel-expected.txt:

Source/WebCore:

Strictly looking at whether the renderer has a transform is a bad idea when determining whether a
transform is applied for an element. Looking at the RenderStyle is preferable because in the case
of animations running on the compositor, such as a transform-only animation or transition, the
renderer doesn't necessarily have a transform style on it, since we don't blend properties in
software as the animation progresses. Instead, all of the blending is performed by the compositor,
and only the computed style object has the software-blended transform style on it.

We do need to account for inline renderers though as these do not support transforms.

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::computedTransform):

LayoutTests:

We obtain a number of progressions by correctly serializing the transform property on getComputedStyle().

* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-expected.txt:
* platform/mac-sierra/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/interpolation-per-property-expected.txt:

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

2 years ago[Web Animations] Support "transition: all" for CSS Transitions as Web Animations
graouts@webkit.org [Fri, 23 Mar 2018 11:42:31 +0000 (11:42 +0000)]
[Web Animations] Support "transition: all" for CSS Transitions as Web Animations
https://bugs.webkit.org/show_bug.cgi?id=183917

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Record progressions thanks to supporting "transition: all".

* css-transitions/test_animation-finished-expected.txt:
* css-transitions/test_csstransition-transitionproperty-expected.txt:
* css-transitions/test_effect-target-expected.txt:
* css-transitions/test_element-get-animations-expected.txt:
* css-transitions/test_pseudoElement-get-animations-expected.txt:

Source/WebCore:

We now support "transition: all" CSS Transitions by iterating over all known CSS properties should the mode
of the backing animation be AnimateAll. Any property that we find to have a different value in the previous
and current style will have a backing CSSTransition object created for it. To support this, we now explicitly
provide a CSSPropertyID when creating a CSSTransition since we can no longer infer the transition property
from the backing animation, as Animation objects with mode AnimateAll report CSSPropertyInvalid as their
property.

* animation/AnimationTimeline.cpp:
(WebCore::shouldBackingAnimationBeConsideredForCSSTransition): New method that checks whether a given backing
Animation object is suitable for consideration as a CSSTransition, where the mode must not be either AnimateNone
or AnimateUnknownProperty, and should the mode be AnimateSingleProperty, the property must not be CSSPropertyInvalid.
(WebCore::AnimationTimeline::updateCSSTransitionsForElement): We now assemble the list of previously animated
properties by looking at the m_elementToCSSTransitionByCSSPropertyID map and getting its keys. Then we compile
all backing Animation objects found in the old style that match the conditions enforced by the new method
shouldBackingAnimationBeConsideredForCSSTransition(). Then as we iterate over backing Animation objects found
in the new style, we iterate over all known CSS properties if the mode is AnimateAll, indicating that we're dealing
with a "transition: all" style. If we're dealing with a single property, we only process that single property.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::create): Expect a new CSSPropertyID parameter when creating a new CSSTransition since
we can no longer infer it from the backing Animation object.
(WebCore::CSSTransition::CSSTransition): Expect a new CSSPropertyID parameter when creating a new CSSTransition
since we can no longer infer it from the backing Animation object.
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): We can no longer use the == overloaded operator
for backing Animation objects to determine whether their respective properties match since this would compare the
"property" member of both Animation objects and when going from a "transition: all" style to one targeting a single
property, we would falsely identify mis-matching Animation objects. Instead, we pass a false flag to animationsMatch()
which indicates that we don't care about matching the transition property itself.
* animation/CSSTransition.h: Expose a new property() accessor which returns the CSSPropertyID passed at construction.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::computeCSSTransitionBlendingKeyframes): Use the new property() accessor on
CSSTransition to get at the transition property.
* platform/animation/Animation.cpp:
(WebCore::Animation::animationsMatch const): Replace the boolean parameter, which was not in use in WebCore, to indicate
whether we should match the property-related fields. We need this in CSSTransition::matchesBackingAnimationAndStyles().
* platform/animation/Animation.h:

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

2 years agoUnreviewed GTK+ gardening.
zandobersek@gmail.com [Fri, 23 Mar 2018 08:53:06 +0000 (08:53 +0000)]
Unreviewed GTK+ gardening.

Add a port-specific baseline for fast/css/apple-system-control.html.

Mark http/wpt/service-workers tests as a mix of failures and passes,
since a lot of the tests pass now that service workers were enabled, but
the passing ones are still in minority and there's additionally flaky
tests. This should improve after necessary testing SW directories are
properly specified.

In contrast, a bunch of SW-reliant tests under
imported/w3c/web-platform-tests/streams are now passing consistently.
Failure expectations for these are removed.

Failue expectations for three compositing tests are also removed after
r229804 fixed them.

* platform/gtk/TestExpectations:
* platform/gtk/fast/css/apple-system-control-colors-expected.txt: Added.

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

2 years agoUnreviewed build fix for GCC 4.9 builds.
zandobersek@gmail.com [Fri, 23 Mar 2018 08:46:09 +0000 (08:46 +0000)]
Unreviewed build fix for GCC 4.9 builds.

* assembler/MacroAssemblerCodeRef.h: std::is_trivially_copyable<> isn't
supported in 4.9 libstdc++, so wrap the static assert using it in a
COMPILER_SUPPORTS() macro, and use __is_trivially_copyable() builtin,
as is done in bitwise_cast() in StdLibExtras.h.

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

2 years ago[WPE][GTK] Fix -Wswitch warnings after r229778
mcatanzaro@igalia.com [Fri, 23 Mar 2018 07:56:08 +0000 (07:56 +0000)]
[WPE][GTK] Fix -Wswitch warnings after r229778
https://bugs.webkit.org/show_bug.cgi?id=183927

Reviewed by Carlos Garcia Campos.

* NetworkProcess/soup/NetworkDataTaskSoup.cpp:
(WebKit::NetworkDataTaskSoup::dispatchDidReceiveResponse): Log a warning if Suspend is
received as a PolicyAction
* UIProcess/API/glib/WebKitNavigationClient.cpp: Ignore the ProcessSwap termination reason,
which should be invisible to WebKit clients

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

2 years agoUnreviewed. Run JSC GLib API tests in GTK+ and WPE bots.
carlosgc@webkit.org [Fri, 23 Mar 2018 07:49:14 +0000 (07:49 +0000)]
Unreviewed. Run JSC GLib API tests in GTK+ and WPE bots.

The test runners were still considering the JSC tests as google tests, but they are now GLib tests.

* Scripts/run-gtk-tests:
(GtkTestRunner.is_glib_test):
(GtkTestRunner.is_google_test):
* Scripts/run-wpe-tests:
(WPETestRunner.is_glib_test):
(WPETestRunner.is_google_test):

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

2 years agoAdopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
timothy_horton@apple.com [Fri, 23 Mar 2018 06:53:26 +0000 (06:53 +0000)]
Adopt WK_ALTERNATE_FRAMEWORKS_DIR in WebCore
https://bugs.webkit.org/show_bug.cgi?id=183930
<rdar://problem/38782249>

Reviewed by Dan Bernstein.

Source/JavaScriptCore:

* JavaScriptCore.xcodeproj/project.pbxproj:

Source/WebCore:

* Configurations/Base.xcconfig:
* Configurations/WebCore.xcconfig:
* Configurations/WebCoreTestSupport.xcconfig:

Source/WebCore/PAL:

* Configurations/Base.xcconfig:
* Configurations/CopyPALHeaders.xcconfig:
* Configurations/PAL.xcconfig:

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

2 years agoVersioning.
jmarcell@apple.com [Fri, 23 Mar 2018 05:33:55 +0000 (05:33 +0000)]
Versioning.

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

2 years agoUnreviewed, rolling out r229876.
commit-queue@webkit.org [Fri, 23 Mar 2018 05:11:45 +0000 (05:11 +0000)]
Unreviewed, rolling out r229876.
https://bugs.webkit.org/show_bug.cgi?id=183929

Some webrtc tests are timing out on iOS simulator (Requested
by youenn on #webkit).

Reverted changeset:

"Use libwebrtc ObjectiveC H264 encoder and decoder"
https://bugs.webkit.org/show_bug.cgi?id=183912
https://trac.webkit.org/changeset/229876

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

2 years agoExpose more system colors via CSS
megan_gardner@apple.com [Fri, 23 Mar 2018 04:04:57 +0000 (04:04 +0000)]
Expose more system colors via CSS
https://bugs.webkit.org/show_bug.cgi?id=183764
<rdar://problem/36975898>

Reviewed by Tim Horton.

Test: fast/css/apple-system-control-colors.html

Expose Apple specific system colors via CSS.

* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::systemColor const):

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

2 years agoAX: Web table row count is incorrect when role row is added to <tr> in DOM
n_wang@apple.com [Fri, 23 Mar 2018 01:41:44 +0000 (01:41 +0000)]
AX: Web table row count is incorrect when role row is added to <tr> in DOM
https://bugs.webkit.org/show_bug.cgi?id=183922

Reviewed by Chris Fleizach.

Source/WebCore:

Although the parent table for an ARIA grid row should be an ARIA table, we
should return the native table if the row is native <tr>.

Test: accessibility/row-with-aria-role-in-native-table.html

* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentTable const):

LayoutTests:

* accessibility/row-with-aria-role-in-native-table-expected.txt: Added.
* accessibility/row-with-aria-role-in-native-table.html: Added.

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

2 years agoInclude security origin in the service worker process name
cdumez@apple.com [Fri, 23 Mar 2018 01:37:15 +0000 (01:37 +0000)]
Include security origin in the service worker process name
https://bugs.webkit.org/show_bug.cgi?id=183913

Reviewed by Youenn Fablet.

Source/WebCore:

Updated localizable strings.

* English.lproj/Localizable.strings:

Source/WebKit:

Include security origin in the service worker process name to facilitate debugging. This way, we
can differentiate which service worker process is used for which origin in activity monitor.

* Shared/ChildProcess.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.mm:
(WebKit::XPCServiceInitializerDelegate::getExtraInitializationData):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::getLaunchOptions):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::initializeProcessName):

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

2 years agoUnreviewed, silence unused variable warning
mcatanzaro@igalia.com [Fri, 23 Mar 2018 01:19:25 +0000 (01:19 +0000)]
Unreviewed, silence unused variable warning

Patch by Michael Catanzaro <mcatanzaro@igalia.com> on 2018-03-22

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::decidePolicyForNavigationAction):

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

2 years agoUse libwebrtc ObjectiveC H264 encoder and decoder
youenn@apple.com [Fri, 23 Mar 2018 01:18:31 +0000 (01:18 +0000)]
Use libwebrtc ObjectiveC H264 encoder and decoder
https://bugs.webkit.org/show_bug.cgi?id=183912

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Add utilities inside libwebrtc to be used by WebKit:
- Create ObjectiveC encoder/decoder factories
- Notify of application status to invalidate encoders/decoders when in background
Implement RTCUIApplicationStatusObserver as a simple boolean that is set by WebCore.
This allows limiting the changes made to libwebrtc codec implementations.

Minor modifications done to libwebrtc to fix compilation.
Add Block_copy/Block_release to codec callbacks.

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:
* Source/webrtc/sdk/WebKit/WebKitUtilities.h: Added.
* Source/webrtc/sdk/WebKit/WebKitUtilities.mm: Added.
(+[RTCUIApplicationStatusObserver sharedInstance]):
(+[RTCUIApplicationStatusObserver prepareForUse]):
(-[RTCUIApplicationStatusObserver setActive]):
(-[RTCUIApplicationStatusObserver setInactive]):
(-[RTCUIApplicationStatusObserver isApplicationActive]):
(webrtc::setApplicationStatus):
(webrtc::createVideoToolboxEncoderFactory):
(webrtc::createVideoToolboxDecoderFactory):
(webrtc::setH264HardwareEncoderAllowed):
(webrtc::isH264HardwareEncoderAllowed):
(webrtc::pixelBufferFromFrame):
* Source/webrtc/sdk/objc/Framework/Classes/Video/RTCCVPixelBuffer.mm:
(-[RTCCVPixelBuffer dealloc]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoDecoderH264.mm:
(-[RTCVideoDecoderH264 dealloc]):
(-[RTCVideoDecoderH264 setCallback:]):
(-[RTCVideoDecoderH264 releaseDecoder]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 dealloc]):
(-[RTCVideoEncoderH264 setCallback:]):
(-[RTCVideoEncoderH264 releaseEncoder]):
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* WebKit/0001-Adapting-libwebrtc-H264-codec.patch: Added.
* libwebrtc.xcodeproj/project.pbxproj:

Source/WebCore:

No observable change of behavior.
Made use of libwebrtc WebKit utilities.
Updated RealtimeINcomingVideoSourceCocoa as it now receives ObjcVideoFrame.

* Configurations/WebCore.xcconfig:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProviderCocoa::~LibWebRTCProviderCocoa):
(WebCore::LibWebRTCProviderCocoa::setH264HardwareEncoderAllowed):
(WebCore::LibWebRTCProviderCocoa::createDecoderFactory):
(WebCore::LibWebRTCProviderCocoa::createEncoderFactory):
(WebCore::LibWebRTCProviderCocoa::setActive):
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm: Renamed from Source/WebCore/platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.cpp.
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
(WebCore::RealtimeIncomingVideoSourceCocoa::OnFrame):
* testing/Internals.cpp: Removed commented out include.

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

2 years agoWKWebView doesn’t expose its spellCheckerDocumentTag
mitz@apple.com [Fri, 23 Mar 2018 01:15:24 +0000 (01:15 +0000)]
WKWebView doesn’t expose its spellCheckerDocumentTag
https://bugs.webkit.org/show_bug.cgi?id=183797
<rdar://problem/38678089>

Reviewed by Tim Horton.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _spellCheckerDocumentTag]): Added this getter which calls through to the WebViewImpl.
* UIProcess/API/Cocoa/WKWebViewPrivate.h: Declared _spellCheckerDocumentTag property.

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

2 years agoUncaught Exception: TypeError: this._textEditor.toggleUnexecutedCodeHighlights()...
nvasilyev@apple.com [Fri, 23 Mar 2018 01:00:43 +0000 (01:00 +0000)]
Uncaught Exception: TypeError: this._textEditor.toggleUnexecutedCodeHighlights().then is not a function
https://bugs.webkit.org/show_bug.cgi?id=181912
<rdar://problem/36700022>

Reviewed by Matt Baker.

The uncaught exception was caused by returning `false` instead of a promise object.
This patch only fixes the exception. Further enhancements should be done in <https://webkit.org/b/183887>.

* UserInterface/Views/SourceCodeTextEditor.js:
(WI.SourceCodeTextEditor.prototype.toggleTypeAnnotations):
(WI.SourceCodeTextEditor.prototype.toggleUnexecutedCodeHighlights):

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

2 years agoUse the same SWServer for all ephemeral sessions
cdumez@apple.com [Fri, 23 Mar 2018 00:00:55 +0000 (00:00 +0000)]
Use the same SWServer for all ephemeral sessions
https://bugs.webkit.org/show_bug.cgi?id=183921
<rdar://problem/36873075>

Reviewed by Youenn Fablet.

Use the same SWServer for all ephemeral sessions. SWServers never go away and we create
one per sessionID. When browsing doing private browsing in Safari (and other fetching
favorite icons), the sessionID is ephemeral and keeps changing. This means that we kept
constructing new SWServers that would never go away. Each SWServer has a thread so we
would eventually hit the thread limit for the storage process.

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::swServerForSession):

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

2 years agoUnreviewed, fix format string warnings in service worker code
mcatanzaro@igalia.com [Thu, 22 Mar 2018 22:18:08 +0000 (22:18 +0000)]
Unreviewed, fix format string warnings in service worker code

On Linux x86_64, uint64_t is unsigned long, not unsigned long long.

Source/WebCore:

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::jobFailedWithException):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
(WebCore::ServiceWorkerContainer::startScriptFetchForJob):
(WebCore::ServiceWorkerContainer::jobFinishedLoadingScript):
(WebCore::ServiceWorkerContainer::jobFailedLoadingScript):

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::didFinishFetch):
(WebKit::WebSWServerConnection::didFailFetch):
(WebKit::WebSWServerConnection::didNotHandleFetch):

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

2 years agoExpose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
dbates@webkit.org [Thu, 22 Mar 2018 22:10:38 +0000 (22:10 +0000)]
Expose SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() as WebKit SPI
https://bugs.webkit.org/show_bug.cgi?id=183907
<rdar://problem/38759127>

Reviewed by Alex Christensen.

Source/WebCore:

Exports SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest() so that we can use it from WebKit.

* platform/SchemeRegistry.h:

Source/WebKit:

Adds both modern Objective-C SPI and C SPI to allow an embedding client to register a scheme
whose content should be displayed/loaded if and only if it can be requested. Disregarding an
app that enables universal access, by using this SPI WebKit will refuse to display cross-origin
content for the registered schemes.

We need to add C SPI for embedding clients that have not transitioned to the modern Objective-
C API/SPI.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/API/C/WKContext.cpp:
(WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequest):
* UIProcess/API/C/WKContextPrivate.h:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _registerURLSchemeAsCanDisplayOnlyIfCanRequest:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::registerURLSchemeAsCanDisplayOnlyIfCanRequest):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):
(WebKit::WebProcess::registerURLSchemeAsCanDisplayOnlyIfCanRequest const):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Adds unit tests for the modern Objective-C and C SPI to ensure we do not regress it.

We use the deprecated -[WKBrowsingContextController registerSchemeForCustomProtocol:]
in both the modern Objective-C API and C API tests to share code. Once we no longer
need to support the C API we should remove the tests and transition the modern Objective-
C tests to use -[WKWebViewConfiguration setURLSchemeHandler:forURLScheme:].

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKitCocoa/SchemeRegistry.mm: Added.
(+[EchoURLProtocol canInitWithRequest:]):
(+[EchoURLProtocol canonicalRequestForRequest:]):
(+[EchoURLProtocol requestIsCacheEquivalent:toRequest:]):
(-[EchoURLProtocol startLoading]):
(-[EchoURLProtocol stopLoading]):
(-[WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequestLoadDelegate browsingContextController:didFailProvisionalLoadWithError:]):
(-[WKContextRegisterURLSchemeAsCanDisplayOnlyIfCanRequestLoadDelegate browsingContextControllerDidFinishLoad:]):
(TestWebKitAPI::TEST):

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

2 years agoCSS mask images should be retrieved using potentially CORS-enabled fetch
dbates@webkit.org [Thu, 22 Mar 2018 22:02:58 +0000 (22:02 +0000)]
CSS mask images should be retrieved using potentially CORS-enabled fetch
https://bugs.webkit.org/show_bug.cgi?id=179983
<rdar://problem/35678149>

Reviewed by Brent Fulgham.

Source/WebCore:

As per <https://drafts.fxtf.org/css-masking-1/#priv-sec> (Editor's Draft, 23 December 2017)
we should fetch CSS mask images using a potentially CORS-enabled fetch.

Both cross-origin CSS shape-outside images and CSS mask images may be sensitive to timing
attacks that can be used to reveal their pixel data when retrieved without regard to CORS.
For the same reason that we fetch CSS shape-outside images using a potentially CORS-enabled
fetch we should fetch CSS mask the same way. This also makes the behavior of WebKit more
closely align with the behavior in the spec.

Test: http/tests/security/css-mask-image.html

* style/StylePendingResources.cpp: Substitute LoadPolicy::NoCORS and LoadPolicy::Anonymous for
LoadPolicy::Normal and LoadPolicy::ShapeOutside, respectively, to match the terminology used
in the HTML, CSS Shapes Module Level 1, and CSS Masking Module Level 1 specs.
(WebCore::Style::loadPendingImage): Ditto.
(WebCore::Style::loadPendingResources): Use load policy LoadPolicy::Anonymous when fetching
a mask image or shape-outside image.

LayoutTests:

Add a test to ensure we do not fetch a cross-origin CSS mask image that does
not allow CORS access.

* http/tests/security/css-mask-image-expected.html: Added.
* http/tests/security/css-mask-image.html: Added.
* http/tests/security/resources/black-square.png: Added.
* http/tests/security/resources/fail-mask.png: Added.

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

2 years ago[Simple line layout] Text with letter spacing is not positioned properly.
zalan@apple.com [Thu, 22 Mar 2018 21:59:41 +0000 (21:59 +0000)]
[Simple line layout] Text with letter spacing is not positioned properly.
https://bugs.webkit.org/show_bug.cgi?id=183079
<rdar://problem/38762569>

Reviewed by Antti Koivisto.

Source/WebCore:

We need to recompute RenderText::m_canUseSimplifiedTextMeasuring when the font cascade changes
since we might not be able to use the fast path anymore.

Test: fast/text/simple-line-layout-dynamic-letter-word-spacing.html

* rendering/RenderText.cpp:
(WebCore::RenderText::styleDidChange):

LayoutTests:

* fast/text/simple-line-layout-dynamic-letter-word-spacing-expected.html: Added.
* fast/text/simple-line-layout-dynamic-letter-word-spacing.html: Added.

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

2 years ago[WPE] Enable WOFF2 support
aperez@igalia.com [Thu, 22 Mar 2018 21:56:18 +0000 (21:56 +0000)]
[WPE] Enable WOFF2 support
https://bugs.webkit.org/show_bug.cgi?id=178158

Reviewed by Frédéric Wang.

.:

* Source/cmake/OptionsWPE.cmake: Add needed logic to detect the Brotli and WOFF2 libraries.

Tools:

* wpe/jhbuild.modules: Add "brotli" and "woff2" to the JHBuild moduleset.

LayoutTests:

* platform/wpe/TestExpectations: Unskip the fast/text/woff2.html and fast/text/woff2-totalsfntsize.html

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

2 years agoDo not export web-platform-test files generated by the wpt importer to assist the...
commit-queue@webkit.org [Thu, 22 Mar 2018 21:52:51 +0000 (21:52 +0000)]
Do not export web-platform-test files generated by the wpt importer to assist the webkit test runner
https://bugs.webkit.org/show_bug.cgi?id=183916

Patch by Brendan McLoughlin <brendan@bocoup.com> on 2018-03-22
Reviewed by Youenn Fablet.

* Scripts/webkitpy/w3c/test_exporter.py:
(TestExporter.create_branch_with_patch):
* Scripts/webkitpy/w3c/test_exporter_unittest.py:
(TestExporterTest.test_export):
(TestExporterTest.test_export_with_specific_branch):

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

2 years ago[Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass...
graouts@webkit.org [Thu, 22 Mar 2018 21:33:53 +0000 (21:33 +0000)]
[Web Animations] Make imported/mozilla/css-animations/test_event-dispatch.html pass reliably
https://bugs.webkit.org/show_bug.cgi?id=183845

Reviewed by Dean Jackson.

LayoutTests/imported/mozilla:

Add test expectations for previously crashing tests, update other expectations with progressions, including
the two event dispatch tests which now pass all assertions.

* css-animations/test_animation-finish-expected.txt:
* css-animations/test_animation-pausing-expected.txt:
* css-animations/test_animation-playstate-expected.txt:
* css-animations/test_animation-ready-expected.txt:
* css-animations/test_animation-starttime-expected.txt:
* css-animations/test_event-dispatch-expected.txt:
* css-animations/test_event-order-expected.txt:
* css-animations/test_setting-effect-expected.txt: Added.
* css-transitions/test_animation-cancel-expected.txt:
* css-transitions/test_animation-computed-timing-expected.txt:
* css-transitions/test_animation-currenttime-expected.txt:
* css-transitions/test_animation-pausing-expected.txt:
* css-transitions/test_animation-starttime-expected.txt:
* css-transitions/test_event-dispatch-expected.txt:
* css-transitions/test_setting-effect-expected.txt: Added.

Source/WebCore:

Finish the work to get DOM events for CSS Animations and CSS Transitions dispatching as specified.

* animation/AnimationEffectReadOnly.cpp: Move timeEpsilon to be shared as part of WebAnimationUtilities.h since we now need it in
WebAnimation::timeToNextRequiredTick().
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::updateCSSAnimationsForElement): We add a pre-emptive return clause when we know that the AnimationList
for previous and current styles are a match.
* animation/CSSTransition.cpp:
(WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Ensure we have a valid effect before downcasting it.
* animation/DeclarativeAnimation.cpp:
(WebCore::DeclarativeAnimation::initialize): We need to call pause() for declarative animations that aren't playing so that the animation's
playState is set correctly and the animation is not idle.
* animation/DocumentTimeline.cpp:
(WebCore::DocumentTimeline::updateAnimationSchedule): We no longer need to pass the current time to timeToNextRequiredTick() since the method has
been reworked to use the animation's current time, which is based on the timeline's current time.
(WebCore::DocumentTimeline::updateAnimations): Avoid creating a copy when iterating over pending hardware animations.
* animation/KeyframeEffectReadOnly.cpp:
(WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): We should never generate new blending keyframes if the
old and new styles contain the same value, since there would be no transition between two equal values, and we should only look at whether the new
style value and the recorded target value differ to determine if new blending keyframes are necessary.
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::timeToNextRequiredTick const): We correct our scheduling code which was shown to be broken in several of the newly-imported
Mozilla tests. Any running animation is now scheduled to invalidate again on the next tick, and we use timeEpsilon from WebAnimationUtilities.h to
correctly check if we're right at the active threshold, when we also invalidate on the next tick. If our current time is negative, in other words
when the animation has not yet started, we schedule this animation's next tick to be the negative of that value. In all other cases, no invalidation
needs to be scheduled.
* animation/WebAnimation.h: We move updateFinishedState() to private since this method is not actually used outside of WebAnimation.cpp.
* animation/WebAnimationUtilities.h: Move timeEpsilon to be shared as part of WebAnimationUtilities.h.

LayoutTests:

A couple of crashing tests no longer crash and a couple are now reliably passing.

* TestExpectations:

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

2 years agoAdd placeholder call and jump MacroAssembler emitters that take PtrTag in a register.
mark.lam@apple.com [Thu, 22 Mar 2018 21:24:15 +0000 (21:24 +0000)]
Add placeholder call and jump MacroAssembler emitters that take PtrTag in a register.
https://bugs.webkit.org/show_bug.cgi?id=183914
<rdar://problem/38763536>

Reviewed by Saam Barati and JF Bastien.

This is in preparation for supporting pointer profiling work.

* assembler/MacroAssemblerARM.h:
(JSC::MacroAssemblerARM::jump):
(JSC::MacroAssemblerARM::call):
* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::call):
(JSC::MacroAssemblerARM64::jump):
* assembler/MacroAssemblerARMv7.h:
(JSC::MacroAssemblerARMv7::jump):
(JSC::MacroAssemblerARMv7::call):
* assembler/MacroAssemblerMIPS.h:
(JSC::MacroAssemblerMIPS::jump):
(JSC::MacroAssemblerMIPS::call):
* assembler/MacroAssemblerX86.h:
(JSC::MacroAssemblerX86::call):
(JSC::MacroAssemblerX86::jump):
* assembler/MacroAssemblerX86Common.h:
(JSC::MacroAssemblerX86Common::jump):
(JSC::MacroAssemblerX86Common::call):
* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::call):
(JSC::MacroAssemblerX86_64::jump):

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

2 years agoUnreviewed gardening. Update WinCairo TestExpectations and drop the unnecessary suffix.
ross.kirsling@sony.com [Thu, 22 Mar 2018 21:17:47 +0000 (21:17 +0000)]
Unreviewed gardening. Update WinCairo TestExpectations and drop the unnecessary suffix.

* platform/wincairo-win10/TestExpectations: Removed.
* platform/wincairo/TestExpectations: Added.

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

2 years agoImprove readability of WebCore's OTHER_LDFLAGS
timothy_horton@apple.com [Thu, 22 Mar 2018 20:54:06 +0000 (20:54 +0000)]
Improve readability of WebCore's OTHER_LDFLAGS
https://bugs.webkit.org/show_bug.cgi?id=183909
<rdar://problem/38760992>

Reviewed by Dan Bernstein.

* .../Configurations/Base.xcconfig:
* .../Configurations/FeatureDefines.xcconfig:

* WebCore/Configurations/WebCore.xcconfig:

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

2 years agoAdopt USE(OPENGL[_ES]) in more places
timothy_horton@apple.com [Thu, 22 Mar 2018 18:37:17 +0000 (18:37 +0000)]
Adopt USE(OPENGL[_ES]) in more places
https://bugs.webkit.org/show_bug.cgi?id=183882
<rdar://problem/37912195>

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/graphics/GraphicsContext3D.h:
* platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
(WebCore::hasMuxableGPU):
(WebCore::GraphicsContext3DManager::updateHighPerformanceState):
(WebCore::GraphicsContext3D::GraphicsContext3D):
(WebCore::GraphicsContext3D::~GraphicsContext3D):
(WebCore::GraphicsContext3D::makeContextCurrent):
(WebCore::GraphicsContext3D::checkGPUStatus):
(WebCore::GraphicsContext3D::texImageIOSurface2D):
* platform/graphics/cocoa/WebGLLayer.h:
* platform/graphics/cocoa/WebGLLayer.mm:
(-[WebGLLayer initWithGraphicsContext3D:]):
(-[WebGLLayer copyImageSnapshotWithColorSpace:]):
(-[WebGLLayer display]):
* platform/graphics/ios/GraphicsContext3DIOS.h:
* platform/graphics/opengl/Extensions3DOpenGL.cpp:
(WebCore::Extensions3DOpenGL::blitFramebuffer):
(WebCore::Extensions3DOpenGL::createVertexArrayOES):
(WebCore::Extensions3DOpenGL::deleteVertexArrayOES):
(WebCore::Extensions3DOpenGL::isVertexArrayOES):
(WebCore::Extensions3DOpenGL::bindVertexArrayOES):
* platform/graphics/opengl/Extensions3DOpenGL.h:
* platform/graphics/opengl/GraphicsContext3DOpenGL.cpp:
(WebCore::GraphicsContext3D::reshapeFBOs):
(WebCore::GraphicsContext3D::resolveMultisamplingIfNecessary):
(WebCore::GraphicsContext3D::renderbufferStorage):
(WebCore::GraphicsContext3D::getIntegerv):
(WebCore::GraphicsContext3D::texImage2D):
(WebCore::GraphicsContext3D::depthRange):
(WebCore::GraphicsContext3D::clearDepth):
* platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
(WebCore::GraphicsContext3D::paintRenderingResultsToCanvas):
Make it a bit more clear which code is platform-dependent and which code is GL/GLES-dependent.

Source/WTF:

* wtf/Platform.h:

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

2 years ago[TexMap] Make TextureMapperContextAttributes thread-specific
zandobersek@gmail.com [Thu, 22 Mar 2018 18:07:05 +0000 (18:07 +0000)]
[TexMap] Make TextureMapperContextAttributes thread-specific
https://bugs.webkit.org/show_bug.cgi?id=183895

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Store the TextureMapperContextAttributes in a thread-specific manner.
The TextureMapperContextAttributes::get() method is now used to retrieve
a reference to that thread-specific object. If it's not been initialized
yet, then the current GL context is used for the initialization, as it
used to be done in the now-removed initialize() method.

TextureMapperPlatformLayerBuffer::clone() method now doesn't need to
be passed a TextureMapperGL object, since the texture can be created
directly by calling BitmapTextureGL::create(), passing the
TextureMapperContextAttributes object that's retrieved from the
thread-specific storage. This further simplifies the
TextureMapperPlatformLayerProxy::Compositor interface, removing the
texmapGL() getter from it.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
* platform/graphics/texmap/TextureMapperContextAttributes.cpp:
(WebCore::threadSpecificAttributes):
(WebCore::TextureMapperContextAttributes::get):
(WebCore::TextureMapperContextAttributes::initialize): Deleted.
* platform/graphics/texmap/TextureMapperContextAttributes.h:
* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::TextureMapperGL):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
(WebCore::TextureMapperPlatformLayerBuffer::clone):
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.h:

Source/WebKit:

CoordinatedGraphicsScene, as an implementor of the
TextureMapperPlatformLayerProxy::Compositor interface, doesn't have to
implement the texmapGL() method anymore.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::onNewBufferAvailable):
(WebKit::CoordinatedGraphicsScene::texmapGL): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:

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

2 years ago[ARM] Thumb: Do not decorate bottom bit twice
commit-queue@webkit.org [Thu, 22 Mar 2018 18:03:36 +0000 (18:03 +0000)]
[ARM] Thumb: Do not decorate bottom bit twice
https://bugs.webkit.org/show_bug.cgi?id=183906

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-03-22
Reviewed by Mark Lam.

Use MacroAssemblerCodePtr::createFromExecutableAddress instead of
MacroAssemblerCodePtr(void*) to avoid decorating the pointer twice as
a thumb pointer.

* jit/Repatch.cpp:
(JSC::linkPolymorphicCall):

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

2 years ago[JSC] Clear MustGenerate for ToString(Number) converted from NumberToStringWithRadix
utatane.tea@gmail.com [Thu, 22 Mar 2018 17:07:26 +0000 (17:07 +0000)]
[JSC] Clear MustGenerate for ToString(Number) converted from NumberToStringWithRadix
https://bugs.webkit.org/show_bug.cgi?id=183559

Reviewed by Mark Lam.

JSTests:

* stress/double-to-string-in-loop-removed.js: Added.
(test):
* stress/int32-to-string-in-loop-removed.js: Added.
(test):
* stress/int52-to-string-in-loop-removed.js: Added.
(test):

Source/JavaScriptCore:

When converting NumberToStringWithRadix to ToString(Int52/Int32/Double), we forget
to clear NodeMustGenerate for this ToString. It should be since it does not have
any user-observable side effect. This patch clears NodeMustGenerate.

* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):

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

2 years ago[JSC] List up all candidates in DFGCapabilities and FTLCapabilities
utatane.tea@gmail.com [Thu, 22 Mar 2018 15:58:59 +0000 (15:58 +0000)]
[JSC] List up all candidates in DFGCapabilities and FTLCapabilities
https://bugs.webkit.org/show_bug.cgi?id=183897

Reviewed by Mark Lam.

We should not use `default:` clause here since it accidentally catches
the opcode and DFG nodes which should be optimized. For example,
op_super_sampler_begin and op_super_sampler_end are not listed while
they have DFG and FTL backend.

This patch lists up all candiates in DFGCapabilities and FTLCapabilities.
And we also clean up unnecessary checks in FTLCapabilities. Since we
already handles all the possible array types for these nodes (which can
be checked in DFG's code), we do not need to check array types.

We also fix FTLLowerDFGToB3' PutByVal code to use modeForPut.

* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compilePutByVal):

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

2 years agoUnreviewed gardening.
zalan@apple.com [Thu, 22 Mar 2018 15:46:36 +0000 (15:46 +0000)]
Unreviewed gardening.

Unskipping imported/blink/svg/css/path-layout-crash.html (should have been unskipped with r229782).

* TestExpectations:

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

2 years ago[JSC] Drop op_put_by_index
utatane.tea@gmail.com [Thu, 22 Mar 2018 15:40:57 +0000 (15:40 +0000)]
[JSC] Drop op_put_by_index
https://bugs.webkit.org/show_bug.cgi?id=183899

Reviewed by Mark Lam.

This patch drops op_put_by_index.

1. This functionality can be just covered by direct put_by_val.
2. put_by_index is not well optimized. It is just calling a C
function. And it does not have DFG handling.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPutByIndex): Deleted.
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::ArrayNode::emitBytecode):
(JSC::ArrayPatternNode::emitDirectBinding):
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emit_op_put_by_index): Deleted.
* jit/JITPropertyAccess32_64.cpp:
(JSC::JIT::emit_op_put_by_index): Deleted.
* llint/LLIntSlowPaths.cpp:
* llint/LLIntSlowPaths.h:
* llint/LowLevelInterpreter.asm:

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

2 years agoUnreviewed GTK+ gardening after r229847.
magomez@igalia.com [Thu, 22 Mar 2018 15:26:38 +0000 (15:26 +0000)]
Unreviewed GTK+ gardening after r229847.

* platform/gtk/TestExpectations:
* platform/gtk/http/tests/loading/simple-subframe-expected.txt:
* platform/gtk/http/tests/navigation/redirect-to-fragment2-expected.txt: Added.
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

2 years agoRace Condition in arrayProtoFuncReverse() causes wrong results or crash
msaboff@apple.com [Thu, 22 Mar 2018 15:12:44 +0000 (15:12 +0000)]
Race Condition in arrayProtoFuncReverse() causes wrong results or crash
https://bugs.webkit.org/show_bug.cgi?id=183901

Reviewed by Keith Miller.

JSTests:

New test.

* stress/array-reverse-doesnt-clobber.js: Added.
(testArrayReverse):
(createArrayOfArrays):
(createArrayStorage):

Source/JavaScriptCore:

Added write barriers to ensure the reversed contents are properly marked.

* runtime/ArrayPrototype.cpp:
(JSC::arrayProtoFuncReverse):

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

2 years agoSVG root is skipped while marking percentage height descendants dirty.
zalan@apple.com [Thu, 22 Mar 2018 14:54:12 +0000 (14:54 +0000)]
SVG root is skipped while marking percentage height descendants dirty.
https://bugs.webkit.org/show_bug.cgi?id=183877

Reviewed by Antti Koivisto.

Source/WebCore:

Calling continingBlock() to get to the correct container works as long as the ancestor inline element
renderers are wrapped in anonymous blocks (continuation for example).

While the SVG root renderer is an inline renderer, it is not wrapped or normalized in any way,
so containingBlock() will elegantly skip it and return an SVG root ancestor.
dirtyForLayoutFromPercentageHeightDescendants calls containingBlock() to walk up
on the ancestor chain to mark elements dirty. This fails when there's an SVG subtree in the block chain.
This patch marks the SVG subtree chain dirty to ensure that layout will get to all the dirty leaf renderers
(note that the SVG subtree is supposed to have only statically positioned elements so parent == containing block).

Covered by existing tests.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):

LayoutTests:

* TestExpectations:

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

2 years ago[WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are...
aperez@igalia.com [Thu, 22 Mar 2018 13:48:34 +0000 (13:48 +0000)]
[WPE][GTK] Build failure when ENABLE_VIDEO, ENABLE_WEB_AUDIO and ENABLE_XSLT are disabled
https://bugs.webkit.org/show_bug.cgi?id=183896

Reviewed by Yusuke Suzuki.

No new tests needed.

* bindings/js/JSWebAnimationCustom.cpp: Add missing #include of Document.h

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

2 years ago[MathML] Import WPT test to replace mathml/opentype/large-operators-italic-correction...
fred.wang@free.fr [Thu, 22 Mar 2018 11:31:47 +0000 (11:31 +0000)]
[MathML] Import WPT test to replace mathml/opentype/large-operators-italic-correction.html
https://bugs.webkit.org/show_bug.cgi?id=183891

Patch by Frederic Wang <fwang@igalia.com> on 2018-03-22
Reviewed by Manuel Rego Casasnovas.

LayoutTests/imported/w3c:

Import WPT test added in https://github.com/w3c/web-platform-tests/pull/9993.

* web-platform-tests/fonts/math/largeop-displayoperatorminheight2000-2AFF-italiccorrection3000.woff: Added.
* web-platform-tests/fonts/math/w3c-import.log:
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2-expected.txt: Added.
* web-platform-tests/mathml/presentation-markup/scripts/subsup-parameters-2.html: Added.
* web-platform-tests/mathml/presentation-markup/scripts/w3c-import.log:
* web-platform-tests/mathml/tools/largeop.py:

LayoutTests:

Remove large-operators-italic-correction.html. Italic correction is tested more completely by
a new WPT test that does not require Latin Modern Math to be installed on the try bots.

* mathml/opentype/large-operators-italic-correction-expected.txt: Removed.
* mathml/opentype/large-operators-italic-correction.html: Removed.
* platform/ios/TestExpectations: Remove test expectation.
* platform/mac/TestExpectations: Ditto.
* platform/win/TestExpectations: Ditto.

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

2 years agoUnreviewed, update comment added in r229801.
fred.wang@free.fr [Thu, 22 Mar 2018 06:48:43 +0000 (06:48 +0000)]
Unreviewed, update comment added in r229801.

Patch by Frederic Wang <fwang@igalia.com> on 2018-03-21

* WebProcess/WebPage/ios/FindControllerIOS.mm:
(WebKit::FindController::didFindString): Remove "On Mobile" and mention bug 183889.

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

2 years agoCreate an assertion mechanism to ensure proper WebCore use in each WebKit Process
bfulgham@apple.com [Thu, 22 Mar 2018 04:35:13 +0000 (04:35 +0000)]
Create an assertion mechanism to ensure proper WebCore use in each WebKit Process
https://bugs.webkit.org/show_bug.cgi?id=183806
<rdar://problem/38694251>

Reviewed by Ryosuke Niwa.

Part of our security improvements involve better isolation between the different WebKit
processes (UIProcess, WebContent, Networking, Storage, etc.).

We need an assertion language we can use to protect certain critical APIs and code paths
against accidental misuse.

This patch adds a new enum type meant to represent different categories of program logic
that we do not want used in the wrong process.

This first patch just creates these types and makes them available. New assertions using
these values will be added as we complete our work ensuring proper process isolation.

In a method we want to protect, we can add an assertion describing the process privileges
needed to execute the code. For example, for cookie access we might use this:

    ASSERT(hasProcessPrivilege(ProcessPrivilege::CanAccessRawCookies);

At the launch of the UIProcess we would use this method to ensure all privileges are available:

    setProcessPrivileges(allPrivileges());

In the network process, during platform initialization, we would use something like this:

    setProcessPrivileges({ ProcessPrivilege::CanAccessRawCookies, ProcessPrivilege::CanAccessCredentials });

In the WebContent process, we would not set any privileges. We could just leave it as the
default initialization, or use this:

    setProcessPrivileges({ });

Later, when we attempt to execute the initial code, we would expect an assertion for the
WebContent process, while Network and UIProcess pass the assertion.

* WTF.xcodeproj/project.pbxproj: Add new files.
* wtf/CMakeLists.txt: Ditto.
* wtf/ProcessPrivilege.cpp: Added.
(WTF::processPrivileges):
(WTF::setProcessPrivileges):
(WTF::hasProcessPrivilege):
* wtf/ProcessPrivilege.h: Added.

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

2 years agoUnreviewed. Marked myself as a committer.
Hironori.Fujii@sony.com [Thu, 22 Mar 2018 04:20:28 +0000 (04:20 +0000)]
Unreviewed. Marked myself as a committer.

* Scripts/webkitpy/common/config/contributors.json:

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

2 years agoRegression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
cdumez@apple.com [Thu, 22 Mar 2018 03:14:14 +0000 (03:14 +0000)]
Regression(r229828): WebKit.NoHistoryItemScrollToFragment API test is failing on iOS
https://bugs.webkit.org/show_bug.cgi?id=183886

Reviewed by Wenson Hsieh.

Since r229828, the FrameLoader needs to call FrameLoaderClient::didDecidePolicyForNavigationAction()
whenever a navigation policy decision is made. I added such a call r229828 to
FrameLoader::continueLoadAfterNavigationPolicy() but forgot to add one to
FrameLoader::continueFragmentScrollAfterNavigationPolicy(), which is the equivalent
for fragment navigations.

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

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

2 years agoScopedArguments should do poisoning and index masking
fpizlo@apple.com [Thu, 22 Mar 2018 02:15:44 +0000 (02:15 +0000)]
ScopedArguments should do poisoning and index masking
https://bugs.webkit.org/show_bug.cgi?id=183863

Reviewed by Mark Lam.

JSTests:

Adds another stress test of scoped arguments.

* stress/scoped-arguments-test.js: Added.
(foo):

Source/JavaScriptCore:

This outlines the ScopedArguments overflow storage and adds poisoning.

* bytecode/AccessCase.cpp:
(JSC::AccessCase::generateWithGuard):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
(JSC::DFG::SpeculativeJIT::compileGetArrayLength):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetArrayLength):
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitScopedArgumentsGetByVal):
* runtime/JSCPoison.h:
* runtime/ScopedArguments.cpp:
(JSC::ScopedArguments::ScopedArguments):
(JSC::ScopedArguments::createUninitialized):
(JSC::ScopedArguments::visitChildren):
* runtime/ScopedArguments.h:

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

2 years agoRegression(r229831): ProcessSwap.Basic API test is crashing
cdumez@apple.com [Thu, 22 Mar 2018 01:49:27 +0000 (01:49 +0000)]
Regression(r229831): ProcessSwap.Basic API test is crashing
https://bugs.webkit.org/show_bug.cgi?id=183884

Reviewed by Brady Eidson.

This code should only be called for navigation policy decisions.
It used to work without this check because of an early return, which
was dropped in r229831.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedPolicyDecision):

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

2 years agoRegression(r229831): fast/loader/javascript-url-iframe-remove-on-navigate-async-deleg...
cdumez@apple.com [Thu, 22 Mar 2018 01:47:43 +0000 (01:47 +0000)]
Regression(r229831): fast/loader/javascript-url-iframe-remove-on-navigate-async-delegate.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=183885

Unreviewed, temporarily mark the test as flaky while I investigate.

* TestExpectations:

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

2 years agoUnreviewed, make the email address of Yoshiaki Jitsukawa all lower case.
yoshiaki.jitsukawa@sony.com [Thu, 22 Mar 2018 01:24:37 +0000 (01:24 +0000)]
Unreviewed, make the email address of Yoshiaki Jitsukawa all lower case.

* Scripts/webkitpy/common/config/contributors.json:

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

2 years agoUnreviewed, add myself as a WebKit committer.
yoshiaki.jitsukawa@sony.com [Thu, 22 Mar 2018 00:59:17 +0000 (00:59 +0000)]
Unreviewed, add myself as a WebKit committer.

* Scripts/webkitpy/common/config/contributors.json:

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

2 years ago[Extra zoom mode] Add new SPI hooks for clients to vend an input session context...
wenson_hsieh@apple.com [Thu, 22 Mar 2018 00:22:37 +0000 (00:22 +0000)]
[Extra zoom mode] Add new SPI hooks for clients to vend an input session context view
https://bugs.webkit.org/show_bug.cgi?id=183866
<rdar://problem/38692256>

Reviewed by Tim Horton.

Add new SPI hooks to _WKInputDelegate allowing internal clients to provide a view that gives additional context
when editing form controls, on top of the default label or placeholder text displayed by WebKit. The height
delegate is invoked first, giving the client an opportunity to lay out the context view to fit the given size;
the actual view is then queried.

If the view changes, clients may tell WebKit to reload the context view via SPI on WKFormInputSession; this call
to reload is plumbed through to the currently presented list view controller (at the moment, this is only the
text input list view controller).

* UIProcess/API/Cocoa/_WKFormInputSession.h:
* UIProcess/API/Cocoa/_WKInputDelegate.h:

Add the new SPI hooks, described above.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKFormInputSession reloadFocusedElementContextView]):

Plumb the context view reload hook through WKContentView to WKTextInputListViewController.

(-[WKContentView setupInteraction]):
(-[WKContentView _stopAssistingNode]):
(-[WKContentView reloadContextViewForPresentedListViewController]):
(-[WKContentView focusedFormControllerDidUpdateSuggestions:]):

Slight tweak to only reload text suggestions if we are not blurring the focused element. Without this extra
condition, the list view controller's inner table view would get reloaded when the form input session's text
suggestions are set to nil when the list view controller is dismissed, causing a visible stutter in the
dismissal animation of view controller.

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

2 years agoMark fast/scrolling/latching/scroll-div-no-latching.html as flaky.
ryanhaddad@apple.com [Thu, 22 Mar 2018 00:05:44 +0000 (00:05 +0000)]
Mark fast/scrolling/latching/scroll-div-no-latching.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=183879

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoMark inspector/console/messageAdded-from-named-evaluations.html as slow.
ryanhaddad@apple.com [Wed, 21 Mar 2018 23:58:41 +0000 (23:58 +0000)]
Mark inspector/console/messageAdded-from-named-evaluations.html as slow.
https://bugs.webkit.org/show_bug.cgi?id=183880

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark media/modern-media-controls/seek-backward-support/seek-backward-support.html...
ryanhaddad@apple.com [Wed, 21 Mar 2018 23:58:39 +0000 (23:58 +0000)]
Mark media/modern-media-controls/seek-backward-support/seek-backward-support.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=183869

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoWebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServic...
cdumez@apple.com [Wed, 21 Mar 2018 23:11:38 +0000 (23:11 +0000)]
WebKitTestRunner crashed in com.apple.WebKit: WebKit::WebProcessPool::terminateServiceWorkerProcesses
https://bugs.webkit.org/show_bug.cgi?id=183875

Reviewed by Brent Fulgham.

Protect |this| while we're iterating over m_serviceWorkerProcesses and terminating
each service worker process. It is possible for the WebProcess pool to get destroyed
as a result of terminating a service worker process.

This change is covered by layout tests that are currently crashing on the ASAN bots.

* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::terminateServiceWorkerProcesses):

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

2 years agoFix typo in inactive media stream timeout default value
eric.carlson@apple.com [Wed, 21 Mar 2018 22:37:37 +0000 (22:37 +0000)]
Fix typo in inactive media stream timeout default value
https://bugs.webkit.org/show_bug.cgi?id=183872
<rdar://problem/38723903>

Reviewed by Jer Noble.

* Shared/WebPreferences.yaml: Fix typo.
* Shared/WebPreferencesDefaultValues.h: Ditto.

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