WebKit-https.git
12 months agoWebGL 2 partial passes and failing test expectations for conformance/conformance2...
justin_fan@apple.com [Thu, 20 Sep 2018 00:59:04 +0000 (00:59 +0000)]
WebGL 2 partial passes and failing test expectations for conformance/conformance2 layout tests
https://bugs.webkit.org/show_bug.cgi?id=189686

Reviewed by Dean Jackson.

* TestExpectations: Still skipping all of deqp, but now enabling all non-crashing/timing out tests.
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* webgl/2.0.0/conformance/.../*expected.txt: Failures now report results of individual sub-tests for more granular implementation testing.
* webgl/2.0.0/conformance2/.../*expected.txt:
* platform/ios-simulator/webgl/2.0.0/.../*expected.txt: ios-simulator-specific expectations added.

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

12 months agoAdd functions to measure memory footprint to JSC
msaboff@apple.com [Thu, 20 Sep 2018 00:42:29 +0000 (00:42 +0000)]
Add functions to measure memory footprint to JSC
https://bugs.webkit.org/show_bug.cgi?id=189768

Reviewed by Saam Barati.

Provide system memory metrics for the current process to aid in memory reduction measurement and
tuning using native JS tests.

* jsc.cpp:
(MemoryFootprint::now):
(MemoryFootprint::resetPeak):
(GlobalObject::finishCreation):
(JSCMemoryFootprint::JSCMemoryFootprint):
(JSCMemoryFootprint::createStructure):
(JSCMemoryFootprint::create):
(JSCMemoryFootprint::finishCreation):
(JSCMemoryFootprint::addProperty):
(functionResetMemoryPeak):

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

12 months agoTemporarily move fullscreen back to experimental features
dino@apple.com [Thu, 20 Sep 2018 00:21:50 +0000 (00:21 +0000)]
Temporarily move fullscreen back to experimental features
https://bugs.webkit.org/show_bug.cgi?id=189770
<rdar://problem/44619282>

Reviewed by Simon Fraser.

Make fullscreen an experimental feature again.

* Shared/WebPreferences.yaml:

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

12 months agoUnreviewed, rolling out r236229.
realdawei@apple.com [Thu, 20 Sep 2018 00:20:05 +0000 (00:20 +0000)]
Unreviewed, rolling out r236229.

caused API timouts on mac and ios

Reverted changeset:

"Clear persistent storage between tests for
resourceLoadStatistics"
https://bugs.webkit.org/show_bug.cgi?id=189684
https://trac.webkit.org/changeset/236229

Patch by Dawei Fenton <realdawei@apple.com> on 2018-09-19

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

12 months agoREGRESSION(236154) C API clients not using WKPageSetPageNavigationClient couldn't...
achristensen@apple.com [Thu, 20 Sep 2018 00:13:25 +0000 (00:13 +0000)]
REGRESSION(236154) C API clients not using WKPageSetPageNavigationClient couldn't complete HTTPS requests
https://bugs.webkit.org/show_bug.cgi?id=189771

Reviewed by Tim Horton.

* UIProcess/API/APINavigationClient.h:
(API::NavigationClient::didReceiveAuthenticationChallenge):
Perform default behavior if there's an authentication challenge but we're using the default navigation client.
I wish we had infrastructure to test this but WebKitTestRunner uses WKPageSetNavigationClient
and we don't have the ability to do networking from API tests.  This is a growing problem I intend to solve.

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

12 months agoMediaStream-MediaElement-srcObject.https.html expects video duration for a MediaStrea...
commit-queue@webkit.org [Wed, 19 Sep 2018 23:58:33 +0000 (23:58 +0000)]
MediaStream-MediaElement-srcObject.https.html expects video duration for a MediaStream to be Infinity and is currently NaN
https://bugs.webkit.org/show_bug.cgi?id=189516

Patch by YUHAN WU <yuhan_wu@apple.com> on 2018-09-19
Reviewed by Youenn Fablet.

* web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https.html:
* web-platform-tests/mediacapture-streams/MediaStream-MediaElement-srcObject.https-expected.txt:

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

12 months agostorage/indexeddb/modern/transactions-stop-on-navigation.html is flaky.
realdawei@apple.com [Wed, 19 Sep 2018 23:05:49 +0000 (23:05 +0000)]
storage/indexeddb/modern/transactions-stop-on-navigation.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=186339

Unreviewed, mark test as flaky.

Patch by Dawei Fenton <realdawei@apple.com> on 2018-09-19

* platform/mac-wk2/TestExpectations:

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

12 months agoClear persistent storage between tests for resourceLoadStatistics
commit-queue@webkit.org [Wed, 19 Sep 2018 22:57:23 +0000 (22:57 +0000)]
Clear persistent storage between tests for resourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=189684
<rdar://problem/44540099>

Patch by Woodrow Wang <woodrow_wang@apple.com> on 2018-09-19
Reviewed by Chris Dumez.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

Remove function only called in testing for resetting statistics to consistent
state.

(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemory): Deleted.

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

12 months agoREGRESSION(r235917): 2% regression in Dromaeo CSS selector on MacBookPro11,4
rniwa@webkit.org [Wed, 19 Sep 2018 22:31:18 +0000 (22:31 +0000)]
REGRESSION(r235917): 2% regression in Dromaeo CSS selector on MacBookPro11,4
https://bugs.webkit.org/show_bug.cgi?id=189738

Reviewed by Yusuke Suzuki.

The regression was caused by the regundant walk to the parent element. Removed it to fix the regression.

* cssjit/SelectorCompiler.cpp:
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthChildParentCheckAndRelationUpdate):
(WebCore::SelectorCompiler::SelectorCodeGenerator::generateNthLastChildParentCheckAndRelationUpdate):

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

12 months agoCrash under WebPageProxy::decidePolicyForNavigationAction()
cdumez@apple.com [Wed, 19 Sep 2018 21:58:45 +0000 (21:58 +0000)]
Crash under WebPageProxy::decidePolicyForNavigationAction()
https://bugs.webkit.org/show_bug.cgi?id=189763
<rdar://problem/44597111>

Reviewed by Alex Christensen.

Update WebNavigationState::navigation() / WebNavigationState::takeNavigation()
to return a pointer instead of a reference as we have evidence that they can
return null. I kept the debug assertions to try and catch the cases where we
return null but at least we stop crashing in release builds.

* UIProcess/WebNavigationState.cpp:
(WebKit::WebNavigationState::navigation):
(WebKit::WebNavigationState::takeNavigation):
* UIProcess/WebNavigationState.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForResponse):

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

12 months agoCrash under WebProcessProxy::suspendedPageWasDestroyed(WebKit::SuspendedPageProxy&)
cdumez@apple.com [Wed, 19 Sep 2018 21:33:51 +0000 (21:33 +0000)]
Crash under WebProcessProxy::suspendedPageWasDestroyed(WebKit::SuspendedPageProxy&)
https://bugs.webkit.org/show_bug.cgi?id=189721
<rdar://problem/44359788>

Reviewed by Geoffrey Garen.

Source/WebKit:

Fix crash when destroying a SuspendedPageProxy whose WebProcessProxy was already
destroyed.

* UIProcess/SuspendedPageProxy.cpp:
(WebKit::SuspendedPageProxy::SuspendedPageProxy):
(WebKit::SuspendedPageProxy::~SuspendedPageProxy):
* UIProcess/SuspendedPageProxy.h:
(WebKit::SuspendedPageProxy::process const):
Update SuspendedPageProxy::m_process to be a RefPtr<> instead of a raw pointer, similarly
to what we do in WebPageProxy. Relying on the WebProcessProxy to not get destroyed is
risky as this crash demonstrates.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::requestTermination):
When a WebProcessProxy is terminated (by client or WebKit due to memory / cpu usage), call
webProcessDidClose() on all SuspendedPages, similarly to what we do in case of a crash in
processDidTerminateOrFailedToLaunch(). Failing to do so means that the SuspendedPageProxy
may still have a pointer to this WebProcessProxy, even though WebProcessProxy::shutDown()
has been called (which may destroy the WebProcessProxy).

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

12 months agoMarked imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded...
realdawei@apple.com [Wed, 19 Sep 2018 21:33:01 +0000 (21:33 +0000)]
Marked imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-onnegotiationneeded.html as flak on iOS.
https://bugs.webkit.org/show_bug.cgi?id=176078

Unreviewed test gardening.

Patch by Dawei Fenton <realdawei@apple.com> on 2018-09-19

* platform/ios/TestExpectations:

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

12 months agoCheckStructureOrEmpty should pass in a tempGPR to emitStructureCheck since it may...
sbarati@apple.com [Wed, 19 Sep 2018 21:09:14 +0000 (21:09 +0000)]
CheckStructureOrEmpty should pass in a tempGPR to emitStructureCheck since it may jump over that code
https://bugs.webkit.org/show_bug.cgi?id=189703

Reviewed by Mark Lam.

This fixes a crash that a TypeProfiler change revealed.

* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

12 months agoAI rule for MultiPutByOffset executes its effects in the wrong order
sbarati@apple.com [Wed, 19 Sep 2018 21:00:08 +0000 (21:00 +0000)]
AI rule for MultiPutByOffset executes its effects in the wrong order
https://bugs.webkit.org/show_bug.cgi?id=189757
<rdar://problem/43535257>

Reviewed by Michael Saboff.

JSTests:

* stress/multi-put-by-offset-must-filter-value-before-filtering-base.js: Added.
(foo):
(Foo):
(g):

Source/JavaScriptCore:

The AI rule for MultiPutByOffset was executing effects in the wrong order.
It first executed the transition effects and the effects on the base, and
then executed the filtering effects on the value being stored. However, you
can end up with the wrong type when the base and the value being stored
are the same. E.g, in a program like `o.f = o`. These effects need to happen
in the opposite order, modeling what happens in the runtime executing of
MultiPutByOffset.

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

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

12 months ago[WHLSL] Improve test suite type safety
commit-queue@webkit.org [Wed, 19 Sep 2018 20:08:51 +0000 (20:08 +0000)]
[WHLSL] Improve test suite type safety
https://bugs.webkit.org/show_bug.cgi?id=189502

Patch by Thomas Denney <tdenney@apple.com> on 2018-09-19
Reviewed by Myles C. Maxfield.

Each of the 'makeT' functions now call the relevant cast function on the
value before hand. The checkNumber function has also been removed and
its uses have been replaced with functions that also check the type.
Some of the arithmetic checks have been updated to reflect that the
casts happen outside of WHLSL evaluation. Other tests have also been
updated to reflect that some values cannot be precisely expressed in
32-bit floating point.

* WebGPUShadingLanguageRI/Casts.js:
(castToBool): Added.
(castAndCheckValue): Added.
(isBitwiseEquivalent): Moved from Intrinsics.js.
* WebGPUShadingLanguageRI/Intrinsics.js: Ditto.
* WebGPUShadingLanguageRI/SPIRV.html: Update depdencies.
* WebGPUShadingLanguageRI/Test.html: Ditto.
* WebGPUShadingLanguageRI/Test.js: Update makeT functions to do a cast
and check the result. Some tests were also updated to reflect the change
in the behavior of these functions.
* WebGPUShadingLanguageRI/index.html: Update dependencies.

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

12 months agoResource Load Statistics: Add optional cap on partitioned cache max age
wilander@apple.com [Wed, 19 Sep 2018 19:19:56 +0000 (19:19 +0000)]
Resource Load Statistics: Add optional cap on partitioned cache max age
https://bugs.webkit.org/show_bug.cgi?id=189711
<rdar://problem/39246837>

Reviewed by Antti Koivisto and Chris Dumez.

Source/WebCore:

Test: http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::maxAgeCacheCap):
    Checks if a max age cap is set and returns it if the request
    represents a prevalent resource.
(WebCore::NetworkStorageSession::setCacheMaxAgeCapForPrevalentResources):
(WebCore::NetworkStorageSession::resetCacheMaxAgeCapForPrevalentResources):
    New functionality to receive a max age cap setting in the session.

Source/WebKit:

These changes add the capability to set a max age cap for prevalent resources
and consults it when retrieving cache entries. If an entry is capped and found
to be too old, it will not be used but instead removed from the cache.

This functionality is off by default because no cap is set by default.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcess::resetCacheMaxAgeCapForPrevalentResources):
    Infrastructure for testing.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::retrieveCacheEntry):
    Now sends in the session ID in the retrieve call.
* NetworkProcess/cache/NetworkCache.cpp:
(WebKit::NetworkCache::hasReachedPrevalentResourceAgeCap):
    Static convenience function.
(WebKit::NetworkCache::makeUseDecision):
    Now receives an optional maxAge parameter and checks
    hasReachedPrevalentResourceAgeCap() first.
(WebKit::NetworkCache::Cache::retrieve):
    Now takes a session ID.
* NetworkProcess/cache/NetworkCache.h:
* NetworkProcess/cache/NetworkCacheStatistics.cpp:
(WebKit::NetworkCache::cachedEntryReuseFailureToDiagnosticKey):
    Added UseDecision::NoDueToPrevalentResourceAgeCap which causes a
    return of WebCore::DiagnosticLoggingKeys::otherKey().
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetStatisticsCacheMaxAgeCap):
(WKWebsiteDataStoreStatisticsResetToConsistentState):
    Infrastructure for testing.
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/Cocoa/ResourceLoadStatisticsMemoryStoreCocoa.mm:
(WebKit::ResourceLoadStatisticsMemoryStore::registerUserDefaultsIfNeeded):
    Now supports a user default ResourceLoadStatisticsCacheMaxAgeCap.
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::hasStorageAccessForFrame):
(WebKit::NetworkProcessProxy::grantStorageAccess):
(WebKit::NetworkProcessProxy::removeAllStorageAccess):
(WebKit::NetworkProcessProxy::getAllStorageAccessEntries):
(WebKit::NetworkProcessProxy::setCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didSetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::resetCacheMaxAgeCapForPrevalentResources):
(WebKit::NetworkProcessProxy::didResetCacheMaxAgeCapForPrevalentResources):
(WebKit::nextRequestStorageAccessContextId): Deleted.
    Deleted this to make all code use the generic generateCallbackID().
* UIProcess/Network/NetworkProcessProxy.h:
* UIProcess/Network/NetworkProcessProxy.messages.in:
    Used to transfer the setting from the UI process to the network process.
* UIProcess/ResourceLoadStatisticsMemoryStore.cpp:
(WebKit::ResourceLoadStatisticsMemoryStore::setCacheMaxAgeCap):
* UIProcess/ResourceLoadStatisticsMemoryStore.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setCacheMaxAgeCap):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::setCacheMaxAgeCapForPrevalentResources):
(WebKit::WebsiteDataStore::resetCacheMaxAgeCapForPrevalentResources):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

This change adds infrastructure for layout tests of capped cache max age.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setStatisticsCacheMaxAgeCap):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::setStatisticsCacheMaxAgeCap):
* WebKitTestRunner/TestController.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveSynchronousMessageFromInjectedBundle):

LayoutTests:

* http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource-expected.txt: Added.
* http/tests/resourceLoadStatistics/cap-cache-max-age-for-prevalent-resource.html: Added.
* http/tests/resourceLoadStatistics/resources/cached-permanent-redirect.php: Added.
* http/tests/resourceLoadStatistics/resources/echo-query.php: Added.
* platform/ios/TestExpectations:
    New test marked as [ Pass ].
* platform/mac-wk2/TestExpectations:
    New test marked as [ Pass ].
* platform/wk2/TestExpectations:
    New test marked as [ Skip ] because it's not supported on non-Cocoa platforms.

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

12 months ago Unreviewed. Update my email and alias in list of contributors.
realdawei@apple.com [Wed, 19 Sep 2018 17:27:13 +0000 (17:27 +0000)]
   Unreviewed. Update my email and alias in list of contributors.

Patch by Dawei Fenton <realdawei@apple.com> on 2018-09-19

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

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

12 months agoLayout Test webrtc/video-mute.html is flaky.
youenn@apple.com [Wed, 19 Sep 2018 17:17:34 +0000 (17:17 +0000)]
Layout Test webrtc/video-mute.html is flaky.
https://bugs.webkit.org/show_bug.cgi?id=177501

Reviewed by Eric Carlson.

Source/WebCore:

Covered by updated test expectation.

* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer): Make sure the whole buffer is properly initialized.

LayoutTests:

* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:
* webrtc/routines.js: Increase counter to make test more robust.

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

12 months ago[iOS] Layout Test imported/w3c/web-platform-tests/beacon/beacon-basic-blob.html is...
cdumez@apple.com [Wed, 19 Sep 2018 16:27:06 +0000 (16:27 +0000)]
[iOS] Layout Test imported/w3c/web-platform-tests/beacon/beacon-basic-blob.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=189728

Unreviewed, send console logging to stderr to adress flakiness.

* TestExpectations:

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

12 months agoWebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
ddkilzer@apple.com [Wed, 19 Sep 2018 16:22:49 +0000 (16:22 +0000)]
WebCoreNSURLSession leaks an NSString (_sessionDescription) in -dealloc
<https://webkit.org/b/189742>
<rdar://problem/44589774>

Reviewed by Joseph Pecoraro.

* platform/network/cocoa/WebCoreNSURLSession.h:
(WebCoreNSURLSession._sessionDescription): Change type from
NSString * to RetainPtr<NSString>.
* platform/network/cocoa/WebCoreNSURLSession.mm: Remove
@synthesized statement for sessionDescription so that custom
methods can be implemented to handle RetainPtr<NSString>.
(-[WebCoreNSURLSession sessionDescription]): Add.
(-[WebCoreNSURLSession setSessionDescription:]): Add.

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

12 months ago[WPE] Unreviewed test gardening
Ms2ger@igalia.com [Wed, 19 Sep 2018 16:19:03 +0000 (16:19 +0000)]
[WPE] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=189749

Unreviewed test gardening.

* platform/wpe/TestExpectations: Add some expectations to match GTK.
* platform/wpe/imported/w3c/web-platform-tests/dom/events/EventTarget-dispatchEvent-expected.txt: Update after r236002.
* platform/wpe/imported/w3c/web-platform-tests/xhr/access-control-basic-cors-safelisted-request-headers-expected.txt: Removed (defer to generic expectation).
* platform/wpe/imported/w3c/web-platform-tests/xhr/access-control-basic-get-fail-non-simple-expected.txt: Removed (defer to generic expectation).
* platform/wpe/imported/w3c/web-platform-tests/xhr/access-control-basic-post-with-non-cors-safelisted-content-type-expected.txt: Removed (defer to generic expectation).
* platform/wpe/imported/w3c/web-platform-tests/xhr/send-redirect-infinite-expected.txt: Update after r235354.
* platform/wpe/imported/w3c/web-platform-tests/xhr/send-redirect-infinite-sync-expected.txt: Update after r235354.
* platform/wpe/imported/w3c/web-platform-tests/xhr/xmlhttprequest-network-error-expected.txt: Update after r235354.
* platform/wpe/imported/w3c/web-platform-tests/xhr/xmlhttprequest-network-error-sync-expected.txt: Update after r235354.
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-as-return-value-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-assign-constructor-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-assign-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-complex-indexing-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-element-increment-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-equality-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/array-in-complex-expression-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/bool-type-cast-bug-uint-ivec-uvec-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/compare-structs-containing-arrays-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/compound-assignment-type-combination-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/const-array-init-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/forbidden-operators-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/frag-depth-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/invalid-default-precision-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/invalid-invariant-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/loops-with-side-effects-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/misplaced-version-directive-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/sampler-no-precision-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/sequence-operator-returns-non-constant-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/shader-linking-expected.txt: Update after r236001.
* platform/wpe/webgl/2.0.0/conformance2/glsl3/shader-with-mis-matching-uniform-block-expected.txt: Update after r236001.
* platform/wpe/webgl/2.0.0/conformance2/glsl3/short-circuiting-in-loop-condition-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/texture-offset-out-of-range-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/texture-offset-uniform-texture-coordinate-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/tricky-loop-conditions-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/uniform-block-layout-match-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/uniform-block-layouts-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/valid-invariant-expected.txt: Update after r236001.
* platform/wpe/webgl/2.0.0/conformance2/glsl3/vector-dynamic-indexing-expected.txt: Removed (defer to generic expectation after r236001).
* platform/wpe/webgl/2.0.0/conformance2/glsl3/vector-dynamic-indexing-nv-driver-bug-expected.txt: Removed (defer to generic expectation after r236001).

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

12 months agoImplement sender/receiver getStats
youenn@apple.com [Wed, 19 Sep 2018 15:54:08 +0000 (15:54 +0000)]
Implement sender/receiver getStats
https://bugs.webkit.org/show_bug.cgi?id=189707

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCRtpReceiver-getStats.https-expected.txt:
* web-platform-tests/webrtc/RTCRtpSender-getStats.https-expected.txt:

Source/WebCore:

Add support for sender and receiver getStats.
Also add support for peer connection selector parameter.

Add the plumbing of the selector to LibWebRTCMediaEndpoint.
Then make use of libwebrtc overloaded methods to retrieve the right stats.

Covered by updated/rebased tests.

* Modules/mediastream/PeerConnectionBackend.h:
* Modules/mediastream/RTCPeerConnection.cpp:
(WebCore::RTCPeerConnection::getStats):
* Modules/mediastream/RTCPeerConnection.h:
* Modules/mediastream/RTCPeerConnection.idl:
* Modules/mediastream/RTCRtpReceiver.cpp:
(WebCore::RTCRtpReceiver::RTCRtpReceiver):
(WebCore::RTCRtpReceiver::getStats):
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::create):
(WebCore::RTCRtpReceiver::backend):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpSender.cpp:
(WebCore::RTCRtpSender::create):
(WebCore::RTCRtpSender::RTCRtpSender):
(WebCore::RTCRtpSender::getStats):
* Modules/mediastream/RTCRtpSender.h:
* Modules/mediastream/RTCRtpSender.idl:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::getStats):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::getStats):
(WebCore::backendFromRTPSender):
(WebCore::createReceiverForSource):
(WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTrack):
(WebCore::LibWebRTCPeerConnectionBackend::addUnifiedPlanTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
(WebCore::LibWebRTCPeerConnectionBackend::newRemoteTransceiver):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:

LayoutTests:

* webrtc/video-stats-expected.txt:
* webrtc/video-stats.html:

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

12 months ago[WPE][GTK] Unreviewed, try #3 to fix a typo
mcatanzaro@igalia.com [Wed, 19 Sep 2018 14:48:51 +0000 (14:48 +0000)]
[WPE][GTK] Unreviewed, try #3 to fix a typo

I feel like Charlie Brown, how hard this has been for me....

* Scripts/run-minibrowser:
* Scripts/webkitdirs.pm:
(runInFlatpakIfAvailable):
(runInFlatpakIfAvailible): Deleted.

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

12 months ago[WPE][GTK] Unreviewed, fix that typo in more places
mcatanzaro@igalia.com [Wed, 19 Sep 2018 14:28:47 +0000 (14:28 +0000)]
[WPE][GTK] Unreviewed, fix that typo in more places

It got copied into webkitdirs.pm!

* Scripts/webkitdirs.pm:
(runInFlatpakIfAvailible):
(runInFlatpakIfAvalaible): Deleted.

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

12 months agoREGRESSION (r236006): New waitingForKey() requirement breaks Modern EME tests.
jer.noble@apple.com [Wed, 19 Sep 2018 13:58:24 +0000 (13:58 +0000)]
REGRESSION (r236006): New waitingForKey() requirement breaks Modern EME tests.
https://bugs.webkit.org/show_bug.cgi?id=189720
<rdar://problem/44572140>

Reviewed by Xabier Rodriguez-Calvar.

Always call waitingForKey() after calling initializationDataEncountered().

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
(WebCore::MediaPlayerPrivateMediaSourceAVFObjC::initializationDataEncountered):

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

12 months ago[WPE][GTK] Unreviewed, fix a pervasive typo in the webkit-flatpak script
mcatanzaro@igalia.com [Wed, 19 Sep 2018 13:50:14 +0000 (13:50 +0000)]
[WPE][GTK] Unreviewed, fix a pervasive typo in the webkit-flatpak script

* flatpak/flatpakutils.py:
(WebkitFlatpak.load_from_args):
(WebkitFlatpak.__init__):
(WebkitFlatpak.run):

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

12 months ago[WPE][GTK] Unreviewed, update to latest GNOME SDK
mcatanzaro@igalia.com [Wed, 19 Sep 2018 13:39:39 +0000 (13:39 +0000)]
[WPE][GTK] Unreviewed, update to latest GNOME SDK

* flatpak/org.webkit.WebKit.yaml:

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

12 months agoUnreviewed, rolling out r235500.
mcatanzaro@igalia.com [Wed, 19 Sep 2018 13:29:41 +0000 (13:29 +0000)]
Unreviewed, rolling out r235500.

Time to switch back to master runtime

Reverted changeset:

"Unreviewed, rolling out r235114."
https://bugs.webkit.org/show_bug.cgi?id=188731
https://trac.webkit.org/changeset/235500

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

12 months agoUnreviewed. Add Pablo Saavedra to the list of contributors.
aperez@igalia.com [Wed, 19 Sep 2018 12:48:03 +0000 (12:48 +0000)]
Unreviewed. Add Pablo Saavedra to the list of contributors.

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

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

12 months ago[GTK] Unreviewed test gardening
Ms2ger@igalia.com [Wed, 19 Sep 2018 11:04:32 +0000 (11:04 +0000)]
[GTK] Unreviewed test gardening
https://bugs.webkit.org/show_bug.cgi?id=189744

Unreviewed test gardening.

* platform/gtk/TestExpectations: Add some expectations.

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

12 months ago[GStreamer] Add support for AV1 decoding
commit-queue@webkit.org [Wed, 19 Sep 2018 08:53:50 +0000 (08:53 +0000)]
[GStreamer] Add support for AV1 decoding
https://bugs.webkit.org/show_bug.cgi?id=189647

Source/WebCore:

Tweaked by Xabier Rodriguez Calvar <calvaris@igalia.com>.
Patch by Philippe Normand <pnormand@igalia.com> on 2018-09-19
Reviewed by Žan Doberšek.

AV1 can be muxed in MP4 and WebM containers. The test is an adaptation from Chromium's unittest:
https://chromium.googlesource.com/chromium/src/+/master/content/browser/media/media_canplaytype_browsertest.cc

Test: media/media-can-play-av1.html

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::supportsType): Add AV1
support. The av01 codec has to be explicitely checked, along with
the presence of a compatible AV1 decoder.

Tools:

Patch by Philippe Normand <pnormand@igalia.com> on 2018-09-19
Reviewed by Žan Doberšek.

Add patches required for AV1 decoding support. They're all
upstream already and will be shipped in GStreamer 1.16. The aom
GStreamer plugin depends on the aom library for which there's no
official release yet.

* gstreamer/jhbuild.modules:
* gstreamer/patches/gst-plugins-bad-0001-aomenc-Add-support-for-10-12bit-decoding.patch: Added.
* gstreamer/patches/gst-plugins-bad-0002-aomenc-Handle-8-bit_depth-images-with-AOM_IMG_FMT_HI.patch: Added.
* gstreamer/patches/gst-plugins-good-0001-qtdemux-Detect-and-expose-CEA-608-708-Closed-Caption.patch: Added. This one is unrelated but an implicit dependency of the next one.
* gstreamer/patches/gst-plugins-good-0004-qtdemux-Add-initial-support-for-AV1-demuxing.patch: Added.
* gstreamer/patches/gst-plugins-good-0005-qtdemux-Extract-AV1-codec_data-and-put-it-in-the-cap.patch: Added.
* gstreamer/patches/gst-plugins-good-0006-qtdemux-Recognize-more-AV1-atoms.patch: Added.

LayoutTests:

Patch by Philippe Normand <pnormand@igalia.com> on 2018-09-19
Reviewed by Žan Doberšek.

Layout test for AV1 canPlay() compatiblity checking. Right now
GStreamer-based ports are the only ones expecting to support AV1.

* media/media-can-play-av1-expected.txt: Added.
* media/media-can-play-av1.html: Added.
* platform/ios/media/media-can-play-av1-expected.txt: Added.
* platform/mac/media/media-can-play-av1-expected.txt: Added.

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

12 months agohttp/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html...
cdumez@apple.com [Wed, 19 Sep 2018 08:16:23 +0000 (08:16 +0000)]
http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=189710

Reviewed by Ryosuke Niwa.

Update the test to stop relying on the test page posting a message to the auxiliary window
to trigger a navigation. Instead, the auxiliary window now takes care of navigating itself
after it is loaded. This is more robust, especially considering that the test page is cross
origin and thus is not getting a load event for the auxiliary window.

* http/tests/navigation/resources/navigate-back-same-origin-helper.html: Added.
* http/tests/navigation/resources/navigate-helper.html: Removed.
* http/tests/navigation/window-open-cross-origin-then-navigated-back-same-origin.html:

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

12 months ago[WPE][GTK] Assorted gardening
csaavedra@igalia.com [Wed, 19 Sep 2018 08:11:04 +0000 (08:11 +0000)]
[WPE][GTK] Assorted gardening

Unreviewed test gardening
* platform/gtk/TestExpectations: Add new mediastream failures.
* platform/wpe/TestExpectations: Ditto.
* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt: rebaseline

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

12 months ago[macOS WK1] Mark intersection-observer/no-document-leak.html as a flaky timeout
ajuma@chromium.org [Wed, 19 Sep 2018 03:53:55 +0000 (03:53 +0000)]
[macOS WK1] Mark intersection-observer/no-document-leak.html as a flaky timeout
https://bugs.webkit.org/show_bug.cgi?id=189731

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

12 months agoEnsure that ForInContexts are invalidated if their loop local is over-written.
mark.lam@apple.com [Wed, 19 Sep 2018 00:57:56 +0000 (00:57 +0000)]
Ensure that ForInContexts are invalidated if their loop local is over-written.
https://bugs.webkit.org/show_bug.cgi?id=189571
<rdar://problem/44402277>

Reviewed by Saam Barati.

JSTests:

* stress/regress-189571.js: Added.

Source/JavaScriptCore:

Instead of hunting down every place in the BytecodeGenerator that potentially
needs to invalidate an enclosing ForInContext (if one exists), we simply iterate
the bytecode range of the loop body when the ForInContext is popped, and
invalidate the context if we ever find the loop temp variable over-written.

This has 2 benefits:
1. It ensures that every type of opcode that can write to the loop temp will be
   handled appropriately, not just the op_mov that we've hunted down.
2. It avoids us having to check the BytecodeGenerator's m_forInContextStack
   every time we emit an op_mov (or other opcodes that can write to a local)
   even when we're not inside a for-in loop.

JSC benchmarks show that that this change is performance neutral.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::pushIndexedForInScope):
(JSC::BytecodeGenerator::popIndexedForInScope):
(JSC::BytecodeGenerator::pushStructureForInScope):
(JSC::BytecodeGenerator::popStructureForInScope):
(JSC::ForInContext::finalize):
(JSC::StructureForInContext::finalize):
(JSC::IndexedForInContext::finalize):
(JSC::BytecodeGenerator::invalidateForInContextForLocal): Deleted.
* bytecompiler/BytecodeGenerator.h:
(JSC::ForInContext::ForInContext):
(JSC::ForInContext::bodyBytecodeStartOffset const):
(JSC::StructureForInContext::StructureForInContext):
(JSC::IndexedForInContext::IndexedForInContext):
* bytecompiler/NodesCodegen.cpp:
(JSC::PostfixNode::emitResolve):
(JSC::PrefixNode::emitResolve):
(JSC::ReadModifyResolveNode::emitBytecode):
(JSC::AssignResolveNode::emitBytecode):
(JSC::EmptyLetExpression::emitBytecode):
(JSC::ForInNode::emitLoopHeader):
(JSC::ForOfNode::emitBytecode):
(JSC::BindingNode::bindValue const):
(JSC::AssignmentElementNode::bindValue const):
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):

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

12 months ago[iOS] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker...
ryanhaddad@apple.com [Wed, 19 Sep 2018 00:51:05 +0000 (00:51 +0000)]
[iOS] Layout Test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=189727

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

12 months ago[iOS] Layout test imported/w3c/web-platform-tests/service-workers/service-worker...
ryanhaddad@apple.com [Wed, 19 Sep 2018 00:51:03 +0000 (00:51 +0000)]
[iOS] Layout test imported/w3c/web-platform-tests/service-workers/service-worker/fetch-mixed-content-to-inscope.https.html and fetch-mixed-content-to-outscope.https.html are flaky failures
https://bugs.webkit.org/show_bug.cgi?id=189726

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

12 months ago[iOS] Allow WebContent process to check the "Protocol Characteristics" of files to...
bfulgham@apple.com [Tue, 18 Sep 2018 23:17:30 +0000 (23:17 +0000)]
[iOS] Allow WebContent process to check the "Protocol Characteristics" of files to which it has access
https://bugs.webkit.org/show_bug.cgi?id=189712
<rdar://problem/44386429>

Reviewed by Alex Christensen.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb:

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

12 months ago[iOS] Crash under WebPageProxy::navigationGestureSnapshotWasRemoved()
cdumez@apple.com [Tue, 18 Sep 2018 22:05:51 +0000 (22:05 +0000)]
[iOS] Crash under WebPageProxy::navigationGestureSnapshotWasRemoved()
https://bugs.webkit.org/show_bug.cgi?id=189714
<rdar://problem/32839498>

Reviewed by Tim Horton.

The ViewGestureController::removeSwipeSnapshot() implementation for iOS calls
navigationGestureSnapshotWasRemoved() on m_webPageProxyForBackForwardListForCurrentSwipe.
m_webPageProxyForBackForwardListForCurrentSwipe can differ from m_webPageProxy, and
is a RefPtr<>. This means that this WebPageProxy's WKWebView might have been deallocated,
in which case we'll crash when trying to use the pageClient in
WebPageProxy::navigationGestureSnapshotWasRemoved(). To address the issue, we now return
early in WebPageProxy::navigationGestureSnapshotWasRemoved() if m_isClosed is true,
after resetting m_isShowingNavigationGestureSnapshot to false but *before* trying to use
the pageClient. When a WKWebView is deallocated, it calls WebPageProxy::close(), which
sets m_isClosed to true.

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

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

12 months ago[Curl] Limit capturing extra metrics for Web Inspector when not required.
Basuke.Suzuki@sony.com [Tue, 18 Sep 2018 21:52:10 +0000 (21:52 +0000)]
[Curl] Limit capturing extra metrics for Web Inspector when not required.
https://bugs.webkit.org/show_bug.cgi?id=189520

Reviewed by Alex Christensen.

Respect the value of NetworkDataTask::shouldCaptureExtraNetworkLoadMetrics() to reduce the process
time when they are not needed.

Source/WebCore:

No new tests because there's no behavior change.

* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::getNetworkLoadMetrics):
(WebCore::CurlHandle::addExtraNetworkLoadMetrics):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::updateNetworkLoadMetrics):
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::createCurlRequest):

Source/WebKit:

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::createCurlRequest):

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

12 months agoSupport Images Module Level 4's double-position gradient color stop syntax
megan_gardner@apple.com [Tue, 18 Sep 2018 21:38:19 +0000 (21:38 +0000)]
Support Images Module Level 4's double-position gradient color stop syntax
https://bugs.webkit.org/show_bug.cgi?id=186154
<rdar://problem/44158152>

Reviewed by Simon Fraser.

Source/WebCore:

The CSS spec for all gradients allows for each color stop to have two angles to be used for hints.
This makes pie chart and checkerboard conic gradients much simpler to write.
Any time you want to have a hard line in a gradient, this syntax simplifies the gradient specification.

Test: fast/gradients/conic-two-hints.html
Test: fast/gradients/linear-two-hints-angle.html
Test: fast/gradients/linear-two-hints.html
Test: fast/gradients/radial-two-hints.html

* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops): Removed.
(WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):

LayoutTests:

Test that uses two angles or positions per color stop.

* TestExpectations:
* fast/gradients/conic-two-hints-expected.html: Added.
* fast/gradients/conic-two-hints.html: Added.
* fast/gradients/linear-two-hints-angle-expected.html: Added.
* fast/gradients/linear-two-hints-angle.html: Added.
* fast/gradients/linear-two-hints-expected.html: Added.
* fast/gradients/linear-two-hints.html: Added.
* fast/gradients/radial-two-hints-expected.html: Added.
* fast/gradients/radial-two-hints.html: Added.
* platform/ios-12/TestExpectations:
* platform/mac/TestExpectations:

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

12 months agoMake WebPageProxy always have a API::NavigationClient instead of always having a...
achristensen@apple.com [Tue, 18 Sep 2018 21:03:30 +0000 (21:03 +0000)]
Make WebPageProxy always have a API::NavigationClient instead of always having a API::LoaderClient and API::PolicyClient
https://bugs.webkit.org/show_bug.cgi?id=189012

Reviewed by Andy Estes.

When WebKit2 was being developed, we initially made the C API WKPageSetPagePolicyClient and WKPageSetPageLoaderClient.
When we released WKWebView, it was using WKNavigationDelegate, equivalent to WKPageSetPageNavigationClient.
To support one or the other, we would use the navigation client if it was present, but if not we would fall back to the
loader or policy client.  Since the loader and policy clients are now being minimally supported only until legacy
software migrates to the navigation client, we are adding new functionality to the navigation client.
Making the navigation client the default and using the loader or policy client only if they are present supports
the legacy software and makes us have fewer forgotten null checks when adding new functionality to the navigation client.

* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/Cocoa/NavigationState.h:
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::createNavigationClient):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::setNavigationClient):
(WebKit::WebPageProxy::setLoaderClient):
(WebKit::WebPageProxy::setPolicyClient):
(WebKit::WebPageProxy::close):
(WebKit::WebPageProxy::didChangeBackForwardList):
(WebKit::WebPageProxy::willGoToBackForwardListItem):
(WebKit::WebPageProxy::findPlugin):
(WebKit::WebPageProxy::didStartProvisionalLoadForFrame):
(WebKit::WebPageProxy::didReceiveServerRedirectForProvisionalLoadForFrame):
(WebKit::WebPageProxy::willPerformClientRedirectForFrame):
(WebKit::WebPageProxy::didCancelClientRedirectForFrame):
(WebKit::WebPageProxy::didFailProvisionalLoadForFrame):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::didFinishDocumentLoadForFrame):
(WebKit::WebPageProxy::didFinishLoadForFrame):
(WebKit::WebPageProxy::didFailLoadForFrame):
(WebKit::WebPageProxy::didSameDocumentNavigationForFrame):
(WebKit::WebPageProxy::didReachLayoutMilestone):
(WebKit::WebPageProxy::didDisplayInsecureContentForFrame):
(WebKit::WebPageProxy::didRunInsecureContentForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
(WebKit::WebPageProxy::contentRuleListNotification):
(WebKit::WebPageProxy::webGLPolicyForURL):
(WebKit::WebPageProxy::resolveWebGLPolicyForURL):
(WebKit::WebPageProxy::processDidBecomeUnresponsive):
(WebKit::WebPageProxy::processDidBecomeResponsive):
(WebKit::WebPageProxy::dispatchProcessDidTerminate):
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
(WebKit::WebPageProxy::wrapCryptoKey):
(WebKit::WebPageProxy::unwrapCryptoKey):
(WebKit::WebPageProxy::signedPublicKeyAndChallengeString):
(WebKit::WebPageProxy::navigationGestureDidBegin):
(WebKit::WebPageProxy::navigationGestureWillEnd):
(WebKit::WebPageProxy::navigationGestureDidEnd):
(WebKit::WebPageProxy::navigationGestureSnapshotWasRemoved):
* UIProcess/WebPageProxy.h:

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

12 months agoClean up AuthenticationChallengeProxy
achristensen@apple.com [Tue, 18 Sep 2018 20:55:55 +0000 (20:55 +0000)]
Clean up AuthenticationChallengeProxy
https://bugs.webkit.org/show_bug.cgi?id=189668

Reviewed by Youenn Fablet.

At its core, it's a CompletionHandler with some information.
Make it more elegant and simple with no change in behavior and reduce the complexity of this security-sensitive object.

* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(toNSURLSessionAuthChallengeDisposition):
* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
* Shared/Authentication/AuthenticationManager.h:
* UIProcess/API/C/WKAuthenticationChallenge.cpp:
(WKAuthenticationChallengeGetDecisionListener):
(WKAuthenticationChallengeGetProtectionSpace):
(WKAuthenticationChallengeGetProposedCredential):
(WKAuthenticationChallengeGetPreviousFailureCount):
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPageNavigationClient):
* UIProcess/API/Cocoa/WKNSURLAuthenticationChallenge.mm:
(-[WKNSURLAuthenticationChallengeSender cancelAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender continueWithoutCredentialForAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender useCredential:forAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender performDefaultHandlingForAuthenticationChallenge:]):
(-[WKNSURLAuthenticationChallengeSender rejectProtectionSpaceAndContinueWithChallenge:]):
* UIProcess/Authentication/AuthenticationChallengeProxy.cpp:
(WebKit::AuthenticationChallengeProxy::AuthenticationChallengeProxy):
(WebKit::AuthenticationChallengeProxy::~AuthenticationChallengeProxy): Deleted.
(WebKit::AuthenticationChallengeProxy::useCredential): Deleted.
(WebKit::AuthenticationChallengeProxy::cancel): Deleted.
(WebKit::AuthenticationChallengeProxy::performDefaultHandling): Deleted.
(WebKit::AuthenticationChallengeProxy::rejectProtectionSpaceAndContinue): Deleted.
(WebKit::AuthenticationChallengeProxy::proposedCredential const): Deleted.
(WebKit::AuthenticationChallengeProxy::protectionSpace const): Deleted.
(WebKit::AuthenticationChallengeProxy::setSecKeyProxyStore): Deleted.
* UIProcess/Authentication/AuthenticationChallengeProxy.h:
(WebKit::AuthenticationChallengeProxy::create):
(WebKit::AuthenticationChallengeProxy::listener const):
(WebKit::AuthenticationChallengeProxy::previousFailureCount const): Deleted.
* UIProcess/Authentication/AuthenticationDecisionListener.cpp:
(WebKit::AuthenticationDecisionListener::AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::~AuthenticationDecisionListener):
(WebKit::AuthenticationDecisionListener::useCredential):
(WebKit::AuthenticationDecisionListener::cancel):
(WebKit::AuthenticationDecisionListener::performDefaultHandling):
(WebKit::AuthenticationDecisionListener::rejectProtectionSpaceAndContinue):
(WebKit::AuthenticationDecisionListener::detachChallenge): Deleted.
* UIProcess/Authentication/AuthenticationDecisionListener.h:
(WebKit::AuthenticationDecisionListener::create):
* UIProcess/Authentication/cocoa/AuthenticationChallengeProxyCocoa.mm:
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc):
(WebKit::AuthenticationChallengeProxy::sendClientCertificateCredentialOverXpc const): Deleted.
* UIProcess/Cocoa/DownloadClient.mm:
(WebKit::DownloadClient::didReceiveAuthenticationChallenge):
* UIProcess/Cocoa/NavigationState.mm:
(WebKit::NavigationState::NavigationClient::didReceiveAuthenticationChallenge):
* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::didReceiveAuthenticationChallenge):
* UIProcess/Network/NetworkProcessProxy.cpp:
(WebKit::NetworkProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::didReceiveAuthenticationChallenge):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::secKeyProxyStore):
(WebKit::WebPageProxy::didReceiveAuthenticationChallengeProxy):
* UIProcess/WebPageProxy.h:

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

12 months agoAdd script to generate WebContent service resource files and change XPC service main...
achristensen@apple.com [Tue, 18 Sep 2018 20:54:29 +0000 (20:54 +0000)]
Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
https://bugs.webkit.org/show_bug.cgi?id=188601

Patch by Ben Richards <benton_richards@apple.com> on 2018-09-18
Reviewed by Dan Bernstein.

Added a script to the process entitlements build phase of the WebContent service that copies resource
files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
be used by clients who would like to make a custom WebContent service.

* Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/API/Cocoa/WKWebProcess.h: Drive-by fix to make this header compileable alone.

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

12 months agowebkitpy: Clobbering and building occurs multiple times for iOS Simulator ports
jbedard@apple.com [Tue, 18 Sep 2018 20:10:33 +0000 (20:10 +0000)]
webkitpy: Clobbering and building occurs multiple times for iOS Simulator ports
https://bugs.webkit.org/show_bug.cgi?id=189702
<rdar://problem/44541704>

Reviewed by Aakash Jain.

* Scripts/webkitpy/layout_tests/controllers/manager.py:
(Manager._set_up_run): Move build check and clobbering to run, since set up is
run multiple times for iOS simulator.
(Manager.run):

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

12 months agoRemove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
simon.fraser@apple.com [Tue, 18 Sep 2018 18:34:15 +0000 (18:34 +0000)]
Remove the unused RenderLayerCompositor::enclosingCompositorFlushingLayers()
https://bugs.webkit.org/show_bug.cgi?id=189689

Reviewed by Alex Christensen.

enclosingCompositorFlushingLayers() was added in r76196 but never used. Also use
a SetForScope<>.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::flushPendingLayerChanges):
(WebCore::RenderLayerCompositor::enclosingCompositorFlushingLayers const): Deleted.
* rendering/RenderLayerCompositor.h:

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

12 months ago[macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask
commit-queue@webkit.org [Tue, 18 Sep 2018 18:30:02 +0000 (18:30 +0000)]
[macOS] Frequent leaks seen under WebCore::gpuIDForDisplayMask
https://bugs.webkit.org/show_bug.cgi?id=189685
<rdar://problem/44541974>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-09-18
Reviewed by Per Arne Vollan.

* platform/mac/PlatformScreenMac.mm:
(WebCore::gpuIDForDisplayMask):

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

12 months agoImplement RTCRtpReceiver getContributingSources/getSynchronizationSources
youenn@apple.com [Tue, 18 Sep 2018 18:29:06 +0000 (18:29 +0000)]
Implement RTCRtpReceiver getContributingSources/getSynchronizationSources
https://bugs.webkit.org/show_bug.cgi?id=189671

Reviewed by Eric Carlson.

LayoutTests/imported/w3c:

* web-platform-tests/webrtc/RTCRtpReceiver-getContributingSources.https-expected.txt:
* web-platform-tests/webrtc/RTCRtpReceiver-getSynchronizationSources.https-expected.txt:
* web-platform-tests/webrtc/interfaces-expected.txt: Removed, as no longer needed.

Source/ThirdParty/libwebrtc:

* Configurations/libwebrtc.iOS.exp:
* Configurations/libwebrtc.iOSsim.exp:
* Configurations/libwebrtc.mac.exp:

Source/WebCore:

Introduce implementation of these two methods by calling the libwebrtc corresponding method.
Add corresponding IDL as per spec.
Covered by rebased WPT tests.

* CMakeLists.txt:
* DerivedSources.make:
* Modules/mediastream/RTCRtpContributingSource.h: Added.
* Modules/mediastream/RTCRtpContributingSource.idl: Added.
* Modules/mediastream/RTCRtpReceiver.h:
(WebCore::RTCRtpReceiver::getContributingSources const):
(WebCore::RTCRtpReceiver::getSynchronizationSources const):
* Modules/mediastream/RTCRtpReceiver.idl:
* Modules/mediastream/RTCRtpReceiverBackend.h:
(WebCore::RTCRtpReceiverBackend::getContributingSources const):
(WebCore::RTCRtpReceiverBackend::getSynchronizationSources const):
* Modules/mediastream/RTCRtpSynchronizationSource.h: Added.
* Modules/mediastream/RTCRtpSynchronizationSource.idl: Added.
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
(WebCore::fillRTCRtpContributingSource):
(WebCore::toRTCRtpContributingSource):
(WebCore::toRTCRtpSynchronizationSource):
(WebCore::LibWebRTCRtpReceiverBackend::getContributingSources const):
(WebCore::LibWebRTCRtpReceiverBackend::getSynchronizationSources const):
* Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

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

12 months agoUnreviewed, rolling out r236138.
ryanhaddad@apple.com [Tue, 18 Sep 2018 17:59:45 +0000 (17:59 +0000)]
Unreviewed, rolling out r236138.

Caused API test and layout test failures on iOS.

Reverted changeset:

"REGRESSION (PSON): White or Black flash occurs when process
swapping on navigation on Mac"
https://bugs.webkit.org/show_bug.cgi?id=189663
https://trac.webkit.org/changeset/236138

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

12 months agoAlways log when granting/revoking capture sandbox extensions
eric.carlson@apple.com [Tue, 18 Sep 2018 17:32:42 +0000 (17:32 +0000)]
Always log when granting/revoking capture sandbox extensions
https://bugs.webkit.org/show_bug.cgi?id=189701
<rdar://problem/44564029>

Reviewed by Youenn Fablet.

* UIProcess/UserMediaProcessManager.cpp:
(WebKit::UserMediaProcessManager::willCreateMediaStream): Always log.
(WebKit::UserMediaProcessManager::endedCaptureSession): Ditto.

* WebProcess/MediaStream/UserMediaPermissionRequestManager.cpp:
(WebKit::UserMediaPermissionRequestManager::grantUserMediaDeviceSandboxExtensions): Ditto.
(WebKit::UserMediaPermissionRequestManager::revokeUserMediaDeviceSandboxExtensions): Ditto.

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

12 months agoEnable Unified Plan by default
youenn@apple.com [Tue, 18 Sep 2018 17:11:17 +0000 (17:11 +0000)]
Enable Unified Plan by default
https://bugs.webkit.org/show_bug.cgi?id=189675

Reviewed by Eric Carlson.

Source/WebCore:

RTCRtpTransceiver.currentDirection is now gated by the unified plan runtime flag.
This will allow easy feature detection of unified plan support.
Covered by updated test.

* Modules/mediastream/RTCRtpTransceiver.idl:

Source/WebKit:

* Shared/WebPreferences.yaml:

LayoutTests:

* webrtc/video-addLegacyTransceiver-expected.txt:
* webrtc/video-addLegacyTransceiver.html:

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

12 months ago[WebVTT] change "middle" to "center" for consistency with CSS
pvollan@apple.com [Tue, 18 Sep 2018 16:07:24 +0000 (16:07 +0000)]
[WebVTT] change "middle" to "center" for consistency with CSS
https://bugs.webkit.org/show_bug.cgi?id=158478

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, covered by existing tests.

* html/track/TextTrackCueGeneric.cpp:
(WebCore::TextTrackCueGenericBoxElement::applyCSSProperties):
* html/track/VTTCue.cpp:
(WebCore::centerKeyword):
(WebCore::VTTCue::initialize):
(WebCore::VTTCue::align const):
(WebCore::VTTCue::setAlign):
(WebCore::VTTCue::calculateDisplayParameters):
(WebCore::VTTCue::setCueSettings):
(WebCore::middleKeyword): Deleted.
* html/track/VTTCue.h:
* html/track/WebVTTParser.cpp:
(WebCore::WebVTTTreeBuilder::buildFromString):

LayoutTests:

* media/track/track-add-remove-cue-expected.txt:
* media/track/track-add-remove-cue.html:
* media/track/track-cue-mutable-expected.txt:
* media/track/track-cue-mutable.html:
* media/track/track-cue-rendering-snap-to-lines-not-set-expected.txt:
* media/track/track-vttcue-expected.txt:
* media/track/track-vttcue.html:
* media/track/track-webvtt-tc013-settings-expected.txt:
* media/track/track-webvtt-tc013-settings.html:
* media/track/track-webvtt-tc014-alignment-expected.txt:
* media/track/track-webvtt-tc014-alignment.html:
* media/track/track-webvtt-tc016-align-positioning-expected.txt:
* media/track/track-webvtt-tc016-align-positioning.html:
* media/track/track-webvtt-tc018-align-text-line-position-expected.txt:
* media/track/track-webvtt-tc018-align-text-line-position.html:
* media/track/track-webvtt-tc020-cue-size-align-expected.txt:
* media/track/track-webvtt-tc020-cue-size-align.html:
* media/track/track-webvtt-tc021-valign-expected.txt:
* media/track/track-webvtt-tc021-valign.html:

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

12 months ago"DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page...
cdumez@apple.com [Tue, 18 Sep 2018 16:06:10 +0000 (16:06 +0000)]
"DidFirstVisuallyNonEmptyLayout" callback does not get called when restoring a page from PageCache
https://bugs.webkit.org/show_bug.cgi?id=189681
<rdar://problem/44526171>

Reviewed by Alex Christensen and Zalan Bujtas.

Source/WebCore:

The "DidFirstVisuallyNonEmptyLayout" callback was not getting called when restoring a page from PageCache
because the FrameView is restored from PageCache and we would fail to restore its flags (such as
m_firstVisuallyNonEmptyLayoutCallbackPending) when entering Page Cache. We now call reset those flags that
are related to layout miletones when entering PageCache so that layout milestone events properly get sent
again when restoring from Page Cache.

* history/CachedFrame.cpp:
(WebCore::CachedFrame::CachedFrame):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKit/LayoutMilestonesWithAllContentInFrame.cpp:
(TestWebKitAPI::didFinishNavigation):
(TestWebKitAPI::TEST):

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

12 months agoREGRESSION (PSON): White or Black flash occurs when process swapping on navigation...
antti@apple.com [Tue, 18 Sep 2018 15:41:31 +0000 (15:41 +0000)]
REGRESSION (PSON): White or Black flash occurs when process swapping on navigation on Mac
https://bugs.webkit.org/show_bug.cgi?id=189663
<rdar://problem/44184955>

Reviewed by Geoff Garen.

We need to keep the layer tree of the previous page alive and visible until we have something
to render on the new page. With PSON on Mac this means that we should keep displaying the
layer tree from the previus process.

This patch moves the management of 'attaching' the drawing area (Mac only concept) from web process
to UI process. This is when we parent the layer tree to the view root layer. It also ensures that
the layer tree is not deleted too early on process swap and that it still eventually gets deleted.

* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::attachInWebProcess):
* UIProcess/SuspendedPageProxy.cpp:
(WebKit::messageNamesToIgnoreWhileSuspended):
(WebKit::SuspendedPageProxy::tearDownDrawingAreaInWebProcess):

We no longer tear down drawing area (layer tree) for suspended pages automatically. Send an explicit
message for it.

* UIProcess/SuspendedPageProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::reattachToWebProcess):

Only call didRelaunchProcess when process actually relaunched (not navigation process launch) to
match not calling processDidExit in resetStateAfterProcessExited.

(WebKit::WebPageProxy::didCompletePageTransition):

Attach the drawing area if appropriate.

(WebKit::WebPageProxy::decidePolicyForNavigationAction):

Send suspend message to WebPage immediately instead waiting for the runloop callback. This is needed so we
can avoid flashing the initial empty document load when the new Page object is created.

(WebKit::WebPageProxy::resetStateAfterProcessExited):

Don't call processDidExit when suspending, not exiting the process (this function needs a new name or rafactoring).
This avoids clearing the drawing area and flashing to black.

(WebKit::WebPageProxy::enterAcceleratedCompositingMode):

This is called when we have switched to the new layer tree.
Tear down the drawing area in the previus process.

* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.h:
* UIProcess/mac/TiledCoreAnimationDrawingAreaProxy.mm:
(WebKit::TiledCoreAnimationDrawingAreaProxy::attachInWebProcess):

Send a message to the web process to attach the drawing area.

* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::attach):
(WebKit::DrawingArea::attachDrawingArea): Deleted.

Rename to be less redundant.

* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::reinitializeWebPage):

Don't attach drawing area automatically. It will be done by a message from UI process.

(WebKit::WebPage::setLayerTreeStateIsFrozen):

Layer tree is always frozen in a suspended process (if it exists).

(WebKit::WebPage::didStartPageTransition):
(WebKit::WebPage::didCompletePageTransition):

Notify UI process of transition completion.

(WebKit::WebPage::setIsSuspended):
(WebKit::WebPage::tearDownDrawingAreaForSuspend):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):

Don't attach drawing area automatically. It will be done by a message from UI process.

(WebKit::TiledCoreAnimationDrawingArea::attach):
(WebKit::TiledCoreAnimationDrawingArea::attachDrawingArea): Deleted.

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

12 months ago[css-grid] Static position should use content-box, not padding-box
rego@igalia.com [Tue, 18 Sep 2018 15:13:40 +0000 (15:13 +0000)]
[css-grid] Static position should use content-box, not padding-box
https://bugs.webkit.org/show_bug.cgi?id=189698

Reviewed by Javier Fernandez.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html:
Update tests from WPT.

Source/WebCore:

This is a recent change by the CSSWG:
https://github.com/w3c/csswg-drafts/issues/3020

The spec text (https://drafts.csswg.org/css-grid/#static-position):
  "The static position of an absolutely-positioned child
   of a grid container is determined as if it were the sole grid item
   in a grid area whose edges coincide with the content edges
   of the grid container."

Test: imported/w3c/web-platform-tests/css/css-grid/abspos/absolute-positioning-grid-container-parent-001.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::prepareChildForPositionedLayout):
Simple change to use border and padding.

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

12 months ago[WPE] Gardening after r236124
csaavedra@igalia.com [Tue, 18 Sep 2018 14:50:41 +0000 (14:50 +0000)]
[WPE] Gardening after r236124

Quick gardening. There might be more tests that are now passing or
need updated results but this was the most obvious for now.
Unreviewed gardening.
* platform/wpe/TestExpectations:
* platform/wpe/svg/custom/pan-direction-expected.txt:

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

12 months ago[WPE] Implement mouse event modifiers
csaavedra@igalia.com [Tue, 18 Sep 2018 13:44:29 +0000 (13:44 +0000)]
[WPE] Implement mouse event modifiers
https://bugs.webkit.org/show_bug.cgi?id=189697

Reviewed by Carlos Garcia Campos.

Source/WebKit:

Only "CapsLocks" is missing, as WPE doesn't support that modifier.
* Shared/wpe/WebEventFactory.cpp:
(WebKit::modifiersForEventModifiers):
(WebKit::WebEventFactory::createWebKeyboardEvent):
(WebKit::WebEventFactory::createWebMouseEvent):
(WebKit::modifiersForEvent): Deleted.

Tools:

* WebKitTestRunner/wpe/EventSenderProxyWPE.cpp:
(WTR::wkEventModifiersToWPE):
(WTR::EventSenderProxy::mouseDown):
(WTR::EventSenderProxy::mouseUp):

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

12 months ago[EME][GStreamer] The current EME implementation doesn't support the waitingforkey...
calvaris@igalia.com [Tue, 18 Sep 2018 09:14:31 +0000 (09:14 +0000)]
[EME][GStreamer] The current EME implementation doesn't support the waitingforkey event
https://bugs.webkit.org/show_bug.cgi?id=185590

Reviewed by Philippe Normand.

Source/WebCore:

When decryptors are blocked waiting for the key, instruct the
player to run the Wait for key algorithm. As per spec, if we run
out of blocks pending to decrypt because we don't have the key, we
request running the algorithm again.

Test: imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https.html.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
(WebCore::MediaPlayerPrivateGStreamerBase::reportWaitingForKey):
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
* platform/graphics/gstreamer/eme/WebKitCommonEncryptionDecryptorGStreamer.cpp:
(webkitMediaCommonEncryptionDecryptTransformInPlace):
(webkitMediaCommonEncryptionDecryptSinkEventHandler):

LayoutTests:

Updated status of
imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https
and expectations.

* platform/wpe/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/encrypted-media/clearkey-mp4-playback-temporary-waitingforkey.https-expected.txt:

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

12 months agoUpdate composedPath to match the latest spec
rniwa@webkit.org [Tue, 18 Sep 2018 07:47:35 +0000 (07:47 +0000)]
Update composedPath to match the latest spec
https://bugs.webkit.org/show_bug.cgi?id=180378
<rdar://problem/42843004>

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Rebaselined the test now that all test cases pass.

* web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation-expected.txt:

Source/WebCore:

This patch makes the check for whether a given node in the event path be included in composedPath
pre-determined at the time of the event dispatching per https://github.com/whatwg/dom/issues/525.
This was a fix for the issue that if an event listener in a closed shadow tree removes a node in the
same tree in the event path, then composedPath called on its shadow host, for example, will include
the removed node since it's no longer in the closed shadow tree.

Naively, implementing this behavior would require remembering the original document or shadow root
of each node in the event path as well as its parent shadow root, or worse which node is disclosed
to every other node at the time of computing the event path.

This patch takes a more novel and efficient approach to implement the new behavior by adding a single
integer indicating the number of closed-mode shadow root ancestors of each node in the event path.
In computePathUnclosedToTarget, any node whose *depth* is greater than the context object is excluded.

Consider the following example:
div ------- ShadowRoot (closed)
  +- span     +- slot
If an event is dispatched on span, then the event path would be [span, slot, ShadowRoot, div]. Then
the values of integers assigned to each node would be: [0, 1, 1, 0] respectively. When composedPath
is called on span or div, slot and ShadowRoot are excluded because they have a greater *depth* value.

Unfortunately, this simplistic solution doesn't work when there are multiple shadow roots of the same
depth through which an event is dispatched as in:
section -- ShadowRoot (closed, SR2)
  |          +- slot (s2)
  +div ------ ShadowRoot (closed, SR1)
    +- span     +- slot (s1)
If an event is dispatched on span, the event path would be [span, s1, SR1, div, s2, SR2, section].
The values of integers assigned are: [0, 1, 1, 0, 1, 1, 0] respectively. When composedPath is called
on SR1, the simplistic approach would include s2 and SR2, which would be wrong.

To account for this case, in computePathUnclosedToTarget, we traverse the event path upwards (i.e.
ancestors) and downwards (i.e. descendants) from the context object and decrease the *allowed depth*
of shadow trees when we traverse out of a shadow tree in either direction. When traversing upwards,
therefore, moving out of a shadow root to its host would would decrease the allowed depth. When
traversing dowards, moving from a slot element to its assigned node would decrease the allowed depth.

Note that the depths can be negative when a composed event is dispatched inside a closed shadow tree,
and it gets out of its shadow host.

Unfortunately, the latest DOM specification has a bug and doesn't match the behavior of Chrome. This
patch proposes a new algorithm which can be adopted in https://github.com/whatwg/dom/issues/684.

Test: imported/w3c/web-platform-tests/shadow-dom/event-composed-path-after-dom-mutation.html

* dom/EventContext.cpp:
(WebCore::EventContext::EventContext):
(WebCore::MouseOrFocusEventContext::MouseOrFocusEventContext):
(WebCore::TouchEventContext::TouchEventContext):
* dom/EventContext.h:
(WebCore::EventContext::closedShadowDepth const): Added.
* dom/EventPath.cpp:
(WebCore::WindowEventContext::WindowEventContext):
(WebCore::EventPath::buildPath): Compute the closed shadow tree's depths for each node in the path.
(WebCore::computePathUnclosedToTarget const): Implemented the aforementioned algorithm.
(WebCore::EventPath::EventPath):

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

12 months agoUnreviewed build fix after r236101.
zandobersek@gmail.com [Tue, 18 Sep 2018 06:36:36 +0000 (06:36 +0000)]
Unreviewed build fix after r236101.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::flushAndDestroyPersistentStore):
Correct a BinarySemaphore::wait() call which now accepts no arguments.

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

12 months ago[WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
yusukesuzuki@slowstart.org [Tue, 18 Sep 2018 05:47:33 +0000 (05:47 +0000)]
[WTF] Use Semaphore and BinarySemaphore instead of dispatch_semaphore_t
https://bugs.webkit.org/show_bug.cgi?id=185339

Patch by Yusuke Suzuki <utatane.tea@gmail.com> on 2018-09-17
Reviewed by Mark Lam.

Source/WebCore:

* fileapi/ThreadableBlobRegistry.cpp:
(WebCore::ThreadableBlobRegistry::blobSize):
* platform/cocoa/NetworkExtensionContentFilter.h:
* platform/cocoa/NetworkExtensionContentFilter.mm:
(WebCore::NetworkExtensionContentFilter::initialize):
(WebCore::NetworkExtensionContentFilter::willSendRequest):
(WebCore::NetworkExtensionContentFilter::responseReceived):
(WebCore::NetworkExtensionContentFilter::addData):
(WebCore::NetworkExtensionContentFilter::finishedAddingData):
(WebCore::NetworkExtensionContentFilter::handleDecision):
Use per-function BinarySemaphore instead of holding it in NetworkExtensionContentFilter's field.

* platform/glib/FileMonitorGLib.cpp:
(WebCore::FileMonitor::FileMonitor):
(WebCore::FileMonitor::~FileMonitor):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::~MediaPlayerPrivateAVFoundationObjC):
(WebCore::MediaPlayerPrivateAVFoundationObjC::waitForVideoOutputMediaDataWillChange):
(WebCore::MediaPlayerPrivateAVFoundationObjC::outputMediaDataWillChange):
Use BinarySemaphore. And remove unused dispatch_semaphore_t.

* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
* platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
(-[WebAVStreamDataParserListener streamDataParserWillProvideContentKeyRequestInitializationData:forTrackID:]):
(-[WebAVStreamDataParserListener streamDataParser:didProvideContentKeyRequestInitializationData:forTrackID:]):
(WebCore::SourceBufferPrivateAVFObjC::SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::~SourceBufferPrivateAVFObjC):
(WebCore::SourceBufferPrivateAVFObjC::didProvideContentKeyRequestInitializationDataForTrackID):
(WebCore::SourceBufferPrivateAVFObjC::abort):
(WebCore::SourceBufferPrivateAVFObjC::setCDMSession):
(WebCore::SourceBufferPrivateAVFObjC::setCDMInstance):
Use Box<Semaphore> and Box<BinarySemaphore>.

* platform/graphics/cocoa/WebCoreDecompressionSession.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::WebCoreDecompressionSession):
Remove unused dispatch_semaphore_t.

* platform/network/cf/ResourceHandleCFNet.cpp:
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::getRunLoop):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.h:
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate initWithHandle:messageQueue:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate detachHandle]):
(-[WebCoreResourceHandleAsOperationQueueDelegate dealloc]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):
Use BinarySemaphore instead.

Source/WebKit:

* Platform/IPC/Connection.cpp:
(IPC::Connection::SyncMessageState::wait):
* Shared/mac/SecItemShim.cpp:
(WebKit::sendSecItemRequest):
Use BinarySemaphore.

* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::finishAllPendingWorkSynchronously):
* UIProcess/WebStorage/StorageManager.cpp:
(WebKit::StorageManager::applicationWillTerminate):
* UIProcess/ios/WKActionSheetAssistant.mm:
(appLinkForURL):
Use BinarySemaphore to wait for async completion handler. We also fix memory leak
since the old code does not call dispatch_release for the used semaphore.

Source/WTF:

This patch adds WTF::Semaphore, which is based on WTF::Lock and WTF::Condition.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/Semaphore.h: Added.
(WTF::Semaphore::Semaphore):
(WTF::Semaphore::signal):
(WTF::Semaphore::waitUntil):
(WTF::Semaphore::waitFor):
(WTF::Semaphore::wait):
* wtf/generic/WorkQueueGeneric.cpp:
(WorkQueue::platformInitialize):
* wtf/threads/BinarySemaphore.cpp:
(WTF::BinarySemaphore::waitUntil):
(WTF::BinarySemaphore::wait): Deleted.
* wtf/threads/BinarySemaphore.h:
(WTF::BinarySemaphore::waitFor):
(WTF::BinarySemaphore::wait):
Align the names of the functions to WTF::Condition.
Add BinarySemaphore::wait(), which is the same to waitUntil(WallTime::infinity()).

Tools:

* TestWebKitAPI/Tests/WTF/SynchronizedFixedQueue.cpp:
(TestWebKitAPI::ToUpperConverter::stopProducing):
(TestWebKitAPI::ToUpperConverter::stopConsuming):

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

12 months agoMany modern media control tests leak documents in testing
simon.fraser@apple.com [Tue, 18 Sep 2018 04:14:39 +0000 (04:14 +0000)]
Many modern media control tests leak documents in testing
https://bugs.webkit.org/show_bug.cgi?id=189437

Reviewed by Darin Adler.
Source/WebCore:

In order to accurately detect leaks in media controls tests which use lots of
SVGImages, we have to:
- Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
  to clear references to elements.
- Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
  to drop the last handle to the CachedResource for an SVGImage.
- Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
  to run again after that timer has fired.

This should fix most of the spurious leak reports involving SVGImage documents.

* page/MemoryRelease.cpp:
(WebCore::releaseCriticalMemory):

Source/WebKit:

In order to accurately detect leaks in media controls tests which use lots of
SVGImages, we have to:
- Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
  to clear references to elements.
- Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
  to drop the last handle to the CachedResource for an SVGImage.
- Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
  to run again after that timer has fired.

This should fix most of the spurious leak reports involving SVGImage documents.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageCallAfterTasksAndTimers):
(WKBundlePagePostTask): Deleted.
* WebProcess/InjectedBundle/API/c/WKBundlePage.h:

Tools:

In order to accurately detect leaks in media controls tests which use lots of
SVGImages, we have to:
- Fire a zero-delay timer after the postTask, in order for ImagesLoader's m_derefElementTimer
  to clear references to elements.
- Have releaseCriticalMemory() call CachedResourceLoader's garbageCollectDocumentResources()
  to drop the last handle to the CachedResource for an SVGImage.
- Call WKBundleReleaseMemory() after the GC and timer, since we need garbageCollectDocumentResources()
  to run again after that timer has fired.

This should fix most of the spurious leak reports involving SVGImage documents.

* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::reportLiveDocuments):
(WTR::InjectedBundle::didReceiveMessageToPage):

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

12 months ago[Win][Clang][WebKitLegacy] error: cannot pass object of non-trivial type through...
Hironori.Fujii@sony.com [Tue, 18 Sep 2018 02:54:37 +0000 (02:54 +0000)]
[Win][Clang][WebKitLegacy] error: cannot pass object of non-trivial type through variadic function
https://bugs.webkit.org/show_bug.cgi?id=189612

Reviewed by Alex Christensen.

Non-trivial types can't be used as aruguments of LOG_ERROR and
ASSERT_WITH_MESSAGE.

* DefaultPolicyDelegate.cpp:
(DefaultPolicyDelegate::unableToImplementPolicyWithError): Apply
static_cast<BSTR> to convert BString.
* WebLocalizableStrings.cpp:
(copyLocalizedStringFromBundle): Convert 'key' from WTF::String to
char* by using 'key.utf8().data()'.

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

12 months agoTry to fix Apple internal builds with the iOS 12.0 SDK.
mitz@apple.com [Tue, 18 Sep 2018 01:42:35 +0000 (01:42 +0000)]
Try to fix Apple internal builds with the iOS 12.0 SDK.

* Configurations/WebKit.xcconfig: Disable framework header postprocessing for iOS 12.0.

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

12 months agoUnreviewed, rolling out r236092 because it breaks internal builds. Also, remove...
ryanhaddad@apple.com [Tue, 18 Sep 2018 01:01:32 +0000 (01:01 +0000)]
Unreviewed, rolling out r236092 because it breaks internal builds. Also,  remove stray '+' character from ChangeLog file.

* Scripts/copy-webcontent-resources-to-private-headers.sh: Removed.
* WebKit.xcodeproj/project.pbxproj:

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

12 months agoLayout Test legacy-animation-engine/animations/play-state-in-shorthand.html is a...
ryanhaddad@apple.com [Tue, 18 Sep 2018 00:54:48 +0000 (00:54 +0000)]
Layout Test legacy-animation-engine/animations/play-state-in-shorthand.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=185651

Unreviewed test gardening.

* platform/mac/TestExpectations: Mark test as flaky.

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

12 months agoUpdated expected test [ PASS ] messages for new test-harness format for webgl tests
justin_fan@apple.com [Tue, 18 Sep 2018 00:31:40 +0000 (00:31 +0000)]
Updated expected test [ PASS ] messages for new test-harness format for webgl tests
https://bugs.webkit.org/show_bug.cgi?id=189677

Reviewed by Dean Jackson.

Update generate-webgl-tests.py's test expectation template
for my new version of webgl-test-harness.js for the webgl 2 suite,
and update all webgl/2.0.0 test expectations to match.

* webgl/resources/webgl-expectation-template.txt:
* webgl/2.0.0/.../*expected.txt: Modified all *expected.txts to match.

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

12 months agoAdd support for HEVC codec types in Media Capabilities
jer.noble@apple.com [Mon, 17 Sep 2018 23:24:21 +0000 (23:24 +0000)]
Add support for HEVC codec types in Media Capabilities
https://bugs.webkit.org/show_bug.cgi?id=189565

Reviewed by Eric Carlson.

Source/WebCore:

Test: media/hevc-codec-parameters.html

Add some utility methods for parsing HEVC codec strings, and using those parsed
values to query the platform for detailed support for HEVC decoding.

Drive-by fix: Modify MediaEngineConfigurationFactory to allow for null function
pointers in the encode/decode factory pair.

* Sources.txt:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/cocoa/VideoToolboxSoftLink.cpp:
* platform/cocoa/VideoToolboxSoftLink.h:
* platform/graphics/HEVCUtilities.cpp: Added.
(WebCore::parseHEVCCodecParameters):
* platform/graphics/HEVCUtilities.h: Added.
* platform/graphics/cocoa/HEVCUtilitiesCocoa.cpp: Added.
(WebCore::validateHEVCParameters):
* platform/graphics/cocoa/HEVCUtilitiesCocoa.h: Added.
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.cpp: Added.
(WebCore::videoCodecTypeFromRFC4281Type):
(WebCore::createMediaPlayerDecodingConfigurationCocoa):
* platform/graphics/cocoa/MediaEngineConfigurationFactoryCocoa.h: Added.
* platform/mediacapabilities/MediaEngineConfigurationFactory.cpp:
(WebCore::factories):
(WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
(WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
* testing/Internals.cpp:
(WebCore::Internals::parseHEVCCodecParameters):
* testing/Internals.h:
* testing/Internals.idl:

Source/WTF:

Extract the toIntegralType template into its own header.

* wtf/CMakeLists.txt:
* wtf/text/StringConversion.h: Added.
(isCharacterAllowedInBase):
(toIntegralType):
* wtf/text/WTFString.cpp:

LayoutTests:

* media/hevc-codec-parameters-expected.txt: Added.
* media/hevc-codec-parameters.html: Added.

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

12 months agoBuild fix after https://trac.webkit.org/changeset/236070
youenn@apple.com [Mon, 17 Sep 2018 23:21:49 +0000 (23:21 +0000)]
Build fix after https://trac.webkit.org/changeset/236070
https://bugs.webkit.org/show_bug.cgi?id=189635
<rdar://problem/44361849>

Unreviewed.
Fix for iOS internal builds.

* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):

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

12 months ago+2018-08-17 Ben Richards <benton_richards@apple.com>
achristensen@apple.com [Mon, 17 Sep 2018 23:00:54 +0000 (23:00 +0000)]
+2018-08-17  Ben Richards  <benton_richards@apple.com>

Add script to generate WebContent service resource files and change XPC service main SPI to have it's own header
https://bugs.webkit.org/show_bug.cgi?id=188601

Reviewed by Dan Bernstein.

Added a script to the process entitlements build phase of the WebContent service that copies resource
files to WebKit.framework/PrivateHeaders/CustomWebContentResources. These resource files are to
be used by clients who would like to make a custom WebContent service.

* Scripts/copy-webcontent-resources-to-private-headers.sh: Added.
* WebKit.xcodeproj/project.pbxproj:

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

12 months agoWeb Inspector: generate CSSKeywordCompletions from backend values
drousso@apple.com [Mon, 17 Sep 2018 22:43:11 +0000 (22:43 +0000)]
Web Inspector: generate CSSKeywordCompletions from backend values
https://bugs.webkit.org/show_bug.cgi?id=189041

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/CSS.json:
Include an optional `aliases` array and `inherited` boolean for `CSSPropertyInfo`.

Source/WebCore:

Modified existing test inspector/css/getSupportedCSSProperties.html.

* inspector/agents/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::getSupportedCSSProperties):
Send alias and longhand information for all properties, and any known keyword values for
those applicable. This makes use of `CSSParserFastPaths::isValidKeywordPropertyAndValue` to
determine if a given keyword is a valid value for each property. This only generates a list
for properties who have no non-keyword values.

* css/makeprop.pl:
* css/makevalues.pl:
Create additional helper functions/constants for retrieving strings of each CSS keyword.

* css/CSSProperty.h:
(WebCore::CSSProperty::aliasesForProperty):

* css/CSSPrimitiveValue.cpp:
(WebCore::valueName):

* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::CSSValuePool):
(WebCore::CSSValuePool::createIdentifierValue):

Source/WebInspectorUI:

Moves the longhands map to `WI.CSSKeywordCompletions` for more global access. Creates an
aliases map to support completions on aliases with the same values as the non-alias name.
Removes all keyword-only properties from `WI.CSSKeywordCompletions._propertyKeywordMap` as
they are now generated by the backend (kept for compatibility).

* UserInterface/Models/CSSCompletions.js:
(WI.CSSCompletions):
(WI.CSSCompletions.requestCSSCompletions.propertyNamesCallback):
(WI.CSSCompletions.prototype.isShorthandPropertyName):

* UserInterface/Models/CSSKeywordCompletions.js:
(WI.CSSKeywordCompletions.forProperty.addKeywordsForName): Added.
(WI.CSSKeywordCompletions.forProperty):
(WI.CSSKeywordCompletions.addCustomCompletions):

* UserInterface/Models/CSSProperty.js:
(WI.CSSProperty.isInheritedPropertyName):

LayoutTests:

* inspector/css/getSupportedCSSProperties-expected.txt:
* inspector/css/getSupportedCSSProperties.html:

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

12 months agotrack.onmute isn't called for a remote MediaStreamTrack when its counter part track...
youenn@apple.com [Mon, 17 Sep 2018 22:22:15 +0000 (22:22 +0000)]
track.onmute isn't called for a remote MediaStreamTrack when its counter part track is removed from the peer connection
https://bugs.webkit.org/show_bug.cgi?id=176281
<rdar://problem/44525674>

Reviewed by Eric Carlson.

Source/WebCore:

Listen to libwebrtc remove track callbacks.
Implement handling as per https://w3c.github.io/webrtc-pc/#process-remote-track-removal.
This triggers a mute event on the track.

Test: webrtc/remove-track.html

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::LibWebRTCMediaEndpoint::removeRemoteTrack):
(WebCore::LibWebRTCMediaEndpoint::OnRemoveTrack):
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
Drive by fix: Plan B code path does not mandate having an rtc backend for each sender.

LayoutTests:

* webrtc/remove-track-expected.txt: Added.
* webrtc/remove-track.html: Added.

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

12 months agoWe must convert ProfileType to CheckStructureOrEmpty instead of CheckStructure
sbarati@apple.com [Mon, 17 Sep 2018 22:21:32 +0000 (22:21 +0000)]
We must convert ProfileType to CheckStructureOrEmpty instead of CheckStructure
https://bugs.webkit.org/show_bug.cgi?id=189676
<rdar://problem/39682897>

Reviewed by Michael Saboff.

JSTests:

* typeProfiler/check-structure-or-empty-in-fixup.js: Added.
(A):
(K):
(i.catch):

Source/JavaScriptCore:

Because the incoming value may be TDZ, CheckStructure may end up crashing.
Since the Type Profile does not currently record TDZ values in any of its
data structures, this is not a semantic change in how it will show you data.
It just fixes crashes when we emit a CheckStructure and the incoming value
is TDZ.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToCheckStructureOrEmpty):

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

12 months agoAdd more Fullscreen logging
simon.fraser@apple.com [Mon, 17 Sep 2018 22:05:45 +0000 (22:05 +0000)]
Add more Fullscreen logging
https://bugs.webkit.org/show_bug.cgi?id=189656

Reviewed by Jer Noble.

Add some fullscreen logging so I can tell whether WebFullScreenManager ever releases
the fullscreen element.

Source/WebCore:

* platform/cocoa/VideoFullscreenModelVideoElement.mm:
(VideoFullscreenModelVideoElement::VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::~VideoFullscreenModelVideoElement):
(VideoFullscreenModelVideoElement::setVideoElement):

Source/WebKit:

* WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::WebFullScreenManager):
(WebKit::WebFullScreenManager::videoControlsManagerDidChange):
(WebKit::WebFullScreenManager::setPIPStandbyElement):
(WebKit::WebFullScreenManager::enterFullScreenForElement):
(WebKit::WebFullScreenManager::exitFullScreenForElement):
(WebKit::WebFullScreenManager::willEnterFullScreen):
(WebKit::WebFullScreenManager::didEnterFullScreen):
(WebKit::WebFullScreenManager::willExitFullScreen):
(WebKit::WebFullScreenManager::didExitFullScreen):
(WebKit::WebFullScreenManager::close):
* WebProcess/FullScreen/WebFullScreenManager.h:

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

12 months agoAdd support for dumping the GraphicsLayer tree via notifyutil
simon.fraser@apple.com [Mon, 17 Sep 2018 22:05:42 +0000 (22:05 +0000)]
Add support for dumping the GraphicsLayer tree via notifyutil
https://bugs.webkit.org/show_bug.cgi?id=189639

Reviewed by Zalan Bujtas.

Make "notifyutil -p com.apple.WebKit.showGraphicsLayerTree" work. It dumps the GraphicsLayer tree
for each top-level document (GraphicsLayers are connected across frame boundaries, so this prints
the entire tree for each main frame).

It uses WTFLogAlways rather than fprintf() so output shows on all platforms (other tree dumps should
be converted in the same way).

* page/mac/PageMac.mm:
(WebCore::Page::platformInitialize):
* platform/graphics/GraphicsLayer.cpp:
(showGraphicsLayerTree):
* rendering/RenderLayerCompositor.cpp:
(showGraphicsLayerTreeForCompositor):
* rendering/RenderLayerCompositor.h:
* rendering/RenderObject.cpp:
(WebCore::printGraphicsLayerTreeForLiveDocuments):
* rendering/RenderObject.h:

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

12 months agoSwipe snapshot can get stuck if swiping is disabled while it is visible
timothy_horton@apple.com [Mon, 17 Sep 2018 21:59:33 +0000 (21:59 +0000)]
Swipe snapshot can get stuck if swiping is disabled while it is visible
https://bugs.webkit.org/show_bug.cgi?id=189667
<rdar://problem/40367780>

Reviewed by Simon Fraser.

If navigation gestures are disabled while a swipe snapshot is visible,
WKWebView will tear down the ViewGestureController, which means that
the SnapshotRemovalTracker will no longer be around to ever remove
the snapshot.

It's currently very hard to write a test for this because we have
yet to come up with a good mechanism for testing swiping on iOS.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView setAllowsBackForwardNavigationGestures:]):
Instead of tearing down the ViewGestureController when navigation
gestures are disabled, just set a bit on it that disables gestures.

* UIProcess/Cocoa/ViewGestureController.cpp:
(WebKit::ViewGestureController::canSwipeInDirection const):
* UIProcess/Cocoa/ViewGestureController.h:
(WebKit::ViewGestureController::setSwipeGestureEnabled):
(WebKit::ViewGestureController::isSwipeGestureEnabled):
Add a bit to ViewGestureController that makes starting new gestures
always fail, but allows e.g. snapshots from existing swipes to continue
their usual behavior.

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

12 months ago[Curl] Add schema version and enable auto vacuum for cookie database.
chris.reid@sony.com [Mon, 17 Sep 2018 21:41:13 +0000 (21:41 +0000)]
[Curl] Add schema version and enable auto vacuum for cookie database.
https://bugs.webkit.org/show_bug.cgi?id=189669

Reviewed by Alex Christensen.

Turning on auto incremental vacuuming and adding versioning to the database. Right now we
reset tables if there's an unknown schema or if the none is set. There is placeholder logic
in place to upgrade databases as the schema changes in the future.

Tested by checking the database manually after launching MiniBrowser.

* platform/network/curl/CookieJarDB.cpp:
(WebCore::CookieJarDB::openDatabase):
(WebCore::CookieJarDB::verifySchemaVersion):
(WebCore::CookieJarDB::deleteAllTables):
(WebCore::CookieJarDB::createPrepareStatement):
(WebCore::CookieJarDB::getPrepareStatement):
(WebCore::CookieJarDB::executeSimpleSql):
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/NetworkStorageSessionCurl.cpp:
(WebCore::defaultSession):
* platform/sql/SQLiteDatabase.cpp:
(WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum): fixed a bug.

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

12 months agoFixed typo in TestExpectations file.
david_fenton@apple.com [Mon, 17 Sep 2018 21:14:34 +0000 (21:14 +0000)]
Fixed typo in TestExpectations file.
https://bugs.webkit.org/show_bug.cgi?id=188020.

Unreviewed test gardening.

Patch by Dawei Fenton <realdawei@apple.com> on 2018-09-17

* platform/ios/TestExpectations:

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

12 months agoRe-order Node flags based on semantics
rniwa@webkit.org [Mon, 17 Sep 2018 21:07:08 +0000 (21:07 +0000)]
Re-order Node flags based on semantics
https://bugs.webkit.org/show_bug.cgi?id=189643

Reviewed by Simon Fraser.

Re-ordered Node flags based on their category and subclasses of Node which use them.

* dom/Node.h:

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

12 months agoExpose WKWebProcess.h as a private header
achristensen@apple.com [Mon, 17 Sep 2018 20:36:09 +0000 (20:36 +0000)]
Expose WKWebProcess.h as a private header
https://bugs.webkit.org/show_bug.cgi?id=189636

* WebKit.xcodeproj/project.pbxproj:

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

12 months agoAdd more ResourceLoading logging, particularly in MemoryCache code
simon.fraser@apple.com [Mon, 17 Sep 2018 19:39:35 +0000 (19:39 +0000)]
Add more ResourceLoading logging, particularly in MemoryCache code
https://bugs.webkit.org/show_bug.cgi?id=189651

Reviewed by Tim Horton.

Adding more logging to the ResourceLoading log channel, which I found useful
when trying to understand cached SVGImage lifetimes (bug 189437).

* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::deleteIfPossible):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::garbageCollectDocumentResources):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::add):
(WebCore::MemoryCache::pruneLiveResourcesToSize):
(WebCore::MemoryCache::pruneDeadResources):
(WebCore::MemoryCache::pruneDeadResourcesToSize):
(WebCore::MemoryCache::remove):
(WebCore::MemoryCache::dumpLRULists const):

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

12 months agoEnable USE_MEDIAREMOTE on iOS
jer.noble@apple.com [Mon, 17 Sep 2018 18:57:53 +0000 (18:57 +0000)]
Enable USE_MEDIAREMOTE on iOS
https://bugs.webkit.org/show_bug.cgi?id=189096

Reviewed by Eric Carlson.

Source/WebCore:

Migrate to using MediaRemote.framework on iOS from MediaPlayer.framework. This unifies the
Now Playing implementation on iOS and Mac.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/audio/cocoa/MediaSessionManagerCocoa.cpp: Removed.
* platform/audio/cocoa/MediaSessionManagerCocoa.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm: Renamed from Source/WebCore/platform/audio/mac/MediaSessionManagerMac.mm.
(PlatformMediaSessionManager::sharedManager):
(PlatformMediaSessionManager::sharedManagerIfExists):
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::beginInterruption):
(MediaSessionManagerCocoa::scheduleUpdateNowPlayingInfo):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::sessionDidEndRemoteScrubbing):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::sessionCanProduceAudioChanged):
(MediaSessionManagerCocoa::nowPlayingEligibleSession):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.h:
(): Deleted.
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::nowPlayingEligibleSession): Deleted.
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillBeginPlayback): Deleted.
(WebCore::MediaSessionManageriOS::removeSession): Deleted.
(WebCore::MediaSessionManageriOS::sessionWillEndPlayback): Deleted.
(WebCore::MediaSessionManageriOS::clientCharacteristicsChanged): Deleted.
* platform/audio/mac/MediaSessionManagerMac.h: Removed.

Source/WTF:

* wtf/Platform.h:

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

12 months agoEnable VCP for iOS and reenable it for MacOS
youenn@apple.com [Mon, 17 Sep 2018 18:49:52 +0000 (18:49 +0000)]
Enable VCP for iOS and reenable it for MacOS
https://bugs.webkit.org/show_bug.cgi?id=189635
<rdar://problem/43621029>

Unreviewed, build fix for iOS simulator.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:

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

12 months agoExpose XPCServiceMain in a WebProcess header rather than WKProcessPool
commit-queue@webkit.org [Mon, 17 Sep 2018 18:45:46 +0000 (18:45 +0000)]
Expose XPCServiceMain in a WebProcess header rather than WKProcessPool
https://bugs.webkit.org/show_bug.cgi?id=189636

Patch by Alex Christensen <achristensen@webkit.org> on 2018-09-17
Reviewed by Dan Bernstein.

Fix a few build failures along the way.

* PluginProcess/mac/PluginControllerProxyMac.mm:
(WebKit::PluginControllerProxy::windowAndViewFramesChanged):
(WebKit::PluginControllerProxy::updateLayerHostingContext):
* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::replacedNSWorkspace_launchApplicationAtURL_options_configuration_error):
(WebKit::PluginProcess::platformInitializeProcess):
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceEntryPoint.h:
* Shared/EntryPointUtilities/mac/XPCService/XPCServiceMain.mm:
(WebKit::XPCServiceMain):
(main):
* SourcesCocoa.txt:
* UIProcess/API/Cocoa/WKProcessPool.mm:
(+[WKProcessPool _webContentProcessXPCMain]): Deleted.
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/API: Added.
* WebProcess/API/Cocoa: Added.
* WebProcess/API/Cocoa/WKWebProcess.cpp: Added.
(WKWebProcessMain):
* WebProcess/API/Cocoa/WKWebProcess.h: Added.
* WebProcess/WebPage/mac/WKAccessibilityWebPageObjectMac.mm:
(-[WKAccessibilityWebPageObject convertScreenPointToRootView:]):
(-[WKAccessibilityWebPageObject accessibilityAttributeValue:]):
(-[WKAccessibilityWebPageObject accessibilityHitTest:]):

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

12 months agoBuild error in ImageBufferCG when compiled with IOSurfacePool
commit-queue@webkit.org [Mon, 17 Sep 2018 18:24:10 +0000 (18:24 +0000)]
Build error in ImageBufferCG when compiled with IOSurfacePool
https://bugs.webkit.org/show_bug.cgi?id=189579

Patch by Frederic Wang <fwang@igalia.com> on 2018-09-17
Reviewed by Tim Horton.

IOSurface.h might be included with different value of IOSURFACE_CANVAS_BACKING_STORE, causing
compilation errors when files in the same unified source do not agree on the definition.
This patch moves the definition of IOSURFACE_CANVAS_BACKING_STORE from ImageBufferDataCG.h
to Platform.h so that IOSURFACE_CANVAS_BACKING_STORE is set to the same value in all files.
Finally some minors changes to explicitly declare/define ImageBuffer are performed in order
to prevent future issues with Unified build rotating.

Source/WebCore:

No new tests, behavior unchanged.

* html/HTMLCanvasElement.cpp: Explicitly include ImageBuffer.h since it's used in this file.
* platform/graphics/cg/ImageBufferDataCG.h: Move definition into Platform.h.
* platform/graphics/cocoa/IOSurface.h: Forward-declare ImageBuffer since it's used in this
header.

Source/WTF:

* wtf/Platform.h: Move definition from ImageBufferDataCG.h.

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

12 months ago[Curl] Respond with requested authentication scheme for authentication challenge.
Basuke.Suzuki@sony.com [Mon, 17 Sep 2018 18:19:34 +0000 (18:19 +0000)]
[Curl] Respond with requested authentication scheme for authentication challenge.
https://bugs.webkit.org/show_bug.cgi?id=189318

Reviewed by Alex Christensen.

Source/WebCore:

Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
mode, the round-trip communication between the client and the server is handled by libcurl
internally. That's okay for many cases. But when initial request has a credentials
(i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
the returned response is not 401.

Passes following tests:
- http/tests/websocket/tests/hybi/httponly-cookie.pl
- http/tests/websocket/tests/hybi/secure-cookie-insecure-connection.pl
- http/tests/websocket/tests/hybi/secure-cookie-secure-connection.pl
- http/tests/xmlhttprequest/basic-auth-default.html
- http/tests/xmlhttprequest/cross-origin-authorization.html
- http/tests/xmlhttprequest/logout.html
- http/tests/xmlhttprequest/null-auth.php
- http/tests/xmlhttprequest/re-login-async.html
- http/tests/xmlhttprequest/re-login.html
- http/tests/xmlhttprequest/redirect-credentials-responseURL.html
- http/tests/xmlhttprequest/remember-bad-password.html

* platform/network/ResourceHandle.h:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setHttpAuthUserPass):
(WebCore::CurlHandle::enableHttpAuthentication): Deleted.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setAuthenticationScheme):
(WebCore::CurlRequest::setupTransfer):
* platform/network/curl/CurlRequest.h:
* platform/network/curl/ResourceHandleCurl.cpp:
(WebCore::ResourceHandle::start):
(WebCore::ResourceHandle::didReceiveAuthenticationChallenge):
(WebCore::ResourceHandle::receivedCredential):
(WebCore::ResourceHandle::getCredential):
(WebCore::ResourceHandle::restartRequestWithCredential):
(WebCore::ResourceHandle::platformLoadResourceSynchronously):
(WebCore::ResourceHandle::continueAfterWillSendRequest):

Source/WebKit:

Curl port depends on libcurl's authentication handling by enabling CURLAUTH_ANY. With this
mode, the round-trip communication between the client and the server is handled by libcurl
internally. That's okay for many cases. But when initial request has a credentials
(i.e. XMLHttpRequest), there's no valid chance to store credential to the storage because
the returned response is not 401.

* NetworkProcess/curl/NetworkDataTaskCurl.cpp:
(WebKit::NetworkDataTaskCurl::NetworkDataTaskCurl):
(WebKit::NetworkDataTaskCurl::willPerformHTTPRedirection):
(WebKit::NetworkDataTaskCurl::tryHttpAuthentication):
(WebKit::NetworkDataTaskCurl::tryProxyAuthentication):
(WebKit::NetworkDataTaskCurl::restartWithCredential):
* NetworkProcess/curl/NetworkDataTaskCurl.h:

LayoutTests:

* platform/wincairo/TestExpectations:

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

12 months ago[Web Animations] Positive delays of accelerated animations are not respected
graouts@webkit.org [Mon, 17 Sep 2018 17:37:48 +0000 (17:37 +0000)]
[Web Animations] Positive delays of accelerated animations are not respected
https://bugs.webkit.org/show_bug.cgi?id=189411
<rdar://problem/44151416>

Reviewed by Dean Jackson.

Use a mask over the animated rectangle to allow for a 1px rounding error when seeking to fix flakiness.

* webanimations/accelerated-animation-with-delay-and-seek-expected.html:
* webanimations/accelerated-animation-with-delay-and-seek.html:

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

12 months agoClear pending resource load statistics' writes after tests
commit-queue@webkit.org [Mon, 17 Sep 2018 17:18:27 +0000 (17:18 +0000)]
Clear pending resource load statistics' writes after tests
https://bugs.webkit.org/show_bug.cgi?id=189632
<rdar://problem/44469275>

Patch by Woodrow Wang <woodrow_wang@apple.com> on 2018-09-17
Reviewed by Chris Dumez.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsResetToConsistentState):

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

12 months agoEnable VCP for iOS and reenable it for MacOS
youenn@apple.com [Mon, 17 Sep 2018 17:15:56 +0000 (17:15 +0000)]
Enable VCP for iOS and reenable it for MacOS
https://bugs.webkit.org/show_bug.cgi?id=189635
<rdar://problem/43621029>

Reviewed by Eric Carlson.

Source/ThirdParty/libwebrtc:

Make sure VCP API is used to set encoding session parameters.

* Source/webrtc/sdk/WebKit/VideoProcessingSoftLink.h:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm:
(-[RTCVideoEncoderH264 resetCompressionSessionWithPixelFormat:]):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.cc:
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/helpers.h:

Source/WebCore:

Covered by exsiting and modified tests.
Instead of using libwebrtc YUV frames for black frames, use CVPixelBuffer to make it efficient.
Add internal API to know whether VCP is enabled so as to make capture-webrtc test pass on all platforms.

* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendBlackFramesIfNeeded):
* platform/mediastream/RealtimeOutgoingVideoSource.h:
* platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.h:
* platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
(WebCore::createBlackPixelBuffer):
(WebCore::RealtimeIncomingVideoSourceCocoa::pixelBufferFromVideoFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
(WebCore::RealtimeOutgoingVideoSourceCocoa::createBlackFrame):
* platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
* testing/Internals.cpp:
(WebCore::Internals::supportsVCPEncoder):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html:
For platforms suppporting VCP, arbitrary size should be supported.
* webrtc/routines.js:

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

12 months agoPSON: window.open() with 'noopener' should only process-swap cross-site, not cross...
cdumez@apple.com [Mon, 17 Sep 2018 17:15:07 +0000 (17:15 +0000)]
PSON: window.open() with 'noopener' should only process-swap cross-site, not cross-origin
https://bugs.webkit.org/show_bug.cgi?id=189602
<rdar://problem/44430549>

Reviewed by Geoff Garen.

Source/WebCore:

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::setTriggeringAction):
* loader/DocumentLoader.h:
* loader/FrameLoadRequest.h:
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithNavigationAction):
(WebCore::FrameLoader::loadWithDocumentLoader):
(WebCore::FrameLoader::loadPostRequest):
(WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
(WebCore::FrameLoader::loadDifferentDocumentItem):
Move NavigationAction's opener setting to loadWithNavigationAction() as this is a better bottleneck.
Otherwise, we'd have to set it at several call sites. Also move the NavigationAction around instead
of copying it.

* loader/FrameLoader.h:
(WebCore::FrameLoader::loadWithNavigationAction):
* loader/NavigationAction.h:
(WebCore::NavigationAction::setShouldOpenExternalURLsPolicy):
* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::createWindow):

Source/WebKit:

The following fixes were made to our process swap on navigation logic:
- Browsing contexts opened via window.open() with 'noopener' option now only same if
  they are cross-site, instead of doing a stricter cross-origin check.
- Support process swapping when opening a new window via <a target="_blank" rel="noopener">
  that is cross-site.

In order to support this, the following changes were made:
- Stop passing a 'isCrossOriginWindowOpenNavigation' flag to the UIProcess when navigating because:
  - This is specific to window.open() and does not apply to other windows opened by DOM
  - This forces the origin check to happens on WebContent process side instead of relying on the
    one in WebProcessPool in the UIProcess
- Pass the origin of the requester to the UIProcess when navigating, so that the WebProcessPool
  can use the requester's host for the cross-site check for the initial navigation in a new window
  created by DOM.
- Add 2 flags to WebPageProxy which indicate if the page was created by the DOM and if any provisional
  loads have been committed. The WebProcessPool uses theses flags to recognize initial loads in
  new windows created by the DOM, so that it uses the requester's origin for the cross-site check.

* Shared/NavigationActionData.cpp:
(WebKit::NavigationActionData::encode const):
(WebKit::NavigationActionData::decode):
* Shared/NavigationActionData.h:
* UIProcess/API/APINavigation.h:
(API::Navigation::setRequesterOrigin):
(API::Navigation::requesterOrigin const):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::continueNavigationInNewProcess):
(WebKit::WebPageProxy::didCommitLoadForFrame):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::createNewPage):
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::setOpenedByDOM):
(WebKit::WebPageProxy::openedByDOM const):
(WebKit::WebPageProxy::hasCommittedAnyProvisionalLoads const):
* UIProcess/WebProcessPool.cpp:
(WebKit::shouldUseSameProcessBasedOnURLs):
(WebKit::WebProcessPool::processForNavigationInternal):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDecidePolicyForNavigationAction):

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ProcessSwapOnNavigation.mm:

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

12 months agoRevert https://trac.webkit.org/r235910, because the new test times out.
ap@apple.com [Mon, 17 Sep 2018 17:11:15 +0000 (17:11 +0000)]
Revert https://trac.webkit.org/r235910, because the new test times out.
Crash under PlatformPopupMenuData::encode when interacting with a select menu that has variable fonts
https://bugs.webkit.org/show_bug.cgi?id=188008

Source/WebKit:

* Shared/cf/ArgumentCodersCF.cpp:
(IPC::encode):
(IPC::decode):

LayoutTests:

* fast/text/variations/ipc2-expected.txt: Removed.
* fast/text/variations/ipc2.html: Removed.
* platform/mac-wk1/TestExpectations:

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

12 months agoRefactoring related to Safe Browsing
commit-queue@webkit.org [Mon, 17 Sep 2018 17:09:43 +0000 (17:09 +0000)]
Refactoring related to Safe Browsing
https://bugs.webkit.org/show_bug.cgi?id=189631

Patch by Alex Christensen <achristensen@webkit.org> on 2018-09-17
Reviewed by Tim Horton.

Make SafeBrowsingResult RefCounted.
Move logic from an unnamed lambda to WebPageProxy::receivedNavigationPolicyDecision.

* UIProcess/Cocoa/WebPageProxyCocoa.mm:
(WebKit::WebPageProxy::beginSafeBrowsingCheck):
(WebKit::WebPageProxy::contentFilterDidBlockLoadForFrame): Deleted.
(WebKit::WebPageProxy::addPlatformLoadParameters): Deleted.
(WebKit::WebPageProxy::createSandboxExtensionsIfNeeded): Deleted.
(WebKit::WebPageProxy::startDrag): Deleted.
(WebKit::WebPageProxy::setPromisedDataForImage): Deleted.
(WebKit::WebPageProxy::setDragCaretRect): Deleted.
(WebKit::WebPageProxy::platformRegisterAttachment): Deleted.
(WebKit::WebPageProxy::platformCloneAttachment): Deleted.
* UIProcess/SafeBrowsingResult.h:
(WebKit::SafeBrowsingResult::create):
* UIProcess/WebFramePolicyListenerProxy.cpp:
(WebKit::WebFramePolicyListenerProxy::didReceiveSafeBrowsingResults):
* UIProcess/WebFramePolicyListenerProxy.h:
* UIProcess/WebFrameProxy.cpp:
(WebKit::WebFrameProxy::setUpPolicyListenerProxy):
* UIProcess/WebFrameProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::receivedNavigationPolicyDecision):
(WebKit::WebPageProxy::decidePolicyForNavigationAction):
(WebKit::WebPageProxy::decidePolicyForNewWindowAction):
(WebKit::WebPageProxy::decidePolicyForResponse):
* UIProcess/WebPageProxy.h:

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

12 months agoUse OpaqueJSString rather than JSRetainPtr inside WebKit
darin@apple.com [Mon, 17 Sep 2018 16:54:55 +0000 (16:54 +0000)]
Use OpaqueJSString rather than JSRetainPtr inside WebKit
https://bugs.webkit.org/show_bug.cgi?id=189652

Reviewed by Saam Barati.

Source/JavaScriptCore:

* API/JSCallbackObjectFunctions.h: Removed an uneeded include of
JSStringRef.h.

* API/JSContext.mm:
(-[JSContext evaluateScript:withSourceURL:]): Use OpaqueJSString::create rather
than JSStringCreateWithCFString, simplifying the code and also obviating the
need for explicit JSStringRelease.
(-[JSContext setName:]): Ditto.

* API/JSStringRef.cpp:
(JSStringIsEqualToUTF8CString): Use adoptRef rather than explicit JSStringRelease.
It seems that additional optimization is possible, obviating the need to allocate
an OpaqueJSString, but that's true almost everywhere else in this patch, too.

* API/JSValue.mm:
(+[JSValue valueWithNewRegularExpressionFromPattern:flags:inContext:]): Use
OpaqueJSString::create and adoptRef as appropriate.
(+[JSValue valueWithNewErrorFromMessage:inContext:]): Ditto.
(+[JSValue valueWithNewSymbolFromDescription:inContext:]): Ditto.
(performPropertyOperation): Ditto.
(-[JSValue invokeMethod:withArguments:]): Ditto.
(valueToObjectWithoutCopy): Ditto.
(containerValueToObject): Ditto.
(valueToString): Ditto.
(objectToValueWithoutCopy): Ditto.
(objectToValue): Ditto.

Source/WebCore:

* Modules/plugins/QuickTimePluginReplacement.mm:
(WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.
(WebCore::jsValueWithAVMetadataItemInContext): Use adoptCF.

* platform/mac/SerializedPlatformRepresentationMac.mm:
(WebCore::jsValueWithDictionaryInContext): Use OpaqueJSString::create.

Source/WebKit:

* Shared/API/c/WKString.cpp: Removed unneeded include of JSStringRef.h.

* WebProcess/Automation/WebAutomationSessionProxy.cpp: Removed unneeded
include of JSRetainPtr.
(WebKit::toJSString): Deleted.
(WebKit::toJSValue): Use OpaqueJSString::create.
(WebKit::callPropertyFunction): Ditto.
(WebKit::evaluate): Use adoptRef.
(WebKit::evaluateJavaScriptCallback): Ditto.
(WebKit::WebAutomationSessionProxy::scriptObjectForFrame):
Use OpaqueJSString::create.
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction): Use
String rather than JSStringRef.

* WebProcess/Plugins/PDF/PDFPlugin.mm: Removed unneeded includes.
(WebKit::PDFPlugin::runScriptsInPDFDocument): Use OpaqueJSString::create.

Source/WebKitLegacy/ios:

* WebView/WebPDFViewIOS.mm:
(-[WebPDFView finishedLoadingWithDataSource:]): Use OpaqueJSString::create.
* WebView/WebPDFViewPlaceholder.mm:
(-[WebPDFViewPlaceholder _evaluateJSForDocument:]): Ditto.

Source/WebKitLegacy/mac:

* WebView/WebPDFRepresentation.mm:
(-[WebPDFRepresentation finishedLoadingWithDataSource:]): Use OpaqueJSString::create.

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

12 months agoLayout Test imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap...
david_fenton@apple.com [Mon, 17 Sep 2018 16:41:29 +0000 (16:41 +0000)]
Layout Test imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html is a flaky failure.
https://bugs.webkit.org/show_bug.cgi?id=188020.

Unreviewed test gardening.

Patch by Dawei Fenton <realdawei@apple.com> on 2018-09-17

* platform/ios/TestExpectations:

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

12 months ago[WPE] Add new failure
csaavedra@igalia.com [Mon, 17 Sep 2018 15:04:32 +0000 (15:04 +0000)]
[WPE] Add new failure

Unreviewed gardening.
* platform/wpe/TestExpectations:

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

12 months ago[GTK][WPE] Update baseline for fast/dom/navigator-detached-no-crash
csaavedra@igalia.com [Mon, 17 Sep 2018 14:36:36 +0000 (14:36 +0000)]
[GTK][WPE] Update baseline for fast/dom/navigator-detached-no-crash

In GTK it's just a matter of updating the baseline. In WPE
there's some JS output that just needs to be ignored.
* platform/gtk/TestExpectations:
* platform/gtk/fast/dom/navigator-detached-no-crash-expected.txt:
* platform/wpe/TestExpectations:

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

12 months ago[WPE] Mark crashing animations test.
csaavedra@igalia.com [Mon, 17 Sep 2018 14:09:19 +0000 (14:09 +0000)]
[WPE] Mark crashing animations test.

animations/play-state-start-paused.html crashing.
Unreviewed gardening.
* platform/wpe/TestExpectations:

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

12 months ago[WPE] Unmark now passing tests
csaavedra@igalia.com [Mon, 17 Sep 2018 12:23:51 +0000 (12:23 +0000)]
[WPE] Unmark now passing tests

Unreviewed gardening.
* platform/wpe/TestExpectations:

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

12 months ago[GTK] Unmark now passing tests.
csaavedra@igalia.com [Mon, 17 Sep 2018 12:07:04 +0000 (12:07 +0000)]
[GTK] Unmark now passing tests.

Unreviewed gardening.
* platform/gtk/TestExpectations:

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

12 months agoUnreviewed, fix incorrect WPE build fix made in r236009
mcatanzaro@igalia.com [Mon, 17 Sep 2018 11:23:13 +0000 (11:23 +0000)]
Unreviewed, fix incorrect WPE build fix made in r236009

This isn't the right place to add the typedef. I failed to notice that the WebKitWebView
type is not actually used anywhere in this header. Actually, the problematic function is no
longer declared or used anywhere and was just missed when WebKitScriptDialog was refactored,
so remove it.

* UIProcess/API/wpe/WebKitScriptDialog.h:
* UIProcess/API/wpe/WebKitScriptDialogWPE.cpp:
(webkitScriptDialogRun): Deleted.

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