WebKit-https.git
3 years agoUpdate ReadMe.md
mcatanzaro@igalia.com [Thu, 1 Feb 2018 01:38:34 +0000 (01:38 +0000)]
Update ReadMe.md
https://bugs.webkit.org/show_bug.cgi?id=182314

Reviewed by Alex Christensen.

Add download link for Epiphany Technology Preview. Improve build instructions for GTK. Add
build instructions for WPE. Add instructions to run MiniBrowser on Linux. Miscellaneous
typographical adjustments.

* ReadMe.md:

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

3 years agoUnreviewed, rolling out r227942.
achristensen@apple.com [Thu, 1 Feb 2018 00:58:52 +0000 (00:58 +0000)]
Unreviewed, rolling out r227942.

r227875 should not have been rolled out.

Reverted changeset:

"Unreviewed, rolling out r227875."
https://bugs.webkit.org/show_bug.cgi?id=182357
https://trac.webkit.org/changeset/227942

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

3 years agoUnreviewed, rolling out r227875.
mcatanzaro@igalia.com [Thu, 1 Feb 2018 00:08:01 +0000 (00:08 +0000)]
Unreviewed, rolling out r227875.
https://bugs.webkit.org/show_bug.cgi?id=182357

Missing cross-platform TestController implementation

Reverted changeset:

"Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()"
https://bugs.webkit.org/show_bug.cgi?id=181958
https://trac.webkit.org/changeset/227875

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
(WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]): Deleted.
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]): Deleted.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
(WebKit::WebResourceLoadStatisticsStore::clearInMemory):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
(WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsUpdateCookiePartitioning):
(WTR::TestRunner::statisticsSetShouldPartitionCookiesForHost):
(WTR::TestRunner::statisticsCallDidSetPartitionOrBlockCookiesForHostCallback): Deleted.
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didSetPartitionOrBlockCookiesForHost): Deleted.
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::statisticsUpdateCookiePartitioning):
(WTR::TestController::statisticsSetShouldPartitionCookiesForHost):

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt:
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect-expected.txt:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
* platform/mac-wk2/TestExpectations:

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

3 years agoFollow-up to r227939.
bfulgham@apple.com [Thu, 1 Feb 2018 00:03:05 +0000 (00:03 +0000)]
Follow-up to r227939.
https://bugs.webkit.org/show_bug.cgi?id=182354
<rdar://problem/37046844>

Make sure the correct sandbox is used on iOS as well.

* StorageProcess/ios/StorageProcessIOS.mm:
(WebKit::StorageProcess::initializeSandbox):

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

3 years agoFix some ARM64_32 build failures.
mark.lam@apple.com [Thu, 1 Feb 2018 00:00:45 +0000 (00:00 +0000)]
Fix some ARM64_32 build failures.
https://bugs.webkit.org/show_bug.cgi?id=182356
<rdar://problem/37057690>

Reviewed by Michael Saboff.

* wtf/MathExtras.h:
(WTF::dynamicPoison):
* wtf/text/ASCIIFastPath.h:
(WTF::copyLCharsFromUCharSource):

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

3 years agoREGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
bfulgham@apple.com [Wed, 31 Jan 2018 23:56:11 +0000 (23:56 +0000)]
REGRESSION(r220094): com.apple.WebKit.Storage lost its sandbox
https://bugs.webkit.org/show_bug.cgi?id=182354
<rdar://problem/37046844>

Reviewed by Ryosuke Niwa.

The Database process was renamed to Storage, but it's sandbox was not updated.

* Configurations/WebKit.xcconfig: Update for sandbox rename.
* DerivedSources.make: Ditto.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb: Removed.
* Resources/SandboxProfiles/ios/com.apple.WebKit.Storage.sb: Copied from Resources/SandboxProfiles/ios/com.apple.WebKit.Databases.sb.
* StorageProcess/mac/com.apple.WebKit.Databases.sb.in: Removed.
* StorageProcess/mac/com.apple.WebKit.Storage.sb.in: Copied from StorageProcess/mac/com.apple.WebKit.Databases.sb.in.
* WebKit.xcodeproj/project.pbxproj: Update for sandbox rename.

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

3 years agoShould chose the best match during 'route' if there are multiple matches.
dewei_zhu@apple.com [Wed, 31 Jan 2018 23:41:37 +0000 (23:41 +0000)]
Should chose the best match during 'route' if there are multiple matches.
https://bugs.webkit.org/show_bug.cgi?id=182326

Reviewed by Ryosuke Niwa.

r227749 made a change that 'analysisCategoryPage' will be added before 'analysisTaskPage'.
As route names for both pages starts with 'analysis', whichever added first will be chosen.
For a route like 'analysis/task/1'. As a result, 'analysisCategoryPage' will be chosen and
this is not expected behavior. Adding the logic on the cases when route name does not extact
match the route name, always choose the longest mathcing route name.

Also modernized the code of 'page-router.js' to use const & let instead of var.

Added a browser test to guard against this bug.

* browser-tests/index.html: Import 'page-router-tests.js'.
* browser-tests/page-router-tests.js: Added unit test to guard against this bug.
* public/v3/pages/page-router.js:
(PageRouter.prototype.route): Added logic to find best matching in the case of inexact match.
(PageRouter.prototype.pageDidOpen):
(PageRouter.prototype._updateURLState):
(PageRouter.prototype._serializeToHash):
(PageRouter.prototype._deserializeFromHash):
(PageRouter.prototype._serializeHashQueryValue):
(PageRouter.prototype._deserializeHashQueryValue):
(PageRouter.prototype._countOccurrences):
(PageRouter):

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

3 years agoBitmapImage::drawPattern() may not draw a complete frame even after all the data...
commit-queue@webkit.org [Wed, 31 Jan 2018 23:23:35 +0000 (23:23 +0000)]
BitmapImage::drawPattern() may not draw a complete frame even after all the data is received
https://bugs.webkit.org/show_bug.cgi?id=182277

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-01-31
Reviewed by Simon Fraser.

Source/WebCore:

BitmapImage::drawPattern() needs to destroy the incomplete decoded frame
before trying to draw it as a pattern.

Test: http/tests/images/draw-pattern-slow-load-large-image.html

* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::updateBufferInternal): We need to disable CachedImage
data buffering for testing. This simulates slow network where intervals
between data chunks can last for seconds.
* loader/cache/CachedImage.h:
* platform/graphics/BitmapImage.cpp:
(WebCore::BitmapImage::drawPattern): Destroy the incomplete decoded frame
before drawing this frame as a pattern. We do not destroy incomplete decoded
frame once new data is received because it may be drawn by async image
drawing while waiting for the newer frame to finish decoding.
* testing/Internals.cpp:
(WebCore::Internals::setForceUpdateImageDataEnabledForTesting):
* testing/Internals.h:
* testing/Internals.idl:

LayoutTests:

* http/tests/images/draw-pattern-slow-load-large-image-expected.html: Added.
* http/tests/images/draw-pattern-slow-load-large-image.html: Added.
* http/tests/resources/load-and-stall.php: Add a new argument to allow
repeating the stall till the end of the file. This simulates real slow
network where sending data and stalling happens constantly and not only
a single time.

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

3 years agoREGRESSION (r227340): Layout Test fast/workers/worker-cloneport.html is a flaky failure
cdumez@apple.com [Wed, 31 Jan 2018 23:22:31 +0000 (23:22 +0000)]
REGRESSION (r227340): Layout Test fast/workers/worker-cloneport.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=182007
<rdar://problem/37005504>

Reviewed by Ryosuke Niwa.

Increase the test's timeout. The test sometimes takes more than 1 second to run and would
log a FAIL line, even though the test eventually succeeds.

* fast/workers/worker-cloneport.html:
* platform/mac-wk2/TestExpectations:

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

3 years agoAdd a release assertion to ensure timers are deleted in the right thread
rniwa@webkit.org [Wed, 31 Jan 2018 23:08:44 +0000 (23:08 +0000)]
Add a release assertion to ensure timers are deleted in the right thread
https://bugs.webkit.org/show_bug.cgi?id=182351

Reviewed by David Kilzer.

Added a relese assertion in ~TimerBase that the current thread is the one in which the timer was created.

We use canAccessThreadLocalDataForThread for this purpose since the condition is more complicated
when WebThread is being used.

* platform/Timer.cpp:
(WebCore::TimerBase::~TimerBase): Added the assertion.
* platform/Timer.h:
(WebCore::TimerBase::m_thread): Always store the current thread in a timer.

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

3 years agoREGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent...
mcatanzaro@igalia.com [Wed, 31 Jan 2018 22:43:29 +0000 (22:43 +0000)]
REGRESSION(r227223): http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html, http/tests/resourceLoadStatistics/grandfathering.html timing out on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=182222

Reviewed by Alex Christensen.

Source/WebKit:

Add callbacks to notify when resource load statistics deletion is complete.

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:

Tools:

Use the new API to notify when resource load statistics deletion is complete.

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::statisticsClearThroughWebsiteDataRemovalCallback):
(WTR::TestController::statisticsClearInMemoryAndPersistentStore):
(WTR::TestController::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):

LayoutTests:

* platform/gtk/TestExpectations:
* platform/wpe/TestExpectations:

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

3 years agoChange SWServer::claim to set the iterator value as soon as possible
commit-queue@webkit.org [Wed, 31 Jan 2018 22:40:10 +0000 (22:40 +0000)]
Change SWServer::claim to set the iterator value as soon as possible
https://bugs.webkit.org/show_bug.cgi?id=182337

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-31
Reviewed by Chris Dumez.

No change of behavior, this is a "let's go safe way" fix.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::claim):

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

3 years agoVersioning.
jmarcell@apple.com [Wed, 31 Jan 2018 22:18:15 +0000 (22:18 +0000)]
Versioning.

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

3 years agoBuild fix for CLoop after r227874.
mark.lam@apple.com [Wed, 31 Jan 2018 22:15:55 +0000 (22:15 +0000)]
Build fix for CLoop after r227874.
https://bugs.webkit.org/show_bug.cgi?id=182155
<rdar://problem/36286266>

Not reviewed.

Just needed support for lea of a LabelReference in cloop.rb (just like those
added for arm64.rb and x86.rb).

* offlineasm/cloop.rb:

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

3 years ago[RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousW...
zalan@apple.com [Wed, 31 Jan 2018 22:00:16 +0000 (22:00 +0000)]
[RenderTreeBuilder] Move RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers to RenderTreeBuilder.
https://bugs.webkit.org/show_bug.cgi?id=182348
<rdar://problem/37082837>

Reviewed by Antti Koivisto.

All the callsites are in the RenderTreeUpdater by now.

No change in functionality.

* rendering/RenderObject.cpp:
(WebCore::isAnonymousAndSafeToDelete): Deleted.
(WebCore::findDestroyRootIncludingAnonymous): Deleted.
(WebCore::RenderObject::removeFromParentAndDestroyCleaningUpAnonymousWrappers): Deleted.
* rendering/RenderObject.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::isAnonymousAndSafeToDelete):
(WebCore::findDestroyRootIncludingAnonymous):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::tearDownRenderers):
(WebCore::RenderTreeUpdater::tearDownTextRenderer):

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

3 years agoOccasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
timothy_horton@apple.com [Wed, 31 Jan 2018 21:39:49 +0000 (21:39 +0000)]
Occasional null deref under WebPageProxy::updateBackingStoreDiscardableState()
https://bugs.webkit.org/show_bug.cgi?id=182349
<rdar://problem/27822258>

Reviewed by Simon Fraser.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::updateBackingStoreDiscardableState):
m_drawingArea can be null during process launch and relaunch.

Cocoa ports don't use the result of setBackingStoreIsDiscardable(),
but they do run this code to keep it up to date.

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

3 years agoRelease assertion in Performance::resourceTimingBufferFullTimerFired when the resourc...
rniwa@webkit.org [Wed, 31 Jan 2018 21:07:36 +0000 (21:07 +0000)]
Release assertion in Performance::resourceTimingBufferFullTimerFired when the resource timing buffer is shrunk
https://bugs.webkit.org/show_bug.cgi?id=182319
<rdar://problem/36904312>

Reviewed by Chris Dumez.

Source/WebCore:

The crash was caused by a wrong release assertion. Handle author scripts shrinking the resource timing buffer
while resourcetimingbufferfull event is being dispatched.

Also fixed a bug that a superflous resourcetimingbufferfull event will be fired when new resource timing entries
are queued while resourcetimingbufferfull event is being dispatched.

Test: http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html
      http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html

* page/Performance.cpp:
(WebCore::Performance::resourceTimingBufferFullTimerFired):

LayoutTests:

Added regression tests for shrinking the resoruce timing buffer and queuing a new resource timing entry while
resourcetimingbufferfull event is being dispatched.

* http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry-expected.txt: Added.
* http/tests/performance/performance-resource-timing-resourcetimingbufferfull-queue-resource-entry.html: Added.
* http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt: Added.
* http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html: Added.

* http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash-expected.txt: Added.
* http/tests/performance/performance-resource-timing-resourcetimingbufferfull-shrinking-buffer-crash.html: Added.

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

3 years agoAdd the support for running StyleBench to run-benchmark
rniwa@webkit.org [Wed, 31 Jan 2018 20:58:20 +0000 (20:58 +0000)]
Add the support for running StyleBench to run-benchmark
https://bugs.webkit.org/show_bug.cgi?id=182323

Reviewed by Antti Koivisto.

Added the plan file and the patch needed to run StyleBench using run-benchmark as of r227863.

* Scripts/webkitpy/benchmark_runner/data/patches/webserver/StyleBench.patch: Added.
* Scripts/webkitpy/benchmark_runner/data/plans/stylebench.plan: Added.

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

3 years ago[GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
mcatanzaro@igalia.com [Wed, 31 Jan 2018 20:40:59 +0000 (20:40 +0000)]
[GTK] Move gir and typelib generation into ENABLE_INTROSPECTION conditional
https://bugs.webkit.org/show_bug.cgi?id=182308

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake:

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

3 years agoAdjusted expectations for fast/forms/searchfield-heights.html.
jlewis3@apple.com [Wed, 31 Jan 2018 19:37:34 +0000 (19:37 +0000)]
Adjusted expectations for fast/forms/searchfield-heights.html.
https://bugs.webkit.org/show_bug.cgi?id=181831

Unreviewed test gardening.

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

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

3 years ago[iOS WK2] API test DataInteractionTests.ExternalSourceDataTransferItemGetFolderAsEntr...
wenson_hsieh@apple.com [Wed, 31 Jan 2018 19:17:56 +0000 (19:17 +0000)]
[iOS WK2] API test DataInteractionTests.ExternalSourceDataTransferItemGetFolderAsEntry is failing after an SDK update
https://bugs.webkit.org/show_bug.cgi?id=182339
<rdar://problem/36041396>

Reviewed by Andy Estes.

This API test wasn't meant to be dependent on the size of an image generated using UIImagePNGRepresentation().
To make this test robust against changes to image encoding, write the raw data to the test folder instead and
check against the length of the data written.

* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
(testIconImageData):
(runTestWithTemporaryFolder):
(TestWebKitAPI::TEST):

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

3 years agocom.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration...
commit-queue@webkit.org [Wed, 31 Jan 2018 19:14:51 +0000 (19:14 +0000)]
com.apple.WebKit.Storage crashing at com.apple.WebCore: WebCore::SWServerRegistration::removeClientUsingRegistration
https://bugs.webkit.org/show_bug.cgi?id=182316
<rdar://problem/37025976>

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-31
Reviewed by Chris Dumez.

SWServer.m_clientToControllingWorker and SWServerRegistration.m_clientsUsingRegistration might currently get out of sync.
This is a defensive fix to ensure storage process will not crash in Release.
We keep the ASSERT as this probably means there is an abnormal situation that other patches might fix.

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::removeClientUsingRegistration):

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

3 years ago[macOS] MiniBrowser isn’t app-sandboxed
mitz@apple.com [Wed, 31 Jan 2018 19:13:31 +0000 (19:13 +0000)]
[macOS] MiniBrowser isn’t app-sandboxed
https://bugs.webkit.org/show_bug.cgi?id=182147

Reviewed by Sam Weinig.

Enable App Sandbox and add a temporary exception allowing read access to all files.

* MiniBrowser/Configurations/Base.xcconfig: Enabled ad-hoc code signing.
* MiniBrowser/Configurations/MiniBrowser.xcconfig: Specified the entitlements file to use.
* MiniBrowser/MiniBrowser.entitlements: Added. Enables App Sandbox with outbound networking
  and read access from /.
* MiniBrowser/MiniBrowser.xcodeproj/project.pbxproj: Added reference to new file.

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

3 years agoRemove StorageToWebProcessConnection::removeSWServerConnection
commit-queue@webkit.org [Wed, 31 Jan 2018 19:10:36 +0000 (19:10 +0000)]
Remove StorageToWebProcessConnection::removeSWServerConnection
https://bugs.webkit.org/show_bug.cgi?id=182305

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-31
Reviewed by Chris Dumez.

* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::removeSWServerConnection): Deleted.
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:

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

3 years agoCanonicalize aquiring the JSCell lock.
keith_miller@apple.com [Wed, 31 Jan 2018 18:57:13 +0000 (18:57 +0000)]
Canonicalize aquiring the JSCell lock.
https://bugs.webkit.org/show_bug.cgi?id=182320

Reviewed by Michael Saboff.

It's currently kinda annoying to figure out where
we aquire the a JSCell's lock. This patch adds a
helper to make it easier to grep...

* bytecode/UnlinkedCodeBlock.cpp:
(JSC::UnlinkedCodeBlock::visitChildren):
(JSC::UnlinkedCodeBlock::setInstructions):
(JSC::UnlinkedCodeBlock::shrinkToFit):
* runtime/ErrorInstance.cpp:
(JSC::ErrorInstance::finishCreation):
(JSC::ErrorInstance::materializeErrorInfoIfNeeded):
(JSC::ErrorInstance::visitChildren):
* runtime/JSArray.cpp:
(JSC::JSArray::shiftCountWithArrayStorage):
(JSC::JSArray::unshiftCountWithArrayStorage):
* runtime/JSCell.h:
(JSC::JSCell::cellLock):
* runtime/JSObject.cpp:
(JSC::JSObject::visitButterflyImpl):
(JSC::JSObject::convertContiguousToArrayStorage):
* runtime/JSPropertyNameEnumerator.cpp:
(JSC::JSPropertyNameEnumerator::visitChildren):
* runtime/SparseArrayValueMap.cpp:
(JSC::SparseArrayValueMap::add):
(JSC::SparseArrayValueMap::remove):
(JSC::SparseArrayValueMap::visitChildren):

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

3 years ago[Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
graouts@webkit.org [Wed, 31 Jan 2018 17:35:15 +0000 (17:35 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/start-support tests back on
https://bugs.webkit.org/show_bug.cgi?id=182297

Reviewed by Jon Lee and Eric Carlson.

Source/WebCore:

We identified one cause of flakiness when turning those tests back on and fix it in this patch. There would be
cases where the play/pause button would never actually become visible because we would first set it as one of
the buttons in the left container in the bottom controls bar before we would identify that we should show the
prominent play/pause button, and then once we did, we would add it as a child to the InlineMediaControls. But,
because the actual layout of the ButtonsContainer would happen in a rAF due to being a layout() method, we would
remove the play/pause button from the InlineMediaControls and set it as a child of the left container even
though it wasn't visible.

Performing the layout of a ButtonsContainer should really happen immediately when we set the buttons, so in this
patch we remove the "buttons" property and clients of ButtonsContainer can simply add or remove children which
will be laid out in a row. To support this, we've added two notification methods to LayoutNode, one that indicates
when children have changed, didChangeChildren(), which we override in ButtonsContainer to perform a synchronous
layout. The other method is willRemoveChild() which we also override in ButtonsContainer, this time to reset
the "x" and "visible" properties which we set while performing layout.

This fixes flakiness for media/modern-media-controls/start-support/start-support-click-to-start.html, and maybe
other modern-media-controls tests that could have been affected by this unexpected behavior.

* Modules/modern-media-controls/controls/buttons-container.js:
(ButtonsContainer.prototype.willRemoveChild):
(ButtonsContainer.prototype.didChangeChildren):
(ButtonsContainer.prototype.layout):
(ButtonsContainer.prototype.get buttons): Deleted.
(ButtonsContainer.prototype.set buttons): Deleted.
* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):
(InlineMediaControls.prototype._updateBottomControlsBarLabel):
(InlineMediaControls.prototype._addTopRightBarWithMuteButtonToChildren):
(InlineMediaControls):
* Modules/modern-media-controls/controls/layout-node.js:
(LayoutNode.prototype.set children):
(LayoutNode.prototype.addChild):
(LayoutNode.prototype.removeChild):
(LayoutNode.prototype.willRemoveChild):
(LayoutNode.prototype.didChangeChildren):
* Modules/modern-media-controls/controls/macos-fullscreen-media-controls.js:
(MacOSFullscreenMediaControls.prototype.layout):
* Modules/modern-media-controls/media/media-controller.js: Drive-by fix to correctly set the value passed as
data-auto-hide-delay on a <video> element.

LayoutTests:

Update tests to account for the new variable name for the playPauseButton and ensure we only listen to the
fullscreen event once to avoid flakiness in cases where we might exit fullscreen before the test completes.

We also update other tests that tested the behavior of ButtonsContainer.

* media/modern-media-controls/buttons-container/buttons-container-buttons-property-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-buttons-property.html:
* media/modern-media-controls/buttons-container/buttons-container-constructor-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-constructor.html:
* media/modern-media-controls/buttons-container/buttons-container-layout-expected.txt:
* media/modern-media-controls/buttons-container/buttons-container-layout.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-rtl.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-top-right-controls-bar-hidden-when-mute-button-disabled.html:
* media/modern-media-controls/pip-support/pip-support-click.html:
* media/modern-media-controls/start-support/start-support-click-to-start.html:
* media/modern-media-controls/start-support/start-support-fullscreen.html:
* media/modern-media-controls/start-support/start-support-lowPowerMode-expected.txt:
* media/modern-media-controls/start-support/start-support-lowPowerMode.html:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

3 years ago[RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
zalan@apple.com [Wed, 31 Jan 2018 16:45:30 +0000 (16:45 +0000)]
[RenderTreeBuilder] Move RenderMultiColumnFlow::resolveMovedChild to RenderTreeBuilder.
https://bugs.webkit.org/show_bug.cgi?id=182315
<rdar://problem/37048160>

Reviewed by Antti Koivisto.

resolveMovedChild() is only called from RenderTreeBuilder.

No change in functionality.

* rendering/RenderFragmentedFlow.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::resolveMovedChild const): Deleted.
* rendering/RenderMultiColumnFlow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::resolveMovedChildForMultiColumnFlow):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlockFlow.cpp:
(WebCore::RenderTreeBuilder::BlockFlow::insertChild):
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::insertChild):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::resolveMovedChild):
* rendering/updating/RenderTreeBuilderMultiColumn.h:

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

3 years ago[GStreamer] Silent WebAudio buffers support
philn@webkit.org [Wed, 31 Jan 2018 16:14:32 +0000 (16:14 +0000)]
[GStreamer] Silent WebAudio buffers support
https://bugs.webkit.org/show_bug.cgi?id=143869

Reviewed by Carlos Garcia Campos.

* platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
(webKitWebAudioSrcLoop): Flag silent buffers as GAP buffers. This
enables downstream elements to optimize the buffer processing.

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

3 years ago[JHBuild] Add gstreamer-vaapi in moduleset
philn@webkit.org [Wed, 31 Jan 2018 16:11:57 +0000 (16:11 +0000)]
[JHBuild] Add gstreamer-vaapi in moduleset
https://bugs.webkit.org/show_bug.cgi?id=182283

Reviewed by Carlos Alberto Lopez Perez.

GStreamer-VAAPI is required for hardware-accelerated video
playback support on Intel and AMD (using radeosi driver)
platforms.

* gstreamer/jhbuild.modules: Add gstreamer-vaapi.
* gtk/install-dependencies: Install libva.
* wpe/install-dependencies: Ditto.
* Scripts/webkitpy/port/gtk.py:
(GtkPort.setup_environ_for_server): Disable va-api support when
testing because it's incompatible with Mesa's softGL driver.

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

3 years ago[WPE] Update jhbuild dependencies
cturner@igalia.com [Wed, 31 Jan 2018 15:55:37 +0000 (15:55 +0000)]
[WPE] Update jhbuild dependencies
https://bugs.webkit.org/show_bug.cgi?id=182286

This upgrades the following packages,
glib 2.44.1 -> 2.54.3
glib-networking 2.42.0 -> 2.54.1
libsoup 2.48.0 -> 2.60.3

The initial reason for performing these upgrades was that when
visiting https://youtube.com, WPE was getting TLS certificate
errors. After upgrading glib-networking, these were fixed, but the
upgrade introduced dependencies on newer versions of the other
packages upgraded in this commit.

The upgrade to glib caused a linking error in gstreamer, the
following errors were being logged during linking,

//usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_glib_script_from_script'
//usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_glib_get_unicode_funcs'
//usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined reference to `hb_glib_script_to_script'

This was fixed by adding the glib package built in the jhbuild to
harfbuzz.

Finally, the upgrade of glib caused the glib-warning-fix.patch to
no longer apply, so this patch was removed.

Reviewed by Michael Catanzaro.

* wpe/jhbuild.modules: Added dependecies.
* wpe/patches/glib-warning-fix.patch: Removed.

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

3 years agoUnreviewed gardening. Update expectations of several WebDriver tests.
carlosgc@webkit.org [Wed, 31 Jan 2018 13:47:44 +0000 (13:47 +0000)]
Unreviewed gardening. Update expectations of several WebDriver tests.

* TestExpectations.json:

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

3 years agoJSC incorrectly interpreting script, sets Global Property instead of Global Lexical...
sbarati@apple.com [Wed, 31 Jan 2018 10:18:28 +0000 (10:18 +0000)]
JSC incorrectly interpreting script, sets Global Property instead of Global Lexical variable (LiteralParser / JSONP path)
https://bugs.webkit.org/show_bug.cgi?id=182074
<rdar://problem/36846261>

Reviewed by Mark Lam.

JSTests:

* stress/jsonp-program-evaluate-path-must-consider-global-lexical-environment.js: Added.
(assert):
(let.func):
(let.o.foo):
(varFunc):

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/import-scripts-updated-flag.https-expected.txt:

Source/JavaScriptCore:

This patch teaches the JSONP evaluator about the global lexical environment.
Before, it was using the global object as the global scope, but that's wrong.
The global lexical environment is the first node in the global scope chain.

* interpreter/Interpreter.cpp:
(JSC::Interpreter::executeProgram):
* jsc.cpp:
(GlobalObject::finishCreation):
(shellSupportsRichSourceInfo):
(functionDisableRichSourceInfo):
* runtime/LiteralParser.cpp:
(JSC::LiteralParser<CharType>::tryJSONPParse):
* runtime/LiteralParser.h:

LayoutTests:

* http/tests/security/regress-52192-expected.txt:

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

3 years agoclean up pushToSaveImmediateWithoutTouchingRegisters a bit
sbarati@apple.com [Wed, 31 Jan 2018 10:04:57 +0000 (10:04 +0000)]
clean up pushToSaveImmediateWithoutTouchingRegisters a bit
https://bugs.webkit.org/show_bug.cgi?id=181774

Reviewed by JF Bastien.

This function on ARM64 was considering what to do with the scratch
register. And conditionally invalidated what was in it. This is not
relevant though, since the function always recovers what was in that
register. This patch just switches it to using dataTempRegister
directly and updates the comment to describe why it can do so safely.

* assembler/MacroAssemblerARM64.h:
(JSC::MacroAssemblerARM64::pushToSaveImmediateWithoutTouchingRegisters):

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

3 years ago[EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
calvaris@igalia.com [Wed, 31 Jan 2018 09:19:56 +0000 (09:19 +0000)]
[EME] Fix NavigatorEME::tryNextSupportedConfiguration typo
https://bugs.webkit.org/show_bug.cgi?id=182324

Reviewed by Žan Doberšek.

* Modules/encryptedmedia/NavigatorEME.cpp:
(WebCore::tryNextSupportedConfiguration): Fix
candidateCofiguration typo.

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

3 years agoUnreviewed, rolling out r227782.
carlosgc@webkit.org [Wed, 31 Jan 2018 09:17:50 +0000 (09:17 +0000)]
Unreviewed, rolling out r227782.

It didn't fix the problem

Reverted changeset:

"Unreviewed. Try to avoid webdriver tests step timing out in
the bots."
https://trac.webkit.org/changeset/227782

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

3 years agoREGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
carlosgc@webkit.org [Wed, 31 Jan 2018 09:14:33 +0000 (09:14 +0000)]
REGRESSION(r227544): [GTK] contextMenuEvent is NULL on CONTEXT_MENU call
https://bugs.webkit.org/show_bug.cgi?id=182224

Reviewed by Michael Catanzaro.

Move the gestures handling to WebKitWebViewBase. This patch adds GestureControllerClient class, created and
implemented by WebKitWebViewBase and used by GestureController instead of the WebPageProxy. This way we ensure
events are handled consistently.

* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::doneWithTouchEvent): Cast the GdkEvent since GestureController no longer works wirth
const GdkEvents.
(WebKit::PageClientImpl::zoom): Use webkit_web_view_set_zoom_level() in case of WebKitWebView or
WebPageProxy::setPageZoomFactor() otherwise.
* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(ClickCounter::currentClickCountForGdkButtonEvent): Receive a GdkEvent to avoid casts.
(webkitWebViewBaseHandleMouseEvent): Helper function to handle mouse events.
(webkitWebViewBaseButtonPressEvent): Use webkitWebViewBaseHandleMouseEvent.
(webkitWebViewBaseButtonReleaseEvent): Ditto.
(webkitWebViewBaseHandleWheelEvent): Helper function to handle wheel events.
(webkitWebViewBaseScrollEvent): Use webkitWebViewBaseHandleWheelEvent.
(webkitWebViewBaseMotionNotifyEvent): Use webkitWebViewBaseHandleMouseEvent.
(webkitWebViewBaseCrossingNotifyEvent): Ditto.
(webkitWebViewBaseGestureController): Pass the widget and client to GestureController.
* UIProcess/gtk/GestureController.cpp:
(WebKit::GestureController::GestureController): Receives a widget and client now.
(WebKit::GestureController::handleEvent): Remove the const.
(WebKit::GestureController::Gesture::Gesture): Initialize client.
(WebKit::GestureController::Gesture::handleEvent): Remove the const.
(WebKit::GestureController::DragGesture::startDrag): Use the client instead of WebPageProxy.
(WebKit::GestureController::DragGesture::handleDrag): Ditto.
(WebKit::GestureController::DragGesture::handleTap): Ditto.
(WebKit::GestureController::DragGesture::begin): Ignore the const returned by gtk_gesture_get_last_event().
(WebKit::GestureController::DragGesture::update): Ditto.
(WebKit::GestureController::DragGesture::end): Ditto.
(WebKit::GestureController::DragGesture::DragGesture): Receives a widget and client now.
(WebKit::GestureController::SwipeGesture::startMomentumScroll): Use the client instead of WebPageProxy.
(WebKit::GestureController::SwipeGesture::swipe): Ignore the const returned by gtk_gesture_get_last_event().
(WebKit::GestureController::SwipeGesture::SwipeGesture): Receives a widget and client now.
(WebKit::GestureController::ZoomGesture::begin): Start the zoom.
(WebKit::GestureController::ZoomGesture::startZoom): Use the client instead of WebPageProxy.
(WebKit::GestureController::ZoomGesture::handleZoom): Ditto.
(WebKit::GestureController::ZoomGesture::ZoomGesture): Receives a widget and client now.
(WebKit::GestureController::LongPressGesture::longPressed): Use the client instead of WebKitWebView.
(WebKit::GestureController::LongPressGesture::pressed): Ignore the const returned by gtk_gesture_get_last_event().
(WebKit::GestureController::LongPressGesture::LongPressGesture): Receives a widget and client now.
(WebKit::GestureController::Gesture::simulateMouseClick): Deleted.
(WebKit::createScrollEvent): Deleted.
* UIProcess/gtk/GestureController.h:

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

3 years agoWeb Automation: cookies returned by automation should have expiry time in seconds
carlosgc@webkit.org [Wed, 31 Jan 2018 09:09:45 +0000 (09:09 +0000)]
Web Automation: cookies returned by automation should have expiry time in seconds
https://bugs.webkit.org/show_bug.cgi?id=182293

Reviewed by Brian Burg.

When creating a WebCore::Cookie from a WebDriver object we convert the given expiry time to milliseconds, but
when creating a WebDriver object from a WebCore::Cookie we are keeping the milliseconds. We should convert to
seconds for consistency, so that the WebDriver always handles seconds.

Fixes: imported/w3c/webdriver/tests/cookies/get_named_cookie.py::test_get_named_cookie

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::buildObjectForCookie): Convert expiry to seconds.

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

3 years agoWebDriver: add domains to server config in w3c tests
carlosgc@webkit.org [Wed, 31 Jan 2018 09:08:37 +0000 (09:08 +0000)]
WebDriver: add domains to server config in w3c tests
https://bugs.webkit.org/show_bug.cgi?id=182294

Reviewed by Carlos Alberto Lopez Perez.

Several cookie tests expect server_config to have a domains key.

Fixes: imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_domain_cookie
       imported/w3c/webdriver/tests/cookies/add_cookie.py::test_add_session_cookie_with_leading_dot_character_in_domain

* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.__init__):

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

3 years agoUnreviewed. Update W3C WebDriver imported tests.
carlosgc@webkit.org [Wed, 31 Jan 2018 09:07:43 +0000 (09:07 +0000)]
Unreviewed. Update W3C WebDriver imported tests.

Tools:

Show full pytest failure logs.

pytest truncates long lists when printing a failed assertion.
This is not great for debugging and arguably it should be the
default to show the full diff when comparing lists.

* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(run):

WebDriverTests:

* imported/w3c/importer.json:
* imported/w3c/tools/wptrunner/requirements_sauce.txt:
* imported/w3c/tools/wptrunner/tox.ini:
* imported/w3c/tools/wptrunner/wptrunner/browsers/sauce.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executormarionette.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/pytestrunner/runner.py:
* imported/w3c/tools/wptrunner/wptrunner/metadata.py:
* imported/w3c/webdriver/OWNERS:
* imported/w3c/webdriver/tests/__init__.py:
* imported/w3c/webdriver/tests/actions/mouse.py:
* imported/w3c/webdriver/tests/actions/mouse_dblclick.py:
* imported/w3c/webdriver/tests/actions/support/mouse.py:
* imported/w3c/webdriver/tests/cookies/add_cookie.py:
* imported/w3c/webdriver/tests/cookies/delete_cookie.py:
* imported/w3c/webdriver/tests/cookies/get_named_cookie.py:
* imported/w3c/webdriver/tests/element_send_keys/form_controls.py: Added.
* imported/w3c/webdriver/tests/element_send_keys/interactability.py:
* imported/w3c/webdriver/tests/interaction/element_clear.py:
* imported/w3c/webdriver/tests/support/asserts.py:

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

3 years agoUnreviewed iOS build fix.
rniwa@webkit.org [Wed, 31 Jan 2018 08:19:35 +0000 (08:19 +0000)]
Unreviewed iOS build fix.

* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

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

3 years ago[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as doubl...
commit-queue@webkit.org [Wed, 31 Jan 2018 07:28:23 +0000 (07:28 +0000)]
[WinCairo] syntheticBoldOffset makes a font with embedded bitmap fonts shown as double strike in HiDPI
https://bugs.webkit.org/show_bug.cgi?id=182093

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-01-30
Reviewed by Alex Christensen.

WebKit draws texts doubly by shifting 1px for fonts without bold
fonts but bold font is desired. This synthetic bold method draws
fonts with embedded bitmap fonts look like double strike in HiDPI.

No new tests (Covered by the existing tests).

* platform/graphics/win/FontCacheWin.cpp:
(WebCore::createGDIFont): Overwrite lfWeight if the desired weight
is bold and matched font weight is't bold and in WinCairo port.
Fix wrong indentation.

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

3 years agoAdd callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunn...
wilander@apple.com [Wed, 31 Jan 2018 06:01:54 +0000 (06:01 +0000)]
Add callbacks to testRunner.statisticsSetShouldPartitionCookiesForHost() and testRunner.statisticsUpdateCookiePartitioning()
https://bugs.webkit.org/show_bug.cgi?id=181958
https://bugs.webkit.org/show_bug.cgi?id=182072
<rdar://problem/36801804>
<rdar://problem/36845795>

Reviewed by Brent Fulgham.

Because of the asynchronous nature of XPC and cookies,
we need callbacks in these TestRunner functions so that
the layout tests can wait for state changes to finish
before checking test conditions.

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsUpdateCookiePartitioning):
(WKWebsiteDataStoreSetStatisticsShouldPartitionCookiesForHost):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning]):
(-[WKWebsiteDataStore _resourceLoadStatisticsUpdateCookiePartitioning:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:]):
(-[WKWebsiteDataStore _resourceLoadStatisticsSetShouldPartitionCookies:forHost:completionHandler:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::resourceLoadStatisticsUpdated):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::logNonRecentUserInteraction):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdate):
(WebKit::WebResourceLoadStatisticsStore::scheduleCookiePartitioningUpdateForDomains):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearPartitioningStateForDomains):
(WebKit::WebResourceLoadStatisticsStore::mergeWithDataFromDecoder):
(WebKit::WebResourceLoadStatisticsStore::clearInMemory):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioning):
(WebKit::WebResourceLoadStatisticsStore::updateCookiePartitioningForDomains):
(WebKit::WebResourceLoadStatisticsStore::clearPartitioningStateForDomains):
* UIProcess/WebResourceLoadStatisticsStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsUpdateCookiePartitioning):
(WTR::TestRunner::statisticsSetShouldPartitionCookiesForHost):
(WTR::TestRunner::statisticsCallDidSetPartitionOrBlockCookiesForHostCallback):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didSetPartitionOrBlockCookiesForHost):
* WebKitTestRunner/TestInvocation.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::statisticsUpdateCookiePartitioning):
(WTR::TestController::statisticsSetShouldPartitionCookiesForHost):

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt:
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect-expected.txt:
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt:
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html:
* http/tests/resourceLoadStatistics/third-party-cookie-with-and-without-user-interaction.html:
* platform/mac-wk2/TestExpectations:

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

3 years agoApply poisoning to TypedArray vector pointers.
mark.lam@apple.com [Wed, 31 Jan 2018 05:23:52 +0000 (05:23 +0000)]
Apply poisoning to TypedArray vector pointers.
https://bugs.webkit.org/show_bug.cgi?id=182155
<rdar://problem/36286266>

Reviewed by JF Bastien.

Source/JavaScriptCore:

The TypeArray's vector pointer is now poisoned.  The poison value is chosen based
on a TypeArray's jsType.  The JSType must be between FirstTypedArrayType and
LastTypedArrayType.  At runtime, we enforce that the index is well-behaved by
masking it against TypedArrayPoisonIndexMask.  TypedArrayPoisonIndexMask (16) is
the number of TypedArray types (10) rounded up to the next power of 2.
Accordingly, we reserve an array of TypedArrayPoisonIndexMask poisons so that we
can use index masking on the index, and be guaranteed that the masked index will
be within bounds of the poisons array.

1. Fixed both DFG and FTL versions of compileGetTypedArrayByteOffset() to not
   do any unnecessary work if the TypedArray vector is null.

   FTL's cagedMayBeNull() is no longer needed because it is only used by
   compileGetTypedArrayByteOffset(), and we need to enhance it to handle unpoisoning
   in a TypedArray specific way.  So, might as well do the work inline in
   compileGetTypedArrayByteOffset() instead.

2. Removed an unnecessary null-check in DFGSpeculativeJIT's compileNewTypedArrayWithSize()
   because there's already a null check above it that ensures that sizeGPR is
   never null.

3. In LLInt's _llint_op_get_by_val, move the TypedArray length check before the
   loading of the vector for unpoisoning and uncaging.  We don't need the vector
   if the length is 0.

Implementation notes on the need to null check the TypeArray vector:

1. DFG::SpeculativeJIT::jumpForTypedArrayIsNeuteredIfOutOfBounds() does not need a
   m_poisonedVector null check because the function is a null check.

2. DFG::SpeculativeJIT::compileGetIndexedPropertyStorage() does not need a
   m_poisonedVector null check because it is followed by a call to
   cageTypedArrayStorage() which assumes that storageReg cannot be null.

3. DFG::SpeculativeJIT::compileGetTypedArrayByteOffset() already has a
   m_poisonedVector null check.

4. DFG::SpeculativeJIT::compileNewTypedArrayWithSize() does not need a vector null
   check because the poisoning code is preceded by a sizeGPR null check, which
   ensures that the storageGPR (vector to be poisoned) is not null.

5. FTL's compileGetIndexedPropertyStorage() does not need a m_poisonedVector null
   check because it is followed by a call to caged() which assumes that the
   vector cannot be null.

6. FTL's compileGetTypedArrayByteOffset() already has a m_poisonedVector null check.

7. FTL's compileNewTypedArray() does not need a vector null check because the
   poisoning code is preceded by a size null check, which ensures that the
   storage (vector to be poisoned) is not null.

8. FTL's speculateTypedArrayIsNotNeutered() does not need a
   m_poisonedVector null check because the function is a null check.

9. IntrinsicGetterAccessCase::emitIntrinsicGetter()'s TypedArrayByteOffsetIntrinsic
   case needs a null check so that it does not try to unpoison a null vector.

10. JIT::emitIntTypedArrayGetByVal() does not need a vector null check because
    we already do a length check even before loading the vector.

11. JIT::emitFloatTypedArrayGetByVal() does not need a vector null check because
    we already do a length check even before loading the vector.

12. JIT::emitIntTypedArrayPutByVal() does not need a vector null check because
    we already do a length check even before loading the vector.

13. JIT::emitFloatTypedArrayPutByVal() does not need a vector null check because
    we already do a length check even before loading the vector.

14. LLInt's loadTypedArrayCaged() does not need a vector null check because its
    client will do a TypedArray length check before calling it.

* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::checkArray):
* dfg/DFGNode.h:
(JSC::DFG::Node::hasArrayMode):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::jumpForTypedArrayIsNeuteredIfOutOfBounds):
(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
(JSC::DFG::SpeculativeJIT::compileNewTypedArrayWithSize):
* ftl/FTLAbstractHeapRepository.h:
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetIndexedPropertyStorage):
(JSC::FTL::DFG::LowerDFGToB3::compileGetTypedArrayByteOffset):
(JSC::FTL::DFG::LowerDFGToB3::compileNewTypedArray):
(JSC::FTL::DFG::LowerDFGToB3::speculateTypedArrayIsNotNeutered):
(JSC::FTL::DFG::LowerDFGToB3::cagedMayBeNull): Deleted.
* jit/IntrinsicEmitter.cpp:
(JSC::IntrinsicGetterAccessCase::emitIntrinsicGetter):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitIntTypedArrayGetByVal):
(JSC::JIT::emitFloatTypedArrayGetByVal):
(JSC::JIT::emitIntTypedArrayPutByVal):
(JSC::JIT::emitFloatTypedArrayPutByVal):
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter64.asm:
* offlineasm/arm64.rb:
* offlineasm/x86.rb:
* runtime/CagedBarrierPtr.h:
* runtime/JSArrayBufferView.cpp:
(JSC::JSArrayBufferView::JSArrayBufferView):
(JSC::JSArrayBufferView::finalize):
(JSC::JSArrayBufferView::neuter):
* runtime/JSArrayBufferView.h:
(JSC::JSArrayBufferView::vector const):
(JSC::JSArrayBufferView::offsetOfPoisonedVector):
(JSC::JSArrayBufferView::poisonFor):
(JSC::JSArrayBufferView::Poison::key):
(JSC::JSArrayBufferView::offsetOfVector): Deleted.
* runtime/JSCPoison.cpp:
(JSC::initializePoison):
* runtime/JSCPoison.h:
* runtime/JSGenericTypedArrayViewInlines.h:
(JSC::JSGenericTypedArrayView<Adaptor>::estimatedSize):
(JSC::JSGenericTypedArrayView<Adaptor>::visitChildren):
(JSC::JSGenericTypedArrayView<Adaptor>::slowDownAndWasteMemory):
* runtime/JSObject.h:

Source/WTF:

1. Added the ability to poison a CagedPtr.

2. Prevent CagedPtr from being implicitly instantiated, and add operator= methods
   instead.  This is because implicitly instantiated CagedPtrs with a poisoned
   trait may silently use a wrong poison value.

* wtf/CagedPtr.h:
(WTF::CagedPtr::CagedPtr):
(WTF::CagedPtr::get const):
(WTF::CagedPtr::operator=):

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

3 years agoREGRESSION(r227550): Resource timing API is disabled on macOS
rniwa@webkit.org [Wed, 31 Jan 2018 05:15:59 +0000 (05:15 +0000)]
REGRESSION(r227550): Resource timing API is disabled on macOS
https://bugs.webkit.org/show_bug.cgi?id=182318

Reviewed by Chris Dumez.

Resource timing API should be enabled by default all versions of macOS we support now.

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

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

3 years ago[Win] Warning fix.
commit-queue@webkit.org [Wed, 31 Jan 2018 04:47:43 +0000 (04:47 +0000)]
[Win] Warning fix.
https://bugs.webkit.org/show_bug.cgi?id=177007

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-01-30
Reviewed by Yusuke Suzuki.

Source/JavaScriptCore:

* interpreter/StackVisitor.cpp:
(JSC::StackVisitor::Frame::dump const):
Changed the type of locationRawBits from unsigned to uintptr_t.
* runtime/IntlNumberFormat.cpp:
(JSC::IntlNumberFormat::createNumberFormat):
Initialize 'style' to avoid potentially uninitialized local variable warning.

Source/WTF:

A 32 bit integer should not be casted to a pointer directly in 64
bit Windows. It should be casted to a uintptr_t beforehand.

Rules for Using Pointers (Windows)
https://msdn.microsoft.com/library/windows/desktop/aa384242

* wtf/ThreadingWin.cpp (InvalidThread): Casted 0xbbadbeef to uintptr_t.

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

3 years ago[webkitpy] Config file for apache is copied twice.
commit-queue@webkit.org [Wed, 31 Jan 2018 04:27:41 +0000 (04:27 +0000)]
[webkitpy] Config file for apache is copied twice.
https://bugs.webkit.org/show_bug.cgi?id=182131

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-01-30
Reviewed by Daniel Bates.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__):
(LayoutTestApacheHttpd._copy_apache_config_file):
(LayoutTestApacheHttpd._get_apache_config_file_path): Deleted.

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

3 years agoFetchResponse should support ConsumeData callback on chunk data is received
gskachkov@gmail.com [Wed, 31 Jan 2018 04:23:50 +0000 (04:23 +0000)]
FetchResponse should support ConsumeData callback on chunk data is received
https://bugs.webkit.org/show_bug.cgi?id=181600
<rdar://problem/36932547>

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html: Added.
* web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-body-loaded-in-chunk-worker.js: Added.

Source/WebCore:

Test: imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-body-loaded-in-chunk.https.html

Apply same read-by-chunk strategy for body coming from network as for body coming from ReadableStream.
Refactor to have one consumeBodyReceivedByChunk method for both cases.
This allows streaming data from a service worker to WebProcess as would be done by NetworkProcess.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::addAll):
(WebCore::DOMCache::put):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didSucceed):
(WebCore::FetchResponse::BodyLoader::didReceiveData):
(WebCore::FetchResponse::BodyLoader::consumeDataByChunk):
(WebCore::FetchResponse::consumeBody):
(WebCore::FetchResponse::consumeBodyReceivedByChunk):
* Modules/fetch/FetchResponse.h:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):

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

3 years agoWKWebView layout is sometimes wrong after rotation on iPhone X
timothy_horton@apple.com [Wed, 31 Jan 2018 03:02:59 +0000 (03:02 +0000)]
WKWebView layout is sometimes wrong after rotation on iPhone X
https://bugs.webkit.org/show_bug.cgi?id=182304
<rdar://problem/34158671>

Reviewed by Simon Fraser.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _computedContentInset]):
(-[WKWebView _scrollViewSystemContentInset]):
(activeMinimumLayoutSize):
It turns out that it is not always safe to look at the safe area insets of
children from inside layoutSubviews, even after the call to super.

Instead, make use of the fact that WKScrollView and WKWebView have identical
coordinate spaces, and map WKWebView's safe area insets into the WKScrollView.
It's safe to use the scroll view's affected-edges and contentScrollInset,
because those aren't updated at the same outside-of-layout time that
safe area insets are.

We could alternatively move all calls to activeMinimumLayoutSize outside
of layoutSubviews, but that seems like a larger and riskier change.

All attempts to write a test have failed; this depends heavily on use of
autolayout and the mechanism by which the system updates system-owned
safe area insets during device rotation.

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

3 years agoMove http/wpt/service-workers/clone-opaque-being-loaded-response.https.html to use...
commit-queue@webkit.org [Wed, 31 Jan 2018 01:35:34 +0000 (01:35 +0000)]
Move http/wpt/service-workers/clone-opaque-being-loaded-response.https.html to use HTTP
https://bugs.webkit.org/show_bug.cgi?id=182202
<rdar://problem/36912402>

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-30
Reviewed by Chris Dumez.
Follow-up to ensure subresource load is also done in HTTP and not HTTPS

* http/wpt/service-workers/clone-opaque-being-loaded-response-worker.js:

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

3 years agoJSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
don.olmstead@sony.com [Wed, 31 Jan 2018 00:53:48 +0000 (00:53 +0000)]
JSExports.h should be included as <JavaScriptCore/JSExportMacros.h>
https://bugs.webkit.org/show_bug.cgi?id=182312

Reviewed by Michael Catanzaro.

Source/WebCore:

No new tests. No change in behavior.

* config.h:

Source/WebKit:

* config.h:

Source/WebKitLegacy/cf:

* WebCoreSupport/WebInspectorClientCF.cpp:

Source/WebKitLegacy/mac:

* WebKitPrefix.h:

Tools:

* DumpRenderTree/config.h:
* TestWebKitAPI/config.h:
* WebKitTestRunner/config.h:

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

3 years agoMarked fast/workers/worker-cloneport.html as flaky on macOS Release.
jlewis3@apple.com [Wed, 31 Jan 2018 00:46:02 +0000 (00:46 +0000)]
Marked fast/workers/worker-cloneport.html as flaky on macOS Release.
https://bugs.webkit.org/show_bug.cgi?id=182007

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoWeb Inspector: Replace Object.shallowMerge with ES2018 spread operator
webkit@devinrousso.com [Wed, 31 Jan 2018 00:39:18 +0000 (00:39 +0000)]
Web Inspector: Replace Object.shallowMerge with ES2018 spread operator
https://bugs.webkit.org/show_bug.cgi?id=182219

Reviewed by Brian Burg.

* UserInterface/Base/Utilities.js:
(Object.shallowMerge): Deleted.
* UserInterface/Base/DOMUtilities.js:
(WI.linkifyNodeReference):
* UserInterface/Base/Main.js:
(WI.handlePossibleLinkClick):
(WI.openURL):
(WI.showSourceCodeLocation):
(WI.showOriginalUnformattedSourceCodeLocation):
(WI.showOriginalOrFormattedSourceCodeLocation):
(WI.showOriginalOrFormattedSourceCodeTextRange):
(WI.linkifyLocation):
* UserInterface/Views/DOMTreeElement.js:
(WI.DOMTreeElement.prototype._insertAdjacentHTML):
* UserInterface/Views/WebSocketContentView.js:
(WI.WebSocketContentView.prototype._addRow):

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

3 years agoStyleBench: Generate more mutation steps
rniwa@webkit.org [Wed, 31 Jan 2018 00:31:49 +0000 (00:31 +0000)]
StyleBench: Generate more mutation steps
https://bugs.webkit.org/show_bug.cgi?id=182291

Rubber-stamped by Antti Koivisto

Use zero-based index instead of one-based index.

* StyleBench/resources/tests.js:
(makeSteps):

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

3 years agoUse double-quotes when serializing font-feature-settings
commit-queue@webkit.org [Wed, 31 Jan 2018 00:08:44 +0000 (00:08 +0000)]
Use double-quotes when serializing font-feature-settings
https://bugs.webkit.org/show_bug.cgi?id=182201

Source/WebCore:

According to the CSSOM spec, all strings should be serialized with double-quotes. The feature
tag value was previously serialized with single-quotes; change this to double-quotes to match
the spec and non-WebKit browsers.

Patch by Chris Nardi <cnardi@chromium.org> on 2018-01-30
Reviewed by Myles C. Maxfield.

Updated css3/font-feature-settings-parsing.html, fast/css/inherited-properties-rare-text.html,
and fast/text/font-face-javascript.html.

* css/CSSFontFeatureValue.cpp:
(WebCore::CSSFontFeatureValue::customCSSText const):

LayoutTests:

Update tests with double-quotes instead of single-quotes.

Patch by Chris Nardi <cnardi@chromium.org> on 2018-01-30
Reviewed by Myles C. Maxfield.

* css3/font-feature-settings-parsing-expected.txt:
* css3/font-feature-settings-parsing.html:
* fast/css/inherited-properties-rare-text-expected.txt:
* fast/text/font-face-javascript-expected.txt:
* fast/text/font-face-javascript.html:

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

3 years agoUnreviewed build fix for JSCOnly after r227845.
don.olmstead@sony.com [Tue, 30 Jan 2018 23:13:27 +0000 (23:13 +0000)]
Unreviewed build fix for JSCOnly after r227845.
https://bugs.webkit.org/show_bug.cgi?id=182274

* wtf/PlatformJSCOnly.cmake:

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

3 years agoAdd telemetry to track storage access API adoption
bfulgham@apple.com [Tue, 30 Jan 2018 23:12:03 +0000 (23:12 +0000)]
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>

Reviewed by Chris Dumez.

Part 2: Add telemetry for the Storage Access API case

Source/WebCore:

Adds a new convenience method to identify origin/page/frame combinations that
have been granted access to the Storage Access API. This is used for debug
logging in the NetworkProcess. It is not used in production builds.

* platform/network/NetworkStorageSession.h:
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::hasStorageAccessForFrame const): Added.

Source/WebKit:

This change increments a counter when an origin is loaded in a first part context because
it was granted Storage Access API permissions.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation const): Add logging to indicate
loads that happened with the Storage Access API enabled.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::requestStorageAccess): Increment counter for
loads using the new API.

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

3 years ago[iOS] API test UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentation...
wenson_hsieh@apple.com [Tue, 30 Jan 2018 23:05:57 +0000 (23:05 +0000)]
[iOS] API test UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentations fails after r223440
https://bugs.webkit.org/show_bug.cgi?id=182307
<rdar://problem/36041485>

Reviewed by Ryosuke Niwa.

Adjusts a failing API test that we forgot to rebaseline after r223440, which ensures that the result of reading
"text/html" from the DataTransfer is sanitized markup. To do this, teach the test harness
(dump-datatransfer-types.html) to ignore inline styles in markup if a flag is set, and then set that flag in
UIPasteboardTests.DataTransferGetDataWhenPastingPlatformRepresentations.

* TestWebKitAPI/Tests/WebKitCocoa/dump-datatransfer-types.html:
* TestWebKitAPI/Tests/ios/UIPasteboardTests.mm:
(TestWebKitAPI::TEST):

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

3 years agoRelease assert in updateLayout() via AXObjectCache::childrenChanged
rniwa@webkit.org [Tue, 30 Jan 2018 22:47:05 +0000 (22:47 +0000)]
Release assert in updateLayout() via AXObjectCache::childrenChanged
https://bugs.webkit.org/show_bug.cgi?id=182279
<rdar://problem/36994456>

Reviewed by Antti Koivisto.

Source/WebCore:

Disable the assertion in Document::updateLayout and Document::updateStyle* in this particular circumstance as fixing it
would require a large architectural refactoring of the accessibility code.

Test: accessibility/accessibility-object-update-during-style-resolution-crash.html

* accessibility/AXObjectCache.cpp:
(WebCore::AXObjectCache::childrenChanged): Disabled the release assertion here.
* dom/Document.cpp:
(WebCore::Document::isSafeToUpdateStyleOrLayout const): Check LayoutAssertionDisableScope::shouldDisable.
* dom/ScriptDisallowedScope.h:
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::~LayoutAssertionDisableScope): Added.
(WebCore::ScriptDisallowedScope::LayoutAssertionDisableScope::shouldDisable): Added.
* page/LayoutContext.cpp:
(WebCore::LayoutContext::layout): Check LayoutAssertionDisableScope::shouldDisable.

LayoutTests:

Added a regression test.

* accessibility/accessibility-object-update-during-style-resolution-crash-expected.txt: Added.
* accessibility/accessibility-object-update-during-style-resolution-crash.html: Added.

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

3 years agoSkipping imported/w3c/web-platform-tests/service-workers/service-worker/navigation...
jlewis3@apple.com [Tue, 30 Jan 2018 22:45:09 +0000 (22:45 +0000)]
Skipping imported/w3c/web-platform-tests/service-workers/service-worker/navigation-redirect.https.html.
https://bugs.webkit.org/show_bug.cgi?id=182311

Unreviewed test expectations.

* TestExpectations:

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

3 years ago[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
zalan@apple.com [Tue, 30 Jan 2018 22:40:57 +0000 (22:40 +0000)]
[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
https://bugs.webkit.org/show_bug.cgi?id=182306
<rdar://problem/37041440>

Reviewed by Antti Koivisto.

With all the ruby mutation code moving, only RenderTreeBuilder calls RenderRubyRun::rubyBaseSafe.

No change in functionality.

* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::rubyText const):
(WebCore::RenderRubyRun::rubyBase const):
(WebCore::RenderRubyRun::firstLineBlock const):
(WebCore::RenderRubyRun::takeChild):
(WebCore::RenderRubyRun::rubyBaseSafe): Deleted.
* rendering/RenderRubyRun.h:
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderRuby.h:

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

3 years agoMake preserve and restore focus more likely to be symmetrical
megan_gardner@apple.com [Tue, 30 Jan 2018 22:16:08 +0000 (22:16 +0000)]
Make preserve and restore focus more likely to be symmetrical
https://bugs.webkit.org/show_bug.cgi?id=182264
Source/WebKit:

<rdar://problem/36948473>

Reviewed by Tim Horton.

Keep a stack of if we actually increment the focusState, so that
changes to the web content do not result in asymmetric decrements to the focus state.
To work around problems associated with <rdar://problem/37000122>.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _restoreFocusWithToken:]):
(-[WKContentView _preserveFocusWithToken:destructively:]):

LayoutTests:

Reviewed by Tim Horton.

Added new test to verify that opening a selection form twice works.

* fast/forms/ios/ipad/select-form-run-twice-expected.txt: Added.
* fast/forms/ios/ipad/select-form-run-twice.html: Added.

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

3 years agoStyleBench: Generate more mutation steps
antti@apple.com [Tue, 30 Jan 2018 22:08:11 +0000 (22:08 +0000)]
StyleBench: Generate more mutation steps
https://bugs.webkit.org/show_bug.cgi?id=182291

Reviewed by Ryosuke Niwa.

The test should be doing multiple rounds of mutations in a single document to test what is supposed to test (like it did before r227756).
This also makes test results more stable and less dependent on possible first-time costs.

* StyleBench/resources/benchmark-runner.js:

Adjust correctionFactor to match the new steps count. With 1.5 Firefox is ~72rpm.

* StyleBench/resources/tests.js:
(makeSteps):

Generate 10 rounds of class/element mutation steps.
Give each generated step unique name so reporting works.
Make individual steps do fewer mutations.

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

3 years agoUnified sources for FEMorphology.cpp seems to break the windows build.
commit-queue@webkit.org [Tue, 30 Jan 2018 21:55:12 +0000 (21:55 +0000)]
Unified sources for FEMorphology.cpp seems to break the windows build.
https://bugs.webkit.org/show_bug.cgi?id=178847

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-01-30
Reviewed by Yusuke Suzuki.

Fix a compilation error.
platform/graphics/filters/SpotLightSource.cpp(45): error C2027: use of undefined type 'WebCore::FilterEffect'

No new tests (No behavior change)

* Sources.txt: Removed @no-unify for FEMorphology.cpp.
* platform/graphics/filters/SpotLightSource.cpp: Added #include "FilterEffect.h".

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

3 years agoTest fix after r227776
mmaxfield@apple.com [Tue, 30 Jan 2018 21:51:18 +0000 (21:51 +0000)]
Test fix after r227776
https://bugs.webkit.org/show_bug.cgi?id=180951

Unreviewed.

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::mandatoryAttributesForUserInstalledFonts):

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

3 years agoCrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIf...
dino@apple.com [Tue, 30 Jan 2018 20:29:02 +0000 (20:29 +0000)]
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>

Removing a misleading comment based on Zalan Bujtas's feedback.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded):

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

3 years ago[CMake] Make WTF headers copies
don.olmstead@sony.com [Tue, 30 Jan 2018 20:02:17 +0000 (20:02 +0000)]
[CMake] Make WTF headers copies
https://bugs.webkit.org/show_bug.cgi?id=182274

Reviewed by Alex Christensen.

Source/ThirdParty:

* gtest/CMakeLists.txt:

Source/WebDriver:

* CMakeLists.txt:

Source/WTF:

* wtf/CMakeLists.txt:
* wtf/PlatformGTK.cmake:
* wtf/PlatformJSCOnly.cmake:
* wtf/PlatformMac.cmake:
* wtf/PlatformWPE.cmake:
* wtf/PlatformWin.cmake:

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

3 years agoCrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIf...
dino@apple.com [Tue, 30 Jan 2018 19:46:38 +0000 (19:46 +0000)]
CrashTracer: com.apple.WebKit.WebContent at WebCore: WebCore::Document::updateStyleIfNeeded
https://bugs.webkit.org/show_bug.cgi?id=182299
<rdar://problem/36853088>

Reviewed by Simon Fraser.

Source/WebCore:

Mostly speculative fix for the case where a scrollTo moves an
animated SVG image into view, causing its animation to restart during
a paint operation. This was causing a release ASSERT, so we now defer
the resumption of the animation into a timer.

Test: svg/animated-svgImage-scroll.html

* rendering/RenderElement.cpp:
(WebCore::RenderElement::repaintForPausedImageAnimationsIfNeeded): Enqueue the
animation if it is an SVGImage.
* svg/graphics/SVGImage.cpp: Add a timer to enqueue animation starts.
(WebCore::SVGImage::SVGImage):
(WebCore::SVGImage::startAnimationTimerFired):
(WebCore::SVGImage::enqueueStartAnimation):
(WebCore::SVGImage::stopAnimation):
* svg/graphics/SVGImage.h:

LayoutTests:

* svg/animated-svgImage-scroll-expected.txt: Added.
* svg/animated-svgImage-scroll.html: Added.

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

3 years agoService worker registration soft updates happen too frequently
cdumez@apple.com [Tue, 30 Jan 2018 18:47:51 +0000 (18:47 +0000)]
Service worker registration soft updates happen too frequently
https://bugs.webkit.org/show_bug.cgi?id=182296
<rdar://problem/37031862>

Reviewed by Youenn Fablet.

Move code that updates the registration's last update check time from after
the script bytecheck to before, as per:
- https://w3c.github.io/ServiceWorker/#update (step 7.19)

This way, the last update check time gets updated even if the newly fetched
script is identical to the previous one, which is the common case.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::updateWorker):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptFetchFinished):

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

3 years agoMove ENABLE_POISON to Platform.h.
mark.lam@apple.com [Tue, 30 Jan 2018 18:04:21 +0000 (18:04 +0000)]
Move ENABLE_POISON to Platform.h.
https://bugs.webkit.org/show_bug.cgi?id=182298
<rdar://problem/37032686>

Reviewed by Michael Saboff and JF Bastien.

ENABLE_POISON belongs in Platform.h to ensure that all places that depend on
ENABLE(POISON) will see it properly defined.

* wtf/Platform.h:
* wtf/Poisoned.h:

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

3 years ago[RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
zalan@apple.com [Tue, 30 Jan 2018 18:01:48 +0000 (18:01 +0000)]
[RenderTreeBuilder] Move childBecameNonInline to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182265
<rdar://problem/37004459>

Reviewed by Antti Koivisto.

Move the mutation code that wraps/unwraps a child element when its flow state changes
from(to) in-flow to(from) floating/out-of-flow.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::childBecameNonInline): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderBoxModelObject.h:
(WebCore::RenderBoxModelObject::childBecameNonInline): Deleted.
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::handleDynamicFloatPositionChange): Deleted.
* rendering/RenderInline.cpp:
(WebCore::RenderInline::childBecameNonInline): Deleted.
* rendering/RenderInline.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::childFlowStateChangesAndAffectsParentBlock):
(WebCore::RenderTreeBuilder::splitFlow): Deleted.
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::childBecameNonInline):
* rendering/updating/RenderTreeBuilderBlock.h:
* rendering/updating/RenderTreeBuilderInline.cpp:
(WebCore::RenderTreeBuilder::Inline::childBecameNonInline):
* rendering/updating/RenderTreeBuilderInline.h:

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

3 years agoAdd telemetry to track storage access API adoption
bfulgham@apple.com [Tue, 30 Jan 2018 17:44:41 +0000 (17:44 +0000)]
Add telemetry to track storage access API adoption
https://bugs.webkit.org/show_bug.cgi?id=182197
<rdar://problem/35803309>

Reviewed by Chris Dumez.

Source/WebCore:

Partial roll-out of r227755.

The original patch assumed the WebContent process kept track of user interaction. This is
only tracked in the UIProcess, so we can get rid of some of the logging code adding in
r227755.

* loader/ResourceLoadObserver.cpp:
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::setTimeToLivePartitionFree): Deleted.
(WebCore::ResourceLoadObserver::wasAccessedWithinInteractionWindow const): Deleted.
* loader/ResourceLoadObserver.h:

Source/WebKit:

This patch also handled aggregating the counts in the UIProcess, which has access to
the right data.

The original patch assumed the WebContent process kept track of user interaction. This is
only tracked in the UIProcess, so we can get rid of some of the logging code adding in
r227755.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const): Rollout of r227755 changes not
needed to track the statistics.
(WebKit::WebProcessCreationParameters::decode): Ditto.
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess): Ditto.
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::wasAccessedAsFirstPartyDueToUserInteraction): Moved from
the WebContent process, which does not keep track of user interaction.
(WebKit::WebResourceLoadStatisticsStore::mergeStatistics): Aggregate counts while processing
the statistics.
* UIProcess/WebResourceLoadStatisticsStore.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

3 years agoMake sure we never create a WebSWClientConnection with an invalid sessionID
cdumez@apple.com [Tue, 30 Jan 2018 17:21:49 +0000 (17:21 +0000)]
Make sure we never create a WebSWClientConnection with an invalid sessionID
https://bugs.webkit.org/show_bug.cgi?id=182276
<rdar://problem/36582633>

Reviewed by Alex Christensen.

Make sure we never create a WebSWClientConnection with an invalid sessionID as this
could corrupt our hash tables.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange):
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::ready):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationRequest):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::didFinishGetRegistrationsRequest):
(WebCore::ServiceWorkerContainer::jobResolvedWithRegistration):
(WebCore::ServiceWorkerContainer::ensureSWClientConnection):

Source/WebKit:

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::swServerForSession):
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::WebSWClientConnection):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::serviceWorkerConnectionForSession):
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):

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

3 years ago[WebVR][GTK][WPE] Exclude OpenVR from tarballs
svillar@igalia.com [Tue, 30 Jan 2018 16:18:26 +0000 (16:18 +0000)]
[WebVR][GTK][WPE] Exclude OpenVR from tarballs
https://bugs.webkit.org/show_bug.cgi?id=182284

Reviewed by Michael Catanzaro.

.:

Added private build options for USE_OPENVR.

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Tools:

* gtk/manifest.txt.in: Added ThirdParty/openvr to exclusions.
* wpe/manifest.txt.in: Ditto.

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

3 years agoAvoid traversing too much when doing class change invalidation
antti@apple.com [Tue, 30 Jan 2018 16:13:15 +0000 (16:13 +0000)]
Avoid traversing too much when doing class change invalidation
https://bugs.webkit.org/show_bug.cgi?id=181604

Reviewed by Zalan Bujtas.

We are now collecting information about which part of the tree a change in class can potentially affect.
Use the information to traverse only the required elements in Style::Invalidator.

The same mechanism can be later used for attribute and id change invalidation.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::collectFeatures const):
(WebCore::DocumentRuleSets::classInvalidationRuleSets const):
(WebCore::DocumentRuleSets::subjectClassRules const): Deleted.
(WebCore::DocumentRuleSets::ancestorClassRules const): Deleted.

    Remove separate subject and ancestor invalidation RuleSets. Instead collect all invalidation rulesets
    to a vector along with their MatchElements.

* css/DocumentRuleSets.h:
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):
(WebCore::RuleFeatureSet::collectFeatures):

    Similarly collect all class invalidation RuleFeatures to a general HashMap along with the MatchElement.

(WebCore::RuleFeatureSet::add):
(WebCore::RuleFeatureSet::clear):
(WebCore::RuleFeatureSet::shrinkToFit):
* css/RuleFeature.h:
(WebCore::RuleFeature::RuleFeature):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::computeInvalidation):

    Find out InvalidationRuleSets to use.

(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):

    Pass them to Style::Invalidator.

* style/ClassChangeInvalidation.h:
* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleForTree):
(WebCore::Style::Invalidator::invalidateStyleForDescendants):
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):

    Traverse only the part of the tree needed by the given MatchElement.

* style/StyleInvalidator.h:
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::classNamesAffectedByRules const):

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

3 years ago[css-align] The 'baseline' value must be invalid for the 'justify-content' property
jfernandez@igalia.com [Tue, 30 Jan 2018 16:03:14 +0000 (16:03 +0000)]
[css-align] The 'baseline' value must be invalid for the 'justify-content' property
https://bugs.webkit.org/show_bug.cgi?id=181794

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Adapted the test cases using <baseline-position> keywords to the new CSS syntax.
Imported the CSS/support folder.

* resources/import-expectations.json:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-001-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-001.html:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-003-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-align-content-003.html:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-001-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-001.html:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-003-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-003.html:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/parse-justify-content-004.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-001.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-002.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-004.html:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006-expected.txt:
* web-platform-tests/css/css-align/content-distribution/place-content-shorthand-006.html:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-001-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-001.html:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-003-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-align-items-003.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-001-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-001.html:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-003-expected.txt:
* web-platform-tests/css/css-align/default-alignment/parse-justify-items-003.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-001.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-002.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-004.html:
* web-platform-tests/css/css-align/default-alignment/place-items-shorthand-006.html:
* web-platform-tests/css/css-align/resources/alignment-parsing-utils.js:
(checkPlaceShorhand):
(checkPlaceShorhandLonghands):
* web-platform-tests/css/css-align/self-alignment/parse-align-self-001-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-align-self-001.html:
* web-platform-tests/css/css-align/self-alignment/parse-align-self-003-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-align-self-003.html:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-001-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-001.html:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-003-expected.txt:
* web-platform-tests/css/css-align/self-alignment/parse-justify-self-003.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-001.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-002.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-004.html:
* web-platform-tests/css/css-align/self-alignment/place-self-shorthand-006.html:
* web-platform-tests/css/support/1x1-green.png: Added.
* web-platform-tests/css/support/1x1-lime.png: Added.
* web-platform-tests/css/support/1x1-maroon.png: Added.
* web-platform-tests/css/support/1x1-navy.png: Added.
* web-platform-tests/css/support/1x1-red.png: Added.
* web-platform-tests/css/support/1x1-white.png: Added.
* web-platform-tests/css/support/60x60-gg-rr.png: Added.
* web-platform-tests/css/support/60x60-green.png: Added.
* web-platform-tests/css/support/60x60-red.png: Added.
* web-platform-tests/css/support/OWNERS: Added.
* web-platform-tests/css/support/README: Added.
* web-platform-tests/css/support/a-green.css: Added.
(.a):
* web-platform-tests/css/support/alignment.css: Added.
(.alignSelfAuto):
(.alignSelfNormal):
(.alignSelfStretch):
(.alignSelfStart):
(.alignSelfEnd):
(.alignSelfCenter):
(.alignSelfRight):
(.alignSelfLeft):
(.alignSelfFlexStart):
(.alignSelfFlexEnd):
(.alignSelfSelfStart):
(.alignSelfSelfEnd):
(.alignSelfSafeCenter):
(.alignSelfUnsafeCenter):
(.alignSelfSafeEnd):
(.alignSelfUnsafeEnd):
(.alignSelfSafeSelfEnd):
(.alignSelfUnsafeSelfEnd):
(.alignSelfSafeSelfStart):
(.alignSelfUnsafeSelfStart):
(.alignSelfSafeRight):
(.alignSelfUnsafeRight):
(.alignSelfSafeLeft):
(.alignSelfUnsafeLeft):
(.alignSelfSafeFlexEnd):
(.alignSelfUnsafeFlexEnd):
(.alignSelfSafeFlexStart):
(.alignSelfUnsafeFlexStart):
(.alignSelfBaseline):
(.alignSelfFirstBaseline):
(.alignSelfLastBaseline):
(.alignItemsAuto):
(.alignItemsNormal):
(.alignItemsStretch):
(.alignItemsStart):
(.alignItemsCenter):
(.alignItemsEnd):
(.alignItemsLeft):
(.alignItemsRight):
(.alignItemsFlexStart):
(.alignItemsFlexEnd):
(.alignItemsSelfStart):
(.alignItemsSelfEnd):
(.alignItemsSafeCenter):
(.alignItemsUnsafeCenter):
(.alignItemsSafeEnd):
(.alignItemsUnsafeEnd):
(.alignItemsSafeSelfEnd):
(.alignItemsUnsafeSelfEnd):
(.alignItemsSafeSelfStart):
(.alignItemsUnsafeSelfStart):
(.alignItemsSafeRight):
(.alignItemsUnsafeRight):
(.alignItemsSafeLeft):
(.alignItemsUnsafeLeft):
(.alignItemsSafeFlexEnd):
(.alignItemsUnsafeFlexEnd):
(.alignItemsSafeFlexStart):
(.alignItemsUnsafeFlexStart):
(.alignItemsBaseline):
(.alignItemsFirstBaseline):
(.alignItemsLastBaseline):
(.alignContentBaseline):
(.alignContentLastBaseline):
(.alignContentStart):
(.alignContentEnd):
(.alignContentCenter):
(.alignContentLeft):
(.alignContentRight):
(.alignContentFlexStart):
(.alignContentFlexEnd):
(.alignContentSpaceBetween):
(.alignContentSpaceAround):
(.alignContentSpaceEvenly):
(.alignContentStretch):
(.alignContentSafeCenter):
(.alignContentUnsafeCenter):
(.alignContentSafeEnd):
(.alignContentUnsafeEnd):
(.alignContentSafeRight):
(.alignContentUnsafeRight):
(.alignContentSafeLeft):
(.alignContentUnsafeLeft):
(.alignContentSafeFlexEnd):
(.alignContentUnsafeFlexEnd):
(.alignContentSafeFlexStart):
(.alignContentUnsafeFlexStart):
(.alignContentFirstBaseline):
(.justifySelfAuto):
(.justifySelfNormal):
(.justifySelfStretch):
(.justifySelfStart):
(.justifySelfCenter):
(.justifySelfEnd):
(.justifySelfRight):
(.justifySelfLeft):
(.justifySelfFlexStart):
(.justifySelfFlexEnd):
(.justifySelfSelfStart):
(.justifySelfSelfEnd):
(.justifySelfSafeCenter):
(.justifySelfUnsafeCenter):
(.justifySelfSafeEnd):
(.justifySelfUnsafeEnd):
(.justifySelfSafeSelfEnd):
(.justifySelfUnsafeSelfEnd):
(.justifySelfSafeSelfStart):
(.justifySelfUnsafeSelfStart):
(.justifySelfSafeRight):
(.justifySelfUnsafeRight):
(.justifySelfSafeLeft):
(.justifySelfUnsafeLeft):
(.justifySelfSafeFlexEnd):
(.justifySelfUnsafeFlexEnd):
(.justifySelfSafeFlexStart):
(.justifySelfUnsafeFlexStart):
(.justifySelfBaseline):
(.justifySelfFirstBaseline):
(.justifySelfLastBaseline):
(.justifyItemsAuto):
(.justifyItemsNormal):
(.justifyItemsStretch):
(.justifyItemsStart):
(.justifyItemsCenter):
(.justifyItemsEnd):
(.justifyItemsLeft):
(.justifyItemsRight):
(.justifyItemsFlexStart):
(.justifyItemsFlexEnd):
(.justifyItemsSelfStart):
(.justifyItemsSelfEnd):
(.justifyItemsLegacy):
(.justifyItemsLegacyLeft):
(.justifyItemsLegacyCenter):
(.justifyItemsLegacyRight):
(.justifyItemsLeftLegacy):
(.justifyItemsCenterLegacy):
(.justifyItemsRightLegacy):
(.justifyItemsSafeCenter):
(.justifyItemsUnsafeCenter):
(.justifyItemsSafeEnd):
(.justifyItemsUnsafeEnd):
(.justifyItemsSafeSelfEnd):
(.justifyItemsUnsafeSelfEnd):
(.justifyItemsSafeSelfStart):
(.justifyItemsUnsafeSelfStart):
(.justifyItemsSafeRight):
(.justifyItemsUnsafeRight):
(.justifyItemsSafeLeft):
(.justifyItemsUnsafeLeft):
(.justifyItemsSafeFlexEnd):
(.justifyItemsUnsafeFlexEnd):
(.justifyItemsSafeFlexStart):
(.justifyItemsUnsafeFlexStart):
(.justifyItemsTest):
(.justifyItemsBaseline):
(.justifyItemsFirstBaseline):
(.justifyItemsLastBaseline):
(.justifyContentBaseline):
(.justifyContentLastBaseline):
(.justifyContentStart):
(.justifyContentEnd):
(.justifyContentCenter):
(.justifyContentLeft):
(.justifyContentRight):
(.justifyContentFlexStart):
(.justifyContentFlexEnd):
(.justifyContentSpaceBetween):
(.justifyContentSpaceAround):
(.justifyContentSpaceEvenly):
(.justifyContentStretch):
(.justifyContentSafeCenter):
(.justifyContentUnsafeCenter):
(.justifyContentSafeEnd):
(.justifyContentUnsafeEnd):
(.justifyContentSafeRight):
(.justifyContentUnsafeRight):
(.justifyContentSafeLeft):
(.justifyContentUnsafeLeft):
(.justifyContentSafeFlexEnd):
(.justifyContentUnsafeFlexEnd):
(.justifyContentSafeFlexStart):
(.justifyContentUnsafeFlexStart):
(.justifyContentFirstBaseline):
(.itemsNormal):
(.itemsStretch):
(.itemsStart):
(.itemsCenter):
(.itemsEnd):
(.itemsLeft):
(.itemsRight):
(.itemsSelfStart):
(.itemsSelfEnd):
(.itemsBaseline):
(.selfStretch):
(.selfStart):
(.selfEnd):
(.selfCenter):
(.selfRight):
(.selfLeft):
(.selfSelfStart):
(.selfSelfEnd):
(.selfBaseline):
(.contentStart):
(.contentCenter):
(.contentEnd):
(.contentCenterSafe):
(.contentCenterUnsafe):
(.contentEndSafe):
(.contentEndUnsafe):
(.contentSpaceBetween):
(.contentSpaceAround):
(.contentSpaceEvenly):
(.contentStretch):
* web-platform-tests/css/support/b-green.css: Added.
(.b):
* web-platform-tests/css/support/c-red.css: Added.
(.c):
* web-platform-tests/css/support/cat.png: Added.
* web-platform-tests/css/support/green.ico: Added.
* web-platform-tests/css/support/import-green.css: Added.
(.import):
* web-platform-tests/css/support/import-red.css: Added.
(.import):
* web-platform-tests/css/support/pattern-grg-rgr-grg.png: Added.
* web-platform-tests/css/support/pattern-grg-rrg-rgg.png: Added.
* web-platform-tests/css/support/pattern-rgr-grg-rgr.png: Added.
* web-platform-tests/css/support/pattern-tr.png: Added.
* web-platform-tests/css/support/red.ico: Added.
* web-platform-tests/css/support/ruler-h-50%.png: Added.
* web-platform-tests/css/support/ruler-h-50px.png: Added.
* web-platform-tests/css/support/ruler-v-100px.png: Added.
* web-platform-tests/css/support/ruler-v-50px.png: Added.
* web-platform-tests/css/support/square-purple.png: Added.
* web-platform-tests/css/support/square-teal.png: Added.
* web-platform-tests/css/support/square-white.png: Added.
* web-platform-tests/css/support/support/README: Added.
* web-platform-tests/css/support/support/swatch-green.png: Added.
* web-platform-tests/css/support/support/swatch-red.png: Added.
* web-platform-tests/css/support/support/w3c-import.log: Added.
* web-platform-tests/css/support/swatch-blue.png: Added.
* web-platform-tests/css/support/swatch-green.png: Added.
* web-platform-tests/css/support/swatch-lime.png: Added.
* web-platform-tests/css/support/swatch-orange.png: Added.
* web-platform-tests/css/support/swatch-red.png: Added.
* web-platform-tests/css/support/swatch-teal.png: Added.
* web-platform-tests/css/support/swatch-white.png: Added.
* web-platform-tests/css/support/swatch-yellow.png: Added.
* web-platform-tests/css/support/test-bl.png: Added.
* web-platform-tests/css/support/test-br.png: Added.
* web-platform-tests/css/support/test-inner-half-size.png: Added.
* web-platform-tests/css/support/test-outer.png: Added.
* web-platform-tests/css/support/test-tl.png: Added.
* web-platform-tests/css/support/test-tr.png: Added.
* web-platform-tests/css/support/w3c-import.log: Added.

Source/WebCore:

The CSS WG has resolved that it doesn't make sense to define Baseline
Content-Alignment in the inline/main axis.

https://github.com/w3c/csswg-drafts/issues/1184

The spec has been updated so that <baseline-postion> is not valid for
the 'justify-content' property's syntax. This CL updates our parsing
logic to match the new spec, including the parsing logic of the
place-content shorthand.

Additionally, this CL updates the computed value of the
<baseline-position> values to match other browsers.

We don't implement support for <baseline-position> values in the
Content Distribution properties (align-content and justify-content),
so I don't expect this change to break content of sites using the CSS
Box Alignment feature.

No new tests, just adapt the Web Platform Tests we already have to the new CSS syntax.

* css/parser/CSSPropertyParser.cpp:
(WebCore::getBaselineKeyword):
(WebCore::consumeBaselineKeyword):
(WebCore::consumeContentDistributionOverflowPosition):
(WebCore::consumeSelfPositionOverflowPosition):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::consumeSimplifiedContentPosition):
(WebCore::CSSPropertyParser::consumePlaceContentShorthand):
(WebCore::consumeSimplifiedItemPosition):

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

3 years agoUnreviewed test gardening.
fred.wang@free.fr [Tue, 30 Jan 2018 14:56:44 +0000 (14:56 +0000)]
Unreviewed test gardening.

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-30

* TestExpectations: Add Bugzilla references for scrollingElement-quirks-dynamic tests.

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

3 years agoUnreviewed WPE test gardening
mcatanzaro@igalia.com [Tue, 30 Jan 2018 13:54:57 +0000 (13:54 +0000)]
Unreviewed WPE test gardening

This test now has a global flakiness expectation

* platform/wpe/TestExpectations:

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

3 years agoUnreviewed, try to fix JSCOnly build
utatane.tea@gmail.com [Tue, 30 Jan 2018 13:43:10 +0000 (13:43 +0000)]
Unreviewed, try to fix JSCOnly build
https://bugs.webkit.org/show_bug.cgi?id=177202

* CMakeLists.txt:

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

3 years agoUnreviewed. Try to avoid webdriver tests step timing out in the bots.
carlosgc@webkit.org [Tue, 30 Jan 2018 13:29:32 +0000 (13:29 +0000)]
Unreviewed. Try to avoid webdriver tests step timing out in the bots.

The process itself doesn't seem to be timing out, but the buildbot is always reporting the step as finished
after timeout. I think there's a race condition or something in buildbot, and it keeps watching the json log
file even when it has already been written. This is a speculative workaround, assuming that's the problem, that
creates the json file before running the tests. I'll revert this if it doesn't fix the issue in the end.

* Scripts/run-webdriver-tests:
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.dump_results_to_json_file):

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

3 years agoUse document.scrollingElement to access viewport scroll properties in tests
fred.wang@free.fr [Tue, 30 Jan 2018 13:05:44 +0000 (13:05 +0000)]
Use document.scrollingElement to access viewport scroll properties in tests
https://bugs.webkit.org/show_bug.cgi?id=182241

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-30
Reviewed by Antonio Gomes.

Many tests use document.body in standard mode in order to access scroll properties of the
viewport. This is incorrect per the CSSOM View specification but WebKit does not follow the
spec at the moment (see bug 5991). This replaces several of these instances with
document.scrollingElement, so that tests will still work when WebKit's behavior is changed.
LayoutTests/imported/w3c:

The change in that web-platform-tests test are imported from
https://github.com/w3c/web-platform-tests/commit/fc33ef7641427a3f1388093c54b24f292c21b34d

* web-platform-tests/html/browsers/browsing-the-web/scroll-to-fragid/003.html:

LayoutTests:

* fast/multicol/scrolling-overflow.html:
* fast/scrolling/latching/iframe_in_iframe.html:
* fast/scrolling/latching/scroll-div-no-latching.html:
* fast/scrolling/latching/scroll-latched-nested-div.html:
* fast/scrolling/latching/scroll-nested-iframe.html:
* http/tests/navigation/anchor-frames-expected.txt:
* http/tests/navigation/anchor-frames-gbk-expected.txt:
* http/tests/navigation/anchor-frames-same-origin-expected.txt:
* http/tests/navigation/resources/frame-with-anchor-gbk.html:
* http/tests/navigation/resources/frame-with-anchor-same-origin.html:
* http/tests/navigation/resources/frame-with-anchor.html:
* tiled-drawing/resources/scroll-and-load-page.html:
* tiled-drawing/scrolling/fast-scroll-mainframe-zoom.html:
* tiled-drawing/scrolling/frames/resources/autoscrolling-frame-with-fixed.html:
* tiled-drawing/scrolling/iframe_in_iframe.html:
* tiled-drawing/tiled-drawing-scroll-position-page-cache-restoration-expected.txt:

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

3 years agoUnreviewed, update test262 expects
utatane.tea@gmail.com [Tue, 30 Jan 2018 12:55:17 +0000 (12:55 +0000)]
Unreviewed, update test262 expects
https://bugs.webkit.org/show_bug.cgi?id=182232

* test262.yaml:

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

3 years ago[JSC] Implement trimStart and trimEnd
utatane.tea@gmail.com [Tue, 30 Jan 2018 12:06:24 +0000 (12:06 +0000)]
[JSC] Implement trimStart and trimEnd
https://bugs.webkit.org/show_bug.cgi?id=182233

Reviewed by Mark Lam.

JSTests:

* stress/trim.js: Added.
(shouldBe):
(startTest):
(endTest):
(trimTest):

Source/JavaScriptCore:

String.prototype.{trimStart,trimEnd} are now stage 3[1].
String.prototype.{trimLeft,trimRight} are alias to these functions.

We rename these functions to trimStart and trimEnd, and put them as
trimLeft and trimRight too.

[1]: https://tc39.github.io/proposal-string-left-right-trim/

* runtime/StringPrototype.cpp:
(JSC::StringPrototype::finishCreation):
(JSC::trimString):
(JSC::stringProtoFuncTrim):
(JSC::stringProtoFuncTrimStart):
(JSC::stringProtoFuncTrimEnd):
(JSC::stringProtoFuncTrimLeft): Deleted.
(JSC::stringProtoFuncTrimRight): Deleted.

LayoutTests:

* js/Object-getOwnPropertyNames-expected.txt:
* js/script-tests/Object-getOwnPropertyNames.js:

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

3 years ago[WinCairo] Fix forwarding header conflict of WebKit on WinCairo
commit-queue@webkit.org [Tue, 30 Jan 2018 11:37:12 +0000 (11:37 +0000)]
[WinCairo] Fix forwarding header conflict of WebKit on WinCairo
https://bugs.webkit.org/show_bug.cgi?id=177202

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-01-30
Reviewed by Alex Christensen.

.:

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* PlatformWin.cmake:

Source/WebKit:

* PlatformWin.cmake:

Tools:

* CMakeLists.txt:

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

3 years agoShould fetch owner commits in build-requests-fetcher.
dewei_zhu@apple.com [Tue, 30 Jan 2018 10:07:04 +0000 (10:07 +0000)]
Should fetch owner commits in build-requests-fetcher.
https://bugs.webkit.org/show_bug.cgi?id=182266

Reviewed by Ryosuke Niwa.

In a build request, owner commit of a commit is not always one of a commit in the commit set.
Build request api should contain owner commits in the 'commits' field of the return value.

* public/include/build-requests-fetcher.php: Added logic to fetch owner commits and added them into 'commits'.
* server-tests/api-build-requests-tests.js: Added a unit test.
* server-tests/resources/mock-data.js:
(MockData.set addTestGroupWithOwnerCommitNotInCommitSet): Added a test group with a build request, the commit set of which does
not contain owner commit of one commit.

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

3 years agoA disallowed user-installed font may be used if its PostScript name is specified
mmaxfield@apple.com [Tue, 30 Jan 2018 09:01:28 +0000 (09:01 +0000)]
A disallowed user-installed font may be used if its PostScript name is specified
https://bugs.webkit.org/show_bug.cgi?id=180951

Reviewed by Brent Fulgham.

Source/WebCore:

This patch adds a new CoreText font attribute, kCTFontFallbackOptionAttribute, to the
fonts which WebKit creates. It also adds this attribute to web fonts, so that font
fallback will happen according to our rules about user-installed fonts. It also marks
these font attributes as "mandatory" so CoreText will be guaranteed to follow the
policy.

Test: fast/text/user-installed-fonts/disable.html

* platform/graphics/FontCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontDatabase::collectionForFamily):
(WebCore::FontDatabase::fontForPostScriptName):
(WebCore::addAttributesForUserInstalledFonts):
(WebCore::mandatoryAttributesForUserInstalledFonts):
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData):

Source/WebCore/PAL:

* pal/spi/cocoa/CoreTextSPI.h:

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

3 years ago[JSC] Relax line terminators in String to make JSON subset of JS
utatane.tea@gmail.com [Tue, 30 Jan 2018 07:34:44 +0000 (07:34 +0000)]
[JSC] Relax line terminators in String to make JSON subset of JS
https://bugs.webkit.org/show_bug.cgi?id=182232

Reviewed by Keith Miller.

JSTests:

* ChakraCore/test/es5/Lex_u3.baseline-jsc:
* stress/relaxed-line-terminators-in-string.js: Added.
(shouldBe):

Source/JavaScriptCore:

"Subsume JSON" spec is now stage 3[1]. Before this spec change,
JSON can accept \u2028 / \u2029 in string while JS cannot do that.
It accidentally made JSON non subset of JS.

Now we extend our JS string to accept \u2028 / \u2029 to make JSON
subset of JS in this spec change.

[1]: https://github.com/tc39/proposal-json-superset

* parser/Lexer.cpp:
(JSC::Lexer<T>::parseStringSlowCase):

LayoutTests:

* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.3.html:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4-expected.txt:
* sputnik/Conformance/07_Lexical_Conventions/7.3_Line_Terminators/S7.3_A2.4.html:

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

3 years agoWebDriver: evaluateJavaScriptFunction should return null when return value is undefined
carlosgc@webkit.org [Tue, 30 Jan 2018 06:32:38 +0000 (06:32 +0000)]
WebDriver: evaluateJavaScriptFunction should return null when return value is undefined
https://bugs.webkit.org/show_bug.cgi?id=180350

Reviewed by Carlos Alberto Lopez Perez.

Source/WebDriver:

Stop handling the empty string as a special case of evaluateJavaScriptFunction result.

* Session.cpp:
(WebDriver::Session::executeScript):

Source/WebKit:

undefined can't be converted to JSON string, in which case JSON.stringify() returns undefined and we handle that
case to return an empty string. We currently handle this case for execute script commands, but not in all other
cases where we use evaluateJavaScriptFunction. It would be simpler if evaluateJavaScriptFunction returned null,
because in that case we wouldn't need to handle it as a special case.

15.2 Executing Script
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-json-clone

Fixes: imported/w3c/webdriver/tests/state/get_element_property.py::test_element_non_existent

* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype._jsonStringify): Return "null" instead of "" when undefined is given.

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

3 years agoRelease assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsec...
rniwa@webkit.org [Tue, 30 Jan 2018 05:56:36 +0000 (05:56 +0000)]
Release assert in updateLayout while waiting for sync reply to WebPageProxy::HasInsecureContent
https://bugs.webkit.org/show_bug.cgi?id=182273

Reviewed by Chris Dumez.

The assertion was caused by unrelated sync IPCs being processed while WebContent process is waiting for
the reply to WebPageProxy::HasInsecureContent. Since this IPC can be used while creating CachedFrame,
it's not safe to execute arbitrary code.

Fixed the bug by using DoNotProcessIncomingMessagesWhenWaitingForSyncReply added in r227566.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::savePlatformDataToCachedFrame):

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

3 years agoAdd a build step to copy resources from WebKitAdditions as bundle resources in WebKit
wenson_hsieh@apple.com [Tue, 30 Jan 2018 05:36:38 +0000 (05:36 +0000)]
Add a build step to copy resources from WebKitAdditions as bundle resources in WebKit
https://bugs.webkit.org/show_bug.cgi?id=182268
<rdar://problem/37003784>

Reviewed by Tim Horton and Dan Bernstein.

Adds a "Copy Additional Resources" phase when building WebKit. This phase copies resources from
usr/local/include/WebKitAdditions/WebKit/AdditionalResources in the build directory into the
unlocalized resources directory. If the AdditionalResources directory does not exist in the build
directory, we fall back to searching the SDK.

* WebKit.xcodeproj/project.pbxproj:

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

3 years agoServiceWorkerClientFetch should not consider responses without Location headers as...
commit-queue@webkit.org [Tue, 30 Jan 2018 02:15:14 +0000 (02:15 +0000)]
ServiceWorkerClientFetch should not consider responses without Location headers as redirection responses
https://bugs.webkit.org/show_bug.cgi?id=182134

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-29
Reviewed by Chris Dumez.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:

Source/WebKit:

As per fetch spec, a response with a redirection status code but no Location header should not be considered as a redirection.
This is also consistent with SubresourceLoader::didReceiveResponse.

* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
(WebKit::ServiceWorkerClientFetch::didReceiveResponse):

LayoutTests:

* TestExpectations:

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

3 years agoStyleBench: Remove : from a test name
antti@apple.com [Tue, 30 Jan 2018 02:04:09 +0000 (02:04 +0000)]
StyleBench: Remove : from a test name
https://bugs.webkit.org/show_bug.cgi?id=182258

Reviewed by Ryosuke Niwa.

It breaks reporting.

* StyleBench/resources/style-bench.js:
(nthPseudoClassConfiguration):

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

3 years agoCache API should make sure to resolve caches.open promises in the same order as called
commit-queue@webkit.org [Tue, 30 Jan 2018 01:41:22 +0000 (01:41 +0000)]
Cache API should make sure to resolve caches.open promises in the same order as called
https://bugs.webkit.org/show_bug.cgi?id=182193
<rdar://problem/36930363>

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-29
Reviewed by Chris Dumez.

Source/WebCore:

Covered by LayoutTests/http/wpt/cache-storage/cache-open-delete-in-parallel.https.html.

* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::doRemove): Removed optimization consisting in removing the cache from DOMCacheStorage object synchronously.
This optimization prevents going to the network process to try deleting the cache.

Source/WebKit:

Covered by added test.
Whenever opening/removing a cache requires writing to disk, wait to finish the task
until any disk writing task is done.
Applying this strategy when clearing data so that we also clear data that is pending to be written.
For removing cache, we now return whether a cache was actually deleted by returning zero as removed cache identifier.
WebCore uses that information to return true/false as promise resolution value.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::retrieveCaches):
* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::clear):
(WebKit::CacheStorage::Caches::open):
(WebKit::CacheStorage::Caches::remove):
(WebKit::CacheStorage::Caches::writeCachesToDisk):
(WebKit::CacheStorage::Caches::cacheInfos):
(WebKit::CacheStorage::Caches::cacheInfos const): Deleted.
* NetworkProcess/cache/CacheStorageEngineCaches.h:
(WebKit::CacheStorage::Caches::createWeakPtr):

LayoutTests:

* http/wpt/cache-storage/cache-open.https-expected.txt: Added.
* http/wpt/cache-storage/cache-open.https.html: Added.

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

3 years agoTemporarily skip StyleBench until webkit.org/b/182088 is fixed.
rniwa@webkit.org [Tue, 30 Jan 2018 01:38:23 +0000 (01:38 +0000)]
Temporarily skip StyleBench until webkit.org/b/182088 is fixed.

* Skipped:

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

3 years agoMarked imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element...
jlewis3@apple.com [Tue, 30 Jan 2018 01:33:24 +0000 (01:33 +0000)]
Marked imported/w3c/web-platform-tests/html/semantics/scripting-1/the-script-element/module/errorhandling.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=182177

Unreviewed test expectations.

* TestExpectations:

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

3 years agoClean up API after bugs 178240 and 176474
achristensen@apple.com [Tue, 30 Jan 2018 01:27:18 +0000 (01:27 +0000)]
Clean up API after bugs 178240 and 176474
https://bugs.webkit.org/show_bug.cgi?id=182259

Reviewed by Dan Bernstein.

Source/WebKit:

NS_OPTIONS should be NSUInteger, not NSInteger.  This is how all other NS_OPTIONS in WebKit are,
and it's necessary if we get really big numbers as options.  Changing them won't cause binary
incompatibility unless someone does signed integer comparison with currently invalid values.

Added availability macros I forgot to add earlier.

* UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:
(TEST):
(-[PinnedStateObserver observeValueForKeyPath:ofObject:change:context:]):

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

3 years ago[WebAuthN] Add a compile-time feature flag
jiewen_tan@apple.com [Tue, 30 Jan 2018 01:20:17 +0000 (01:20 +0000)]
[WebAuthN] Add a compile-time feature flag
https://bugs.webkit.org/show_bug.cgi?id=182211
<rdar://problem/36936365>

Reviewed by Brent Fulgham.

.:

* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add a compile-time feature flag for WebAuthN as most of the functionality is platform
dependent.

No tests.

* Configurations/FeatureDefines.xcconfig:
* Modules/credentialmanagement/BasicCredential.cpp:
* Modules/credentialmanagement/BasicCredential.h:
* Modules/credentialmanagement/BasicCredential.idl:
* Modules/credentialmanagement/CredentialCreationOptions.h:
* Modules/credentialmanagement/CredentialCreationOptions.idl:
* Modules/credentialmanagement/CredentialRequestOptions.h:
* Modules/credentialmanagement/CredentialRequestOptions.idl:
* Modules/credentialmanagement/CredentialsContainer.cpp:
* Modules/credentialmanagement/CredentialsContainer.h:
* Modules/credentialmanagement/CredentialsContainer.idl:
* Modules/credentialmanagement/NavigatorCredentials.cpp:
* Modules/credentialmanagement/NavigatorCredentials.h:
* Modules/credentialmanagement/NavigatorCredentials.idl:
* Modules/webauthn/Authenticator.cpp:
* Modules/webauthn/Authenticator.h:
* Modules/webauthn/AuthenticatorAssertionResponse.cpp:
* Modules/webauthn/AuthenticatorAssertionResponse.h:
* Modules/webauthn/AuthenticatorAssertionResponse.idl:
* Modules/webauthn/AuthenticatorAttestationResponse.cpp:
* Modules/webauthn/AuthenticatorAttestationResponse.h:
* Modules/webauthn/AuthenticatorAttestationResponse.idl:
* Modules/webauthn/AuthenticatorResponse.cpp:
* Modules/webauthn/AuthenticatorResponse.h:
* Modules/webauthn/AuthenticatorResponse.idl:
* Modules/webauthn/PublicKeyCredential.cpp:
* Modules/webauthn/PublicKeyCredential.h:
* Modules/webauthn/PublicKeyCredential.idl:
* Modules/webauthn/PublicKeyCredentialCreationOptions.h:
* Modules/webauthn/PublicKeyCredentialCreationOptions.idl:
* Modules/webauthn/PublicKeyCredentialDescriptor.h:
* Modules/webauthn/PublicKeyCredentialDescriptor.idl:
* Modules/webauthn/PublicKeyCredentialRequestOptions.h:
* Modules/webauthn/PublicKeyCredentialRequestOptions.idl:
* Modules/webauthn/PublicKeyCredentialType.h:
* Modules/webauthn/PublicKeyCredentialType.idl:
* bindings/js/JSAuthenticatorResponseCustom.cpp:
* bindings/js/JSBasicCredentialCustom.cpp:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* Scripts/webkitperl/FeatureList.pm:
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

Skip WebAuthN related tests on certain platforms as they won't
support it immediately.

* platform/gtk/TestExpectations:
* platform/ios-wk1/TestExpectations:
* platform/mac-wk1/TestExpectations:
* platform/win/TestExpectations:
* platform/wpe/TestExpectations:

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

3 years agoMark webrtc/captureCanvas-webrtc.html as flaky on macOS.
ryanhaddad@apple.com [Tue, 30 Jan 2018 00:37:10 +0000 (00:37 +0000)]
Mark webrtc/captureCanvas-webrtc.html as flaky on macOS.
https://bugs.webkit.org/show_bug.cgi?id=181835

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

3 years agoResource Load Statistics: Introduce debug mode as experimental feature
wilander@apple.com [Tue, 30 Jan 2018 00:25:58 +0000 (00:25 +0000)]
Resource Load Statistics: Introduce debug mode as experimental feature
https://bugs.webkit.org/show_bug.cgi?id=182199
<rdar://problem/36930364>

Reviewed by Alex Christensen.

Source/WebCore:

No new tests. This adds an experimental feature.

The only changes to default behavior are:
- Increased resolution on timestamps which is needed to be able to set shorter
  timeouts in debug mode.
- Only update partitioning and blocking table when needed. This is an optimization
  which pays off in less XPC with shorter timeouts.

* loader/ResourceLoadObserver.cpp:
(WebCore::reduceTimeResolution):
(WebCore::ResourceLoadObserver::logFrameNavigation):
(WebCore::ResourceLoadObserver::logSubresourceLoading):
(WebCore::ResourceLoadObserver::logWebSocketLoading):
(WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
(WebCore::reduceToHourlyTimeResolution): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setResourceLoadStatisticsDebugMode):
(WebCore::RuntimeEnabledFeatures::resourceLoadStatisticsDebugMode const):
* page/Settings.yaml:

Source/WebKit:

The only changes to default behavior are:
- Increased resolution on timestamps which is needed to be able to set shorter
  timeouts in debug mode.
- Only update partitioning and blocking table when needed. This is an optimization
  which pays off in less XPC with shorter timeouts.

* Shared/WebPreferences.yaml:
* UIProcess/API/APIWebsiteDataStore.cpp:
(API::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
(API::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/API/APIWebsiteDataStore.h:
* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreSetResourceLoadStatisticsDebugMode):
* UIProcess/API/C/WKWebsiteDataStoreRef.h:
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsDebugMode]):
(-[WKWebsiteDataStore _setResourceLoadStatisticsDebugMode:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::setResourceLoadStatisticsDebugMode):
(WebKit::WebResourceLoadStatisticsStore::logUserInteraction):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resourceLoadStatisticsDebugMode const):
(WebKit::WebsiteDataStore::setResourceLoadStatisticsDebugMode):
* UIProcess/WebsiteData/WebsiteDataStore.h:

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

3 years agoSwitch grandfathering layout test to trigger on data record scanning instead of data...
wilander@apple.com [Tue, 30 Jan 2018 00:16:46 +0000 (00:16 +0000)]
Switch grandfathering layout test to trigger on data record scanning instead of data record modification
https://bugs.webkit.org/show_bug.cgi?id=181482
<rdar://problem/36549026>

Unreviewed test gardening.

* http/tests/resourceLoadStatistics/grandfathering.html:
    Switched from
    testRunner.installStatisticsDidModifyDataRecordsCallback()
    to
    testRunner.installStatisticsDidScanDataRecordsCallback().
* platform/mac-wk2/TestExpectations:
    Marked as [ Pass ] again.

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

3 years agoFetchResponse should support ConsumeData callback on chunk data is received: handling...
gskachkov@gmail.com [Mon, 29 Jan 2018 23:39:21 +0000 (23:39 +0000)]
FetchResponse should support ConsumeData callback on chunk data is received: handling ReadableStream bodies
https://bugs.webkit.org/show_bug.cgi?id=182008

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https-expected.txt: Added.
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-readable-stream-chunk.https.html: Added.
* web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-chunk-iframe.html: Added.
* web-platform-tests/service-workers/service-worker/resources/fetch-event-respond-with-readable-stream-chunk-worker.js: Added.
(const.process):
(this.step):
(this.run):
(const.asyncSteps):

Source/WebCore:

Modify FetchResponse to support ConsumeData callback with
handling of ReadableStream by chunks

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::put):
* Modules/fetch/FetchBodyConsumer.cpp:
(WebCore::FetchBodyConsumer::resolve):
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::consumeBodyFromReadableStream):
* Modules/fetch/FetchResponse.h:
* Modules/streams/ReadableStreamChunk.h: Added.
* Modules/streams/ReadableStreamSink.cpp:
(WebCore::ReadableStreamToSharedBufferSink::enqueue):
(WebCore::ReadableStreamToSharedBufferSink::close):
* Modules/streams/ReadableStreamSink.h:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::processResponse):

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