WebKit-https.git
19 months agoShould reject updating a build request which has an associated build.
dewei_zhu@apple.com [Mon, 22 Jan 2018 07:38:16 +0000 (07:38 +0000)]
Should reject updating a build request which has an associated build.
https://bugs.webkit.org/show_bug.cgi?id=181893

Reviewed by Ryosuke Niwa.

Current code does not prevent submitting to same build request multiple times.
This could lead to a build losing its associated build request.
As a result, this build will be visible in charts which is not right.
Added a check when a build request is reported.
Addressed a 'FIXME' for the race condition inside ReportProcessor->resolve_build_id by surrounding
it with a database transaction.

* public/include/report-processor.php:
Wrap adding platform and resolve_build_id with a database transaction.
Add a check to make sure only a build request has no associated build can be updated.
* server-tests/api-report-tests.js: Added unit tests accordingly.

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

19 months agoTurning off custom pasteboard data doesn't actually turn it off in WK2
rniwa@webkit.org [Mon, 22 Jan 2018 06:41:05 +0000 (06:41 +0000)]
Turning off custom pasteboard data doesn't actually turn it off in WK2
https://bugs.webkit.org/show_bug.cgi?id=181920
<rdar://problem/36686429>

Reviewed by Wenson Hsieh.

Source/WebCore:

Replaced the global settings for custom pasteboard data by regular runtime enabled flags.

* dom/DataTransfer.cpp:
(WebCore::DataTransfer::getDataForItem const):
(WebCore::DataTransfer::shouldSuppressGetAndSetDataToAvoidExposingFilePaths const):
(WebCore::DataTransfer::setDataFromItemList):
(WebCore::DataTransfer::types const):
(WebCore::DataTransfer::commitToPasteboard):
* dom/DataTransferItemList.cpp:
(WebCore::shouldExposeTypeInItemList):
* editing/Editor.cpp:
(WebCore::createDataTransferForClipboardEvent):
* editing/cocoa/WebContentReaderCocoa.mm:
(WebCore::createFragmentAndAddResources):
(WebCore::WebContentReader::readWebArchive):
* page/DeprecatedGlobalSettings.cpp:
(WebCore::DeprecatedGlobalSettings::defaultCustomPasteboardDataEnabled): Deleted.
* page/DeprecatedGlobalSettings.h:
(WebCore::DeprecatedGlobalSettings::setCustomPasteboardDataEnabled): Deleted.
(WebCore::DeprecatedGlobalSettings::customPasteboardDataEnabled): Deleted.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setCustomPasteboardDataEnabled):
(WebCore::RuntimeEnabledFeatures::customPasteboardDataEnabled const):
* testing/InternalSettings.cpp:
(WebCore::InternalSettings::Backup::Backup):
(WebCore::InternalSettings::Backup::restoreTo):
(WebCore::InternalSettings::setCustomPasteboardDataEnabled):

Source/WebKit:

Moved the code to decide when to enable custom pasteboard data from WebCore
since we never enable this feature in WebKit1.

* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp:
(defaultCustomPasteboardDataEnabled): Added.
* Shared/WebPreferencesDefaultValues.h:

Source/WebKitLegacy/mac:

Always disable custom pasteboard data in WebKit1. See r226156 for details.

* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

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

19 months agoAdd a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
wenson_hsieh@apple.com [Mon, 22 Jan 2018 03:58:10 +0000 (03:58 +0000)]
Add a new feature flag for EXTRA_ZOOM_MODE and reintroduce AdditionalFeatureDefines.h
https://bugs.webkit.org/show_bug.cgi?id=181918

Reviewed by Tim Horton.

Source/JavaScriptCore:

Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default). No change in behavior.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

Include AdditionalFeatureDefines.h, if possible. This allows WebKitAdditions to override
the value of certain feature flags in the OpenSource WebKit repository.

* wtf/Platform.h:

Tools:

Add EXTRA_ZOOM_MODE to FeatureDefines.xconfig (off by default).

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

19 months agoRelease assertion in canExecuteScript when executing scripts during page cache restore
rniwa@webkit.org [Mon, 22 Jan 2018 03:39:36 +0000 (03:39 +0000)]
Release assertion in canExecuteScript when executing scripts during page cache restore
https://bugs.webkit.org/show_bug.cgi?id=181902

Reviewed by Antti Koivisto.

Source/WebCore:

The crash was caused by an erroneous instantiation of ScriptDisallowedScope::InMainThread in CachedPage::restore.
It can execute arbitrary scripts since CachedFrame::open can update style, layout, and evaluate media queries.

This is fine because there is no way to put this page back into a page cache until the load is commited via
FrameLoader::commitProvisionalLoad is invoked later which only happens after CachedPage::restore had exited.

Also added a release assert to make sure this condition holds.

Tests: fast/history/page-cache-execute-script-during-restore.html
       fast/history/page-cache-navigate-during-restore.html

* history/CachedPage.cpp:
(WebCore::CachedPageRestorationScope::CachedPageRestorationScope): Added.
(WebCore::CachedPageRestorationScope::~CachedPageRestorationScope): Added.
(WebCore::CachedPage::restore): Don't instantiate ScriptDisallowedScope::InMainThread. Set isRestoringCachedPage
on the cached pate to release-assert that there won't be any attempt to put this very page back into the cache.
* history/PageCache.cpp:
(WebCore::canCachePage): Added a release assert to make sure the page which is in the process of being restored
from the page cache is not put into the page cache.
* page/Page.h:
(WebCore::Page::setIsRestoringCachedPage): Added.
(WebCore::Page::isRestoringCachedPage const): Added.

LayoutTests:

Added regression tests for the release assertion and navigating while a document is being restored from the page cache.
WebKit should not hit any assertions in either situations.

* fast/history/page-cache-execute-script-during-restore-expected.txt: Added.
* fast/history/page-cache-execute-script-during-restore.html: Added.
* fast/history/page-cache-navigate-during-restore-expected.txt: Added.
* fast/history/page-cache-navigate-during-restore.html: Added.
* fast/history/resources/navigate-back-with-finish-test-stage.html: Added.

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

19 months agoResign NowPlaying status when no media element is eligible
eric.carlson@apple.com [Mon, 22 Jan 2018 03:30:35 +0000 (03:30 +0000)]
Resign NowPlaying status when no media element is eligible
https://bugs.webkit.org/show_bug.cgi?id=181914
<rdar://problem/35294116>

Reviewed by Jer Noble.

Source/WebCore:

Updated API test.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::removedFromAncestor): Call mediaSession->clientCharacteristicsChanged
so NowPlaying status will be updated.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::canShowControlsManager const): Return false when being queried
for NowPlaying status in an inactive document.

* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Implement in for all
ports.
* platform/audio/PlatformMediaSessionManager.h:
(WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/mac/MediaSessionManagerMac.h:
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo): Call MRMediaRemoteSetCanBeNowPlayingApplication
whenever status changes.
(WebCore::PlatformMediaSessionManager::updateNowPlayingInfoIfNecessary): Deleted, implemented
in the base class.

Source/WebKit:

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _requestActiveNowPlayingSessionInfo:]): Return registeredAsNowPlayingApplication
status.
* UIProcess/API/Cocoa/WKWebViewPrivate.h:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::nowPlayingInfoCallback): Ditto.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebPage/Cocoa/WebPageCocoa.mm:
(WebKit::WebPage::requestActiveNowPlayingSessionInfo): Ditto.

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/NowPlayingControlsTests.mm:
(-[NowPlayingTestWebView hasActiveNowPlayingSession]):
(TestWebKitAPI::TEST):
* TestWebKitAPI/Tests/WebKitCocoa/large-video-test-now-playing.html:

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

19 months agoREGRESSION (macOS 10.13.2): imported/w3c/web-platform-tests/media-source/mediasource...
jer.noble@apple.com [Mon, 22 Jan 2018 02:38:51 +0000 (02:38 +0000)]
REGRESSION (macOS 10.13.2): imported/w3c/web-platform-tests/media-source/mediasource-* LayoutTests failing
https://bugs.webkit.org/show_bug.cgi?id=181891

Reviewed by Eric Carlson.

Source/WebCore:

In macOS 10.13.2, CoreMedia changed the definition of CMSampleBufferGetDuration() to return
the presentation duration rather than the decode duration. For media streams where those two
durations are identical (or at least, closely similar), this isn't a problem. But the media
file used in the WPT tests have an unusual frame cadence: decode durations go {3000, 1, 5999,
1, 5999,...} and presentation durations go {3000, 2999, 3000, 2999}. This caused one check in
the "Coded Frame Processing" algorithm to begin failing, where it checks that the delta
between the last sample's decode time and the new decode time is no more than 2x as far as
the last sample's duration. That's not a problem as long as the "duration" is the "decode
duration" and the samples are all adjacent. Once the "duration" is "presentation duration",
all the assumptions in the algorithm are invalidated. In the WPT test case, the delta between
decode times is 5999, and 2 * the presentation duration is 5998, causing all samples up to
the next sync sample to be dropped.

To work around this change in behavior, we'll adopt the same technique used by Mozilla's MSE
implementation, which was done for similar reasons. Rather than track the "last frame duration",
we'll record the "greatest frame duration", and use actual decode timestamps to derive this
duration. The "greatest frame duration" field will be reset at the same times as "last frame
duration", and will be used only in the part of the algorithm that checks for large decode
timestamp gaps.

* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::TrackBuffer::TrackBuffer):
(WebCore::SourceBuffer::resetParserState):
(WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):

LayoutTests:

* platform/mac/TestExpectations:

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

19 months ago[ios] LayoutTest imported/w3c/web-platform-tests/payment-request/rejects_if_not_activ...
aestes@apple.com [Sun, 21 Jan 2018 21:41:07 +0000 (21:41 +0000)]
[ios] LayoutTest imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html is crashing in JSC::JSONParse
https://bugs.webkit.org/show_bug.cgi?id=177832
<rdar://problem/34805315>

Reviewed by Tim Horton.

Source/WebCore:

Test: http/tests/paymentrequest/rejects_if_not_active.https.html

* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::show): Rejected promise if the document is not active.

LayoutTests:

Made a copy of imported/w3c/web-platform-tests/payment-request/rejects_if_not_active.https.html
and modified it to handle Apple Pay and user gesture requirements.

* http/tests/paymentrequest/rejects_if_not_active.https-expected.txt: Added.
* http/tests/paymentrequest/rejects_if_not_active.https.html: Added.
* http/tests/paymentrequest/resources/page1.html: Added.
* http/tests/paymentrequest/resources/page2.html: Added.
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

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

19 months agoFix broken unit-tests after r227192
aakash_jain@apple.com [Sun, 21 Jan 2018 08:57:15 +0000 (08:57 +0000)]
Fix broken unit-tests after r227192
https://bugs.webkit.org/show_bug.cgi?id=181909

Reviewed by Carlos Garcia Campos.

* BuildSlaveSupport/build.webkit.org-config/steps_unittest.py:

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

19 months agoMake garbage collection of MessagePort objects be asynchronous.
beidson@apple.com [Sun, 21 Jan 2018 07:07:49 +0000 (07:07 +0000)]
Make garbage collection of MessagePort objects be asynchronous.
https://bugs.webkit.org/show_bug.cgi?id=181910

Reviewed by Andy Estes.

No new tests (Covered by existing tests, including GC-specific ones).

The basic premise here is as follows:
- You can *always* GC a MessagePort that is closed
- You can *always* GC a MessagePort that has no onmessage handler, as incoming messages cannot
  possibly revive it.
- You can GC a MessagePort, even if it has a message handler, as long as there are no messages
  in flight between it and the remote port, and as long as the remote port is "maybe eligible for GC."

A MessagePort is considered "maybe eligible for GC" once hasPendingActivity is asked once.

A MessagePort loses "maybe eligible for GC" status once it is used for sending or receiving a message.

The changes to MessagePort.cpp implement the above with a tiny little bool-driven state machine.
* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::registerLocalActivity):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::isLocallyReachable const):
(WebCore::MessagePort::addEventListener):
(WebCore::MessagePort::removeEventListener):
* dom/MessagePort.h:

- Remove the lock and any background-thread code paths
- Add ASSERT(isMainThread())s throughout
* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::includesPort):
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::closePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::checkRemotePortForActivity):
(WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
* dom/messageports/MessagePortChannel.h:

Add a callback for a MessagePortChannel to go ask the remote MessagePort object about local activity:
* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelProviderImpl.cpp:
(WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
(WebCore::MessagePortChannelProviderImpl::checkProcessLocalPortForActivity):
(WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync): Deleted.
* dom/messageports/MessagePortChannelProviderImpl.h:

- Remove the lock and any background-thread code paths
- Add ASSERT(isMainThread())s throughout
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
(WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
(WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
(WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
(WebCore::MessagePortChannelRegistry::didCloseMessagePort):
(WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::checkRemotePortForActivity):
(WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
(WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): Deleted.
* dom/messageports/MessagePortChannelRegistry.h:

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

19 months ago[Apple Pay] Stop eagerly loading PassKit.framework
aestes@apple.com [Sun, 21 Jan 2018 04:29:46 +0000 (04:29 +0000)]
[Apple Pay] Stop eagerly loading PassKit.framework
https://bugs.webkit.org/show_bug.cgi?id=181911
<rdar://problem/36555369>

Reviewed by Tim Horton.

Source/WebCore:

r226458 and r226123 added code that caused PassKit.framework to be eagerly loaded when
initializing a WKWebView. This is costly and should only be done when Apple Pay is first used.

To avoid eagerly loading PassKit, this patch does two things:

1. Instead of sending the available payment networks as part of WebPageCreationParameters,
PaymentCoordinator asks for them using a syncrhonous message the first time they are needed.
2. Instead of setting the Apple Pay preference to false when PassKit can't be loaded,
the following API entry points check for a missing PassKit and return false, or throw
exceptions, or reject promises:
    - ApplePaySession.canMakePayments()
    - ApplePaySession.canMakePaymentsWithActiveCard()
    - ApplePaySession.openPaymentSetup()
    - ApplePaySession.begin()

No new tests for (1), which causes no change in behavior. (2) was manually verified by
locally moving aside PassKit.framework, but that's not possible to do in an automated test.

* Modules/applepay/PaymentCoordinator.cpp:
(WebCore::PaymentCoordinator::PaymentCoordinator):
(WebCore::PaymentCoordinator::validatedPaymentNetwork const):
(WebCore::toHashSet): Deleted.
* Modules/applepay/PaymentCoordinator.h:
* Modules/applepay/PaymentCoordinatorClient.h:
* loader/EmptyClients.cpp:
* page/MainFrame.cpp:
(WebCore::MainFrame::MainFrame):

Removed PaymentCoordinator::m_availablePaymentNetworks and made
PaymentCoordinator::validatedPaymentNetwork() call
PaymentCoordinatorClient::validatedPaymentNetwork() instead.

* page/PageConfiguration.h:

Removed availablePaymentNetworks from PageConfiguration.

* testing/Internals.cpp:
(WebCore::Internals::Internals):
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::validatedPaymentNetwork):
* testing/MockPaymentCoordinator.h:

Implemented PaymentCoordinatorClient::validatedPaymentNetwork().

Source/WebKit:

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode const):
(WebKit::WebPageCreationParameters::decode):
* Shared/WebPageCreationParameters.h:

Removed availablePaymentNetworks from WebPageCreationParameters.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetApplePayEnabled):
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):

Stopped calling WebPaymentCoordinatorProxy::platformSupportsPayments().

* UIProcess/ApplePay/WebPaymentCoordinatorProxy.cpp:
(WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.h:
* UIProcess/ApplePay/WebPaymentCoordinatorProxy.messages.in:

Added message AvailablePaymentNetworks, which synchronously returns a Vector of payment
networks.

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm:
(WebKit::WebPaymentCoordinatorProxy::platformCanMakePayments):

Returned false if PassKitLibrary() fails.

(WebKit::WebPaymentCoordinatorProxy::platformCanMakePaymentsWithActiveCard):
(WebKit::WebPaymentCoordinatorProxy::platformOpenPaymentSetup):

Called completionHandler with false if PassKitLibrary() fails.

(WebKit::WebPaymentCoordinatorProxy::platformAvailablePaymentNetworks):
(WebKit::WebPaymentCoordinatorProxy::availablePaymentNetworks):

Renamed availablePaymentNetworks to platformAvailablePaymentNetworks

(WebKit::WebPaymentCoordinatorProxy::platformSupportsPayments): Deleted.

* UIProcess/ApplePay/mac/WebPaymentCoordinatorProxyMac.mm:
(WebKit::WebPaymentCoordinatorProxy::platformShowPaymentUI):

Called completionHandler with false if PassKitLibrary() fails.

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

Stopped calling WebPaymentCoordinatorProxy::availablePaymentNetworks().

* WebProcess/ApplePay/WebPaymentCoordinator.cpp:
(WebKit::WebPaymentCoordinator::availablePaymentNetworks):
(WebKit::WebPaymentCoordinator::validatedPaymentNetwork):
* WebProcess/ApplePay/WebPaymentCoordinator.h:

Implemented PaymentCoordinatorClient::validatedPaymentNetwork(). m_availablePaymentNetworks
starts off as std::nullopt, but is initialized by sending the AvailablePaymentNetworks sync
message the first time it's accessed.

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

Stopped setting PageConfiguration::availablePaymentNetworks.

Source/WebKitLegacy/mac:

* WebCoreSupport/WebPaymentCoordinatorClient.h:
* WebCoreSupport/WebPaymentCoordinatorClient.mm:
(WebPaymentCoordinatorClient::validatedPaymentNetwork):

Implemented PaymentCoordinatorClient::validatedPaymentNetwork().

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

19 months agoAPI test URLSchemeHandler.Leaks1 is timing out on iOS simulator debug
cdumez@apple.com [Sat, 20 Jan 2018 20:02:25 +0000 (20:02 +0000)]
API test URLSchemeHandler.Leaks1 is timing out on iOS simulator debug
https://bugs.webkit.org/show_bug.cgi?id=174984
<rdar://problem/33665676>

Reviewed by Alexey Proskuryakov.

Disable URLSchemeHandler.Leaks1 API test on iOS as it sometimes times out.

* TestWebKitAPI/Tests/WebKitCocoa/WKURLSchemeHandler-leaks.mm:
(TEST):

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

19 months agoRelease ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
jer.noble@apple.com [Sat, 20 Jan 2018 16:55:45 +0000 (16:55 +0000)]
Release ASSERT when reloading Vimeo page @ WebCore: WebCore::Document::updateLayout
https://bugs.webkit.org/show_bug.cgi?id=181840
<rdar://problem/36186214>

Reviewed by Simon Fraser.

Source/WebCore:

Test: media/video-fullscreen-reload-crash.html

Short circuit play() or pause() operations if the document is suspended or stopped.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::playInternal):
(WebCore::HTMLMediaElement::pauseInternal):

Source/WebKit:

Updating layout while the document is suspended or stopped is unsafe.

* WebProcess/cocoa/VideoFullscreenManager.mm:
(WebKit::inlineVideoFrame):

LayoutTests:

* media/video-fullscreen-reload-crash-expected.txt: Added.
* media/video-fullscreen-reload-crash.html: Added.
* platform/ios/TestExpectations:

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

19 months ago[JSC] NumberPrototype::extractRadixFromArgs incorrectly cast double to int32_t
ticaiolima@gmail.com [Sat, 20 Jan 2018 12:53:52 +0000 (12:53 +0000)]
[JSC] NumberPrototype::extractRadixFromArgs incorrectly cast double to int32_t
https://bugs.webkit.org/show_bug.cgi?id=181182

Reviewed by Darin Adler.

JSTests:

* stress/big-int-prototype-to-string-cast-overflow.js: Added.
* stress/big-int-prototype-to-string-exception.js: Added.
* stress/big-int-prototype-to-string-wrong-values.js: Added.
* stress/number-prototype-to-string-cast-overflow.js: Added.
* stress/number-prototype-to-string-exception.js: Added.
* stress/number-prototype-to-string-wrong-values.js: Added.

Source/JavaScriptCore:

Casting double to integer is undefined behavior when the truncation
results into a value that doesn't fit into integer size,
according C++ spec[1]. Thus, we are changing bigIntProtoFuncToString and
numberProtoFuncToString to remove these source of undefined
behavior.

[1] - http://en.cppreference.com/w/cpp/language/implicit_conversion

* runtime/BigIntPrototype.cpp:
(JSC::bigIntProtoFuncToString):
* runtime/NumberPrototype.cpp:
(JSC::numberProtoFuncToString):
(JSC::extractToStringRadixArgument):
(JSC::extractRadixFromArgs): Deleted.
* runtime/NumberPrototype.h:

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

19 months agofetch redirect is incompatible with "no-cors" mode
commit-queue@webkit.org [Sat, 20 Jan 2018 10:45:25 +0000 (10:45 +0000)]
fetch redirect is incompatible with "no-cors" mode
https://bugs.webkit.org/show_bug.cgi?id=181866
<rdar://problem/35827140>

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

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/redirect/redirect-mode-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-mode-worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-mode.js:
(redirectMode):
* web-platform-tests/service-workers/service-worker/fetch-event-redirect.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-redirect.https.html:
* web-platform-tests/service-workers/service-worker/fetch-request-redirect.https-expected.txt:

Source/WebCore:

Covered by updated tests.

Return a network error when no-cors mode and redirect mode is manual or error.
Update preflight implementation to no longer use manual redirect mode to simulate https://fetch.spec.whatwg.org/#http-network-or-cache-fetch.
Instead implement redirectReceived callback to treat any redirect response as the preflight response.

* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::canRequest):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::redirectReceived):
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/CrossOriginPreflightChecker.h:

LayoutTests:

* http/tests/fetch/redirectmode-and-preload-expected.txt:
* http/tests/fetch/redirectmode-and-preload.html:

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

19 months agoDOMCache data sometimes not properly removed when clearing data for a given origin
cdumez@apple.com [Sat, 20 Jan 2018 10:43:38 +0000 (10:43 +0000)]
DOMCache data sometimes not properly removed when clearing data for a given origin
https://bugs.webkit.org/show_bug.cgi?id=181887
<rdar://problem/36671239>

Reviewed by Youenn Fablet.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::clearCachesForOrigin):
This code was iterating through folders on disk, then reading the folder's origin
from the origin file on disk. Then, if the origin would match the one we want to
delete, it would regenerate the folder path using cachesRootPath(*folderOrigin).
I don't know how but on my machine, I was ended up in a state where the path
generated by cachesRootPath(*folderOrigin) differed from the actual folder path
we read the origin from (Likely a different salt?). To make the code more robust,
I updated the code to delete "folderPath", which is the path we read the origin
from.

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

19 months agoWebDriver: fix some nits that prevent running W3C tests on Mac
bburg@apple.com [Sat, 20 Jan 2018 08:42:08 +0000 (08:42 +0000)]
WebDriver: fix some nits that prevent running W3C tests on Mac
https://bugs.webkit.org/show_bug.cgi?id=181864

Reviewed by Carlos Garcia Campos.

* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py:
(WebDriverW3CWebServer.__init__): _wsout needs to always be defined,
as we assume that the property exists later.

(WebDriverW3CWebServer.stop): If the temporary file doesn't
exist for some reason, the remove call will raise and exception.
Gracefully handle the case where the file isn't created due to
a problem/exception that happened elsewhere.

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

19 months agoUnreviewed GTK+ gardening. Skip imported/w3c/webdriver/tests/sessions/new_session...
carlosgc@webkit.org [Sat, 20 Jan 2018 07:45:32 +0000 (07:45 +0000)]
Unreviewed GTK+ gardening. Skip imported/w3c/webdriver/tests/sessions/new_session/response.py.

It's causing a crash in the driver process and affecting all other tests.

* TestExpectations.json:

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

19 months ago[macOS] [WK2] Drag location is computed incorrectly when dragging content from subframes
wenson_hsieh@apple.com [Sat, 20 Jan 2018 07:24:50 +0000 (07:24 +0000)]
[macOS] [WK2] Drag location is computed incorrectly when dragging content from subframes
https://bugs.webkit.org/show_bug.cgi?id=181896
<rdar://problem/35479043>

Reviewed by Tim Horton.

In r218837, I packaged most of the information needed to start a drag into DragItem, which is propagated to the client layer
via the startDrag codepath. However, this introduced a bug in computing the event position and drag location in window
coordinates. Consider the case where we're determining the drag image offset for a dragged element in a subframe:

Before the patch, the drag location (which starts out in the subframe's content coordinates) would be converted to root view
coordinates, which would then be converted to mainframe content coordinates, which would then be converted to window coordinates
using the mainframe's view. After the patch, we carry out the same math until the last step, where we erroneously use the
_subframe's_ view to convert to window coordinates from content coordinates. This results in the position of the iframe relative
to the mainframe being accounted for twice.

To fix this, we simply use the main frame's view to convert from mainframe content coordinates to window coordinates while
computing the drag location. As for the event position in window coordinates, this is currently unused by any codepath in WebKit,
so we can just remove it altogether.

Since this bug only affects drag and drop in the macOS WebKit2 port, there's currently no way to test this. I'll be using
<https://bugs.webkit.org/show_bug.cgi?id=181898> to track adding test support for drag and drop on macOS WebKit2. Manually tested
dragging in both WebKit1 and WebKit2 on macOS. dragLocationInWindowCoordinates isn't used at all for iOS drag and drop.

* page/DragController.cpp:
(WebCore::DragController::doSystemDrag):
* platform/DragItem.h:
(WebCore::DragItem::encode const):
(WebCore::DragItem::decode):

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

19 months agoExpose Safe Browsing SPI
commit-queue@webkit.org [Sat, 20 Jan 2018 06:40:33 +0000 (06:40 +0000)]
Expose Safe Browsing SPI
https://bugs.webkit.org/show_bug.cgi?id=181804
<rdar://problem/36626946>

Patch by Zach Li <zacharyli323@gmail.com> on 2018-01-19
Reviewed by Dan Bernstein.

If client is using Apple internal SDK, then we can just import the header; if not,
then we declare necessary symbols that client will need.

* Configurations/WebKit.xcconfig:
Only link against SafariSafeBrowsing framework on macOS High Sierra
and iOS 11 and above. Weak link against SafariSafeBrowsing framework
because it is not present on the Base system.

* Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.

* WebKit.xcodeproj/project.pbxproj:
Added SafeBrowsingSPI.h.

* WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
Added.

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

19 months agoMark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr...
ryanhaddad@apple.com [Sat, 20 Jan 2018 04:34:01 +0000 (04:34 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-cors-xhr.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181901

Unreviewed test gardening.

* TestExpectations:

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

19 months agoMark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas...
ryanhaddad@apple.com [Sat, 20 Jan 2018 04:21:55 +0000 (04:21 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting-cache.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181900

Unreviewed test gardening.

* TestExpectations:

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

19 months agoMark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas...
ryanhaddad@apple.com [Sat, 20 Jan 2018 04:05:58 +0000 (04:05 +0000)]
Mark imported/w3c/web-platform-tests/service-workers/service-worker/fetch-canvas-tainting.https.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181897

Unreviewed test gardening.

* TestExpectations:

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

19 months agoUnreviewed, rolling out r227235.
ryanhaddad@apple.com [Sat, 20 Jan 2018 03:55:15 +0000 (03:55 +0000)]
Unreviewed, rolling out r227235.

The test for this change consistently times out on High
Sierra.

Reverted changeset:

"Support for preconnect Link headers"
https://bugs.webkit.org/show_bug.cgi?id=181657
https://trac.webkit.org/changeset/227235

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

19 months ago[Sierra Debug WK2] ASSERTION FAILED: paymentCoordinator().supportsVersion(version)
ryanhaddad@apple.com [Sat, 20 Jan 2018 03:50:34 +0000 (03:50 +0000)]
[Sierra Debug WK2] ASSERTION FAILED: paymentCoordinator().supportsVersion(version)
https://bugs.webkit.org/show_bug.cgi?id=181833

Patch by Andy Estes <aestes@apple.com> on 2018-01-19
Reviewed by Youenn Fablet.

Moved the version 3 test into its own file that only runs on High Sierra and later.

* http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https-expected.txt: Added.
* http/tests/ssl/applepay/ApplePayRequestShippingContactV3.https.html: Added.
* platform/mac-wk2/TestExpectations:

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

19 months agoMove Bingdings EWS and Webkitpy EWS queues to High Sierra on buildbot dashboard.
lingcherd_ho@apple.com [Sat, 20 Jan 2018 02:24:06 +0000 (02:24 +0000)]
Move Bingdings EWS and Webkitpy EWS queues to High Sierra on buildbot dashboard.
https://bugs.webkit.org/show_bug.cgi?id=181881

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BubbleQueueServer.js:
(BubbleQueueServer):
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/Dashboard.js:
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Styles/Main.css:
(table.queue-grid tr.platform.mac-os-x-elcapitan img.logo): Deleted.

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

19 months agoUnreviewed build fix, removed unused lambda capture.
ryanhaddad@apple.com [Sat, 20 Jan 2018 01:58:47 +0000 (01:58 +0000)]
Unreviewed build fix, removed unused lambda capture.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

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

19 months agoMark http/wpt/web-animations/timing-model/animation-effects/current-iteration.html...
ryanhaddad@apple.com [Sat, 20 Jan 2018 01:50:10 +0000 (01:50 +0000)]
Mark http/wpt/web-animations/timing-model/animation-effects/current-iteration.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181888

Unreviewed test gardening.

* TestExpectations:

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

19 months agoUpdate TestExpectations for webrtc/video-mute.html.
ryanhaddad@apple.com [Sat, 20 Jan 2018 00:16:10 +0000 (00:16 +0000)]
Update TestExpectations for webrtc/video-mute.html.
https://bugs.webkit.org/show_bug.cgi?id=177501

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

19 months agoMark imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-...
ryanhaddad@apple.com [Sat, 20 Jan 2018 00:16:07 +0000 (00:16 +0000)]
Mark imported/w3c/web-platform-tests/media-source/mediasource-config-change-mp4-* tests as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181565

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

19 months agoResource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTe...
wilander@apple.com [Sat, 20 Jan 2018 00:10:01 +0000 (00:10 +0000)]
Resource Load Statistics: Remove unused calls to WebResourceLoadStatisticsStore:logTestingEvent() to fix API test
https://bugs.webkit.org/show_bug.cgi?id=181890
<rdar://problem/36674772>

Unreviewed API test fix.

* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):

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

19 months agoDisable Atomics when SharedArrayBuffer isn’t enabled
ryanhaddad@apple.com [Fri, 19 Jan 2018 23:35:05 +0000 (23:35 +0000)]
Disable Atomics when SharedArrayBuffer isn’t enabled
https://bugs.webkit.org/show_bug.cgi?id=181572

Unreviewed test gardening.

* test262.yaml: Skip tests that fail after this change.

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

19 months agoCache storage errors like Quota should trigger console messages
commit-queue@webkit.org [Fri, 19 Jan 2018 23:26:13 +0000 (23:26 +0000)]
Cache storage errors like Quota should trigger console messages
https://bugs.webkit.org/show_bug.cgi?id=181879
<rdar://problem/36669048>

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

Source/WebCore:

Covered by rebased test.

* Modules/cache/DOMCache.cpp:
(WebCore::DOMCache::retrieveRecords):
(WebCore::DOMCache::batchDeleteOperation):
(WebCore::DOMCache::batchPutOperation):
* Modules/cache/DOMCacheEngine.cpp:
(WebCore::DOMCacheEngine::errorToException):
(WebCore::DOMCacheEngine::logErrorAndConvertToException):
* Modules/cache/DOMCacheEngine.h:
* Modules/cache/DOMCacheStorage.cpp:
(WebCore::DOMCacheStorage::retrieveCaches):
(WebCore::DOMCacheStorage::doOpen):
(WebCore::DOMCacheStorage::doRemove):

LayoutTests:

* http/wpt/cache-storage/cache-quota.any-expected.txt:

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

19 months agoWeb Inspector: Layers tab should do away with popovers (if possible)
ross.kirsling@sony.com [Fri, 19 Jan 2018 23:18:44 +0000 (23:18 +0000)]
Web Inspector: Layers tab should do away with popovers (if possible)
https://bugs.webkit.org/show_bug.cgi?id=181805

Reviewed by Matt Baker.

* Localizations/en.lproj/localizedStrings.js:
Remove superfluous colon from a string.

* UserInterface/Main.html:
* UserInterface/Views/LayerDetailsSidebarPanel.css:
* UserInterface/Views/Layers3DContentView.css: Added.
Remove popover styling from sidebar, add new file with similar styling for canvas overlay.

* UserInterface/Views/LayerDetailsSidebarPanel.js:
(WI.LayerDetailsSidebarPanel):
(WI.LayerDetailsSidebarPanel.prototype.selectNodeByLayerId):
(WI.LayerDetailsSidebarPanel.prototype._dataGridSelectedNodeChanged):
(WI.LayerDetailsSidebarPanel.prototype._updateLayers):
(WI.LayerDetailsSidebarPanel.prototype._updateBottomBar):
(WI.LayerDetailsSidebarPanel.prototype.willDismissPopover): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._showPopoverForSelectedNode): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._presentPopover): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._contentForPopover): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._populateListOfCompositingReasons.addReason): Deleted.
(WI.LayerDetailsSidebarPanel.prototype._populateListOfCompositingReasons): Deleted.
* UserInterface/Views/Layers3DContentView.js:
(WI.Layers3DContentView):
(WI.Layers3DContentView.prototype.shown):
(WI.Layers3DContentView.prototype.selectLayerById):
(WI.Layers3DContentView.prototype._canvasMouseDown):
(WI.Layers3DContentView.prototype._buildLayerInfoElement):
(WI.Layers3DContentView.prototype._updateLayerInfoElement):
(WI.Layers3DContentView.prototype._updateReasonsList):
Remove popover from sidebar table, overlay div with same data arrangement on top of the canvas.
Also reverse the fix from r226671 since the visualization is no longer unusable without the sidebar!

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

19 months agoWeb Inspector: Canvas Tab: Multiple "waiting for frames" messages displayed
mattbaker@apple.com [Fri, 19 Jan 2018 23:01:11 +0000 (23:01 +0000)]
Web Inspector: Canvas Tab: Multiple "waiting for frames" messages displayed
https://bugs.webkit.org/show_bug.cgi?id=181865
<rdar://problem/36664737>

Reviewed by Devin Rousso.

* UserInterface/Views/CanvasContentView.js:
(WI.CanvasContentView.prototype._recordingStarted):
(WI.CanvasContentView.prototype._recordingStopped):

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

19 months agoDo not go to the storage process when registering a service worker client if there...
commit-queue@webkit.org [Fri, 19 Jan 2018 22:58:48 +0000 (22:58 +0000)]
Do not go to the storage process when registering a service worker client if there is no service worker registered
https://bugs.webkit.org/show_bug.cgi?id=181740
<rdar://problem/36650400>

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

Source/WebCore:

Register a document as service worker client only if there is an existing service worker connection.
This allows not creating any connection if no service worker is registered.

Add internals API to test whether a service worker connection was created or not.
This is used by API tests that cover the changes.

* dom/Document.cpp:
(WebCore::Document::privateBrowsingStateDidChange): No need to create a service worker connection if client is not registered yet.
(WebCore::Document::setServiceWorkerConnection): No need to unregister/register if service worker connection is the same.
Similarly, if Document is to be destroyed or suspended, we should not register it.
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerConnection):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/ServiceWorkerProvider.cpp:
(WebCore::ServiceWorkerProvider::registerServiceWorkerClients):
* workers/service/ServiceWorkerProvider.h:

Source/WebKit:

UIProcess notifies all web processes to register their service worker clients when spinning the service worker process.
Add private API to set the number of web processes for testing purposes.

* UIProcess/API/Cocoa/WKProcessPool.mm:
(-[WKProcessPool _setMaximumNumberOfProcesses:]):
* UIProcess/API/Cocoa/WKProcessPoolPrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::establishWorkerContextConnectionToStorageProcess):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::registerServiceWorkerClients):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Tools:

Add support for internals inside API tests.

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/InjectInternals_Bundle.cpp: Added.
(TestWebKitAPI::InternalsInjectedBundleTest::InternalsInjectedBundleTest):
(TestWebKitAPI::InternalsInjectedBundleTest::initialize):
(TestWebKitAPI::InternalsInjectedBundleTest::didCreatePage):
(TestWebKitAPI::InternalsInjectedBundleTest::didClearWindowForFrame):
* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
(setConfigurationInjectedBundlePath):
(-[RegularPageMessageHandler userContentController:didReceiveScriptMessage:]):

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

19 months agoREGRESSION (r221092): Swipe actions are hard to perform in FastMail app
dino@apple.com [Fri, 19 Jan 2018 22:48:22 +0000 (22:48 +0000)]
REGRESSION (r221092): Swipe actions are hard to perform in FastMail app
https://bugs.webkit.org/show_bug.cgi?id=181817
<rdar://problem/35274055>

Source/WebCore:

Add a setting for controlling whether touch listeners are passive
by default on document/window/body.

Updated existing test.

* dom/EventTarget.cpp:
(WebCore::EventTarget::addEventListener):
* page/Settings.yaml:

Source/WebKit:

Reviewed by Simon Fraser.

Add a linked-on-or-after check to set passive touch listeners on document in WebCore.

* CMakeLists.txt:
* Shared/WebPreferences.yaml:
* Shared/WebPreferencesDefaultValues.cpp: Copied from Source/WebKit/UIProcess/Cocoa/VersionChecks.h.
(defaultPassiveTouchListenersAsDefaultOnDocument):
* Shared/WebPreferencesDefaultValues.h:
* UIProcess/Cocoa/VersionChecks.h:
* WebKit.xcodeproj/project.pbxproj:

Source/WebKitLegacy/mac:

Reviewed by Simon Fraser.

Add a linked-on-or-after check to set passive touch listeners on document in WebCore.

* Misc/WebKitVersionChecks.h:
* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):

LayoutTests:

Reviewed by Simon Fraser.

* fast/events/touch/ios/passive-by-default-on-document-and-window-expected.txt:

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

19 months agoUpdate frame-ancestor directive to match Content Security Policy Level 3
dbates@webkit.org [Fri, 19 Jan 2018 22:43:11 +0000 (22:43 +0000)]
Update frame-ancestor directive to match Content Security Policy Level 3
https://bugs.webkit.org/show_bug.cgi?id=178891
<rdar://problem/35209458>

Reviewed by Alex Christensen.

Derived from Blink e667cc2e501fabab3605b838e4ee0d642a9c4a59:
<https://chromium.googlesource.com/chromium/src.git/+/e667cc2e501fabab3605b838e4ee0d642a9c4a59>

Source/WebCore:

Update frame-ancestor directive to match against the origin of the ancestor document per the
Content Security Policy Level 3 spec.: <https://w3c.github.io/webappsec-csp/> (15 January 2018).
Specifically this change in behavior was made to CSP 3 in <https://github.com/w3c/webappsec/issues/311>.
In earlier versions of the spec, the frame-ancestor directive matched against the URL of the
ancestor document.

Disregarding allow-same-origin sandboxed iframes, a document with policy "frame-ancestor 'self'"
will be blocked from loading in a sandboxed iframe as a result of this change.

Tests: http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow.html
       http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block.html

* page/csp/ContentSecurityPolicyDirectiveList.cpp:
(WebCore::checkFrameAncestors):

LayoutTests:

* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-allow-same-origin-sandboxed-cross-url-allow.html: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block-expected.txt: Added.
* http/tests/security/contentSecurityPolicy/1.1/frame-ancestors/frame-ancestors-nested-cross-in-sandboxed-cross-url-block.html: Added.
* http/tests/security/contentSecurityPolicy/resources/frame-ancestors-test.js:
(injectNestedIframe):
(window.onload):
(testNestedIFrame):

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

19 months ago[Curl] Add timeout support to XMLHttpRequest
commit-queue@webkit.org [Fri, 19 Jan 2018 22:33:51 +0000 (22:33 +0000)]
[Curl] Add timeout support to XMLHttpRequest
https://bugs.webkit.org/show_bug.cgi?id=181876

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

* platform/network/ResourceRequestBase.cpp:
* platform/network/curl/CurlContext.cpp:
(WebCore::CurlHandle::setTimeout):
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):
(WebCore::CurlRequest::didCompleteTransfer):
* platform/network/curl/ResourceError.h:
* platform/network/curl/ResourceErrorCurl.cpp:
(WebCore::ResourceError::httpError):

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

19 months agoKill ArithNegate's ArithProfile assert inside BytecodeParser
sbarati@apple.com [Fri, 19 Jan 2018 22:30:45 +0000 (22:30 +0000)]
Kill ArithNegate's ArithProfile assert inside BytecodeParser
https://bugs.webkit.org/show_bug.cgi?id=181877
<rdar://problem/36630552>

Reviewed by Mark Lam.

JSTests:

* stress/arith-profile-for-negate-can-see-non-number-due-to-dfg-osr-exit-profiling.js: Added.
(runNearStackLimit):
(f1):
(f2):
(f3):
(i.catch):
(i.try.runNearStackLimit):
(catch):

Source/JavaScriptCore:

Before this patch, we used to assert that op_negate's result ArithProfile
only produces number. It's logically true that negate only produces a number.
However, the DFG may incorrectly pick this ArithProfile when doing OSR exit
profiling. So we'll end up profiling something that's likely the input to
negate. This patch removes the assert. We cede to the fact that Graph::methodOfGettingAValueProfileFor
is entirely heuristic based, potentially leading to profiling results being imprecise.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::makeSafe):

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

19 months agoSupport for preconnect Link headers
yoav@yoav.ws [Fri, 19 Jan 2018 22:16:21 +0000 (22:16 +0000)]
Support for preconnect Link headers
https://bugs.webkit.org/show_bug.cgi?id=181657

Reviewed by Darin Adler.

Source/WebCore:

Move the preconnect functionality into its own function, and
also call this function when Link headers are processed.

Test: http/tests/preconnect/link-header-rel-preconnect-http.php

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Call preconnectIfNeeded.
(WebCore::LinkLoader::preconnectIfNeeded): Preconnect to a host functionality moved here.
(WebCore::LinkLoader::loadLink): Call preconnectIfNeeded.
* loader/LinkLoader.h:

LayoutTests:

Add test to see Link preconnect headers trigger a connection.

* http/tests/preconnect/link-header-rel-preconnect-http-expected.txt: Added.
* http/tests/preconnect/link-header-rel-preconnect-http.html: Added.
* http/tests/preconnect/resources/header-preconnect.php: Added.
* platform/ios-simulator/TestExpectations: Skipped the test, as ios-simulator doesn't process Link headers for subresources.
* platform/win/TestExpectations: Skipped the preconnect test directory, as it doesn't work on Windows.

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

19 months agoShould allow updating a build-request to 'canceled'.
dewei_zhu@apple.com [Fri, 19 Jan 2018 22:12:23 +0000 (22:12 +0000)]
Should allow updating a build-request to 'canceled'.
https://bugs.webkit.org/show_bug.cgi?id=181819

Reviewed by Ryosuke Niwa.

It's possible syncing script update a build-request to 'canceled' state.

* public/api/build-requests.php: Added 'canceled' as an acceptable update state.
* server-tests/api-build-requests-tests.js: Added a unit test to update a build-request to 'canceled'.

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

19 months agooss-fuzz jsc build is broken: StringImpl.h:27:10: fatal error: 'unicode/ustring.h...
ddkilzer@apple.com [Fri, 19 Jan 2018 21:48:25 +0000 (21:48 +0000)]
oss-fuzz jsc build is broken: StringImpl.h:27:10: fatal error: 'unicode/ustring.h' file not found
<https://webkit.org/b/181871>

Rubber-stamped by JF Bastien.

* CMakeLists.txt: Add ICU header search path to
LLIntOffsetsExtractor target by reusing
JavaScriptCore_SYSTEM_INCLUDE_DIRECTORIES.

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

19 months agoWeb Inspector: Styles Redesign: tabbing on commented out property throws exception
nvasilyev@apple.com [Fri, 19 Jan 2018 21:36:58 +0000 (21:36 +0000)]
Web Inspector: Styles Redesign: tabbing on commented out property throws exception
https://bugs.webkit.org/show_bug.cgi?id=180676
<rdar://problem/35981058>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingFirstProperty):
Tabbing from the selector field should focus on the first editable property.
When no editable properties are present, a new blank property should be added after the commented out ones.

(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.startEditingLastProperty):
Shift-tabbing from the selector field should focus on the last editable property of the previous CSS rule.
When no editable properties are present, a new blank property should be added after the commented out ones.

(WI.SpreadsheetCSSStyleDeclarationEditor.prototype.spreadsheetCSSStyleDeclarationEditorFocusMoved):
When navigating between properties skip the commented out ones.

(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._editablePropertyAfter):
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._editablePropertyBefore):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype.get enabled):
(WI.SpreadsheetStyleProperty.prototype._update):

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

19 months ago[Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
commit-queue@webkit.org [Fri, 19 Jan 2018 21:22:30 +0000 (21:22 +0000)]
[Cocoa] _WKNSWindowExtras.h: Add missing availability annotation
https://bugs.webkit.org/show_bug.cgi?id=181868

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-19
Reviewed by Dan Bernstein.

* Shared/API/Cocoa/_WKNSWindowExtras.h:

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

19 months agoFix jsc-only build
commit-queue@webkit.org [Fri, 19 Jan 2018 21:19:27 +0000 (21:19 +0000)]
Fix jsc-only build
https://bugs.webkit.org/show_bug.cgi?id=181874

Patch by Alex Christensen <achristensen@webkit.org> on 2018-01-19
Reviewed by JF Bastien.

This makes "build-webkit --jsc-only" work on Mac!

* wtf/PlatformJSCOnly.cmake:

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

19 months agoSpread's effects are modeled incorrectly both in AI and in Clobberize
sbarati@apple.com [Fri, 19 Jan 2018 21:15:55 +0000 (21:15 +0000)]
Spread's effects are modeled incorrectly both in AI and in Clobberize
https://bugs.webkit.org/show_bug.cgi?id=181867
<rdar://problem/36290415>

Reviewed by Michael Saboff.

JSTests:

* stress/ai-needs-to-model-spreads-effects.js: Added.
(try.p.Symbol.iterator):
(try.go):
(catch):
* stress/clobberize-needs-to-model-spread-effects.js: Added.
(assert):
(foo):
(a.Symbol.iterator):

Source/JavaScriptCore:

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

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

19 months agoWeb Inspector: Make styles sidebar always LTR
nvasilyev@apple.com [Fri, 19 Jan 2018 20:13:20 +0000 (20:13 +0000)]
Web Inspector: Make styles sidebar always LTR
https://bugs.webkit.org/show_bug.cgi?id=175357
<rdar://problem/33787988>

Reviewed by Joseph Pecoraro.

* UserInterface/Views/SpreadsheetRulesStyleDetailsPanel.js:
(WI.SpreadsheetRulesStyleDetailsPanel):

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

19 months agoResource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
wilander@apple.com [Fri, 19 Jan 2018 20:11:38 +0000 (20:11 +0000)]
Resource Load Statistics: Add void to argument list to fix build with -Wstrict-prototypes
https://bugs.webkit.org/show_bug.cgi?id=181870
<rdar://problem/36666750>

Unreviewed build fix.

* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

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

19 months agoFollow-up build fix for r227206.
joepeck@webkit.org [Fri, 19 Jan 2018 20:04:11 +0000 (20:04 +0000)]
Follow-up build fix for r227206.

Unreviewed.

* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.h:
Avoid duplicate and different definitions of ALWAYS_INLINE.

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

19 months agoAppCache: Log a Deprecation warning to the Console when AppCache is used
commit-queue@webkit.org [Fri, 19 Jan 2018 19:54:03 +0000 (19:54 +0000)]
AppCache: Log a Deprecation warning to the Console when AppCache is used
https://bugs.webkit.org/show_bug.cgi?id=181778

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-01-19
Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

* web-platform-tests/html/browsers/offline/appcache/workers/appcache-worker-expected.txt:
* web-platform-tests/html/browsers/offline/introduction-4/event_cached-expected.txt:
* web-platform-tests/html/browsers/offline/introduction-4/event_checking-expected.txt:
* web-platform-tests/html/browsers/offline/introduction-4/event_noupdate-expected.txt:
* web-platform-tests/html/browsers/offline/introduction-4/event_progress-expected.txt:
* web-platform-tests/html/browsers/offline/manifest_url_check-expected.txt:
* web-platform-tests/service-workers/service-worker/appcache-ordering-main.https-expected.txt:

Source/WebCore:

* html/HTMLHtmlElement.cpp:
(WebCore::HTMLHtmlElement::insertedByParser):

LayoutTests:

* http/tests/appcache/404-manifest-expected.txt:
* http/tests/appcache/404-resource-expected.txt:
* http/tests/appcache/404-resource-with-slow-main-resource-expected.txt:
* http/tests/appcache/abort-cache-onchecking-expected.txt:
* http/tests/appcache/abort-cache-onchecking-manifest-404-expected.txt:
* http/tests/appcache/abort-cache-onchecking-resource-404-expected.txt:
* http/tests/appcache/abort-cache-ondownloading-expected.txt:
* http/tests/appcache/abort-cache-ondownloading-manifest-404-expected.txt:
* http/tests/appcache/abort-cache-ondownloading-resource-404-expected.txt:
* http/tests/appcache/abort-cache-onprogress-expected.txt:
* http/tests/appcache/access-via-redirect-expected.txt:
* http/tests/appcache/crash-when-navigating-away-then-back-expected.txt:
* http/tests/appcache/credential-url-expected.txt:
* http/tests/appcache/cyrillic-uri-expected.txt:
* http/tests/appcache/decide-navigation-policy-after-delay-expected.txt:
* http/tests/appcache/deferred-events-delete-while-raising-expected.txt:
* http/tests/appcache/deferred-events-delete-while-raising-timer-expected.txt:
* http/tests/appcache/deferred-events-expected.txt:
* http/tests/appcache/different-https-origin-resource-main-expected.txt:
* http/tests/appcache/different-origin-manifest-expected.txt:
* http/tests/appcache/different-scheme-expected.txt:
* http/tests/appcache/document-write-html-element-2-expected.txt:
* http/tests/appcache/empty-manifest-expected.txt:
* http/tests/appcache/fail-on-update-2-expected.txt:
* http/tests/appcache/fail-on-update-expected.txt:
* http/tests/appcache/fallback-expected.txt:
* http/tests/appcache/fallback-namespace-outside-manifest-path-expected.txt:
* http/tests/appcache/foreign-fallback-expected.txt:
* http/tests/appcache/foreign-iframe-main-expected.txt:
* http/tests/appcache/history-test-expected.txt:
* http/tests/appcache/idempotent-update-expected.txt:
* http/tests/appcache/identifier-test-expected.txt:
* http/tests/appcache/interrupted-update-expected.txt:
* http/tests/appcache/local-content-expected.txt:
* http/tests/appcache/main-resource-fallback-for-network-error-crash-expected.txt:
* http/tests/appcache/main-resource-hash-expected.txt:
* http/tests/appcache/main-resource-redirect-expected.txt:
* http/tests/appcache/manifest-containing-itself-expected.txt:
* http/tests/appcache/manifest-parsing-expected.txt:
* http/tests/appcache/manifest-redirect-2-expected.txt:
* http/tests/appcache/manifest-redirect-expected.txt:
* http/tests/appcache/manifest-with-empty-file-expected.txt:
* http/tests/appcache/max-size-expected.txt:
* http/tests/appcache/multi-fallback-expected.txt:
* http/tests/appcache/navigating-away-while-cache-attempt-in-progress-expected.txt:
* http/tests/appcache/non-html-expected.txt:
* http/tests/appcache/offline-access-expected.txt:
* http/tests/appcache/online-fallback-layering-expected.txt:
* http/tests/appcache/online-whitelist-expected.txt:
* http/tests/appcache/origin-delete-expected.txt:
* http/tests/appcache/origin-quota-continued-download-expected.txt:
* http/tests/appcache/origin-quota-continued-download-multiple-manifests-expected.txt:
* http/tests/appcache/origin-quota-expected.txt:
* http/tests/appcache/origin-usage-expected.txt:
* http/tests/appcache/origins-with-appcache-expected.txt:
* http/tests/appcache/progress-counter-expected.txt:
* http/tests/appcache/reload-expected.txt:
* http/tests/appcache/remove-cache-expected.txt:
* http/tests/appcache/resource-redirect-2-expected.txt:
* http/tests/appcache/resource-redirect-expected.txt:
* http/tests/appcache/simple-expected.txt:
* http/tests/appcache/simple-video-async-expected.txt:
* http/tests/appcache/simple-video-sync-expected.txt:
* http/tests/appcache/top-frame-1-expected.txt:
* http/tests/appcache/top-frame-2-expected.txt:
* http/tests/appcache/top-frame-3-expected.txt:
* http/tests/appcache/top-frame-4-expected.txt:
* http/tests/appcache/update-cache-expected.txt:
* http/tests/appcache/video-expected.txt:
* http/tests/appcache/whitelist-wildcard-expected.txt:
* http/tests/appcache/wrong-content-type-expected.txt:
* http/tests/appcache/wrong-signature-2-expected.txt:
* http/tests/appcache/wrong-signature-expected.txt:
* http/tests/appcache/x-frame-options-prevents-framing-expected.txt:
* http/tests/appcache/xhr-foreign-resource-expected.txt:
* http/tests/contentfiltering/load-substitute-data-from-appcache-expected.txt:
* http/tests/security/appcache-switching-private-browsing-expected.txt:
* http/tests/security/cross-origin-appcache-allowed-expected.txt:
* http/tests/security/cross-origin-appcache-expected.txt:
* http/tests/security/same-origin-appcache-blocked-expected.txt:
* http/tests/ssl/upgrade-origin-usage-expected.txt:

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

19 months agoUnreviewed, rolling out r227211.
ryanhaddad@apple.com [Fri, 19 Jan 2018 19:47:04 +0000 (19:47 +0000)]
Unreviewed, rolling out r227211.

Breaks iOS Simulator tests.

Reverted changeset:

"Expose Safe Browsing SPI"
https://bugs.webkit.org/show_bug.cgi?id=181804
https://trac.webkit.org/changeset/227211

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

19 months agoResource Load Statistics: Implement callback support for removal of WebsiteDataType...
wilander@apple.com [Fri, 19 Jan 2018 19:26:13 +0000 (19:26 +0000)]
Resource Load Statistics: Implement callback support for removal of WebsiteDataType::ResourceLoadStatistics
https://bugs.webkit.org/show_bug.cgi?id=181822
https://bugs.webkit.org/show_bug.cgi?id=175263
https://bugs.webkit.org/show_bug.cgi?id=178536
https://bugs.webkit.org/show_bug.cgi?id=181223
https://bugs.webkit.org/show_bug.cgi?id=181482
<rdar://problem/33491222>
<rdar://problem/33805293>
<rdar://problem/36332683>
<rdar://problem/36549026>

Reviewed by Alex Christensen.

Source/WebKit:

* UIProcess/API/C/WKWebsiteDataStoreRef.cpp:
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStore):
(WKWebsiteDataStoreStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore]):
    Calls the new API with no-op completion handler.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStore:]):
    New API with completion handler.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:]):
    Calls the new API with no-op completion handler.
(-[WKWebsiteDataStore _resourceLoadStatisticsClearInMemoryAndPersistentStoreModifiedSinceHours:completionHandler:]):
    New API with completion handler.
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/ResourceLoadStatisticsPersistentStorage.cpp:
(WebKit::ResourceLoadStatisticsPersistentStorage::populateMemoryStoreFromDisk):
* UIProcess/WebResourceLoadStatisticsStore.cpp:
(WebKit::WebResourceLoadStatisticsStore::grandfatherExistingWebsiteData):
(WebKit::WebResourceLoadStatisticsStore::scheduleClearInMemoryAndPersistent):
* UIProcess/WebResourceLoadStatisticsStore.h:
* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::removeData):
(WebKit::WebsiteDataStore::clearResourceLoadStatisticsInWebProcesses):
* UIProcess/WebsiteData/WebsiteDataStore.h:

Tools:

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStore):
(WTR::TestRunner::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::TestController::statisticsClearInMemoryAndPersistentStore):
(WTR::TestController::statisticsClearInMemoryAndPersistentStoreModifiedSinceHours):

LayoutTests:

* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:
* http/tests/resourceLoadStatistics/grandfathering.html:
* platform/ios/TestExpectations:
    Marked the three updated tests as [ Pass ].
* platform/mac-wk2/TestExpectations:
    Marked the three updated tests as [ Pass ].

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

19 months agorun-webkit-tests fails when there is a curly brace in Xcode build output
jbedard@apple.com [Fri, 19 Jan 2018 19:15:58 +0000 (19:15 +0000)]
run-webkit-tests fails when there is a curly brace in Xcode build output
https://bugs.webkit.org/show_bug.cgi?id=181254
<rdar://problem/36453374>

Reviewed by Daniel Bates.

* Scripts/webkitpy/port/base.py:
(Port._run_script): Encode script output before logging it.

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

19 months agoASSERT(registration || isTerminating()) hit in SWServerWorker::skipWaiting()
cdumez@apple.com [Fri, 19 Jan 2018 19:13:54 +0000 (19:13 +0000)]
ASSERT(registration || isTerminating()) hit in SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181761
<rdar://problem/36594564>

Reviewed by Youenn Fablet.

There is a short period of time, early in the registration process where a
SWServerWorker object exists for a registration but is not in the registration's
installing/waiting/active slots yet. As a result, if a registration is cleared
during this period (for e.g. due to the user clearing all website data), that
SWServerWorker will not be terminated. We then hit assertion later on when this
worker is trying to do things (like call skipWaiting).

To address the issue, we now keep a reference this SWServerWorker on the
registration, via a new SWServerRegistration::m_preInstallationWorker data member.
When the registration is cleared, we now take care of terminating this worker.

No new tests, covered by existing tests that crash flakily in debug builds.

* workers/WorkerThread.cpp:
(WebCore::WorkerThread::stop):
if the mutex is locked, then the worker thread is still starting. We spin the
runloop and try to stop again later. This avoids the deadlock shown in
Bug 181763 as the worker thread may need to interact with the main thread
during startup.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::installContextData):
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::scriptContextFailedToStart):
(WebCore::SWServerJobQueue::install):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::~SWServerRegistration):
(WebCore::SWServerRegistration::setPreInstallationWorker):
(WebCore::SWServerRegistration::clear):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::preInstallationWorker const):

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

19 months agoService worker registrations restored from disk may not be reused when the JS calls...
cdumez@apple.com [Fri, 19 Jan 2018 19:13:24 +0000 (19:13 +0000)]
Service worker registrations restored from disk may not be reused when the JS calls register() again
https://bugs.webkit.org/show_bug.cgi?id=181810
<rdar://problem/36591711>

Reviewed by Youenn Fablet.

Source/WebCore:

The issue was that when restoring a registration from disk, we would not set its active worker right
away. We only set it later in installContextData(). installContextData() is only called after we’ve
launched the service worker process and established a connection to it.

However, we would start processing jobs (such as registrations) before we’ve established the connection
to the service worker process. SWServerJobQueue::runRegisterJob(), in order to reuse an existing
registration checks the registration’s active worker has the right script URL. The issue was that when
this code would execute, we may not have set the registration’s active service worker yet, in which case,
we would update the existing registration instead of reusing it as-is.

To address the issue, we now delay the processing of jobs until the connection to the service worker
process has been established and we've installed all pending contexts via installContextData().

Changed is covered by new API test.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::scheduleJobInServer):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:

Tools:

Add API test coverage.

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

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

19 months agoAX: when invert colors is on, double-invert image and picture elements in UserAgentSt...
jcraig@apple.com [Fri, 19 Jan 2018 19:12:35 +0000 (19:12 +0000)]
AX: when invert colors is on, double-invert image and picture elements in UserAgentStyleSheet
https://bugs.webkit.org/show_bug.cgi?id=181281
<rdar://problem/36291776>

Reviewed by Simon Fraser.

Source/WebCore:

Updated "Smart Invert" to include img and picture element inversion and tests.

Tests: accessibility/smart-invert-reference.html
       accessibility/smart-invert.html

* css/html.css:
(@media (inverted-colors)):
(img:not(picture>img), picture, video):

LayoutTests:

Updated to include img and picture element tests.

* accessibility/smart-invert-expected.txt:
* accessibility/smart-invert-reference-expected.html:
* accessibility/smart-invert.html:

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

19 months agoREGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
dbates@webkit.org [Fri, 19 Jan 2018 19:02:05 +0000 (19:02 +0000)]
REGRESSION (r223149): Ref WebPageProxy objects before calling their functionality
https://bugs.webkit.org/show_bug.cgi?id=181863
<rdar://problem/36662452>

Reviewed by Chris Dumez.

More fix ups following r223149. When notifying all pages of a process state change we need to
take care to ref all the pages before iterating over them and notifying them of the change.
Notifying a page of such a state change may ultimately delegate to the embedding client. And
the embedding client can do anything, including deallocating one or more pages.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::didBecomeUnresponsive):
(WebKit::WebProcessProxy::didBecomeResponsive):
(WebKit::WebProcessProxy::willChangeIsResponsive):
(WebKit::WebProcessProxy::didChangeIsResponsive):
(WebKit::WebProcessProxy::requestTermination):

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

19 months agoRemove El Capitan queues from flakiness dashboard
ryanhaddad@apple.com [Fri, 19 Jan 2018 18:51:52 +0000 (18:51 +0000)]
Remove El Capitan queues from flakiness dashboard
https://bugs.webkit.org/show_bug.cgi?id=181860

Reviewed by Aakash Jain.

* TestResultServer/static-dashboards/builders.jsonp:

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

19 months agoThe WebContent process should not process incoming IPC while waiting for a sync IPC...
cdumez@apple.com [Fri, 19 Jan 2018 18:38:51 +0000 (18:38 +0000)]
The WebContent process should not process incoming IPC while waiting for a sync IPC reply
https://bugs.webkit.org/show_bug.cgi?id=181560

Reviewed by Ryosuke Niwa.

Source/WebCore:

Add internals API for testing purposes.

Test: fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html

* page/ChromeClient.h:
* testing/Internals.cpp:
(WebCore::Internals::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* testing/Internals.h:
* testing/Internals.idl:

Source/WebKit:

The WebContent process should not process incoming IPC while waiting for a sync IPC reply.
This is causing hard-to-debug crashes because developers often assume the state does not
change during a sendSync() call.

* Platform/IPC/Connection.cpp:
(IPC::Connection::waitForSyncReply):
* Platform/IPC/Connection.h:
(IPC::Connection::setShouldProcessIncomingMessagesWhileWaitingForSyncReply):
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:
* WebProcess/Network/NetworkProcessConnection.cpp:
(WebKit::NetworkProcessConnection::NetworkProcessConnection):
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::WebToStorageProcessConnection):
* WebProcess/WebConnectionToUIProcess.cpp:
(WebKit::WebConnectionToUIProcess::WebConnectionToUIProcess):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::testIncomingSyncIPCMessageWhileWaitingForSyncReply):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/WebEditorClient.cpp:
(WebKit::WebEditorClient::undo):
(WebKit::WebEditorClient::redo):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::syncIPCMessageWhileWaitingForSyncReplyForTesting):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

LayoutTests:

Add layout test coverage.

* fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply-expected.txt: Added.
* fast/misc/testIncomingSyncIPCMessageWhileWaitingForSyncReply.html: Added.

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

19 months agoHaveInternalSDK includes should be "#include?"
keith_miller@apple.com [Fri, 19 Jan 2018 18:33:52 +0000 (18:33 +0000)]
HaveInternalSDK includes should be "#include?"
https://bugs.webkit.org/show_bug.cgi?id=179670

Reviewed by Dan Bernstein.

Source/bmalloc:

* Configurations/Base.xcconfig:

Source/JavaScriptCore:

* Configurations/Base.xcconfig:

Source/WebCore:

* Configurations/Base.xcconfig:

Source/WebInspectorUI:

* Configurations/Base.xcconfig:

Source/WebKit:

* Configurations/Base.xcconfig:

Source/WTF:

* Configurations/Base.xcconfig:

Tools:

* MiniBrowser/Configurations/Base.xcconfig:
* MobileMiniBrowser/Configurations/Base.xcconfig:
* TestWebKitAPI/Configurations/Base.xcconfig:
* WebKitTestRunner/Configurations/Base.xcconfig:

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

19 months agoFix misspelling; substitute willDetachRenderer for willDetatchRenderer.
dbates@webkit.org [Fri, 19 Jan 2018 18:32:00 +0000 (18:32 +0000)]
Fix misspelling; substitute willDetachRenderer for willDetatchRenderer.

Source/WebCore:

* html/HTMLPlugInImageElement.cpp:
(WebCore::HTMLPlugInImageElement::willDetachRenderers):
* plugins/PluginViewBase.h:
(WebCore::PluginViewBase::willDetachRenderer):
(WebCore::PluginViewBase::willDetatchRenderer): Deleted.

Source/WebKit:

* WebProcess/Plugins/PDF/PDFPlugin.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::willDetachRenderer):
(WebKit::PDFPlugin::willDetatchRenderer): Deleted.
* WebProcess/Plugins/Plugin.h:
(WebKit::Plugin::willDetachRenderer):
(WebKit::Plugin::willDetatchRenderer): Deleted.
* WebProcess/Plugins/PluginView.cpp:
(WebKit::PluginView::willDetachRenderer):
(WebKit::PluginView::willDetatchRenderer): Deleted.
* WebProcess/Plugins/PluginView.h:

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

19 months agoUnreviewed build fix, remove unused lambda captures.
jbedard@apple.com [Fri, 19 Jan 2018 18:12:45 +0000 (18:12 +0000)]
Unreviewed build fix, remove unused lambda captures.

* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::takeAllMessagesForPort):
* dom/messageports/MessagePortChannelRegistry.cpp:
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):

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

19 months agoUpdate XPCSPI.h
ap@apple.com [Fri, 19 Jan 2018 18:09:23 +0000 (18:09 +0000)]
Update XPCSPI.h
https://bugs.webkit.org/show_bug.cgi?id=181827
rdar://problem/36393031

Reviewed by Daniel Bates.

* wtf/spi/darwin/XPCSPI.h:

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

19 months agoExpose Safe Browsing SPI
commit-queue@webkit.org [Fri, 19 Jan 2018 18:05:40 +0000 (18:05 +0000)]
Expose Safe Browsing SPI
https://bugs.webkit.org/show_bug.cgi?id=181804
<rdar://problem/36626946>

Patch by Zach Li <zacharyli323@gmail.com> on 2018-01-19
Reviewed by Alex Christensen.

If client is using Apple internal SDK, then we can just import the header; if not,
then we declare necessary symbols that client will need.

* Configurations/WebKit.xcconfig:
Only link against SafariSafeBrowsing framework on macOS High Sierra
and iOS 11 and above. Weak link against SafariSafeBrowsing framework
because it is not present on the Base system.

* Platform/spi/Cocoa/SafeBrowsingSPI.h: Added.

* WebKit.xcodeproj/project.pbxproj:
Added SafeBrowsingSPI.h.

* WebKitLibraries/WebKitPrivateFrameworkStubs/iOS/11/SafariSafeBrowsing.framework/SafariSafeBrowsing.tbd:
Added.

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

19 months ago[Web Animations] Remove http/wpt/wk-web-animations tests
graouts@webkit.org [Fri, 19 Jan 2018 17:59:59 +0000 (17:59 +0000)]
[Web Animations] Remove http/wpt/wk-web-animations tests
https://bugs.webkit.org/show_bug.cgi?id=181861

These tests were written early on during our Web Animations implementation before we had a good sense of the quality
of the coverage of the W3C WPT suite. That suite is extremely comprehensive and all of the assertions we wrote ourselves
are redundant and should be removed so that all testing, unless specific to our implementation, is done through the WPT
suite.

Reviewed by Dean Jackson.

* http/wpt/wk-web-animations/interfaces/document-get-animations-expected.txt: Removed.
* http/wpt/wk-web-animations/interfaces/document-get-animations.html: Removed.
* http/wpt/wk-web-animations/interfaces/element-get-animations-expected.txt: Removed.
* http/wpt/wk-web-animations/interfaces/element-get-animations.html: Removed.
* http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle-expected.txt: Removed.
* http/wpt/wk-web-animations/interfaces/keyframe-effect-getComputedStyle.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-creation-basic-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-creation-basic.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-current-time-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-current-time.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-effect-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-effect-timing-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-effect-timing.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-effect-unique-relationship.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-effect.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-interface-effect-property.html: Removed.
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/animation-interface-start-time-property.html: Removed.
* http/wpt/wk-web-animations/timing-model/document-timeline-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/document-timeline.html: Removed.
* http/wpt/wk-web-animations/timing-model/keyframe-effect-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html: Removed.
* http/wpt/wk-web-animations/timing-model/keyframe-effect.html: Removed.
* http/wpt/wk-web-animations/timing-model/timeline-current-time-expected.txt: Removed.
* http/wpt/wk-web-animations/timing-model/timeline-current-time.html: Removed.

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

19 months ago[Win] Compile error: 'WebKitQuartzCoreAdditionsBase.h' not found.
pvollan@apple.com [Fri, 19 Jan 2018 17:58:15 +0000 (17:58 +0000)]
[Win] Compile error: 'WebKitQuartzCoreAdditionsBase.h' not found.
https://bugs.webkit.org/show_bug.cgi?id=181859
<rdar://problem/36659886>

Reviewed by Alex Christensen.

Use local include patch.

* WebKitQuartzCoreAdditions/API/WKCACFImage.h:
* WebKitQuartzCoreAdditions/API/WKCACFView.h:
* WebKitQuartzCoreAdditions/API/WKCACFViewPrivate.h:

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

19 months ago[Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart...
graouts@webkit.org [Fri, 19 Jan 2018 17:56:53 +0000 (17:56 +0000)]
[Web Animations] Expose timing properties (delay, endDelay, fill, iterationStart, iterations, direction) and getComputedTiming()
https://bugs.webkit.org/show_bug.cgi?id=181857
<rdar://problem/36660081>

Reviewed by Dean Jackson.

Source/WebCore:

We start the work to implement the rest of the Web Animations timing and animation model by exposing more properties on
AnimationEffectTiming to control delay (delay, endDelay), looping (iterationStart, iterations), fill and direction.
Additionally, we expose the getComputedTiming() method on AnimationEffect, although it currently lacks some computed
properties that will come in later patch as we implement various processes defined by the spec. We also update the
existing duration() method on AnimationEffectTiming to be called iterationDuration() to match the terms used in the
specification.

Finally, we make all new properties, and update existing ones, that expose a time value go through the new utility
function secondsToWebAnimationsAPITime() to guarantee rounded values with microseconds precision, as advised by
the Web Animations specification.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* animation/AnimationEffect.cpp:
(WebCore::AnimationEffect::localTime const):
(WebCore::AnimationEffect::getComputedTiming):
* animation/AnimationEffect.h:
* animation/AnimationEffect.idl:
* animation/AnimationEffectTiming.cpp:
(WebCore::AnimationEffectTiming::AnimationEffectTiming):
(WebCore::AnimationEffectTiming::setIterationStart):
(WebCore::AnimationEffectTiming::setIterations):
(WebCore::AnimationEffectTiming::bindingsDuration const):
(WebCore::AnimationEffectTiming::setBindingsDuration):
(WebCore::AnimationEffectTiming::endTime const):
(WebCore::AnimationEffectTiming::activeDuration const):
* animation/AnimationEffectTiming.h:
* animation/AnimationEffectTiming.idl:
* animation/AnimationPlaybackEvent.cpp:
(WebCore::AnimationPlaybackEvent::bindingsCurrentTime const):
(WebCore::AnimationPlaybackEvent::bindingsTimelineTime const):
* animation/AnimationTimeline.cpp:
(WebCore::AnimationTimeline::bindingsCurrentTime):
* animation/ComputedTimingProperties.h: Added.
* animation/ComputedTimingProperties.idl: Added. We set nullable double values to a default value of "null" since
otherwise setting those properties to a null value would not set the properties in the converted JS dictionary.
* animation/KeyframeEffect.cpp:
(WebCore::KeyframeEffect::create): Handle new timing properties passed in the KeyframeEffectOptions dictionary.
(WebCore::KeyframeEffect::applyAtLocalTime):
(WebCore::KeyframeEffect::getAnimatedStyle):
(WebCore::KeyframeEffect::startOrStopAccelerated):
* animation/WebAnimation.cpp:
(WebCore::WebAnimation::bindingsStartTime const):
(WebCore::WebAnimation::bindingsCurrentTime const):
(WebCore::WebAnimation::effectEndTime const):
(WebCore::WebAnimation::timeToNextRequiredTick const):
* animation/WebAnimationUtilities.h: Added.
(WebCore::secondsToWebAnimationsAPITime):

LayoutTests:

Update expectations with progressions and new failure points now we expose more of the API.

* http/wpt/web-animations/animation-model/animation-types/discrete-animation-expected.txt:
* http/wpt/web-animations/interfaces/Animatable/animate-expected.txt:
* http/wpt/web-animations/interfaces/Animation/finish-expected.txt:
* http/wpt/web-animations/interfaces/Animation/finished-expected.txt:
* http/wpt/web-animations/interfaces/Animation/pause-expected.txt:
* http/wpt/web-animations/interfaces/Animation/play-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/delay-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/direction-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/duration-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/easing-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/endDelay-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/fill-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterationStart-expected.txt:
* http/wpt/web-animations/interfaces/AnimationEffectTiming/iterations-expected.txt:
* http/wpt/web-animations/interfaces/AnimationTimeline/document-timeline-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/active-time-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/current-iteration-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/local-time-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/phases-and-states-expected.txt:
* http/wpt/web-animations/timing-model/animation-effects/simple-iteration-progress-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-animation-start-time-expected.txt:
* http/wpt/web-animations/timing-model/animations/set-the-target-effect-of-an-animation-expected.txt:
* http/wpt/web-animations/timing-model/time-transformations/transformed-progress-expected.txt:
* http/wpt/wk-web-animations/timing-model/keyframe-effect-interface-timing-duration.html:

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

19 months agoRemove dead networking code
commit-queue@webkit.org [Fri, 19 Jan 2018 17:55:55 +0000 (17:55 +0000)]
Remove dead networking code
https://bugs.webkit.org/show_bug.cgi?id=181813

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

CFURLConnection is only used on Windows.

* platform/network/cf/ResourceError.h:
* platform/network/cf/ResourceRequest.h:
(WebCore::ResourceRequest::encodingRequiresPlatformData const):
* platform/network/cf/ResourceRequestCFNet.cpp:
(WebCore::findCFURLRequestCopyContentDispositionEncodingFallbackArrayFunction):
(WebCore::ResourceRequest::doUpdatePlatformRequest):
(WebCore::ResourceRequest::doUpdatePlatformHTTPBody):
(WebCore::ResourceRequest::doUpdateResourceRequest):
(WebCore::ResourceRequest::setStorageSession):
* platform/network/cf/ResourceResponse.h:
(WebCore::ResourceResponse::ResourceResponse):

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

19 months agoSoftlink VideoProcessing in WebKit
commit-queue@webkit.org [Fri, 19 Jan 2018 17:48:23 +0000 (17:48 +0000)]
Softlink VideoProcessing in WebKit
https://bugs.webkit.org/show_bug.cgi?id=181853
<rdar://problem/36590005>

Patch by Youenn Fablet <youenn@apple.com> on 2018-01-19
Reviewed by Eric Carlson.

* Configurations/libwebrtc.xcconfig:
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.cpp: Added.
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/VideoProcessingSoftLink.h: Added.
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.h:
* Source/webrtc/sdk/objc/Framework/Classes/VideoProcessing/encoder_vcp.mm:
(internal::SetVTSessionProperty):
(webrtc::H264VideoToolboxEncoderVCP::Encode):
* Source/webrtc/sdk/objc/Framework/Classes/VideoToolbox/videocodecfactory.mm:
(webrtc::VideoToolboxVideoEncoderFactory::VideoToolboxVideoEncoderFactory):
* libwebrtc.xcodeproj/project.pbxproj:

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

19 months agoRemove unused WebViewPrivate _allowCookies
commit-queue@webkit.org [Fri, 19 Jan 2018 17:46:06 +0000 (17:46 +0000)]
Remove unused WebViewPrivate _allowCookies
https://bugs.webkit.org/show_bug.cgi?id=181812

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

Source/WebCore:

This SPI was in the original iOS upstreaming and has not been used in many years.

* platform/network/ResourceRequestBase.cpp:
(WebCore::ResourceRequestBase::setDefaultAllowCookies): Deleted.
(WebCore::ResourceRequestBase::defaultAllowCookies): Deleted.
* platform/network/ResourceRequestBase.h:
(WebCore::ResourceRequestBase::ResourceRequestBase):

Source/WebKitLegacy/mac:

* WebView/WebView.mm:
(+[WebView _setAllowCookies:]): Deleted.
(+[WebView _allowCookies]): Deleted.
* WebView/WebViewPrivate.h:

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

19 months agoMark http/tests/images/image-supports-video.html as flaky.
ryanhaddad@apple.com [Fri, 19 Jan 2018 17:45:06 +0000 (17:45 +0000)]
Mark http/tests/images/image-supports-video.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181862

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

19 months agoUpdate TestExpectations for media/W3C/audio/networkState/networkState_during_loadstar...
ryanhaddad@apple.com [Fri, 19 Jan 2018 17:38:15 +0000 (17:38 +0000)]
Update TestExpectations for media/W3C/audio/networkState/networkState_during_loadstart.html.
https://bugs.webkit.org/show_bug.cgi?id=123010

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

19 months agoMove select-out-of-floated-non-editable iOS Simulator expectations to iOS
jbedard@apple.com [Fri, 19 Jan 2018 17:12:04 +0000 (17:12 +0000)]
Move select-out-of-floated-non-editable iOS Simulator expectations to iOS

Unreviewed test gardening.

r222317 introduced these test expectations. These expectations should apply to both
Simulator and device testing.

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

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

19 months agoUse promises for basic-gestures.js and 'await' for the corresponding tests
fred.wang@free.fr [Fri, 19 Jan 2018 16:45:49 +0000 (16:45 +0000)]
Use promises for basic-gestures.js and 'await' for the corresponding tests
https://bugs.webkit.org/show_bug.cgi?id=181841

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-19
Reviewed by Megan Gardner.

* fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html: Remove redundant
check for testRunner.runUIScript, rewrite runUIScript calls to just await a promise, add the
async keyword to runTest and reindent.
Also remove extraneous space after + operator.
* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-to-select-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html: Ditto.
* fast/events/touch/ios/long-press-to-select-text.html: Ditto.
* resources/basic-gestures.js: For all functions in this file, wrap the script source into a
runUIScript call and a new promise, reindent.

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

19 months agoMark svg/filters/feDiffuseLighting-bottomRightPixel.html as failing on Windows.
pvollan@apple.com [Fri, 19 Jan 2018 16:21:33 +0000 (16:21 +0000)]
Mark svg/filters/feDiffuseLighting-bottomRightPixel.html as failing on Windows.
https://bugs.webkit.org/show_bug.cgi?id=181854

Unreviewed test gardening.

* platform/win/TestExpectations:

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

19 months ago[iOS] LayoutTest media/modern-media-controls/media-controller/ios/media-controller...
graouts@webkit.org [Fri, 19 Jan 2018 16:10:34 +0000 (16:10 +0000)]
[iOS] LayoutTest media/modern-media-controls/media-controller/ios/media-controller-ios-do-not-hide-controls-when-tapping-button.html fails on Internal bots
https://bugs.webkit.org/show_bug.cgi?id=181843
<rdar://problem/36061363>

The button we were trying to press was outside of the viewable screen area and so the tap wouldn't occur.
Resizing the video to fit in the window fixes the issue.

Reviewed by Youenn Fablet.

* media/modern-media-controls/media-controller/ios/media-controller-ios-do-not-hide-controls-when-tapping-button.html:

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

19 months agoWebDriver: driver environment not passed to pytest when running w3c tests
commit-queue@webkit.org [Fri, 19 Jan 2018 15:19:32 +0000 (15:19 +0000)]
WebDriver: driver environment not passed to pytest when running w3c tests
https://bugs.webkit.org/show_bug.cgi?id=181852

Patch by Carlos Garcia Campos <cgarcia@igalia.com> on 2018-01-19
Reviewed by Carlos Alberto Lopez Perez.

That's why color codes are not used in the bots log for selenium tests but they appear in w3c tests.

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

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

19 months ago[GTK] WebDriver: wayland display no used in wayland bot
carlosgc@webkit.org [Fri, 19 Jan 2018 14:19:59 +0000 (14:19 +0000)]
[GTK] WebDriver: wayland display no used in wayland bot
https://bugs.webkit.org/show_bug.cgi?id=181851

Reviewed by Carlos Alberto Lopez Perez.

We need to handle the additionalArguments property in the WebDriverTests step.

* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunWebDriverTests.start):

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

19 months agoUnreviewed, reduce count of iteration to fix timing out debug JSC test
utatane.tea@gmail.com [Fri, 19 Jan 2018 13:06:42 +0000 (13:06 +0000)]
Unreviewed, reduce count of iteration to fix timing out debug JSC test
https://bugs.webkit.org/show_bug.cgi?id=181535

* stress/inserted-recovery-with-set-last-index.js:

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

19 months ago[GTK] TERM environment variable is not passed to the test driver.
clopez@igalia.com [Fri, 19 Jan 2018 12:22:00 +0000 (12:22 +0000)]
[GTK] TERM environment variable is not passed to the test driver.
https://bugs.webkit.org/show_bug.cgi?id=181847

Rubber-stamped by by Carlos Garcia Campos.

* Scripts/webkitpy/port/base.py:
(Port.to.setup_environ_for_server):

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

19 months agoWebDriver: run-webdriver-tests is crashing in the bots when creating results json...
carlosgc@webkit.org [Fri, 19 Jan 2018 11:54:20 +0000 (11:54 +0000)]
WebDriver: run-webdriver-tests is crashing in the bots when creating results json file
https://bugs.webkit.org/show_bug.cgi?id=181844

Reviewed by Carlos Alberto Lopez Perez.

We always try to create the directory where to store the json file, but when the filename is given directly,
like in the bots, the current dir is used.

* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.dump_results_to_json_file): Do not try to create the directory if dirname() returns an
empty string.

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

19 months ago[GTK] WebDriver tests are running outside the jhbuild env
carlosgc@webkit.org [Fri, 19 Jan 2018 09:58:04 +0000 (09:58 +0000)]
[GTK] WebDriver tests are running outside the jhbuild env
https://bugs.webkit.org/show_bug.cgi?id=181842

Reviewed by Žan Doberšek.

We need to enter jhbuild env in run-webdriver-tests.

* Scripts/run-webdriver-tests:

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

19 months ago[GTK] Run WebDriver tests in the bots
carlosgc@webkit.org [Fri, 19 Jan 2018 07:31:26 +0000 (07:31 +0000)]
[GTK] Run WebDriver tests in the bots
https://bugs.webkit.org/show_bug.cgi?id=181787

Reviewed by Michael Catanzaro.

Add a step to run WebDriver tests in the GTK test bots. The new step is not GTK specific, but only added to the
factory for the GTK port for now.

* BuildSlaveSupport/build.webkit.org-config/factories.py:
(TestFactory.__init__):
* BuildSlaveSupport/build.webkit.org-config/steps.py:
(RunWebDriverTests):
(RunWebDriverTests.start):
(RunWebDriverTests.commandComplete):
(RunWebDriverTests.evaluateCommand):
(RunWebDriverTests.getText):
(RunWebDriverTests.getText2):

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

19 months agoMove helper files for iOS touch gestures into LayoutTests/resources
fred.wang@free.fr [Fri, 19 Jan 2018 07:03:50 +0000 (07:03 +0000)]
Move helper files for iOS touch gestures into LayoutTests/resources
https://bugs.webkit.org/show_bug.cgi?id=181798

Patch by Frederic Wang <fwang@igalia.com> on 2018-01-18
Reviewed by Wenson Hsieh.

* fast/events/touch/ios/drag-to-autoscroll-in-single-line-editable.html: Change URL of
basic-gestures.js ; remove gesture-helpers.js it seems unused and has the wrong URL anyway.
* fast/events/touch/ios/long-press-then-drag-down-to-change-selected-text.html: Change URL
of basic-gestures.js.
* fast/events/touch/ios/long-press-then-drag-left-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-to-select-text.html: Ditto.
* fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html: Ditto.
* fast/events/touch/ios/long-press-to-select-and-tap-to-clear.html: Ditto.
* fast/events/touch/ios/long-press-to-select-text.html: Ditto.
* resources/basic-gestures.js: Renamed from LayoutTests/fast/events/touch/ios/resources/basic-gestures.js.
* resources/ui-debugging.js: Renamed from LayoutTests/fast/events/touch/ios/resources/ui-debugging.js.
Note that this file was introduced in r222517 but seems unused for now.

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

19 months agoMake in-process MessagePorts be (mostly) asynchronous
beidson@apple.com [Fri, 19 Jan 2018 06:33:11 +0000 (06:33 +0000)]
Make in-process MessagePorts be (mostly) asynchronous
https://bugs.webkit.org/show_bug.cgi?id=181454

Reviewed by Alex Christensen.

No new tests (Covered *brutally* by existing tests)

Part of making MessagePorts be a thing we can pass across processes is making them work async.

The existing "MessagePortChannel" method of abstraction was not cut out for this.
This patch gets rid of MessagePortChannel and adds a new MessagePortChannelProvider abstraction.
It then gets the new machinery working in-process (with some pieces of out-of-process in place)

One synchronous behavior this patch maintains is the hasPendingActivity() check used to support GC.
That will (creatively) be made async in the next followup.

More generally from MessagePorts, this patch also adds a "MessageWithMessagePorts" object to be used
with all forms of postMessage(). Much better.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

* dom/InProcessMessagePortChannel.cpp: Removed.
* dom/InProcessMessagePortChannel.h: Removed.
* dom/MessagePortChannel.cpp: Removed.
* dom/MessagePortChannel.h: Removed.

* dom/MessageChannel.cpp:
(WebCore::MessageChannel::create):
(WebCore::MessageChannel::MessageChannel):
(WebCore::m_port2): Deleted.
* dom/MessageChannel.h:
(WebCore::MessageChannel::create): Deleted.

* dom/MessagePort.cpp:
(WebCore::MessagePort::create):
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::messageAvailable):
(WebCore::MessagePort::start):
(WebCore::MessagePort::close):
(WebCore::MessagePort::contextDestroyed):
(WebCore::MessagePort::dispatchMessages):
(WebCore::MessagePort::hasPendingActivity const):
(WebCore::MessagePort::locallyEntangledPort const):
(WebCore::MessagePort::disentanglePorts):
(WebCore::MessagePort::entanglePorts):
(WebCore::MessagePort::entangleWithRemote): Deleted.
* dom/MessagePort.h:

* dom/MessagePortIdentifier.h:
(WebCore::MessagePortIdentifier::logString const):

* dom/ScriptExecutionContext.cpp:
(WebCore::ScriptExecutionContext::processMessageWithMessagePortsSoon):
(WebCore::ScriptExecutionContext::dispatchMessagePortEvents):
(WebCore::ScriptExecutionContext::processMessagePortMessagesSoon): Deleted.
* dom/ScriptExecutionContext.h:

Add a single object that represents two intertwined ports, tracks their pending
messages, tracks which process they're in, etc etc:
* dom/messageports/MessagePortChannel.cpp: Added.
(WebCore::MessagePortChannel::create):
(WebCore::MessagePortChannel::MessagePortChannel):
(WebCore::MessagePortChannel::~MessagePortChannel):
(WebCore::MessagePortChannel::includesPort):
(WebCore::MessagePortChannel::entanglePortWithProcess):
(WebCore::MessagePortChannel::disentanglePort):
(WebCore::MessagePortChannel::closePort):
(WebCore::MessagePortChannel::postMessageToRemote):
(WebCore::MessagePortChannel::takeAllMessagesForPort):
(WebCore::MessagePortChannel::hasAnyMessagesPendingOrInFlight const):
* dom/messageports/MessagePortChannel.h: Added.
(WebCore::MessagePortChannel::port1 const):
(WebCore::MessagePortChannel::port2 const):
(WebCore::MessagePortChannel::logString const):

Abstraction for creating and operating on MessagePorts in a potentially cross-process way:
* dom/messageports/MessagePortChannelProvider.cpp: Added.
(WebCore::MessagePortChannelProvider::singleton):
(WebCore::MessagePortChannelProvider::setSharedProvider):
* dom/messageports/MessagePortChannelProvider.h: Added.
(WebCore::MessagePortChannelProvider::~MessagePortChannelProvider):

Adds a concrete implementation of that provider to be used in-process (e.g. WK1):
* dom/messageports/MessagePortChannelProviderImpl.cpp: Added.
(WebCore::MessagePortChannelProviderImpl::~MessagePortChannelProviderImpl):
(WebCore::MessagePortChannelProviderImpl::performActionOnAppropriateThread):
(WebCore::MessagePortChannelProviderImpl::createNewMessagePortChannel):
(WebCore::MessagePortChannelProviderImpl::entangleLocalPortInThisProcessToRemote):
(WebCore::MessagePortChannelProviderImpl::messagePortDisentangled):
(WebCore::MessagePortChannelProviderImpl::messagePortClosed):
(WebCore::MessagePortChannelProviderImpl::postMessageToRemote):
(WebCore::MessagePortChannelProviderImpl::takeAllMessagesForPort):
(WebCore::MessagePortChannelProviderImpl::hasMessagesForPorts_temporarySync):
* dom/messageports/MessagePortChannelProviderImpl.h: Added.

Adds a main thread object to handle the set of all MessagePortChannels that are open.
For now it lives in the WebProcess, but for out-of-process it will live in the UIProcess:
* dom/messageports/MessagePortChannelRegistry.cpp: Added.
(WebCore::MessagePortChannelRegistry::~MessagePortChannelRegistry):
(WebCore::MessagePortChannelRegistry::didCreateMessagePortChannel):
(WebCore::MessagePortChannelRegistry::messagePortChannelCreated):
(WebCore::MessagePortChannelRegistry::messagePortChannelDestroyed):
(WebCore::MessagePortChannelRegistry::didEntangleLocalToRemote):
(WebCore::MessagePortChannelRegistry::didDisentangleMessagePort):
(WebCore::MessagePortChannelRegistry::didCloseMessagePort):
(WebCore::MessagePortChannelRegistry::didPostMessageToRemote):
(WebCore::MessagePortChannelRegistry::takeAllMessagesForPort):
(WebCore::MessagePortChannelRegistry::hasMessagesForPorts_temporarySync): This is named against style
  and weird on purpose - to call attention to how bad it is and how it's temporary.
(WebCore::MessagePortChannelRegistry::existingChannelContainingPort):
* dom/messageports/MessagePortChannelRegistry.h: Added.

Add an object that represents a "SerializedScriptValue for the message payload and the ports
that are being transferred along with that payload". This is used in all forms of postMessage():
* dom/messageports/MessageWithMessagePorts.cpp: Added.
* dom/messageports/MessageWithMessagePorts.h: Added.

* page/DOMWindow.cpp:
(WebCore::PostMessageTimer::PostMessageTimer):
(WebCore::PostMessageTimer::event):
(WebCore::DOMWindow::postMessage):

* platform/Logging.h:

* workers/DedicatedWorkerGlobalScope.cpp:
(WebCore::DedicatedWorkerGlobalScope::postMessage):

* workers/Worker.cpp:
(WebCore::Worker::postMessage):

* workers/WorkerGlobalScopeProxy.h:

* workers/WorkerMessagingProxy.cpp:
(WebCore::WorkerMessagingProxy::postMessageToWorkerObject):
(WebCore::WorkerMessagingProxy::postMessageToWorkerGlobalScope):
* workers/WorkerMessagingProxy.h:

* workers/WorkerObjectProxy.h:

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):

* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):

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

* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::fireMessageEvent):
(WebCore::ServiceWorkerThread::postMessageToServiceWorker):
* workers/service/context/ServiceWorkerThread.h:

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

19 months agoMark platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html as flaky.
ryanhaddad@apple.com [Fri, 19 Jan 2018 06:17:19 +0000 (06:17 +0000)]
Mark platform/mac/webrtc/captureCanvas-webrtc-software-encoder.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=180171

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

19 months agoMark inspector/debugger/breakpoint-action-log.html as flaky.
ryanhaddad@apple.com [Fri, 19 Jan 2018 06:11:01 +0000 (06:11 +0000)]
Mark inspector/debugger/breakpoint-action-log.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=181839

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations:

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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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

19 months 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