WebKit-https.git
2 years agoMark storage/websql/database-lock-after-reload.html as flaky.
ryanhaddad@apple.com [Fri, 19 Jan 2018 06:04:53 +0000 (06:04 +0000)]
Mark storage/websql/database-lock-after-reload.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=173928

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark imported/w3c/web-platform-tests/IndexedDB/idbdatabase-createObjectStore-exceptio...
ryanhaddad@apple.com [Fri, 19 Jan 2018 06:04:51 +0000 (06:04 +0000)]
Mark imported/w3c/web-platform-tests/IndexedDB/idbdatabase-createObjectStore-exception-order.htm as flaky.
https://bugs.webkit.org/show_bug.cgi?id=172243

Unreviewed test gardening.

* TestExpectations:

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

2 years agoMark js/slow-stress/Int32Array-alloc-huge-long-lived.html as slow on iOS.
ryanhaddad@apple.com [Fri, 19 Jan 2018 05:55:15 +0000 (05:55 +0000)]
Mark js/slow-stress/Int32Array-alloc-huge-long-lived.html as slow on iOS.
https://bugs.webkit.org/show_bug.cgi?id=181838

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoAdd support for builderNameToIDMap in BuildbotSyncer
aakash_jain@apple.com [Fri, 19 Jan 2018 05:42:39 +0000 (05:42 +0000)]
Add support for builderNameToIDMap in BuildbotSyncer
https://bugs.webkit.org/show_bug.cgi?id=176526

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotSyncer._loadConfig): Added builderNameToIDMap parameter. It would be used later on.
(BuildbotSyncer._resolveBuildersWithPlatforms): Ditto.
(BuildbotSyncer._validateAndMergeConfig): Added builderID as a valid config parameter.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype.getBuilderNameToIDMap): Method to fetch BuilderNameToIDMap from Buildbot 0.9.
(BuildbotTriggerable.prototype.getBuilderNameToIDMapDeprecated): Method to fetch BuilderNameToIDMap from Buildbot 0.8.
(BuildbotTriggerable.prototype.initSyncers): Updated to use getBuilderNameToIDMap.
* unit-tests/buildbot-syncer-tests.js: Updated unit-tests.
* server-tests/resources/mock-data.js:
(MockData.buildbotBuildersURLDeprecated): URL for fetching Builders list.
(MockData.buildbotBuildersURL): Ditto for Buildbot 0.9
(MockData.mockBuildbotBuildersDeprecated): Sample builders data for Buildbot 0.8
(MockData.mockBuildbotBuilders): Ditto for Buildbot 0.9
* server-tests/tools-buildbot-triggerable-tests.js: Added test for getBuilderNameToIDMap. Updated tests to handle
newly added promise for fetching builders list from Buildbot.
* server-tests/tools-sync-buildbot-integration-tests.js: Ditto.

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

2 years agoMark media/W3C/video/networkState/networkState_during_loadstart.html as flaky.
ryanhaddad@apple.com [Fri, 19 Jan 2018 04:55:46 +0000 (04:55 +0000)]
Mark media/W3C/video/networkState/networkState_during_loadstart.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=179643

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoCharts can be empty when values are all identical
rniwa@webkit.org [Fri, 19 Jan 2018 04:46:45 +0000 (04:46 +0000)]
Charts can be empty when values are all identical
https://bugs.webkit.org/show_bug.cgi?id=181828

Reviewed by Alexey Proskuryakov.

Fixed the bug that when SampleVarianceUpperTriangularMatrix can store -Infinity as the initial cost
of some entries when the sample standard deviation between two points turns out to be 0,
and cause splitIntoSegmentsUntilGoodEnough to return undefiend because no segmentation has a finite cost.

Also fixed the bug that the time series chart fails to show any data points when all data points have
identical values as the entire y-coordinate gets collapsed to an empty value range by adjusting the max value
when min & max values are identical.

* public/v3/components/time-series-chart.js:
(TimeSeriesChart.prototype._ensureValueRangeCache): Raise the max slightly when min & max are identical
to avoid the chart becoming empty. Otherwise valueDiff in _computeVerticalRenderingMetrics becomes 0
and value-to-y-coordinate conversion always results in NaN.
* public/shared/statistics.js:
(Statistics..SampleVarianceUpperTriangularMatrix):
* unit-tests/statistics-tests.js: Added a test case.

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

2 years agoMark media/video-main-content-allow-then-deny.html as flaky.
ryanhaddad@apple.com [Fri, 19 Jan 2018 04:33:17 +0000 (04:33 +0000)]
Mark media/video-main-content-allow-then-deny.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181830

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoUpdate TestExpectations for fast/multicol/spanner-crash-when-adding-summary.html.
ryanhaddad@apple.com [Fri, 19 Jan 2018 04:29:33 +0000 (04:29 +0000)]
Update TestExpectations for fast/multicol/spanner-crash-when-adding-summary.html.

Unreviewed test gardening.

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

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

2 years agoMark imported/w3c/web-platform-tests/service-workers/service-worker/update-after...
ryanhaddad@apple.com [Fri, 19 Jan 2018 04:25:52 +0000 (04:25 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/update-after-navigation-fetch-event.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181499

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years agoUnreviewed build fix, removed unused lambda capture.
ryanhaddad@apple.com [Fri, 19 Jan 2018 01:35:06 +0000 (01:35 +0000)]
Unreviewed build fix, removed unused lambda capture.

* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):

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

2 years agoWe should be able to terminate service workers that are unresponsive
cdumez@apple.com [Fri, 19 Jan 2018 00:57:42 +0000 (00:57 +0000)]
We should be able to terminate service workers that are unresponsive
https://bugs.webkit.org/show_bug.cgi?id=181563
<rdar://problem/35280031>

Reviewed by Alex Christensen.

Source/WebCore:

Test: http/tests/workers/service/postmessage-after-terminating-hung-worker.html

* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::terminateWorker):
Before calling WorkerThread::stop(), set a timer with the given timeout parameter.
If the worker thread has not stopped when the timer fires, forcefully exit the
service worker process. The StorageProcess will take care of relaunching the
service worker process if it exits abruptly.

(WebCore::SWContextManager::serviceWorkerFailedToTerminate):
Log error message if we failed to terminate a service worker and call exit().

(WebCore::SWContextManager::ServiceWorkerTerminationRequest::ServiceWorkerTerminationRequest):

* workers/service/context/SWContextManager.h:

Source/WebKit:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::terminateWorker):
Use a 10 second timeout for forcefully exiting the service worker process when
the service worker in question fails to terminate.

(WebKit::WebSWContextManagerConnection::syncTerminateWorker):
Use a 100ms timeout for forcefully exiting the service worker process when
the service worker in question fails to terminate. This method is only called
from the layout tests, which is why we use a very short timeout.

Source/WTF:

* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::loggingString const):
Allow using loggingString() from RELEASE_LOG().

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/postmessage-after-terminating-hung-worker-expected.txt: Added.
* http/tests/workers/service/postmessage-after-terminating-hung-worker.html: Added.
* http/tests/workers/service/resources/postmessage-after-terminating-hung-worker.js: Added.
* http/tests/workers/service/resources/postmessage-echo-worker-mayhang.js: Added.

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

2 years agoBuild fix, remove a call to -[NSWindow setOneShot:]
ap@apple.com [Fri, 19 Jan 2018 00:43:56 +0000 (00:43 +0000)]
Build fix, remove a call to -[NSWindow setOneShot:]
https://bugs.webkit.org/show_bug.cgi?id=181809

Reviewed by Tim Horton.

* WebView/WebTextCompletionController.mm:
(-[WebTextCompletionController _buildUI]):

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

2 years ago[WinCairo] Pass correct url for http test to test driver.
commit-queue@webkit.org [Fri, 19 Jan 2018 00:25:48 +0000 (00:25 +0000)]
[WinCairo] Pass correct url for http test to test driver.
https://bugs.webkit.org/show_bug.cgi?id=181814

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

* Scripts/webkitpy/port/driver.py:
(Driver):
(Driver.http_test_path_to_uri):
(Driver.is_secure_path):
(Driver.http_base_url):
(Driver.uri_to_test):

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

2 years agoUnreviewed, update the triggerable name for 'sierra-release-perf-tests'
ryanhaddad@apple.com [Fri, 19 Jan 2018 00:19:00 +0000 (00:19 +0000)]
Unreviewed, update the triggerable name for 'sierra-release-perf-tests'

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

2 years agoSet the minimum executable allocator size properly
jfbastien@apple.com [Thu, 18 Jan 2018 23:53:23 +0000 (23:53 +0000)]
Set the minimum executable allocator size properly
https://bugs.webkit.org/show_bug.cgi?id=181816
<rdar://problem/36635533>

Reviewed by Saam Barati.

Executable allocator expects at least two page size's worth of
allocation in certain conditions, and that causes some tests to
now fail because they ask for less. Set that minimum correctly. We
were already rounding up to a page size, so having a minimum of 2
page sizes is fine.

* jit/ExecutableAllocator.cpp:
(JSC::FixedVMPoolExecutableAllocator::FixedVMPoolExecutableAllocator):

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

2 years agoUnreviewed, suppress deprecation warnings to fix the build with a newer SDK.
ryanhaddad@apple.com [Thu, 18 Jan 2018 23:39:27 +0000 (23:39 +0000)]
Unreviewed, suppress deprecation warnings to fix the build with a newer SDK.

Source/WebKit:

* UIProcess/ios/WKPDFPageNumberIndicator.mm:
(-[WKPDFPageNumberIndicator _makeRoundedCorners]):

Source/WebKitLegacy/mac:

* Carbon/HIWebView.mm:
(overrideCGContext):
(restoreCGContext):

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

2 years agoDon't fetch more than two builds to check duplicity of builds in ReportProcessor
rniwa@webkit.org [Thu, 18 Jan 2018 23:01:46 +0000 (23:01 +0000)]
Don't fetch more than two builds to check duplicity of builds in ReportProcessor
https://bugs.webkit.org/show_bug.cgi?id=181786

Reviewed by Wenson Hsieh.

Limit the number of builds to check to avoid using a lot of memory with a long delay.

* public/include/report-processor.php:
(ReportProcessor::resolve_build_id):

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

2 years ago2018-01-18 Michael Saboff <msaboff@apple.com>
msaboff@apple.com [Thu, 18 Jan 2018 22:43:01 +0000 (22:43 +0000)]
2018-01-18  Michael Saboff  <msaboff@apple.com>

Unreviewed build fix for Windows

* interpreter/FrameTracers.h:
(JSC::assertStackPointerIsAligned): Can't use gcc style inlined assembly
on Windows.

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

2 years agoDo not go to the storage process when loading a main resource if there is no service...
commit-queue@webkit.org [Thu, 18 Jan 2018 21:12:55 +0000 (21:12 +0000)]
Do not go to the storage process when loading a main resource if there is no service worker registered
https://bugs.webkit.org/show_bug.cgi?id=181395

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

Source/WebCore:

No observable behavior change.
Instead of creating a connection to know whether there is a potential service worker,
Ask the service worker provider that will use the connection if needed.
Otherwise, it will use a default value provided by the UIProcess.

Tested by cleaning all service workers and checking the computed value of the default value,
then observing whether pages registering service workers work well.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::mayHaveServiceWorkerRegisteredForOrigin):
* workers/service/ServiceWorkerProvider.h:

Source/WebKit:

Add a new web process creation parameter to know whether there is any service worker registered at web process creation time.
If there is none, the web process will then start to load HTTP resources from the network.
The connection to the storage process is then executed when receiving the first bytes of the main resource.
This connection is needed as other web processes may create service workers at any given time.
If there is one registered service worker, the web process will wait for its connection to the storage process to be active.

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/ServiceWorkerProcessProxy.cpp:
(WebKit::ServiceWorkerProcessProxy::hasRegisteredServiceWorkers):
* UIProcess/ServiceWorkerProcessProxy.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::initializeNewWebProcess):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::WebServiceWorkerProvider::existingServiceWorkerConnectionForSession):
* WebProcess/Storage/WebServiceWorkerProvider.h:
* WebProcess/Storage/WebToStorageProcessConnection.h:
(WebKit::WebToStorageProcessConnection::existingServiceWorkerConnectionForSession):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeWebProcess):

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

2 years agoPoisons should be initialized after Options are initialized.
mark.lam@apple.com [Thu, 18 Jan 2018 21:00:58 +0000 (21:00 +0000)]
Poisons should be initialized after Options are initialized.
https://bugs.webkit.org/show_bug.cgi?id=181807
<rdar://problem/36629138>

Reviewed by Keith Miller.

This is because poison initialization may depend on options.

* runtime/InitializeThreading.cpp:
(JSC::initializeThreading):

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

2 years agoAX: roles-computedRoleString.html layout test should support enabling/disabling indiv...
jdiggs@igalia.com [Thu, 18 Jan 2018 20:39:12 +0000 (20:39 +0000)]
AX: roles-computedRoleString.html layout test should support enabling/disabling individual test cases
https://bugs.webkit.org/show_bug.cgi?id=181806

Reviewed by Chris Fleizach.

Add a "data-platform" attribute to each element so that we can enable or disable
a given test case on a given platform. Update the platform expectations for GTK
to reflect changes and new support which happened in the interim. And remove the
test from the list of expected failures.

* accessibility/roles-computedRoleString.html:
* platform/gtk/TestExpectations:
* platform/gtk/accessibility/roles-computedRoleString-expected.txt:

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

2 years agoRegression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
cdumez@apple.com [Thu, 18 Jan 2018 20:10:58 +0000 (20:10 +0000)]
Regression(r223149): WebProcessProxy::didClose() no longer refs WebPageProxy objects
https://bugs.webkit.org/show_bug.cgi?id=181771
<rdar://problem/36566237>

Reviewed by Brady Eidson.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didClose):
Use copyToVectorOf<RefPtr<WebPageProxy>>() to maintain pre-r223149 behavior
and ref the pages.

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

2 years ago[Xcode] Streamline and future-proof target-macOS-version-dependent build setting...
mitz@apple.com [Thu, 18 Jan 2018 19:49:51 +0000 (19:49 +0000)]
[Xcode] Streamline and future-proof target-macOS-version-dependent build setting definitions
https://bugs.webkit.org/show_bug.cgi?id=181803

Reviewed by Tim Horton.

Source/bmalloc:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.

Source/JavaScriptCore:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
  useful for defining settings that depend on the target macOS version.

Source/ThirdParty/ANGLE:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.

Source/ThirdParty/libwebrtc:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
  useful for defining settings that depend on the target macOS version.
* Configurations/opus.xcconfig: Adopted macOSTargetConditionals helper.

Source/WebCore:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
  useful for defining settings that depend on the target macOS version.

Source/WebCore/PAL:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
  useful for defining settings that depend on the target macOS version.

Source/WebInspectorUI:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/Version.xcconfig: Ditto.

Source/WebKit:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added.  Defines helper build settings
  useful for defining settings that depend on the target macOS version.

Source/WebKitLegacy/mac:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Ditto.
* Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals helpers.
* Configurations/Version.xcconfig: Updated.
* Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build settings
  useful for defining settings that depend on the target macOS version.

Source/WTF:

* Configurations/Base.xcconfig: Updated.
* Configurations/DebugRelease.xcconfig: Updated.

Tools:

* DumpRenderTree/mac/Configurations/Base.xcconfig: Updated.
* DumpRenderTree/mac/Configurations/DebugRelease.xcconfig: Ditto.
* ImageDiff/cg/Configurations/Base.xcconfig: Ditto.
* ImageDiff/cg/Configurations/DebugRelease.xcconfig: Ditto.
* MiniBrowser/Configurations/Base.xcconfig: Ditto.
* MiniBrowser/Configurations/DebugRelease.xcconfig: Ditto.
* TestWebKitAPI/Configurations/Base.xcconfig: Ditto.
* TestWebKitAPI/Configurations/DebugRelease.xcconfig: Ditto.
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Adopted macOSTargetConditionals
  helpers.
* TestWebKitAPI/Configurations/macOSTargetConditionals.xcconfig: Added. Defines helper build
  settings useful for defining settings that depend on the target macOS version.
* WebKitTestRunner/Configurations/Base.xcconfig: Updated.
* WebKitTestRunner/Configurations/DebugRelease.xcconfig: Updated.

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

2 years agoWeb Inspector: Canvas Tab: record button on canvas card doesn't always show on hover...
webkit@devinrousso.com [Thu, 18 Jan 2018 19:41:00 +0000 (19:41 +0000)]
Web Inspector: Canvas Tab: record button on canvas card doesn't always show on hover, or is misplaced
https://bugs.webkit.org/show_bug.cgi?id=179183

Reviewed by Joseph Pecoraro.

* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas:not(.is-recording) > header > .navigation-bar > .item.record-start-stop): Deleted.

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

2 years agoRemove Opensource El Capitan queues from buildbot
lingcherd_ho@apple.com [Thu, 18 Jan 2018 19:01:26 +0000 (19:01 +0000)]
Remove Opensource El Capitan queues from buildbot
https://bugs.webkit.org/show_bug.cgi?id=181712

Reviewed by Aakash Jain.

* BuildSlaveSupport/build.webkit.org-config/config.json:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/WebKitBuildbot.js:
(WebKitBuildbot):
* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:

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

2 years agoService Workers restored from persistent storage have 'redundant' state
cdumez@apple.com [Thu, 18 Jan 2018 18:46:43 +0000 (18:46 +0000)]
Service Workers restored from persistent storage have 'redundant' state
https://bugs.webkit.org/show_bug.cgi?id=181749
<rdar://problem/36556486>

Reviewed by Youenn Fablet.

Source/WebCore:

Tested by new API test.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::installContextData):
Make sure the SWServerWorker's state is set to "activated" after it is assigned to
the registrations' active slot. Otherwise, it stays in its default state (redundant).

Source/WebKit:

Allow service workers to intercept custom protocol loads as this is useful for
API testing.

* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::tryLoadingUsingURLSchemeHandler):
* WebProcess/Network/WebLoaderStrategy.h:

Tools:

Add API test coverage.

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
(-[SWMessageHandlerForFetchTest userContentController:didReceiveScriptMessage:]):

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

2 years agoREGRESSION (r226068): [X86] Crash in JavaScriptCore ShadowChicken when handling excep...
msaboff@apple.com [Thu, 18 Jan 2018 18:44:30 +0000 (18:44 +0000)]
REGRESSION (r226068): [X86] Crash in JavaScriptCore ShadowChicken when handling exceptions
https://bugs.webkit.org/show_bug.cgi?id=181802

Reviewed by Filip Pizlo.

There where a few places where the stack isn't properly aligned for X86 when we call into C++ code.
Two places are where we call into exception handling code, the LLInt and from nativeForGenerator.
The other place was when we call into the operationOSRWriteBarrier().

Added an assert check that the stack is aligned on X86 platforms in the native call tracing code.
This helped find the other cases beyond the original problem.

* dfg/DFGOSRExitCompilerCommon.cpp:
(JSC::DFG::osrWriteBarrier):
* interpreter/FrameTracers.h:
(JSC::assertStackPointerIsAligned):
(JSC::NativeCallFrameTracer::NativeCallFrameTracer):
(JSC::NativeCallFrameTracerWithRestore::NativeCallFrameTracerWithRestore):
* jit/ThunkGenerators.cpp:
(JSC::nativeForGenerator):
* llint/LowLevelInterpreter32_64.asm:

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

2 years ago[GTK] AX: Two layout tests crash with error 'g_strstr_len: assertion 'haystack !...
jdiggs@igalia.com [Thu, 18 Jan 2018 18:38:15 +0000 (18:38 +0000)]
[GTK] AX: Two layout tests crash with error 'g_strstr_len: assertion 'haystack != NULL' failed' in Accessibility::UIElement::url
https://bugs.webkit.org/show_bug.cgi?id=176796

Reviewed by Chris Fleizach.

Tools:

Add sanity check that we have a URL before calling g_strstr_len().

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

LayoutTests:

Remove failing tests from Test Expectations. Update expected results of
xml-roles-exposed to reflect several bug fixes which were made in the
interim. Modify add-children-pseudo-element.html to account for platform
differences in the accessibility tree. Add an additional URL test because
we didn't have coverage for getting the URL of accessible links resulting
from native anchor elements.

* accessibility/add-children-pseudo-element.html: Modified.
* accessibility/gtk/link-url-expected.txt: Added.
* accessibility/gtk/link-url.html: Added.
* accessibility/gtk/xml-roles-exposed-expected.txt: Updated.
* platform/gtk/TestExpectations: Removed failing tests.
* platform/gtk/accessibility/add-children-pseudo-element-expected.txt: Added.

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

2 years agoAdd triggers for Sierra test262 and perf queues
ryanhaddad@apple.com [Thu, 18 Jan 2018 18:31:42 +0000 (18:31 +0000)]
Add triggers for Sierra test262 and perf queues
https://bugs.webkit.org/show_bug.cgi?id=181799

Reviewed by Aakash Jain.

* BuildSlaveSupport/build.webkit.org-config/config.json:

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

2 years agoMarked multiple imported/w3c/web-platform-tests/service-workers/ test as flaky
jlewis3@apple.com [Thu, 18 Jan 2018 18:12:58 +0000 (18:12 +0000)]
Marked multiple imported/w3c/web-platform-tests/service-workers/ test as flaky
https://bugs.webkit.org/show_bug.cgi?id=181750

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

2 years agoREGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
antti@apple.com [Thu, 18 Jan 2018 17:50:00 +0000 (17:50 +0000)]
REGRESSION(r225650): The scores of MotionMark tests Multiply and Leaves dropped by 8%
https://bugs.webkit.org/show_bug.cgi?id=181460
<rdar://problem/36379776>

Reviewed by Ryosuke Niwa.

* css/parser/CSSParser.cpp:
(WebCore::CSSParserContext::CSSParserContext):

Don't do the expensive security origin test if the supplied sheet base URL is null. This
is true for rules coming from the same document.

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

2 years agoREGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search...
bfulgham@apple.com [Thu, 18 Jan 2018 17:49:44 +0000 (17:49 +0000)]
REGRESSION(r225858): Sandbox violations due to blocked access to Spotlight search preferences
https://bugs.webkit.org/show_bug.cgi?id=181797
<rdar://problem/36546412>

Reviewed by Eric Carlson.

* Resources/SandboxProfiles/ios/com.apple.WebKit.WebContent.sb: Add the read permission for
'com.apple.lookup.shared' to support DataDetectors.

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

2 years agoREGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
antti@apple.com [Thu, 18 Jan 2018 17:37:28 +0000 (17:37 +0000)]
REGRESSION (r223604): Setting :before/after pseudo element on <noscript> asserts
https://bugs.webkit.org/show_bug.cgi?id=181795
<rdar://problem/36334524>

Reviewed by David Kilzer.

Source/WebCore:

<noscript> disallows renderer generation outside CSS mechanisms, however we would still construct
PseudoElements for them during style resolution. These were never removed properly because the
pseudo element removal was tied to render tree teardown. Without proper removal the associated
animations were also not canceled.

Test: fast/css-generated-content/noscript-pseudo-anim-crash.html

* dom/Element.cpp:
(WebCore::Element::removedFromAncestor):

Take care to get rid of PseudoElements when the element is removed from the tree.
This also cancels any associated animations.

LayoutTests:

* fast/css-generated-content/noscript-pseudo-anim-crash-expected.txt: Added.
* fast/css-generated-content/noscript-pseudo-anim-crash.html: Added.

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

2 years agoAX: Aria-activedescendant not supported
cfleizach@apple.com [Thu, 18 Jan 2018 17:26:23 +0000 (17:26 +0000)]
AX: Aria-activedescendant not supported
https://bugs.webkit.org/show_bug.cgi?id=161734
<rdar://problem/28202679>

Reviewed by Joanmarie Diggs.

Source/WebCore:

When a combo-box owns/controls a list/listbox/grid/tree, the owned element needs to check the active-descendant of the combobox when
checking if it has selected children.
The target of the selection change notification should also be the owned element in these cases.

Test: accessibility/aria-combobox-controlling-list.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::selectedListItem):
* accessibility/AccessibilityObject.h:
* accessibility/AccessibilityRenderObject.cpp:
(WebCore::AccessibilityRenderObject::targetElementForActiveDescendant const):
(WebCore::AccessibilityRenderObject::handleActiveDescendantChanged):
(WebCore::AccessibilityRenderObject::canHaveSelectedChildren const):
(WebCore::AccessibilityRenderObject::selectedChildren):
* accessibility/AccessibilityRenderObject.h:
* accessibility/mac/AXObjectCacheMac.mm:
(WebCore::AXObjectCache::postPlatformNotification):

LayoutTests:

* accessibility/aria-combobox-control-owns-elements-expected.txt: Added.
* accessibility/aria-combobox-control-owns-elements.html: Added.

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

2 years agoMark fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html as faili...
pvollan@apple.com [Thu, 18 Jan 2018 16:52:35 +0000 (16:52 +0000)]
Mark fast/forms/auto-fill-button/input-strong-password-auto-fill-button.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=181662

Unreviewed test gardening.

* platform/win/TestExpectations:

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

2 years ago[Xcode] Shared schemes in the WebKit workspace still have build pre-actions that...
mitz@apple.com [Thu, 18 Jan 2018 16:46:12 +0000 (16:46 +0000)]
[Xcode] Shared schemes in the WebKit workspace still have build pre-actions that invoke copy-webkitlibraries-to-product-directory
https://bugs.webkit.org/show_bug.cgi?id=181784

Reviewed by Anders Carlsson.

* WebKit.xcworkspace/xcshareddata/xcschemes/All Source.xcscheme: Remove the build pre-action.
* WebKit.xcworkspace/xcshareddata/xcschemes/All Tools.xcscheme: Ditto.

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

2 years agoREGRESSION (r224780): Text stroke not applied to video captions.
pvollan@apple.com [Thu, 18 Jan 2018 16:13:16 +0000 (16:13 +0000)]
REGRESSION (r224780): Text stroke not applied to video captions.
https://bugs.webkit.org/show_bug.cgi?id=181743
<rdar://problem/35874338>

Reviewed by Simon Fraser.

Source/WebCore:

Tests: media/track/track-css-visible-stroke-expected.html
       media/track/track-css-visible-stroke.html

After r224780, it is no longer possible to mix text stroke styles with webkit
legacy text stroke styles.

* css/StyleResolver.cpp:
(WebCore::isValidCueStyleProperty):
* page/CaptionUserPreferencesMediaAF.cpp:
(WebCore::CaptionUserPreferencesMediaAF::captionsTextEdgeCSS const):

LayoutTests:

* media/track/track-css-stroke-cues-expected.txt:
* media/track/track-css-stroke-cues.html:
* media/track/track-css-visible-stroke-expected.html: Added.
* media/track/track-css-visible-stroke.html: Added.

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

2 years ago[Payment Request] Support a default shipping address for Apple Pay
aestes@apple.com [Thu, 18 Jan 2018 15:42:08 +0000 (15:42 +0000)]
[Payment Request] Support a default shipping address for Apple Pay
https://bugs.webkit.org/show_bug.cgi?id=181754
<rdar://problem/36009733>

Reviewed by Brady Eidson.

Source/WebCore:

Move shippingContact from ApplePayPaymentRequest to ApplePayRequestBase. This allows
merchants to specify a default shipping address when using Apple Pay with Payment Request.

This also fixes a bug found during testing where
+[NSPersonNameComponentsFormatter localizedStringFromPersonNameComponents:style:options:]
would throw an exception when passed a nil NSPersonNameComponents.

Test: http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html

* Modules/applepay/ApplePayPaymentRequest.h:
* Modules/applepay/ApplePayPaymentRequest.idl:
* Modules/applepay/ApplePayRequestBase.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePayRequestBase.h:
* Modules/applepay/ApplePayRequestBase.idl:
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate):
* Modules/applepay/ApplePaySessionPaymentRequest.h:
(WebCore::ApplePaySessionPaymentRequest::version const):
(WebCore::ApplePaySessionPaymentRequest::setVersion):
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert):
* Modules/applepay/paymentrequest/ApplePayRequest.idl:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::showPaymentUI):
(WebCore::MockPaymentCoordinator::completeMerchantValidation):
* testing/MockPaymentCoordinator.h:

LayoutTests:

* http/tests/ssl/applepay/ApplePayRequestShippingContact.https-expected.txt: Added.
* http/tests/ssl/applepay/ApplePayRequestShippingContact.https.html: Added.

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

2 years agoimported/w3c/web-platform-tests/viewport/viewport-resize-event-on-load-overflowing...
commit-queue@webkit.org [Thu, 18 Jan 2018 14:33:32 +0000 (14:33 +0000)]
imported/w3c/web-platform-tests/viewport/viewport-resize-event-on-load-overflowing-page.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181435

Patch by Ali Juma <ajuma@chromium.org> on 2018-01-18
Reviewed by Frédéric Wang.

Test gardening. The flakiness was fixed by r227054, so remove the test expectation.

* TestExpectations:

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

2 years agoUnreviewed. Update Selenium WebDriver imported tests.
carlosgc@webkit.org [Thu, 18 Jan 2018 10:11:12 +0000 (10:11 +0000)]
Unreviewed. Update Selenium WebDriver imported tests.

* imported/selenium/importer.json:
* imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py:
(reset_timeouts):

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

2 years agoLayout Test http/tests/images/image-supports-video.html is flaky
jer.noble@apple.com [Thu, 18 Jan 2018 08:33:14 +0000 (08:33 +0000)]
Layout Test http/tests/images/image-supports-video.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=181008
<rdar://problem/36143943>

Reviewed by Youenn Fablet.

Send a "Cache-control: nocache" header from the HTTP server when the image resource is
requested.

* http/tests/resources/redirect-to-video-if-accepted.php:
* platform/mac-wk1/TestExpectations:

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

2 years agoUnreviewed, rolling out r227096.
commit-queue@webkit.org [Thu, 18 Jan 2018 08:27:27 +0000 (08:27 +0000)]
Unreviewed, rolling out r227096.
https://bugs.webkit.org/show_bug.cgi?id=181788

"it caused a 15% octane regression" (Requested by saamyjoon on
#webkit).

Reverted changeset:

"Support MultiGetByOffset in the DFG"
https://bugs.webkit.org/show_bug.cgi?id=181466
https://trac.webkit.org/changeset/227096

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

2 years ago[iOS] Specify -[NSURL _title] for the associated URL when copying an image element
wenson_hsieh@apple.com [Thu, 18 Jan 2018 08:24:46 +0000 (08:24 +0000)]
[iOS] Specify -[NSURL _title] for the associated URL when copying an image element
https://bugs.webkit.org/show_bug.cgi?id=181783
<rdar://problem/35785445>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Always specify the -[NSURL _title] to be either the title specified in a PasteboardImage's inner PasteboardURL,
or if no title is specified, fall back to the user-visible URL string. This is because at least one internal
client always tries to use the -_title property to determine the title of a pasted URL, or if none is specified,
the -suggestedName. Since we need to set suggestedName to the preferred file name of the copied image and we
don't want the suggested name to become the title of the link, we need to explicitly set the link title.

In doing so, this patch also fixes a bug wherein we forget to set the _title of the NSURL we're registering to
an NSItemProvider.

Tests:  ActionSheetTests.CopyImageElementWithHREFAndTitle (new)
        ActionSheetTests.CopyImageElementWithHREF (modified)

* platform/ios/PlatformPasteboardIOS.mm:
(WebCore::PlatformPasteboard::write):

Tools:

Augments an existing API test and adds a new test to make sure that the resulting NSItemProvider's NSURL when
copying an image contains a relevant title.

* TestWebKitAPI/Tests/ios/ActionSheetTests.mm:
(TestWebKitAPI::TEST):
* TestWebKitAPI/ios/DataInteractionSimulator.mm:
* TestWebKitAPI/ios/UIKitSPI.h:

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

2 years agoTemporarily skip Speedometer until we fix the metrics.
rniwa@webkit.org [Thu, 18 Jan 2018 07:30:51 +0000 (07:30 +0000)]
Temporarily skip Speedometer until we fix the metrics.

* Skipped:

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

2 years agoRename config.json to config.json.sample
rniwa@webkit.org [Thu, 18 Jan 2018 07:24:43 +0000 (07:24 +0000)]
Rename config.json to config.json.sample
https://bugs.webkit.org/show_bug.cgi?id=181785

Reviewed by Wenson Hsieh.

* .gitignore: Added config.json.
* ReadMe.md: Updated the instruction.
* config.json.sample: Renamed from config.json.

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

2 years agoWebDriver: ignore the driver in selenium test names when getting expectations
carlosgc@webkit.org [Thu, 18 Jan 2018 06:51:30 +0000 (06:51 +0000)]
WebDriver: ignore the driver in selenium test names when getting expectations
https://bugs.webkit.org/show_bug.cgi?id=181738

Reviewed by Carlos Alberto Lopez Perez.

Tools:

In selenium tests, the driver is added as a parameter to every test which results in tests names like
foo[DriverName] or foo[DriverName-param2] in case of tests using more parameters. We don't want to include the
driver name in the test expectations file, so we need to remove it when querying the expectations.

* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(TestExpectationsMarker.__init__): Save the param to ignore.
(TestExpectationsMarker._item_name): Return the name of the test without the para to ignore.
(TestExpectationsMarker.pytest_collection_modifyitems): Use _item_name().
(run): Pass param to ignore to TestExpectationsMarker().
* Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
(WebDriverSeleniumExecutor.__init__): Save the driver name.
(WebDriverSeleniumExecutor.run): Pass the driver name as param to ignore.

WebDriverTests:

Add some expectations for selenium tests.

* TestExpectations.json:

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

2 years ago[GTK][WPE] Show unit tests unexpectedly passing in the bots
carlosgc@webkit.org [Thu, 18 Jan 2018 06:50:12 +0000 (06:50 +0000)]
[GTK][WPE] Show unit tests unexpectedly passing in the bots
https://bugs.webkit.org/show_bug.cgi?id=181726

Reviewed by Michael Catanzaro.

Now that we have the info, let's show it also in the bots.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunGLibAPITests.commandComplete):

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

2 years agoUnreviewed build fixes in TestGroupResultsViewer.
rniwa@webkit.org [Thu, 18 Jan 2018 06:45:31 +0000 (06:45 +0000)]
Unreviewed build fixes in TestGroupResultsViewer.

* public/v3/components/test-group-results-viewer.js:
(TestGroupResultsViewer.prototype.render): _renderCurrentMetricsLazily was never called.
(TestGroupResultsViewer.prototype._buildRowForMetric): Don't try to render null or NaN.

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

2 years agoFix perf dashboard tests for node v8
rniwa@webkit.org [Thu, 18 Jan 2018 06:06:50 +0000 (06:06 +0000)]
Fix perf dashboard tests for node v8
https://bugs.webkit.org/show_bug.cgi?id=181782

Reviewed by Wenson Hsieh.

Fixed the various tests for node.js v8, which is the latest LTS version.

* server-tests/api-manifest-tests.js: Replaced the missing Triggerable.acceptsTest by Triggerable.acceptedTests
after r226836.
* server-tests/api-measurement-set-tests.js: Added "Z" to the end timestamps to force UTF timezone now that Date
in node.js parses using the local timezone by default.
* server-tests/resources/test-server.js:
(TestServer.prototype._restoreDataDirectory): Fixed the bug that this function was erroneously using the async
function to rename a directory per new warnings. This code was racy, and it used to cause a test error occasionally.
* server-tests/tools-os-build-fetcher-tests.js: Fixed the assertions to make it work in the latest node.js.
* unit-tests/measurement-set-tests.js:
(waitForMeasurementSet): Wait for setTimeout to cycle through all microtasks instead of just two microtask cycles.

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

2 years agoWebVTT served via HLS never results in cues
jer.noble@apple.com [Thu, 18 Jan 2018 05:55:55 +0000 (05:55 +0000)]
WebVTT served via HLS never results in cues
https://bugs.webkit.org/show_bug.cgi?id=181773

Reviewed by Eric Carlson.

Source/WebCore:

Test: http/tests/media/hls/hls-webvtt-tracks.html

Three independant errors conspired to keep in-band WebVTT samples from parsing:

- The definition of ISOWebVTTCue::boxTypeName() was incorrect.
- ISOWebVTTCue::parse() didn't call it's superclass's parse() method (leading to an incorrect size and offset).
- Use String::fromUTF8() rather than String.adopt(StringVector&&).

* platform/graphics/iso/ISOVTTCue.cpp:
(WebCore::ISOWebVTTCue::parse):
* platform/graphics/iso/ISOVTTCue.h:
(WebCore::ISOWebVTTCue::boxTypeName):

LayoutTests:

* http/tests/media/hls/hls-webvtt-tracks-expected.txt: Added.
* http/tests/media/hls/hls-webvtt-tracks.html: Added.
* http/tests/media/resources/hls/subtitles/fileSequence0.webvtt: Added.
* http/tests/media/resources/hls/subtitles/prog_index.m3u8: Added.
* http/tests/media/resources/hls/test-webvtt.m3u8: Added.

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

2 years agoWeb Inspector: clicking on a path component that has no siblings should select it
webkit@devinrousso.com [Thu, 18 Jan 2018 05:03:26 +0000 (05:03 +0000)]
Web Inspector: clicking on a path component that has no siblings should select it
https://bugs.webkit.org/show_bug.cgi?id=181772

Reviewed by Joseph Pecoraro.

* UserInterface/Views/HierarchicalPathComponent.js:
(WI.HierarchicalPathComponent.prototype._updateSelectElement):
(WI.HierarchicalPathComponent.prototype._selectElementMouseDown):

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

2 years ago[DFG][FTL] Introduce PhantomNewRegexp and RegExpExecNonGlobalOrSticky
utatane.tea@gmail.com [Thu, 18 Jan 2018 04:17:32 +0000 (04:17 +0000)]
[DFG][FTL] Introduce PhantomNewRegexp and RegExpExecNonGlobalOrSticky
https://bugs.webkit.org/show_bug.cgi?id=181535

Reviewed by Saam Barati.

JSTests:

* stress/inserted-recovery-with-set-last-index.js: Added.
(shouldBe):
(foo):
* stress/materialize-regexp-at-osr-exit.js: Added.
(shouldBe):
(test):
* stress/materialize-regexp-cyclic-regexp-at-osr-exit.js: Added.
(shouldBe):
(test):
* stress/materialize-regexp-cyclic-regexp.js: Added.
(shouldBe):
(test):
(i.switch):
* stress/materialize-regexp-cyclic.js: Added.
(shouldBe):
(test):
(i.switch):
* stress/materialize-regexp-referenced-from-phantom-regexp-cyclic.js: Added.
(bar):
(foo):
(test):
* stress/materialize-regexp-referenced-from-phantom-regexp.js: Added.
(bar):
(foo):
(test):
* stress/materialize-regexp.js: Added.
(shouldBe):
(test):
* stress/phantom-regexp-regexp-exec.js: Added.
(shouldBe):
(test):
* stress/phantom-regexp-string-match.js: Added.
(shouldBe):
(test):
* stress/regexp-last-index-sinking.js: Added.
(shouldBe):
(test):

Source/JavaScriptCore:

When executing the code like `string.match(/regexp/)`, `/regexp/` object is created every time we execute this code.
However, user rarely cares about this `/regexp/` object. Typically, it is soon discarded even if it has `lastIndex`
information. So we should not create RegExpObject for this typical case.

This patch introduces PhantomNewRegexp. We convert NewRegexp node to PhantomNewRegexp in Object Allocation Sinking (OAS)
phase. We should do this analysis in OAS phase since we track modifications to `lastIndex` in the OAS phase. Even if
`lastIndex` is modified, it may not be read by users. So we have a chance to drop this NewRegexp beacause we carefully model
SetRegExpObjectLastIndex and GetRegExpObjectLastIndex in OAS phase.

This patch is a first attempt to drop NewRegexp. So we start optimizing it with the simple step: we first drop RegExp with
non-global and non-sticky one. We can later extend this optimization for RegExp with global flag. But this is not included
in this patch.

We convert RegExpExec to RegExpExecNonGlobalOrSticky if we find that the given RegExpObject's RegExp is not global/sticky
flagged. Since we do not need to touch `lastIndex` property in this case, RegExpExecNonGlobalOrSticky just takes RegExp
instead of RegExpObject. This offers the chance to make NewRegExp unused.

We also convert RegExpMatchFast to RegExpExecNonGlobalOrSticky if its RegExpObject's RegExp is non-global and non-sticky,
since they are the same behavior.

The above optimization completely removes NewRegexp in SixSpeed's regexp-u.{es5,es6}. The resulted execution time is
somewhat pure execution time of our Yarr implementation.

                             baseline                  patched

    regex-u.es5          34.8557+-0.5963     ^      6.1507+-0.5526        ^ definitely 5.6670x faster
    regex-u.es6          89.1919+-3.3851     ^     32.0917+-0.4260        ^ definitely 2.7793x faster

This patch does not change Octane/RegExp so much since it heavily uses String.prototype.replace, which is not handled in
this patch right now. We should support StringReplace node in subsequent patches.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGClobbersExitState.cpp:
(JSC::DFG::clobbersExitState):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGGraph.cpp:
(JSC::DFG::Graph::dump):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToRegExpExecNonGlobalOrSticky):
* dfg/DFGNode.h:
(JSC::DFG::Node::convertToPhantomNewRegexp):
(JSC::DFG::Node::convertToSetRegExpObjectLastIndex):
(JSC::DFG::Node::hasHeapPrediction):
(JSC::DFG::Node::hasCellOperand):
(JSC::DFG::Node::isPhantomAllocation):
(JSC::DFG::Node::hasIgnoreLastIndexIsWritable):
(JSC::DFG::Node::ignoreLastIndexIsWritable):
* dfg/DFGNodeType.h:
* dfg/DFGObjectAllocationSinkingPhase.cpp:
* dfg/DFGOperations.cpp:
* dfg/DFGOperations.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGPromotedHeapLocation.cpp:
(WTF::printInternal):
* dfg/DFGPromotedHeapLocation.h:
(JSC::DFG::PromotedLocationDescriptor::neededForMaterialization const):
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileNewRegexp):
(JSC::DFG::SpeculativeJIT::compileSetRegExpObjectLastIndex):
(JSC::DFG::SpeculativeJIT::compileRegExpExecNonGlobalOrSticky):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGStrengthReductionPhase.cpp:
(JSC::DFG::StrengthReductionPhase::handleNode):
* dfg/DFGValidate.cpp:
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compileRegExpExecNonGlobalOrSticky):
(JSC::FTL::DFG::LowerDFGToB3::compileNewRegexp):
(JSC::FTL::DFG::LowerDFGToB3::compileSetRegExpObjectLastIndex):
* ftl/FTLOperations.cpp:
(JSC::FTL::operationPopulateObjectInOSR):
(JSC::FTL::operationMaterializeObjectInOSR):
* jit/JITOperations.h:
* runtime/RegExpObject.h:
(JSC::RegExpObject::create):

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

2 years ago[FTL] Remove unused helper functions to convert node to PutHint
utatane.tea@gmail.com [Thu, 18 Jan 2018 03:15:26 +0000 (03:15 +0000)]
[FTL] Remove unused helper functions to convert node to PutHint
https://bugs.webkit.org/show_bug.cgi?id=181775

Reviewed by Saam Barati.

We are using PromotedHeapLocation::createHint. So they are not necessary.

* dfg/DFGNode.cpp:
(JSC::DFG::Node::convertToPutHint): Deleted.
(JSC::DFG::Node::convertToPutStructureHint): Deleted.
(JSC::DFG::Node::convertToPutByOffsetHint): Deleted.
(JSC::DFG::Node::convertToPutClosureVarHint): Deleted.
* dfg/DFGNode.h:

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

2 years agoUnreviewed, suppress warnings on GCC
utatane.tea@gmail.com [Thu, 18 Jan 2018 02:45:46 +0000 (02:45 +0000)]
Unreviewed, suppress warnings on GCC

Since `length` and `p` are always positive or zero,
static_cast<unsigned>() does what we want.

* runtime/JSBigInt.cpp:
(JSC::JSBigInt::parseInt):

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

2 years agoDisable Atomics when SharedArrayBuffer isn’t enabled
sbarati@apple.com [Thu, 18 Jan 2018 01:58:25 +0000 (01:58 +0000)]
Disable Atomics when SharedArrayBuffer isn’t enabled
https://bugs.webkit.org/show_bug.cgi?id=181572
<rdar://problem/36553206>

Reviewed by Michael Saboff.

JSTests:

* stress/isLockFree.js:

Source/JavaScriptCore:

* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init):
(JSC::createAtomicsProperty): Deleted.

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

2 years agoResource Load Statistics: Block cookies for prevalent resources without user interaction
wilander@apple.com [Thu, 18 Jan 2018 01:58:05 +0000 (01:58 +0000)]
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
       http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
       http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
       http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html

* platform/network/NetworkStorageSession.h:
    Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
    Fixes the FIXME.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Declaration of _initWithIdentifier() on NSHTTPCookieStorage.

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
    Now has m_hasBeenSetToUseStatelessCookieStorage to handle
    cookie blocking.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
    Returns singleton empty, deny-all cookie storage for cookie blocking.
    The ugly pragma instructions for clang are because the NSString
    parameter for _initWithIdentifier was not marked nullable pre-Sierra.
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
    Instead of just decision making, this now applies the policy.
(WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
    New method.
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::shouldChangePartition): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html: Added.
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html: Added.
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect-expected.txt: Removed.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html: Removed.
    Test case reworked and is now remove-partitioning-in-redirect.html.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html: Added.
* platform/ios/TestExpectations:
    New tests marked as [ Pass ] for iOS.
* platform/mac-wk2/TestExpectations:
    New tests marked as [ Pass ] for High Sierra+.
* platform/wk2/TestExpectations:
    New tests skipped for WK2 in general.

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

2 years agoRemove linked-on test for Snow Leopard
dino@apple.com [Thu, 18 Jan 2018 01:47:44 +0000 (01:47 +0000)]
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770

Reviewed by Eric Carlson.

Source/WebCore:

Remove a very old linked-on-or-after test.

* platform/graphics/ca/GraphicsLayerCA.cpp:

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

2 years agoUnreviewed, rolling out r227098.
jlewis3@apple.com [Thu, 18 Jan 2018 01:31:36 +0000 (01:31 +0000)]
Unreviewed, rolling out r227098.

This broke the build.

Reverted changeset:

"Remove linked-on test for Snow Leopard"
https://bugs.webkit.org/show_bug.cgi?id=181770
https://trac.webkit.org/changeset/227098

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

2 years agoVersioning.
jmarcell@apple.com [Thu, 18 Jan 2018 00:59:26 +0000 (00:59 +0000)]
Versioning.

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

2 years agoRemove linked-on test for Snow Leopard
dino@apple.com [Thu, 18 Jan 2018 00:40:53 +0000 (00:40 +0000)]
Remove linked-on test for Snow Leopard
https://bugs.webkit.org/show_bug.cgi?id=181770

Reviewed by Eric Carlson.

Source/WebCore:

Remove a very old linked-on-or-after test.

* platform/graphics/ca/GraphicsLayerCA.cpp:

Source/WebCore/PAL:

No need for _CFExecutableLinkedOnOrAfter any more.

* pal/spi/cf/CFUtilitiesSPI.h:

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

2 years agoUnreviewed GTK+ gardening
aboya@igalia.com [Thu, 18 Jan 2018 00:39:05 +0000 (00:39 +0000)]
Unreviewed GTK+ gardening

* platform/gtk/TestExpectations:

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

2 years agoSupport MultiGetByOffset in the DFG
sbarati@apple.com [Thu, 18 Jan 2018 00:34:16 +0000 (00:34 +0000)]
Support MultiGetByOffset in the DFG
https://bugs.webkit.org/show_bug.cgi?id=181466

Reviewed by Keith Miller.

This seems to benefit Speedometer in my local testing. It seems like this
might be around a 0.5% improvement.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleGetById):
* dfg/DFGConstantFoldingPhase.cpp:
(JSC::DFG::ConstantFoldingPhase::foldConstants):
* dfg/DFGGraph.h:
(JSC::DFG::Graph::supportsMultiGetByOffset):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):

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

2 years ago[Curl] Use ResourceRequest::encodeWithPlatformData()
commit-queue@webkit.org [Thu, 18 Jan 2018 00:26:31 +0000 (00:26 +0000)]
[Curl] Use ResourceRequest::encodeWithPlatformData()
https://bugs.webkit.org/show_bug.cgi?id=181768

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-01-17
Reviewed by Alex Christensen.

Source/WebCore:

No new tests, assertion hit in downstream port, should be covered by
existing tests.

* platform/network/curl/ResourceRequest.h:
(WebCore::ResourceRequest::encodeWithPlatformData const):
(WebCore::ResourceRequest::decodeWithPlatformData):

Source/WebKit:

* Shared/curl/WebCoreArgumentCodersCurl.cpp:
(IPC::ArgumentCoder<ResourceRequest>::encodePlatformData):
(IPC::ArgumentCoder<ResourceRequest>::decodePlatformData):

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

2 years agoUse existing RGB colorspace instead of creating a new one
eric.carlson@apple.com [Thu, 18 Jan 2018 00:04:49 +0000 (00:04 +0000)]
Use existing RGB colorspace instead of creating a new one
https://bugs.webkit.org/show_bug.cgi?id=181765
<rdar://problem/36595753>

Reviewed by Dean Jackson.

* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Use sRGBColorSpaceRef instead
of creating a new static colorspace.

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

2 years agoUnreviewed, rolling out r227076.
jlewis3@apple.com [Wed, 17 Jan 2018 23:49:45 +0000 (23:49 +0000)]
Unreviewed, rolling out r227076.

This breaks internal builds

Reverted changeset:

"Resource Load Statistics: Block cookies for prevalent
resources without user interaction"
https://bugs.webkit.org/show_bug.cgi?id=177394
https://trac.webkit.org/changeset/227076

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

2 years agoinput and textarea elements should reveal selection in setSelection when focused
rniwa@webkit.org [Wed, 17 Jan 2018 23:19:45 +0000 (23:19 +0000)]
input and textarea elements should reveal selection in setSelection when focused
https://bugs.webkit.org/show_bug.cgi?id=181715
<rdar://problem/36570546>

Reviewed by Zalan Bujtas.

Made input and textarea elements reveal selection in FrameSelection::setSelection instead of by directly
invoking FrameSelection::revealSelection in their respective updateFocusAppearance to unify code paths.

Also added options to reveal selection up to the main frame to SetSelectionOption to be used in iOS.

* editing/FrameSelection.cpp:
(WebCore::FrameSelection::FrameSelection):
(WebCore::FrameSelection::moveWithoutValidationTo): Takes SelectionRevealMode as an argument and converts
sets appropriate selection options.
(WebCore::FrameSelection::setSelection): Reconstruct SelectionRevealMode out of selection option sets.
(WebCore::FrameSelection::updateAndRevealSelection):
* editing/FrameSelection.h:
(WebCore::FrameSelection): Added RevealSelectionUpToMainFrame as a SelectionRevealMode and replaced
m_shouldRevealSelection by m_selectionRevealMode.
* html/HTMLInputElement.cpp:
(WebCore::HTMLInputElement::updateFocusAppearance): Pass SelectionRevealMode to HTMLTextFormControlElement's
select and restoreCachedSelection instead of directly invoking FrameSelection::revealSelection.
* html/HTMLTextAreaElement.cpp:
(WebCore::HTMLTextAreaElement::updateFocusAppearance): Ditto.
* html/HTMLTextFormControlElement.cpp:
(WebCore::HTMLTextFormControlElement::select):
(WebCore::HTMLTextFormControlElement::setSelectionRange):
(WebCore::HTMLTextFormControlElement::restoreCachedSelection):
* html/HTMLTextFormControlElement.h:

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

2 years agoFix broken unittest after r227048
lingcherd_ho@apple.com [Wed, 17 Jan 2018 23:19:05 +0000 (23:19 +0000)]
Fix broken unittest after r227048
https://bugs.webkit.org/show_bug.cgi?id=181760

Reviewed by Aakash Jain.

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

2 years agoWEBKIT_FRAMEWORK should not modify file-global include directories
mcatanzaro@igalia.com [Wed, 17 Jan 2018 23:18:17 +0000 (23:18 +0000)]
WEBKIT_FRAMEWORK should not modify file-global include directories
https://bugs.webkit.org/show_bug.cgi?id=181656

Reviewed by Konstantin Tokarev.

.:

Only modify the system include directories of the target passed to WEBKIT_FRAMEWORK.

* Source/cmake/WebKitMacros.cmake:

Source/WebCore:

* CMakeLists.txt:
* PlatformWPE.cmake:

Source/WebKit:

* PlatformGTK.cmake:
* PlatformWPE.cmake:

Tools:

* TestWebKitAPI/PlatformWPE.cmake:
* TestWebKitAPI/glib/CMakeLists.txt:

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

2 years ago[GTK] Try even harder not to static link WTF into libwebkit2gtk
mcatanzaro@igalia.com [Wed, 17 Jan 2018 23:16:28 +0000 (23:16 +0000)]
[GTK] Try even harder not to static link WTF into libwebkit2gtk
https://bugs.webkit.org/show_bug.cgi?id=181751

Reviewed by Alex Christensen.

We don't want two copies of WTF. It should only be in libjavascriptcoregtk.

* PlatformGTK.cmake:

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

2 years agoMarked http/wpt/resource-timing/rt-resources-per-worker.html as flaky on High Sierra.
jlewis3@apple.com [Wed, 17 Jan 2018 22:49:34 +0000 (22:49 +0000)]
Marked http/wpt/resource-timing/rt-resources-per-worker.html as flaky on High Sierra.
https://bugs.webkit.org/show_bug.cgi?id=180260

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMulticol: RenderMultiColumnFlow should not inherit the flow state
zalan@apple.com [Wed, 17 Jan 2018 22:37:23 +0000 (22:37 +0000)]
Multicol: RenderMultiColumnFlow should not inherit the flow state
https://bugs.webkit.org/show_bug.cgi?id=181762
<rdar://problem/35448565>

Reviewed by Simon Fraser.

Source/WebCore:

Do not compute the inherited flow state flag for RenderMultiColumnFlow.
It is (by definition) always inside a fragmented flow.

Test: fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html

* rendering/RenderObject.cpp:
(WebCore::RenderObject::computedFragmentedFlowState):

LayoutTests:

* fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow-expected.txt: Added.
* fast/multicol/crash-when-out-of-flow-positioned-becomes-in-flow.html: Added.

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

2 years agoDeprecate Application Cache
achristensen@apple.com [Wed, 17 Jan 2018 22:34:16 +0000 (22:34 +0000)]
Deprecate Application Cache
https://bugs.webkit.org/show_bug.cgi?id=181764

Reviewed by Geoffrey Garen.

* features.json:

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

2 years ago[iOS] Re-enable LayoutTests in the storage/indexeddb directory
ryanhaddad@apple.com [Wed, 17 Jan 2018 22:25:05 +0000 (22:25 +0000)]
[iOS] Re-enable LayoutTests in the storage/indexeddb directory
https://bugs.webkit.org/show_bug.cgi?id=180958

Unreviewed test gardening.

* platform/ios/TestExpectations:

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

2 years ago[iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage...
wenson_hsieh@apple.com [Wed, 17 Jan 2018 22:16:03 +0000 (22:16 +0000)]
[iOS simulator] API test WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage is failing
https://bugs.webkit.org/show_bug.cgi?id=181758

Reviewed by Tim Horton.

This test is failing because Editor::clientReplacementURLForResource expects a MIME type, but on iOS, the type
paramter passed into WebContentReader::readImage is a UTI; subsequently, the bundle editing delegate receives
a MIME type that's actually a UTI, which is incorrect. To address this, ensure that a MIME type is passed to
bundle SPI by converting the type in WebContentReader::readImage to a MIME type.

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::WebContentReader::readImage):

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

2 years agoMark Alicia as committer in contributors.json
aboya@igalia.com [Wed, 17 Jan 2018 22:01:31 +0000 (22:01 +0000)]
Mark Alicia as committer in contributors.json

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

2 years agoREGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator:...
antti@apple.com [Wed, 17 Jan 2018 21:53:26 +0000 (21:53 +0000)]
REGRESSION (r226385?): Crash in com.apple.WebCore: WebCore::MediaQueryEvaluator::evaluate const + 32
https://bugs.webkit.org/show_bug.cgi?id=181742
<rdar://problem/36334726>

Reviewed by David Kilzer.

Source/WebCore:

Test: fast/media/mediaqueryevaluator-crash.html

* css/MediaQueryEvaluator.cpp:
(WebCore::MediaQueryEvaluator::MediaQueryEvaluator):

Use WeakPtr<Document> instead of a plain Frame pointer.

(WebCore::MediaQueryEvaluator::evaluate const):

Get the frame via document.

* css/MediaQueryEvaluator.h:
* dom/Document.cpp:
(WebCore::Document::prepareForDestruction):

Take care to clear style resolver.

LayoutTests:

* fast/media/mediaqueryevaluator-crash-expected.txt: Added.
* fast/media/mediaqueryevaluator-crash.html: Added.

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

2 years agoMarked inspector/worker/worker-recover-if-inspector-close.html as flaky on macOS
jlewis3@apple.com [Wed, 17 Jan 2018 21:37:47 +0000 (21:37 +0000)]
Marked inspector/worker/worker-recover-if-inspector-close.html as flaky on macOS
https://bugs.webkit.org/show_bug.cgi?id=181100

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoREGRESSION (r226902): fast/events/ios/rotation/layout-viewport-during-rotation.html...
simon.fraser@apple.com [Wed, 17 Jan 2018 21:27:12 +0000 (21:27 +0000)]
REGRESSION (r226902): fast/events/ios/rotation/layout-viewport-during-rotation.html and fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html are timing out
<rdar://problem/36589755>

The first argument to a load event listener is an event, which meant that passing scriptCompleteCallback
didn't work as expected.

* fast/events/ios/rotation/layout-viewport-during-rotation.html:
* fast/events/ios/rotation/safe-area-insets-during-safari-type-rotation.html:

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

2 years agoSource/WebCore:
commit-queue@webkit.org [Wed, 17 Jan 2018 21:06:48 +0000 (21:06 +0000)]
Source/WebCore:
Put fetch request keepAlive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

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

No change of behavior.

* Modules/fetch/FetchRequest.idl:
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::fetchAPIKeepAliveEnabled const):
(WebCore::RuntimeEnabledFeatures::setFetchAPIKeepAliveEnabled):

Source/WebKit:
Put fetch request keepAlive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

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

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetFetchAPIKeepAliveEnabled):
(WKPreferencesGetFetchAPIKeepAliveEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:

Source/WebKitLegacy/mac:
Put fetch Request.keepalive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

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

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences fetchAPIKeepAliveEnabled]):
(-[WebPreferences setFetchAPIKeepAliveEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKitLegacy/win:
Put fetch Request.keepalive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

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

* WebPreferences.cpp:
(WebPreferences::fetchAPIKeepAliveEnabled):
(WebPreferences::setFetchAPIKeepAliveEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:
Put fetch Request.keepalive behind a runtime flag
https://bugs.webkit.org/show_bug.cgi?id=181592

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

* DumpRenderTree/mac/DumpRenderTree.mm:
(enableExperimentalFeatures):
* DumpRenderTree/win/DumpRenderTree.cpp:
(enableExperimentalFeatures):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

2 years agoWeb Inspector: Add back localized strings for Styles sidebar panels
commit-queue@webkit.org [Wed, 17 Jan 2018 20:25:02 +0000 (20:25 +0000)]
Web Inspector: Add back localized strings for Styles sidebar panels
https://bugs.webkit.org/show_bug.cgi?id=181748
<rdar://problem/36583184>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-17
Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/ComputedStyleDetailsSidebarPanel.js:
(WI.ComputedStyleDetailsSidebarPanel):
* UserInterface/Views/RulesStyleDetailsSidebarPanel.js:
(WI.RulesStyleDetailsSidebarPanel):
* UserInterface/Views/VisualStyleDetailsSidebarPanel.js:
(WI.VisualStyleDetailsSidebarPanel):
Add back localized strings for panel titles lost in r225547.

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

2 years ago[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache...
pvollan@apple.com [Wed, 17 Jan 2018 19:35:21 +0000 (19:35 +0000)]
[Win] Use switch when converting from ResourceRequestCachePolicy to platform cache policy.
https://bugs.webkit.org/show_bug.cgi?id=181686

Reviewed by Alex Christensen.

No new tests, covered by existing tests.

A switch will make the function easier on the eyes. Also, use the function in places where the ResourceRequestCachePolicy
is just casted to a platform cache policy.

* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::toPlatformRequestCachePolicy):

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

2 years agoResource Load Statistics: Block cookies for prevalent resources without user interaction
wilander@apple.com [Wed, 17 Jan 2018 19:16:23 +0000 (19:16 +0000)]
Resource Load Statistics: Block cookies for prevalent resources without user interaction
https://bugs.webkit.org/show_bug.cgi?id=177394
<rdar://problem/34613960>

Reviewed by Alex Christensen.

Source/WebCore:

Tests: http/tests/resourceLoadStatistics/add-blocking-to-redirect.html
       http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html
       http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html
       http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html

* platform/network/NetworkStorageSession.h:
    Now exports NetworkStorageSession::nsCookieStorage().
* platform/network/cf/NetworkStorageSessionCFNet.cpp:
(WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies):
    Fixes the FIXME.

Source/WebCore/PAL:

* pal/spi/cf/CFNetworkSPI.h:
    Declaration of _initWithIdentifier() on NSHTTPCookieStorage.

Source/WebKit:

* NetworkProcess/cocoa/NetworkDataTaskCocoa.h:
    Now has m_hasBeenSetToUseStatelessCookieStorage to handle
    cookie blocking.
* NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:
(WebKit::NetworkDataTaskCocoa::statelessCookieStorage):
    Returns singleton empty, deny-all cookie storage for cookie blocking.
(WebKit::NetworkDataTaskCocoa::applyCookieBlockingPolicy):
    Instead of just decision making, this now applies the policy.
(WebKit::NetworkDataTaskCocoa::applyCookiePartitioningPolicy):
    New method.
(WebKit::NetworkDataTaskCocoa::NetworkDataTaskCocoa):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::NetworkDataTaskCocoa::willPerformHTTPRedirection):
    Now blocks cookies for domains where cookies will be purged anyway.
(WebKit::shouldChangePartition): Deleted.
* NetworkProcess/cocoa/NetworkSessionCocoa.mm:
(-[WKNetworkSessionDelegate URLSession:task:willPerformHTTPRedirection:newRequest:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.
(-[WKNetworkSessionDelegate URLSession:task:_schemeUpgraded:completionHandler:]):
    Now downgrades for blocked cookies instead of partitioned cookies.

LayoutTests:

* http/tests/resourceLoadStatistics/add-blocking-to-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/add-blocking-to-redirect.html: Added.
* http/tests/resourceLoadStatistics/add-partitioning-to-redirect.html:
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context-expected.txt: Added.
* http/tests/resourceLoadStatistics/non-prevalent-resources-can-access-cookies-in-a-third-party-context.html: Added.
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-blocking-in-redirect.html: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect-expected.txt: Removed.
* http/tests/resourceLoadStatistics/remove-partitioning-from-redirect.html: Removed.
    Test case reworked and is now remove-partitioning-in-redirect.html.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect-expected.txt: Added.
* http/tests/resourceLoadStatistics/remove-partitioning-in-redirect.html: Added.
* platform/ios/TestExpectations:
    New tests marked as [ Pass ] for iOS.
* platform/mac-wk2/TestExpectations:
    New tests marked as [ Pass ] for High Sierra+.
* platform/wk2/TestExpectations:
    New tests skipped for WK2 in general.

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

2 years agoREGRESSION (r222795): Cardiogram never signs in
dbates@webkit.org [Wed, 17 Jan 2018 19:09:21 +0000 (19:09 +0000)]
REGRESSION (r222795): Cardiogram never signs in
https://bugs.webkit.org/show_bug.cgi?id=181693
<rdar://problem/36286293>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Exempt Cardiogram from the XHR header restrictions in r222795.

Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Cardiogram also depends on such functionality.

Test: fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html

* page/Settings.yaml:
* platform/RuntimeApplicationChecks.h:
* platform/cocoa/RuntimeApplicationChecksCocoa.mm:
(WebCore::IOSApplication::isCardiogram):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setRequestHeader):

Source/WebKit:

Exempt Cardiogram from the XHR header restrictions in r222795.

Following r222795 only Dashboard widgets are allowed to set arbitrary XHR headers.
However Cardiogram also depends on such functionality.

* Shared/WebPreferences.yaml:
* UIProcess/API/Cocoa/WKWebView.mm:
(shouldAllowSettingAnyXHRHeaderFromFileURLs):
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/Cocoa/VersionChecks.h:

Source/WTF:

Add macro define for future iOS.

* wtf/spi/darwin/dyldSPI.h:

LayoutTests:

Adds a test to ensure that a file URL can set forbidden XHR headers when the setting
allowSettingAnyXHRHeaderFromFileURLs is enabled.

* fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled-expected.txt: Added.
* fast/xmlhttprequest/set-dangerous-headers-from-file-when-setting-enabled.html: Added.

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

2 years agoASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
dbates@webkit.org [Wed, 17 Jan 2018 19:01:41 +0000 (19:01 +0000)]
ASSERTION FAILED: !m_completionHandler in PingHandle::~PingHandle()
https://bugs.webkit.org/show_bug.cgi?id=181746
<rdar://problem/36586248>

Reviewed by Chris Dumez.

Source/WebCore:

Call PingHandle::pingLoadComplete() with an error when NSURLConnection queries
whether the ping is able to respond to an authentication request. (Pings do not
respond to authenticate requests.) It will call the completion handler, nullify
the completion handler, and deallocate the PingHandle. Nullifying the completion
handler is necessary to avoid the assertion failure in ~PingHandle().

Test: http/tests/misc/before-unload-load-image.html

* platform/network/PingHandle.h:

LayoutTests:

Adds a test to ensure that loading a protected image from a beforeunload handler
does not cause an assertion failure.

* http/tests/misc/before-unload-load-image-expected.txt: Added.
* http/tests/misc/before-unload-load-image.html: Added.
* http/tests/misc/resources/before-unload-in-subframe-child.html: Added.
* http/tests/misc/resources/protected/protected-image.php: Added.

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

2 years agoWebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWi...
dbates@webkit.org [Wed, 17 Jan 2018 18:57:11 +0000 (18:57 +0000)]
WebCoreResourceHandleAsOperationQueueDelegate/ResourceHandleCFURLConnectionDelegateWithOperationQueue may
be deleted in main thread callback
https://bugs.webkit.org/show_bug.cgi?id=181747
<rdar://problem/36588120>

Reviewed by Alex Christensen.

Retain the delegate (e.g. WebCoreResourceHandleAsOperationQueueDelegate) before scheduling
a main thread callback and blocking on a semaphore for its reply because the main thread
callback can do anything, including deleting the delegate, before the non-main thread
has a chance to execute. For instance, a PingHandle will delete itself (and hence delete
its resource handle delegate) in most of the code paths invoked by the delegate.

* platform/network/cf/ResourceHandleCFURLConnectionDelegateWithOperationQueue.cpp:
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willSendRequest):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::didReceiveResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::willCacheResponse):
(WebCore::ResourceHandleCFURLConnectionDelegateWithOperationQueue::canRespondToProtectionSpace):
* platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:canAuthenticateAgainstProtectionSpace:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
(-[WebCoreResourceHandleAsOperationQueueDelegate connection:willCacheResponse:]):

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

2 years agoWeb Inspector: Super long URL string causes bad wrapping in Resources detail sidebar
commit-queue@webkit.org [Wed, 17 Jan 2018 18:41:56 +0000 (18:41 +0000)]
Web Inspector: Super long URL string causes bad wrapping in Resources detail sidebar
https://bugs.webkit.org/show_bug.cgi?id=181617

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-17
Reviewed by Brian Burg.

* UserInterface/Views/DetailsSection.css:
(.details-section > .content > .group > .row.simple > .value):
Set the break to all characters.

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

2 years ago[Win] Compile error: 'wtf/text/icu/TextBreakIteratorICU.h' not found.
pvollan@apple.com [Wed, 17 Jan 2018 18:26:56 +0000 (18:26 +0000)]
[Win] Compile error: 'wtf/text/icu/TextBreakIteratorICU.h' not found.
https://bugs.webkit.org/show_bug.cgi?id=181744
<rdar://problem/36582562>

Reviewed by Alex Christensen.

Add WTF folders to forwarding headers directories.

* wtf/PlatformWin.cmake:

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

2 years ago'fetch' event may be sent to a service worker before its state is set to 'activated'
cdumez@apple.com [Wed, 17 Jan 2018 18:07:32 +0000 (18:07 +0000)]
'fetch' event may be sent to a service worker before its state is set to 'activated'
https://bugs.webkit.org/show_bug.cgi?id=181698
<rdar://problem/36554856>

Reviewed by Youenn Fablet.

'fetch' event may be sent to a service worker before its state is set to 'activated'.
When the registration's active worker needs to intercept a load, and its state is 'activating',
we queue the request to send the fetch event in SWServerWorker::m_whenActivatedHandlers.
Once the SWServerWorker::setState() is called with 'activated' state, we then call the
handlers in m_whenActivatedHandlers to make send the fetch event now that the worker is
activated. The issue is that even though the worker is activated and its state was set to
'activated' on Storage process side, we had not yet notified the ServiceWorker process
of the service worker's new state yet.

To address the issue, we now make sure that SWServerWorker::m_whenActivatedHandlers are
called *after* we've sent the IPC to the ServiceWorker process to update the worker's
state to 'activated'. Also, we now call ServiceWorkerFetch::dispatchFetchEvent()
asynchronously in a postTask() as the service worker's state is also updated asynchronously
in a postTask. This is as per specification [1], which says to "queue a task" to fire
the fetch event.

[1] https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)

No new tests, covered by imported/w3c/web-platform-tests/service-workers/service-worker/fetch-waits-for-activate.https.html
which hits the new assertion without the fix.

* workers/service/context/ServiceWorkerFetch.cpp:
(WebCore::ServiceWorkerFetch::dispatchFetchEvent):
Add assertions to make sure that we dispatch the fetch event on the right worker and
that the worker is in 'activated' state.

* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postFetchTask):
Queue a task to fire the fetch event as per:
- https://w3c.github.io/ServiceWorker/#on-fetch-request-algorithm (step 18)
We need to match the specification exactly here or things will happen in the wrong
order. In particular, things like "update registration state" and "update worker state"
might happen *after* firing the fetch event, even though the IPC for "update registration/worker
state" was sent before the "fire fetch event" one, because the code for updating a registration/
worker state already queues a task, as per the specification.

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::updateWorkerState):
* workers/service/server/SWServerRegistration.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
Move code to send the IPC to the Service Worker process whenever the service worker's state
needs to be updated from SWServerRegistration::updateWorkerState() to SWServerWorker::setState().
This way, we can make sure the IPC is sent *before* we call the m_whenActivatedHandlers handlers,
as they may also send IPC to the Service Worker process, and we need to make sure this IPC happens
after so that the service worker is in the right state.

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

2 years agoPage.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE...
commit-queue@webkit.org [Wed, 17 Jan 2018 17:36:19 +0000 (17:36 +0000)]
Page.cpp only sees forward declaration of ApplicationStateChangeListener when ENABLE(VIDEO) is off
https://bugs.webkit.org/show_bug.cgi?id=181713

Patch by Stephan Szabo <stephan.szabo@sony.com> on 2018-01-17
Reviewed by Darin Adler.

No new tests (build fix).

* page/Page.cpp: Add include for ApplicationStateChangeListener

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

2 years agoAdd injected bundle SPI to replace subresource URLs when dropping or pasting rich...
wenson_hsieh@apple.com [Wed, 17 Jan 2018 17:07:43 +0000 (17:07 +0000)]
Add injected bundle SPI to replace subresource URLs when dropping or pasting rich content
https://bugs.webkit.org/show_bug.cgi?id=181637
<rdar://problem/36508471>

Reviewed by Tim Horton.

Source/WebCore:

Before carrying out blob URL conversion for pasted or dropped rich content, let the editor client replace
subresource URLs in WebKit2 by calling out to new injected bundle SPI. See comments below for more detail.

Tests:  WKAttachmentTests.InjectedBundleReplaceURLsWhenPastingAttributedString
        WKAttachmentTests.InjectedBundleReplaceURLWhenPastingImage

* editing/Editor.cpp:
(WebCore::Editor::clientReplacementURLForResource):
* editing/Editor.h:

Add a new helper to call out to the editor client for a URL string to replace a given ArchiveResource. In
WebKit2, this calls out to the injected bundle's new `replacementURLForResource` SPI hook.

* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::shouldReplaceSubresourceURL):
(WebCore::replaceRichContentWithAttachments):
(WebCore::replaceSubresourceURLsWithURLsFromClient):

Add a new static helper to replace subresource URLs in the given DocumentFragment with URLs supplied by the
editor client. Additionally builds a list of ArchiveResources that have not been replaced, for use at call sites
so that we don't unnecessarily create more Blobs for ArchiveResources that have already been replaced.

(WebCore::createFragmentAndAddResources):
(WebCore::sanitizeMarkupWithArchive):

Tweak web content reading codepaths to first replace subresource URLs with editor-client-supplied URLs.

(WebCore::WebContentReader::readImage):
(WebCore::shouldConvertToBlob): Deleted.

Rename this helper to shouldReplaceSubresourceURL, blob URL replacement is no longer the only scenario in which
we replace resource URLs, but in both cases, we still want to ignore `http:`-family and `data:` URLs.

* loader/EmptyClients.cpp:
* page/EditorClient.h:

Source/WebKit:

Add new injected bundle SPI, replacementURLForResource, which clients may use to provide a replacement URL to
represent an archive resource, given the resource's data and MIME type.

* WebProcess/InjectedBundle/API/APIInjectedBundleEditorClient.h:
(API::InjectedBundle::EditorClient::replacementURLForResource):
* WebProcess/InjectedBundle/API/Cocoa/WKWebProcessPlugInEditingDelegate.h:
* WebProcess/InjectedBundle/API/c/WKBundlePageEditorClient.h:

Add replacementURLForResource, and also bump the current injected bundle editor client version to 2.

* WebProcess/InjectedBundle/API/mac/WKWebProcessPlugInBrowserContextController.mm:
(-[WKWebProcessPlugInBrowserContextController _setEditingDelegate:]):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp:
(WebKit::InjectedBundlePageEditorClient::replacementURLForResource):
* WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::replacementURLForResource):
* WebProcess/WebCoreSupport/WebEditorClient.h:

Source/WebKitLegacy/mac:

Add a stub implementation of replacementURLForResource. See WebCore and WebKit ChangeLogs for more detail.

* WebCoreSupport/WebEditorClient.h:
* WebCoreSupport/WebEditorClient.mm:
(WebEditorClient::replacementURLForResource):

Source/WebKitLegacy/win:

Add a stub implementation of replacementURLForResource. See WebCore and WebKit ChangeLogs for more detail.

* WebCoreSupport/WebEditorClient.cpp:
(WebEditorClient::replacementURLForResource):
* WebCoreSupport/WebEditorClient.h:

Tools:

Add 2 new API tests to exercise injected bundle SPI for supplying replacement URLs when pasting an image, and an
attributed string containing multiple NSTextAttachments. See WebKit and WebCore ChangeLogs for more detail.

* TestWebKitAPI/Tests/WebKitCocoa/BundleEditingDelegatePlugIn.mm:
(-[BundleEditingDelegatePlugIn webProcessPlugIn:didCreateBrowserContextController:]):
(-[BundleEditingDelegatePlugIn _webProcessPlugInBrowserContextController:replacementURLForResource:mimeType:]):

Implement the new Objective-C bundle SPI to look up the incoming MIME type in the dictionary supplied via the
"MIMETypeToReplacementURLMap" bundle initialization parameter, and return it.

* TestWebKitAPI/Tests/WebKitCocoa/WKAttachmentTests.mm:
(webViewForTestingAttachments):
(-[TestWKWebView tagsInBody]):
(-[TestWKWebView expectElementTagsInOrder:]):
(-[TestWKWebView expectElementTag:toComeBefore:]):

Add a test helper to check that the given list of element tags appears in the document body. Also, reimplement
the existing -expectElementTag:toComeBefore: as a special case of -expectElementTagsInOrder:.

(TestWebKitAPI::TEST):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::InjectedBundlePage):

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

2 years ago[EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey...
commit-queue@webkit.org [Wed, 17 Jan 2018 17:00:07 +0000 (17:00 +0000)]
[EME][GStreamer] Add the full-sample encryption support in the GStreamer ClearKey decryptor
https://bugs.webkit.org/show_bug.cgi?id=180080

Patch by Yacine Bandou <yacine.bandou_ext@softathome.com> on 2018-01-17
Reviewed by Xabier Rodriguez-Calvar.

Source/WebCore:

Currently the GStreamer clearKey decryptor doesn't support the full-sample encryption,
where the buffer is entirely encrypted, it supports only the sub-sample encryption.

Test: media/encrypted-media/clearKey/clearKey-cenc-audio-playback-mse.html

* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt):

LayoutTests:

* platform/wpe/TestExpectations:
This patch fixes the crash of the test clearKey-cenc-audio-playback-mse.

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

2 years agoUnreviewed follow-up to r227051.
zandobersek@gmail.com [Wed, 17 Jan 2018 14:30:58 +0000 (14:30 +0000)]
Unreviewed follow-up to r227051.

* platform/graphics/cairo/CairoOperations.h: Fix declaration of the
fillRoundedRect() function by removing the bool parameter that's not
used at all in the definition. This went unspotted due to the unified
source build including the implementation file before fillRoundedRect()
usage in GrapihcsContextCairo.cpp, leaving the declaration undefined
and instead using the definition directly.

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

2 years ago[Cairo] Don't mirror global alpha and image interpolation quality state values in...
zandobersek@gmail.com [Wed, 17 Jan 2018 13:06:01 +0000 (13:06 +0000)]
[Cairo] Don't mirror global alpha and image interpolation quality state values in PlatformContextCairo
https://bugs.webkit.org/show_bug.cgi?id=181725

Reviewed by Carlos Garcia Campos.

Source/WebCore:

Don't duplicate global alpha and image interpolation quality state
values on the PlatformContextCairo. Instead, retrieve them from
the managing GraphicsContextState when necessary.

For Cairo operations, the FillSource and StrokeSource containers now
store the global alpha value, using it during the operation executions.
For drawNativeImage(), the global alpha and interpolation quality values
are passed through arguments.

In PlatformContextCairo, the two values are no longer stored on the
internally-managed stack, and the getter-setter pairs for the two values
are removed. In drawSurfaceToContext(), the two values are now expected
to be passed through the method arguments.

No new tests -- no change in behavior.

* platform/graphics/cairo/CairoOperations.cpp:
(WebCore::Cairo::prepareForFilling):
(WebCore::Cairo::prepareForStroking):
(WebCore::Cairo::drawPathShadow):
(WebCore::Cairo::fillCurrentCairoPath):
(WebCore::Cairo::FillSource::FillSource):
(WebCore::Cairo::StrokeSource::StrokeSource):
(WebCore::Cairo::strokeRect):
(WebCore::Cairo::strokePath):
(WebCore::Cairo::drawGlyphs):
(WebCore::Cairo::drawNativeImage):
(WebCore::Cairo::State::setGlobalAlpha): Deleted.
(WebCore::Cairo::State::setImageInterpolationQuality): Deleted.
* platform/graphics/cairo/CairoOperations.h:
* platform/graphics/cairo/GraphicsContextCairo.cpp:
(WebCore::GraphicsContext::drawNativeImage):
(WebCore::GraphicsContext::setPlatformAlpha):
(WebCore::GraphicsContext::setPlatformImageInterpolationQuality):
* platform/graphics/cairo/PlatformContextCairo.cpp:
(WebCore::PlatformContextCairo::save):
(WebCore::PlatformContextCairo::drawSurfaceToContext):
(WebCore::PlatformContextCairo::State::State): Deleted.
(WebCore::PlatformContextCairo::setImageInterpolationQuality): Deleted.
(WebCore::PlatformContextCairo::imageInterpolationQuality const): Deleted.
(WebCore::PlatformContextCairo::globalAlpha const): Deleted.
(WebCore::PlatformContextCairo::setGlobalAlpha): Deleted.
* platform/graphics/cairo/PlatformContextCairo.h:
* platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
(WebCore::MediaPlayerPrivateMediaFoundation::Direct3DPresenter::paintCurrentFrame):

Source/WebKit:

* Shared/cairo/ShareableBitmapCairo.cpp:
(WebKit::ShareableBitmap::paint):
Adjust the PlatformContextCairo::drawSurfaceToContext() invocation.
* WebProcess/WebCoreSupport/gtk/WebDragClientGtk.cpp:
(WebKit::convertCairoSurfaceToShareableBitmap): Ditto.

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

2 years agoWebDriver: add support for test expectations
carlosgc@webkit.org [Wed, 17 Jan 2018 11:23:58 +0000 (11:23 +0000)]
WebDriver: add support for test expectations
https://bugs.webkit.org/show_bug.cgi?id=180420

Reviewed by Carlos Alberto Lopez Perez.

Tools:

Add support for parsing test expectations from a JSON file and mark tests on collection accordingly.

* Scripts/run-webdriver-tests: Get the retval from process_results().
* Scripts/webkitpy/thirdparty/__init__.py:
(AutoinstallImportHook._install_pytest): Install also py because pytest needs it.
* Scripts/webkitpy/webdriver_tests/pytest_runner.py:
(TestExpectationsMarker): Plugin to mark tests based on given expectations.
(TestExpectationsMarker.__init__): Initialize expectations.
(TestExpectationsMarker.pytest_collection_modifyitems): Mark tests if needed,
(run): Create and use TestExpectationsMarker plugin.
* Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
(WebDriverSeleniumExecutor.run): Pass expectations to pytest_runner.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.__init__): Create a TestExpectations and pass it to the runners.
(WebDriverTestRunner.run): Do not count results here.
(WebDriverTestRunner.process_results): Rename print_results() as process_results() since it now returns the
amount of failures. Printing the test summary while processing results will be made optional in a follow up
patch.
(WebDriverTestRunner.process_results.report): Return the amount of failures.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py:
(WebDriverTestRunnerSelenium.__init__): Initialize _expectations.
(WebDriverTestRunnerSelenium.collect_tests): Do not include skipped tests.
(WebDriverTestRunnerSelenium.run): Stop returning the tests count.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py:
(WebDriverTestRunnerW3C.__init__): Initialize _expectations.
(WebDriverTestRunnerW3C.collect_tests): Do not include skipped tests.
(WebDriverTestRunnerW3C._scan_directory): Ditto.
(WebDriverTestRunnerW3C.run): Stop returning the tests count.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.run): Pass expectations to pytest_runner.

WebDriverTests:

Add initial test expectations. For now I'm only adding the W3C test expectations, selenium ones will be added in
a follow up patch.

* TestExpectations.json: Added.

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

2 years agoUnreviewed WPE gardening. Mark some known unit test failures.
carlosgc@webkit.org [Wed, 17 Jan 2018 11:21:39 +0000 (11:21 +0000)]
Unreviewed WPE gardening. Mark some known unit test failures.

* TestWebKitAPI/glib/TestExpectations.json:

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

2 years ago[GTK][WPE] Use the same subtest names in GTK and WPE unit tests
carlosgc@webkit.org [Wed, 17 Jan 2018 11:16:10 +0000 (11:16 +0000)]
[GTK][WPE] Use the same subtest names in GTK and WPE unit tests
https://bugs.webkit.org/show_bug.cgi?id=181724

Reviewed by Philippe Normand.

We currently use /webkit2/foo/bar for GTK and /wpe/foo/bar for WPE. Many of the tests are common, so there's no
reason to use different names. This way we can refer to the same test names for both and we can share the
expectations in the TestExpectations.json file.

* TestWebKitAPI/glib/TestExpectations.json:
* TestWebKitAPI/glib/WebKitGLib/TestMain.h: Use /webkit/foo/bar in GTK and WPE.

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

2 years agoREGRESSION(r226973/r226974): Four multimedia tests failing
philn@webkit.org [Wed, 17 Jan 2018 11:10:39 +0000 (11:10 +0000)]
REGRESSION(r226973/r226974): Four multimedia tests failing
https://bugs.webkit.org/show_bug.cgi?id=181696

Reviewed by Carlos Garcia Campos.

This patch reverts some of the changes of the above revisions so as to fix layout test failures.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::handleMessage): Properly
prepare stalled event when an error was detected.
(WebCore::MediaPlayerPrivateGStreamer::processBufferingStats): Revert to previous version.
(WebCore::MediaPlayerPrivateGStreamer::fillTimerFired): Ditto.
(WebCore::MediaPlayerPrivateGStreamer::didLoadingProgress const):
Emit progress event also when streaming but not when an error was
detected.
(WebCore::MediaPlayerPrivateGStreamer::totalBytes const): use isLiveStream like everywhere else.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
* platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
(webkit_web_src_init): Revert to keep-alive FALSE by default.

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

2 years agoUnreviewed. Increase the slow timeout of GTK and WPE unit tests.
carlosgc@webkit.org [Wed, 17 Jan 2018 11:07:25 +0000 (11:07 +0000)]
Unreviewed. Increase the slow timeout of GTK and WPE unit tests.

We are using now a lower default timeout, so multiplying by 5 is no longer enough for some of the WTF
tests. Multiply by 10 so that we get the same slow timeout as before, 50.

* glib/api_test_runner.py:
(TestRunner._run_test_glib):
(TestRunner._run_google_test):

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

2 years agoUnreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.
carlosgc@webkit.org [Wed, 17 Jan 2018 10:36:59 +0000 (10:36 +0000)]
Unreviewed. Update OptionsGTK.cmake and NEWS for 2.19.6 release.

.:

* Source/cmake/OptionsGTK.cmake: Bump version numbers.

Source/WebKit:

* gtk/NEWS: Add release notes for 2.19.6.

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

2 years ago[GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes...
carlosgc@webkit.org [Wed, 17 Jan 2018 10:06:28 +0000 (10:06 +0000)]
[GTK] Duplicated symbols in libjavascriptcoregtk and libwebkit2gtk can cause crashes in production builds
https://bugs.webkit.org/show_bug.cgi?id=179914

Reviewed by Žan Doberšek.

Source/WebKit:

Add symbols detected by check-for-global-bss-symbols-in-webkigtk-libs to the version script.

* webkitglib-symbols.map:

Tools:

Add two scripts to be run by dist-check step when releasing. One is to detect symbols duplicated in
libjavascriptcoregtk and libwebkit2gtk that should be included to the version script. The other one is to ensure
all symbols listed in the script are present in the library.

* Scripts/check-for-global-bss-symbols-in-webkigtk-libs: Added.
(bss_symbols):
* Scripts/check-for-invalid-symbols-in-version-script: Added.
(script_symbols):
* Scripts/make-dist:
(Distcheck.build):
(Distcheck):
(Distcheck.check_symbols):
(Distcheck.check):

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