WebKit-https.git
23 months agoLayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across...
rniwa@webkit.org [Thu, 26 Oct 2017 22:00:17 +0000 (22:00 +0000)]
LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=178828

Reviewed by Wenson Hsieh.

When the pasted content's iframe's body isn't available, wait for load event.

* http/tests/security/clipboard/resources/content-to-copy.html: Always wait for load event before notifying
the parent page that it had finish loading.
* http/tests/security/clipboard/resources/subdirectory/paste-html.html:

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

23 months agoImplement ServiceWorkerContainer getRegistration
commit-queue@webkit.org [Thu, 26 Oct 2017 21:41:19 +0000 (21:41 +0000)]
Implement ServiceWorkerContainer getRegistration
https://bugs.webkit.org/show_bug.cgi?id=178882

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Chris Dumez.

Replace rejection promise by resolving the promise with a null value.
This helps in running WPT tests as WPT tests usually check for registered service workers before running tests.
For WTR, there should be no registered service worker anyway.

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::getRegistration):
* workers/service/ServiceWorkerContainer.h:

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

23 months ago[iOS] Update expected results for platform/ios/ios/fast/text/opticalFontWith*.html
mmaxfield@apple.com [Thu, 26 Oct 2017 21:36:36 +0000 (21:36 +0000)]
[iOS] Update expected results for platform/ios/ios/fast/text/opticalFontWith*.html
https://bugs.webkit.org/show_bug.cgi?id=178885

Unreviewed.

* platform/ios/TestExpectations:
* platform/ios/platform/ios/ios/fast/text/opticalFontWithTextStyle-expected.txt:
* platform/ios/platform/ios/ios/fast/text/opticalFontWithWeight-expected.txt:

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

23 months ago[iOS] Update expected results for fast/text/international/complex-character-based...
mmaxfield@apple.com [Thu, 26 Oct 2017 21:24:33 +0000 (21:24 +0000)]
[iOS] Update expected results for fast/text/international/complex-character-based-fallback.html
https://bugs.webkit.org/show_bug.cgi?id=178884
<rdar://problem/33602192>

Unreviewed.

Test gardening.

* platform/ios/TestExpectations:
* platform/ios/fast/text/international/complex-character-based-fallback-expected.png: Added.
* platform/ios/fast/text/international/complex-character-based-fallback-expected.txt:

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

23 months agoAccount for Mail’s WebMessageDocument class being renamed
mitz@apple.com [Thu, 26 Oct 2017 21:07:01 +0000 (21:07 +0000)]
Account for Mail’s WebMessageDocument class being renamed
https://bugs.webkit.org/show_bug.cgi?id=178881

Reviewed by Sam Weinig.

* editing/cocoa/HTMLConverter.mm:
(_WebMessageDocumentClass): Look up the class by its new name. No longer look it up by the
  old old name, because TOT WebKit isn’t going to be used by versions of Mail that have that name.

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

23 months ago[WPE] Use proper shared object versioning for libWPEWebKit.so
aperez@igalia.com [Thu, 26 Oct 2017 20:57:08 +0000 (20:57 +0000)]
[WPE] Use proper shared object versioning for libWPEWebKit.so
https://bugs.webkit.org/show_bug.cgi?id=178878

Reviewed by Michael Catanzaro.

Move the CALCULATE_LIBRARY_VERSIONS_FROM_LIBTOOL_TRIPLE() to a new CMake include file,
and use it both for the GTK+ and WPE ports. Also add a SET_PROJECT_VERSION() macro to
unify setting the PROJECT_VERSION* family of variables.

* Source/cmake/OptionsGTK.cmake: Use the common macros imported from VersioningUtils.cmake.
* Source/cmake/OptionsWPE.cmake: Properly assign a shared object version to libWPEWebKit.so,
using the common macros from VersioningUtils.cmake.
* Source/cmake/VersioningUtils.cmake: Added.

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

23 months agoRemove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
commit-queue@webkit.org [Thu, 26 Oct 2017 20:22:39 +0000 (20:22 +0000)]
Remove FrameView::serviceScriptedAnimations and Document::serviceScriptedAnimations
https://bugs.webkit.org/show_bug.cgi?id=178879

Patch by Antoine Quint <graouts@apple.com> on 2017-10-26
Reviewed by Dean Jackson.

There are no call sites for FrameView::serviceScriptedAnimations() and that method is the
only call site for Document::serviceScriptedAnimations(), so both can go.

* dom/Document.cpp:
(WebCore::Document::serviceScriptedAnimations): Deleted.
* dom/Document.h:
* page/FrameView.cpp:
(WebCore::FrameView::serviceScriptedAnimations): Deleted.
* page/FrameView.h:

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

23 months ago[MediaStream] Clear cached gUM prompt state
ryanhaddad@apple.com [Thu, 26 Oct 2017 20:22:13 +0000 (20:22 +0000)]
[MediaStream] Clear cached gUM prompt state
https://bugs.webkit.org/show_bug.cgi?id=178754
<rdar://problem/32742356>

Unreviewed, fix a flakey test.

Patch by Eric Carlson <eric.carlson@apple.com> on 2017-10-26

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm:
(-[GetUserMediaRepromptTestView haveStream:]): New, check several times for expected state.
(TestWebKitAPI::TEST): Don't assume stream state changes in the page immediately.

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

23 months ago[Payment Request] Enable Payment Request whenever Apple Pay is enabled
aestes@apple.com [Thu, 26 Oct 2017 20:20:42 +0000 (20:20 +0000)]
[Payment Request] Enable Payment Request whenever Apple Pay is enabled
https://bugs.webkit.org/show_bug.cgi?id=178880

Reviewed by Tim Horton.

Source/WebKit:

* Shared/WebPreferences.yaml:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPaymentRequestEnabled): Deleted.
(WKPreferencesGetPaymentRequestEnabled): Deleted.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

23 months agohttp/tests/workers/service/service-worker-cache-api.https.html is flaky
commit-queue@webkit.org [Thu, 26 Oct 2017 20:17:36 +0000 (20:17 +0000)]
http/tests/workers/service/service-worker-cache-api.https.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=178877

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Alex Christensen.

Marking test as PASS/FAIL.
Changing test to finish after 10 seconds.
Beefing up logging to help identifiying flakiness reason.

* TestExpectations:
* http/tests/workers/service/resources/service-worker-cache-api-worker.js:
(event.event.respondWith.promise.then):
* http/tests/workers/service/resources/service-worker-cache-api.js:
(async.test):
* http/tests/workers/service/service-worker-cache-api.https-expected.txt:

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

23 months agoBring back SWContextManager abstraction in WebCore
cdumez@apple.com [Thu, 26 Oct 2017 20:14:40 +0000 (20:14 +0000)]
Bring back SWContextManager abstraction in WebCore
https://bugs.webkit.org/show_bug.cgi?id=178876

Reviewed by Geoffrey Garen.

Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
is actually useful when the ServiceWorker wants to message the storage process.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/SWContextManager.cpp: Added.
(WebCore::SWContextManager::singleton):
(WebCore::SWContextManager::setConnection):
(WebCore::SWContextManager::connection const):
(WebCore::SWContextManager::registerServiceWorkerThread):
(WebCore::SWContextManager::serviceWorkerThreadProxy const):
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
(WebCore::SWContextManager::Connection::~Connection):

Source/WebKit:

* CMakeLists.txt:
* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startServiceWorkerContext):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp.
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::updatePreferences):
(WebKit::WebSWContextManagerConnection::startServiceWorker):
(WebKit::WebSWContextManagerConnection::startFetch):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
* WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:

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

23 months agoFix issues with WebView subframe painting
simon.fraser@apple.com [Thu, 26 Oct 2017 20:13:47 +0000 (20:13 +0000)]
Fix issues with WebView subframe painting
https://bugs.webkit.org/show_bug.cgi?id=178842
rdar://problem/34072253

Reviewed by Daniel Bates.

WebHTMLView overrides some NSView internal methods to make sure that AppKit doesn't paint
subframes (WebKit controls subframe painting). The method signature of one of these changed in macOS
High Sierra, so match the new signature.

Also rename the 'rect' param to 'displayRect' to match AppKit code.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]):
(-[WebHTMLView _recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:shouldChangeFontReferenceColor:_recursive:displayRectIgnoringOpacity:inGraphicsContext:CGContext:topView:shouldChangeFontReferenceColor:]): Deleted.

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

23 months agoAdd and update some watchlists
joepeck@webkit.org [Thu, 26 Oct 2017 19:19:03 +0000 (19:19 +0000)]
Add and update some watchlists
https://bugs.webkit.org/show_bug.cgi?id=178304

Reviewed by Simon Fraser.

* Scripts/webkitpy/common/config/watchlist:

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

23 months ago[Curl] Rename CurlJobManager to CurlRequestScheduler
commit-queue@webkit.org [Thu, 26 Oct 2017 18:58:29 +0000 (18:58 +0000)]
[Curl] Rename CurlJobManager to CurlRequestScheduler
https://bugs.webkit.org/show_bug.cgi?id=178775

To match the meaning of the class.
It was originally meant to be more generic purpose, but as
other classes was introduced, the objective of the class is
now only to handle the life cycle of curl requests.

The delegate is also renamed to CurlRequestSchedulerClient.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-26
Reviewed by Alex Christensen.

* platform/Curl.cmake:
* platform/network/curl/CurlDownload.cpp:
(WebCore::CurlDownload::~CurlDownload):
(WebCore::CurlDownload::willSendRequest):
* platform/network/curl/CurlDownload.h:
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::CurlRequest):
(WebCore::CurlRequest::start):
(WebCore::CurlRequest::startWithJobManager):
(WebCore::CurlRequest::cancel):
(WebCore::CurlRequest::callClient):
(WebCore::CurlRequest::didReceiveData):
(WebCore::CurlRequest::didCompleteTransfer):
(WebCore::CurlRequest::invokeDidReceiveResponseForFile):
(WebCore::CurlRequest::invokeDidReceiveResponse):
(WebCore::CurlRequest::completeDidReceiveResponse):
(WebCore::CurlRequest::pausedStatusChanged):
(WebCore::CurlRequest::callDelegate): Deleted.
* platform/network/curl/CurlRequest.h:
(WebCore::CurlRequest::create):
(WebCore::CurlRequest::setClient):
(WebCore::CurlRequest::setDelegate): Deleted.
* platform/network/curl/CurlRequestClient.h: Renamed from Source/WebCore/platform/network/curl/CurlRequestDelegate.h.
* platform/network/curl/CurlRequestScheduler.cpp: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.cpp.
(WebCore::CurlJobList::startJobs):
(WebCore::CurlJobList::finishJobs):
(WebCore::CurlRequestScheduler::singleton):
(WebCore::CurlRequestScheduler::add):
(WebCore::CurlRequestScheduler::cancel):
(WebCore::CurlRequestScheduler::callOnWorkerThread):
(WebCore::CurlRequestScheduler::startThreadIfNeeded):
(WebCore::CurlRequestScheduler::stopThreadIfNoMoreJobRunning):
(WebCore::CurlRequestScheduler::stopThread):
(WebCore::CurlRequestScheduler::updateJobList):
(WebCore::CurlRequestScheduler::workerThread):
* platform/network/curl/CurlRequestScheduler.h: Renamed from Source/WebCore/platform/network/curl/CurlJobManager.h.
(WebCore::CurlRequestScheduler::~CurlRequestScheduler):
* platform/network/curl/CurlRequestSchedulerClient.h: Added.
(WebCore::CurlRequestSchedulerClient::~CurlRequestSchedulerClient):
* platform/network/curl/ResourceHandleCurlDelegate.cpp:
(WebCore::ResourceHandleCurlDelegate::~ResourceHandleCurlDelegate):
(WebCore::ResourceHandleCurlDelegate::setAuthentication):
(WebCore::ResourceHandleCurlDelegate::continueAfterWillSendRequest):
* platform/network/curl/ResourceHandleCurlDelegate.h:

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

23 months agoMarked webrtc/video-mute.html as flaky.
jlewis3@apple.com [Thu, 26 Oct 2017 18:56:55 +0000 (18:56 +0000)]
Marked webrtc/video-mute.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=177501

Unreviewed test gardening.

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

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

23 months agoRemove deprecated WebKit symbols
ap@apple.com [Thu, 26 Oct 2017 18:54:46 +0000 (18:54 +0000)]
Remove deprecated WebKit symbols
https://bugs.webkit.org/show_bug.cgi?id=178875
rdar://problem/31139070

Reviewed by Dan Bernstein.

* PlatformMac.cmake:
* Shared/API/c/WKDeprecatedFunctions.cpp:
(WKContextSetProcessModel):
(WKPageGroupCopyIdentifier): Deleted.
(WKPageGroupAddUserContentFilter): Deleted.
(WKPageGroupRemoveUserContentFilter): Deleted.
* UIProcess/API/C/WKPageGroup.h:
* UIProcess/API/Cocoa/_WKVisitedLinkProvider.mm: Removed.
* UIProcess/API/Cocoa/_WKVisitedLinkStore.h:
* WebKit.xcodeproj/project.pbxproj:

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

23 months agoRemove unnecessary whitespace invalidation logic from RenderTreeUpdater
antti@apple.com [Thu, 26 Oct 2017 18:51:33 +0000 (18:51 +0000)]
Remove unnecessary whitespace invalidation logic from RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=178786

Reviewed by Zalan Bujtas.

RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded is a somewhat complex
and confusing function for figuring out if some whitespace-only text node might need to have its
rendering status recomputed. However actually computing if a text renderer is needed is not expensive.
We can simply do it for all whitespace nodes after a sibling mutation.

This also removes a set that could have stale renderer pointers in it (they were never dereferenced).

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

    Fix a display:contents bug exposed by this change. With display:contents a text renderer may have an anonymous
    inline wrapper and we need to take it into account when the text renderer is the beforeChild.

    Tested by imported/w3c/web-platform-tests/css/css-display-3/display-contents-state-change-001.html

* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateRenderTree):

    Call updateTextRenderer() for all whitespace-only text nodes after a change in siblings.
    In normal update case it just figures out quickly (by calling textRendererIsNeeded)
    that there are no changes and bails out.

(WebCore::RenderTreeUpdater::updateElementRenderer):
(WebCore::RenderTreeUpdater::updateTextRenderer):
(WebCore::RenderTreeUpdater::invalidateWhitespaceOnlyTextSiblingsAfterAttachIfNeeded): Deleted.

    No longer needed. Just mark that there have been changes to siblings instead.

* style/RenderTreeUpdater.h:

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

23 months agoMark font palettes as in development
mmaxfield@apple.com [Thu, 26 Oct 2017 18:46:24 +0000 (18:46 +0000)]
Mark font palettes as in development
https://bugs.webkit.org/show_bug.cgi?id=178590

Unreviewed.

* features.json:

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

23 months agoUnreviewed, rolling out r223984.
ryanhaddad@apple.com [Thu, 26 Oct 2017 18:44:08 +0000 (18:44 +0000)]
Unreviewed, rolling out r223984.

Caused LayoutTest assertion failures.

Reverted changeset:

"When navigating back to a page, compositing layers may not
use accelerated drawing"
https://bugs.webkit.org/show_bug.cgi?id=178749
https://trac.webkit.org/changeset/223984

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

23 months agoRebase contentextensions test expectations
achristensen@apple.com [Thu, 26 Oct 2017 18:41:35 +0000 (18:41 +0000)]
Rebase contentextensions test expectations
https://bugs.webkit.org/show_bug.cgi?id=178841

Reviewed by Alexey Proskuryakov.

They've been marked as flaky for so long that nobody has rebased them.  The URLParser
has changed underneath them, DOM error reporting has changed, etc.  The first step to
gaining this test coverage back again is rebasing.

* http/tests/contentextensions/block-everything-if-domain-expected.txt:
* http/tests/contentextensions/block-everything-unless-domain-redirect-expected.txt:
* http/tests/contentextensions/character-set-basic-support-expected.txt:
* http/tests/contentextensions/main-resource-expected.txt:
* http/tests/contentextensions/main-resource-redirect-blocked-expected.txt:
* http/tests/contentextensions/main-resource-redirect-error-expected.txt:
* http/tests/contentextensions/make-https-expected.txt:
* http/tests/contentextensions/plugin-doesnt-crash-expected.txt:
* http/tests/contentextensions/sync-xhr-blocked-expected.txt:
* http/tests/contentextensions/text-track-blocked-expected.txt:

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

23 months agoAdd inspector logging for MediaElementSession autoplay
commit-queue@webkit.org [Thu, 26 Oct 2017 18:38:54 +0000 (18:38 +0000)]
Add inspector logging for MediaElementSession autoplay
https://bugs.webkit.org/show_bug.cgi?id=178846

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-26
Reviewed by Eric Carlson.

No change of behavior.
Making use of pal Logger in MediaElementSession.
This new logging is limited to autoplay/playback for now.

* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::MediaElementSession):
(WebCore::MediaElementSession::playbackPermitted const):
(WebCore::MediaElementSession::autoplayPermitted const):
(WebCore::MediaElementSession::willLog const):
(WebCore::MediaElementSession::logChannel const):
* html/MediaElementSession.h:

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

23 months agoRemove code to update block selection
megan_gardner@apple.com [Thu, 26 Oct 2017 18:20:14 +0000 (18:20 +0000)]
Remove code to update block selection
https://bugs.webkit.org/show_bug.cgi?id=178843

Reviewed by Tim Horton.

Removes code for updating block selection, which has been disabled.
This code is being slowly pruned to avoid regressions and accidental removal of code that is being used.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::didUpdateBlockSelectionWithTouch): Deleted.
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(toSelectionHandlePosition): Deleted.
(-[WKContentView _didUpdateBlockSelectionWithTouch:withFlags:growThreshold:shrinkThreshold:]): Deleted.
(-[WKContentView changeBlockSelectionWithTouchAt:withSelectionTouch:forHandle:]): Deleted.
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::updateBlockSelectionWithTouch): Deleted.
(WebKit::WebPageProxy::didUpdateBlockSelectionWithTouch): Deleted.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::shouldExpand): Deleted.
(WebKit::WebPage::changeBlockSelection): Deleted.
(WebKit::WebPage::updateBlockSelectionWithTouch): Deleted.

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

23 months agoSkipped webrtc/video-replace-muted-track.html on iOS.
jlewis3@apple.com [Thu, 26 Oct 2017 18:16:36 +0000 (18:16 +0000)]
Skipped webrtc/video-replace-muted-track.html on iOS.
https://bugs.webkit.org/show_bug.cgi?id=173608

Unreviewed test gardening.

* platform/ios-wk2/TestExpectations:

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

23 months agoMove ApplePay to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 18:11:24 +0000 (18:11 +0000)]
Move ApplePay to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178871

Rubber-stamped by Tim Horton.

Also, add some other missing files.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:

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

23 months ago[GTK] WebKit library .so version is not being set correctly
aperez@igalia.com [Thu, 26 Oct 2017 17:59:10 +0000 (17:59 +0000)]
[GTK] WebKit library .so version is not being set correctly
https://bugs.webkit.org/show_bug.cgi?id=178873

Reviewed by Michael Catanzaro.

* Source/cmake/OptionsGTK.cmake: Adjust name of the target for which the .so version gets calculated.

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

23 months agoUnreviewed, rolling out r224019.
ryanhaddad@apple.com [Thu, 26 Oct 2017 17:45:19 +0000 (17:45 +0000)]
Unreviewed, rolling out r224019.

This change caused API test WebKit.MSEIsPlayingAudio to time
out.

Reverted changeset:

"XMLHttpRequest should not treat file URLs as same origin"
https://bugs.webkit.org/show_bug.cgi?id=178565
https://trac.webkit.org/changeset/224019

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

23 months agoUnreviewed, rolling out r223994.
ryanhaddad@apple.com [Thu, 26 Oct 2017 17:26:21 +0000 (17:26 +0000)]
Unreviewed, rolling out r223994.

The LayoutTest for this change is failing.

Reverted changeset:

"Add service worker handle fetch support for all subresource
requests"
https://bugs.webkit.org/show_bug.cgi?id=178769
https://trac.webkit.org/changeset/223994

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

23 months agoUnreviewed, rolling out r223908.
ryanhaddad@apple.com [Thu, 26 Oct 2017 17:18:20 +0000 (17:18 +0000)]
Unreviewed, rolling out r223908.

Causes LayoutTest crashes with newer SDKs.

Reverted changeset:

"Adopt new secure coding APIs"
https://bugs.webkit.org/show_bug.cgi?id=178484
https://trac.webkit.org/changeset/223908

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

23 months agoUnreviewed, rolling out r223961.
ryanhaddad@apple.com [Thu, 26 Oct 2017 16:41:22 +0000 (16:41 +0000)]
Unreviewed, rolling out r223961.

The change that required this has been rolled out.

Reverted changeset:

"Mark test262.yaml/test262/test/language/statements/try/tco-
catch.js as passing."
https://bugs.webkit.org/show_bug.cgi?id=178592
https://trac.webkit.org/changeset/223961

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

23 months agoUpdate TestExpectations for compositing/tiling/non-active-window-tiles-size.html.
ryanhaddad@apple.com [Thu, 26 Oct 2017 16:32:46 +0000 (16:32 +0000)]
Update TestExpectations for compositing/tiling/non-active-window-tiles-size.html.
https://bugs.webkit.org/show_bug.cgi?id=171763

Unreviewed test gardening.

* platform/mac-wk2/TestExpectations: Remove Debug-only flag.

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

23 months agoWebAssembly: no VM / JS version of our implementation
jfbastien@apple.com [Thu, 26 Oct 2017 15:33:55 +0000 (15:33 +0000)]
WebAssembly: no VM / JS version of our implementation
https://bugs.webkit.org/show_bug.cgi?id=177472

Reviewed by Michael Saboff.

This patch removes all appearances of "JS" and "VM" in the wasm
directory. These now only appear in the wasm/js directory, which
is only used in a JS embedding of wasm. It should therefore now be
possible to create non-JS embeddings of wasm through JSC, though
it'll still require:

  - Mild codegen for wasm<->embedder calls;
  - A strategy for trap handling (no need for full unwind! Could kill).
  - Creation of the Wasm::* objects.
  - Calling convention handling to call the embedder.
  - Handling of multiple embedders (see #177475, this is optional).

Most of the patch consists in renaming JSWebAssemblyInstance to
Instance, and removing temporary copies which I'd added to make
this specific patch very simple.

* interpreter/CallFrame.cpp:
(JSC::CallFrame::wasmAwareLexicalGlobalObject): this one place
which needs to know about who "owns" the Wasm::Instance. In a JS
embedding it's the JSWebAssemblyInstance.
* wasm/WasmB3IRGenerator.cpp:
(JSC::Wasm::B3IRGenerator::B3IRGenerator):
(JSC::Wasm::B3IRGenerator::restoreWebAssemblyGlobalState):
(JSC::Wasm::B3IRGenerator::addGrowMemory):
(JSC::Wasm::B3IRGenerator::addCurrentMemory):
(JSC::Wasm::B3IRGenerator::getGlobal):
(JSC::Wasm::B3IRGenerator::setGlobal):
(JSC::Wasm::B3IRGenerator::addCall):
(JSC::Wasm::B3IRGenerator::addCallIndirect):
* wasm/WasmBinding.cpp:
(JSC::Wasm::wasmToWasm):
* wasm/WasmContext.cpp:
(JSC::Wasm::Context::load const):
(JSC::Wasm::Context::store):
* wasm/WasmContext.h:
* wasm/WasmEmbedder.h:
* wasm/WasmInstance.cpp:
(JSC::Wasm::Instance::Instance):
(JSC::Wasm::Instance::create):
(JSC::Wasm::Instance::extraMemoryAllocated const):
* wasm/WasmInstance.h: add an "owner", the Wasm::Context, move the
"tail" import information from JSWebAssemblyInstance over to here.
(JSC::Wasm::Instance::finalizeCreation):
(JSC::Wasm::Instance::owner const):
(JSC::Wasm::Instance::offsetOfOwner):
(JSC::Wasm::Instance::context const):
(JSC::Wasm::Instance::setMemory):
(JSC::Wasm::Instance::setTable):
(JSC::Wasm::Instance::offsetOfMemory):
(JSC::Wasm::Instance::offsetOfGlobals):
(JSC::Wasm::Instance::offsetOfTable):
(JSC::Wasm::Instance::offsetOfTail):
(JSC::Wasm::Instance::numImportFunctions const):
(JSC::Wasm::Instance::importFunctionInfo):
(JSC::Wasm::Instance::offsetOfTargetInstance):
(JSC::Wasm::Instance::offsetOfWasmEntrypoint):
(JSC::Wasm::Instance::offsetOfWasmToEmbedderStubExecutableAddress):
(JSC::Wasm::Instance::offsetOfImportFunction):
(JSC::Wasm::Instance::importFunction):
(JSC::Wasm::Instance::allocationSize):
(JSC::Wasm::Instance::create): Deleted.
* wasm/WasmOMGPlan.cpp:
(JSC::Wasm::OMGPlan::runForIndex):
* wasm/WasmOMGPlan.h:
* wasm/WasmTable.cpp:
(JSC::Wasm::Table::Table):
(JSC::Wasm::Table::setFunction):
* wasm/WasmTable.h:
* wasm/WasmThunks.cpp:
(JSC::Wasm::throwExceptionFromWasmThunkGenerator):
(JSC::Wasm::triggerOMGTierUpThunkGenerator):
* wasm/js/JSToWasm.cpp:
(JSC::Wasm::createJSToWasmWrapper):
* wasm/js/JSWebAssemblyInstance.cpp: delete code that is now on Wasm::Instance
(JSC::JSWebAssemblyInstance::JSWebAssemblyInstance): The embedder
decides what the import function is. Here we must properly
placement-new it to what we've elected (and initialize it later).
(JSC::JSWebAssemblyInstance::visitChildren):
(JSC::JSWebAssemblyInstance::finalizeCreation):
(JSC::JSWebAssemblyInstance::create):
* wasm/js/JSWebAssemblyInstance.h: delete code that is now on Wasm::Instance
(JSC::JSWebAssemblyInstance::instance):
(JSC::JSWebAssemblyInstance::moduleNamespaceObject):
(JSC::JSWebAssemblyInstance::setMemory):
(JSC::JSWebAssemblyInstance::table):
(JSC::JSWebAssemblyInstance::setTable):
(JSC::JSWebAssemblyInstance::offsetOfInstance):
(JSC::JSWebAssemblyInstance::offsetOfCallee):
(JSC::JSWebAssemblyInstance::context const): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfTail): Deleted.
(): Deleted.
(JSC::JSWebAssemblyInstance::importFunctionInfo): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfTargetInstance): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfWasmEntrypoint): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfWasmToEmbedderStubExecutableAddress): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfImportFunction): Deleted.
(JSC::JSWebAssemblyInstance::importFunction): Deleted.
(JSC::JSWebAssemblyInstance::internalMemory): Deleted.
(JSC::JSWebAssemblyInstance::wasmCodeBlock const): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfWasmTable): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfGlobals): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfCodeBlock): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfWasmCodeBlock): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfCachedStackLimit): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfWasmMemory): Deleted.
(JSC::JSWebAssemblyInstance::offsetOfTopEntryFramePointer): Deleted.
(JSC::JSWebAssemblyInstance::cachedStackLimit const): Deleted.
(JSC::JSWebAssemblyInstance::setCachedStackLimit): Deleted.
(JSC::JSWebAssemblyInstance::wasmMemory): Deleted.
(JSC::JSWebAssemblyInstance::wasmModule): Deleted.
(JSC::JSWebAssemblyInstance::allocationSize): Deleted.
* wasm/js/JSWebAssemblyTable.cpp:
(JSC::JSWebAssemblyTable::setFunction):
* wasm/js/WasmToJS.cpp: One extra indirection to find the JSWebAssemblyInstance.
(JSC::Wasm::materializeImportJSCell):
(JSC::Wasm::handleBadI64Use):
(JSC::Wasm::wasmToJS):
(JSC::Wasm::wasmToJSException):
* wasm/js/WasmToJS.h:
* wasm/js/WebAssemblyFunction.cpp:
(JSC::callWebAssemblyFunction):
* wasm/js/WebAssemblyInstanceConstructor.cpp:
(JSC::constructJSWebAssemblyInstance):
* wasm/js/WebAssemblyModuleRecord.cpp:
(JSC::WebAssemblyModuleRecord::link):
(JSC::WebAssemblyModuleRecord::evaluate):
* wasm/js/WebAssemblyPrototype.cpp:
(JSC::instantiate):
* wasm/js/WebAssemblyWrapperFunction.cpp:
(JSC::WebAssemblyWrapperFunction::create):

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

23 months agoXMLHttpRequest should not treat file URLs as same origin
bfulgham@apple.com [Thu, 26 Oct 2017 15:14:33 +0000 (15:14 +0000)]
XMLHttpRequest should not treat file URLs as same origin
https://bugs.webkit.org/show_bug.cgi?id=178565
<rdar://problem/11115901>

Reviewed by Ryosuke Niwa.

Source/WebCore:

Do not treat file URLs as same-origin for XHR requests.

Test: fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader): Use new helper method.
* page/SecurityOrigin.cpp:
(WebCore::SecurityOrigin::requestIsSameOrigin): New method to recognize same-origin
requests, with special handling for XHR.
* page/SecurityOrigin.h:

LayoutTests:

* fast/xmlhttprequest/resources/xmlhttprequest-access-self-as-file-real.html: Added.
* fast/xmlhttprequest/xmlhttprequest-access-self-as-file.html: Added.
* fast/xmlhttprequest/xmlhttprequest-access-self-as-file-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-access-self-as-blob-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-access-self-as-blob.html: Added.
* fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: Rebaseline test now that we reject
  XHR to local file URLs.
* platform/ios/fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt: Rebaselined.
* platform/wk2/TestExpectations: Skip test since 'beginDragWithFiles' is not supported in WKTR.

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

23 months agoRemove scopeguard from platform
commit-queue@webkit.org [Thu, 26 Oct 2017 14:06:26 +0000 (14:06 +0000)]
Remove scopeguard from platform
https://bugs.webkit.org/show_bug.cgi?id=178681

Patch by Christopher Reid <chris.reid@sony.com> on 2017-10-26
Reviewed by Brady Eidson.

Source/WebCore:

Replacing platform/ScopeGuard with WTF::ScopeExit.
No new tests, no change in behavior.

* Modules/indexeddb/IDBRequest.cpp:
* Modules/indexeddb/IDBRequest.h:
* Modules/indexeddb/server/UniqueIDBDatabase.cpp:
* WebCore.xcodeproj/project.pbxproj:
* platform/FileSystem.cpp:
* platform/ScopeGuard.h: Removed.
* platform/network/BlobRegistryImpl.cpp:
* workers/service/ServiceWorkerContainer.cpp:

Source/WebKit:

* Shared/mac/ChildProcessMac.mm:

Tools:

* TestWebKitAPI/Tests/WebCore/FileMonitor.cpp:

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

23 months agoREGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in...
carlosgc@webkit.org [Thu, 26 Oct 2017 12:03:29 +0000 (12:03 +0000)]
REGRESSION(r222090): [HarfBuzz] Arabic shaping is broken except for first word in line
https://bugs.webkit.org/show_bug.cgi?id=178625

Reviewed by Michael Catanzaro.

Source/WebCore:

Once we find the first space, which has the COMMON script, we split the run, and the next ones keep using
COMMON instead of ARABIC because we don't update the current script on every loop iteration. This patch
simplifies the script handling by moving the code back to the loop and always breaking in case of different
scripts, correctly handling INHERITED and COMMON cases and updating the current script when needed.

Covered by existing tests. This improves several tests that have been rebaselined.

* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::findNextRun):
(WebCore::scriptsAreCompatibleForCharacters): Deleted.

LayoutTests:

Rebaseline several tests that have been improved.

* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-backward-p-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-br-expected.txt:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.png:
* platform/gtk/editing/selection/vertical-rl-rtl-extend-line-forward-p-expected.txt:
* platform/gtk/fast/text/atsui-negative-spacing-features-expected.png:
* platform/gtk/fast/text/atsui-negative-spacing-features-expected.txt:
* platform/gtk/fast/text/international/hebrew-vowels-expected.png:
* platform/gtk/fast/text/international/hebrew-vowels-expected.txt:
* platform/gtk/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.png:
* platform/gtk/svg/W3C-SVG-1.1/fonts-glyph-02-t-expected.txt:
* platform/gtk/svg/custom/glyph-selection-arabic-forms-expected.png:
* platform/gtk/svg/custom/glyph-selection-arabic-forms-expected.txt:

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

23 months agoWebDriver: Add support to import and run W3C tests
carlosgc@webkit.org [Thu, 26 Oct 2017 10:58:17 +0000 (10:58 +0000)]
WebDriver: Add support to import and run W3C tests
https://bugs.webkit.org/show_bug.cgi?id=177304

Reviewed by Brian Burg.

Tools:

WPT has now several WebDriver tests, and new ones are going to be added to cover the whole spec. This patch
adds the initial support for running W3C tests. The script import-w3c-webdriver-tests reuses parts of the W3C
test downloader to download the tests and required tools from WPT repository into WebDriverTests
directory. Tests can be run with run-webdriver-tests, a new script that works similar to other test runner
scripts. For now it shows a summary at the end of the execution, there aren't expectations yet, since we are not
ready to run those tests in the bots. Once we are ready to properly run the tests, we can add the expectations
support and run the tests in the bots.

* Scripts/import-w3c-webdriver-tests: Added.
* Scripts/run-webdriver-tests: Added.
* Scripts/webkitpy/style/checker.py: Skip WebDriverTests directory since it only contains third-party python
code.
* Scripts/webkitpy/thirdparty/__init__.py: Add support to autodownload mozlog and mozprocess since they are
required by the WebDriver tests.
* Scripts/webkitpy/webdriver_tests/__init__.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_driver.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_driver_gtk.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_test_result.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py: Added.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_web_server.py: Added.

WebDriverTests:

Add json file used by the importer and the result of running the importer.

* imported/w3c/importer.json: Added.
* imported/w3c/tools/pytest/: Added.
* imported/w3c/tools/webdriver/: Added.
* imported/w3c/tools/wptrunner/: Added.
* imported/w3c/webdriver/: Added.

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

23 months ago[GTK] Web Inspector: Add CanvasOverview.svg and Canvas.svg
commit-queue@webkit.org [Thu, 26 Oct 2017 10:44:55 +0000 (10:44 +0000)]
[GTK] Web Inspector: Add CanvasOverview.svg and Canvas.svg
https://bugs.webkit.org/show_bug.cgi?id=178426

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-26
Reviewed by Carlos Garcia Campos.

* UserInterface/Images/gtk/Canvas.svg: Added.
* UserInterface/Images/gtk/CanvasOverview.svg: Added.

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

23 months ago[MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
eocanha@igalia.com [Thu, 26 Oct 2017 10:31:39 +0000 (10:31 +0000)]
[MSE][GStreamer] Fix hang on clearing/destroying AppendPipeline
https://bugs.webkit.org/show_bug.cgi?id=178819

Reviewed by Xabier Rodriguez-Calvar.

The deadlock may occur when UI thread tries to clear pipeline in
AppendPipeline::clearPlayerPrivate() while parser thread tries to change
pipeline state to pause holding the stream lock in
AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread()

This patch is authored by Eugene Mutavchi <Ievgen_Mutavchi@comcast.com>

* platform/graphics/gstreamer/mse/AppendPipeline.cpp:
(WebCore::AppendPipeline::connectDemuxerSrcPadToAppsinkFromAnyThread):
Return if there's no player private.

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

23 months agoAssert that no script is executed during style recalc
rniwa@webkit.org [Thu, 26 Oct 2017 08:46:02 +0000 (08:46 +0000)]
Assert that no script is executed during style recalc
https://bugs.webkit.org/show_bug.cgi?id=178845
<rdar://problem/35106129>

Reviewed by Antti Koivisto.

This patch adds NoEventDispatchAssertion to Document::updateStyle and Document::updateStyleIfNeeded
to make sure we don't start mutating DOM in the middle of a style update.

Added NoEventDispatchAssertion::EventAllowedScope for various places in SVGUseElement to update its
shadow tree since that happens while updating the style.

No new tests since there should be no behavioral change.

* dom/Document.cpp:
(WebCore::Document::resolveStyle): Added NoEventDispatchAssertion while flushing pending stylesheets
and calling FrameView::willRecalcStyle, and while the style tree solver is in works. Also moved in
the code to update the selection and schedule to dispatch a fake mouse event into the same scope.
Also increment m_styleRecalcCount in the same code since post resolution callbacks could run author
scripts which in turn trigger another (recursive) style recalc.
(WebCore::Document::updateStyleIfNeeded): Put everything but the call to resolveStyle in a scope with
NoEventDispatchAssertion.
* dom/Element.cpp:
(WebCore::Element::cloneElementWithChildren): Added NoEventDispatchAssertion::EventAllowedScope to the
newly cloned element for SVG use element's shadow tree.
(WebCore::Element::cloneElementWithoutChildren): Ditto.
* dom/EventDispatcher.cpp:
(WebCore::EventDispatcher::dispatchEvent): Make the assertion more precise to workaround the fact SVG
use elements update its shadow tree in the middle of style updates. Also removed a redundant assertion
since the result of NoEventDispatchAssertion::isEventDispatchAllowedInSubtree cannot chance without
pushing or popoing the stack frame.
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::clearShadowTree):
(WebCore::SVGUseElement::updateShadowTree): Added NoEventDispatchAssertion to the user-agent shadow root
of a SVG use element. Since this is a newly created shadow tree which hasn't been exposed to author
scripts, it's safe to mutate them during the style recalc even though it's not the best design.
(WebCore::SVGUseElement::cloneTarget const): Ditto.
(WebCore::SVGUseElement::expandUseElementsInShadowTree const): Ditto.
(WebCore::SVGUseElement::expandSymbolElementsInShadowTree const): Ditto.
(WebCore::SVGUseElement::transferEventListenersToShadowTree const):

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

23 months agoLayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across...
rniwa@webkit.org [Thu, 26 Oct 2017 07:10:05 +0000 (07:10 +0000)]
LayoutTest http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=178828

Reviewed by Wenson Hsieh.

Removed the superflous call to finishJSTest after 3s.

* http/tests/security/clipboard/copy-paste-html-cross-origin-iframe-across-origin.html:

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

23 months agoMove platform Cocoa sources to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 07:07:51 +0000 (07:07 +0000)]
Move platform Cocoa sources to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178851

Rubber-stamped by Tim Horton.

* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:

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

23 months agoStart moving Cocoa specific unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 06:21:35 +0000 (06:21 +0000)]
Start moving Cocoa specific unified sources
https://bugs.webkit.org/show_bug.cgi?id=178850

Rubber-stamped by Tim Horton.

* PlatformMac.cmake:
* SourcesCocoa.txt:
* WebCore.xcodeproj/project.pbxproj:

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

23 months ago[HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
carlosgc@webkit.org [Thu, 26 Oct 2017 06:03:35 +0000 (06:03 +0000)]
[HarfBuzz] ComplexTextRun should initialize direction from the harfbuzz buffer
https://bugs.webkit.org/show_bug.cgi?id=178788

Reviewed by Michael Catanzaro.

Instead of using the TextRun direction. If the TextRun is ltr, but the harfbuzz buffer is rtl, the character
indexes will be swapped in m_coreTextIndices.

* platform/graphics/ComplexTextController.h:
(WebCore::ComplexTextController::ComplexTextRun::create): Remove the ltr parameter.
* platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
(WebCore::ComplexTextController::ComplexTextRun::ComplexTextRun): Initialize m_isLTR using hb_buffer_get_direction().
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters): Do not pass ltr to ComplexTextRun::create().

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

23 months agoMove remaining platform independent sources to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 05:23:12 +0000 (05:23 +0000)]
Move remaining platform independent sources to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178849

Rubber-stamped by Tim Horton.

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

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

23 months agoMove plugins and rendering to unified sources
keith_miller@apple.com [Thu, 26 Oct 2017 04:57:44 +0000 (04:57 +0000)]
Move plugins and rendering to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178848

Rubber-stamped by Tim Horton.

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

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

23 months agoUnreviewed, add FEMorphology.cpp back to the regular build after r224003.
keith_miller@apple.com [Thu, 26 Oct 2017 04:27:59 +0000 (04:27 +0000)]
Unreviewed, add FEMorphology.cpp back to the regular build after r224003.

* WebCore.xcodeproj/project.pbxproj:

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

23 months agoUnreviewed, Windows build fix.
keith_miller@apple.com [Thu, 26 Oct 2017 04:24:02 +0000 (04:24 +0000)]
Unreviewed, Windows build fix.

* Sources.txt:

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

23 months agoWeb Inspector: provide a way to enable/disable event listeners
webkit@devinrousso.com [Thu, 26 Oct 2017 04:07:59 +0000 (04:07 +0000)]
Web Inspector: provide a way to enable/disable event listeners
https://bugs.webkit.org/show_bug.cgi?id=177451
<rdar://problem/34994925>

Reviewed by Joseph Pecoraro.

Source/JavaScriptCore:

* inspector/protocol/DOM.json:
Add `setEventListenerDisabled` command that enables/disables a specific event listener
during event dispatch. When a disabled event listener is fired, the listener's callback will
not be called.

Source/WebCore:

Test: inspector/dom/setEventListenerDisabled.html

* dom/EventTarget.cpp:
(WebCore::EventTarget::fireEventListeners):
Add InspectorInstrumentation call to isEventListenerDisabled. If true, the event listener's
callback will not be called.

* inspector/InspectorDOMAgent.h:
* inspector/InspectorDOMAgent.cpp:
(WebCore::InspectorDOMAgent::discardBindings):
(WebCore::InspectorDOMAgent::getEventListenersForNode):
(WebCore::InspectorDOMAgent::setEventListenerDisabled):
(WebCore::InspectorDOMAgent::buildObjectForEventListener):
(WebCore::InspectorDOMAgent::willRemoveEventListener):
(WebCore::InspectorDOMAgent::isEventListenerDisabled):
Introduce a mapping of `EventListener*` to `InspectorEventListener`, a struct for uniquely
identifying event listeners so they can be referenced from the frontend. We only add items
to this mapping when `getEventListenersForNode` is called, as that is when EventListener
data is sent to the frontend. This allows us to defer creating an Inspector "mirror" object
for each EventListener until it is needed. Items are removed whenever an event listener is
removed or when the document changes.

* inspector/InspectorInstrumentation.h:
(WebCore::InspectorInstrumentation::isEventListenerDisabled):
* inspector/InspectorInstrumentation.cpp:
(WebCore::InspectorInstrumentation::willRemoveEventListenerImpl):
(WebCore::InspectorInstrumentation::isEventListenerDisabledImpl):
Pass additional parameters to InspectorDOMAgent so it can determine if the event listener
actually exists. If not, don't dispatch an event to the frontend as nothing will change.

Source/WebInspectorUI:

* Localizations/en.lproj/localizedStrings.js:

* UserInterface/Controllers/DOMTreeManager.js:
(WI.DOMTreeManager.prototype.setEventListenerDisabled):

* UserInterface/Views/DOMNodeDetailsSidebarPanel.js:
(WI.DOMNodeDetailsSidebarPanel.prototype.attached):
(WI.DOMNodeDetailsSidebarPanel.prototype.detached):
(WI.DOMNodeDetailsSidebarPanel.prototype._eventListenersChanged):
(WI.DOMNodeDetailsSidebarPanel.prototype.addEventListeners): Deleted.
(WI.DOMNodeDetailsSidebarPanel.prototype.removeEventListeners): Deleted.
Listen for `WI.DOMNode.Event.EventListenersChanged` on all instances of WI.DOMNode, since we
will still want to refresh the event listeners section in the event that an event listener
is removed from a parent node.

* UserInterface/Views/EventListenerSectionGroup.js:
(WI.EventListenerSectionGroup):
(WI.EventListenerSectionGroup.prototype._eventText):
(WI.EventListenerSectionGroup.prototype._nodeTextOrLink):
(WI.EventListenerSectionGroup.prototype._createDisabledToggleElement):
(WI.EventListenerSectionGroup.prototype._createDisabledToggleElement.updateTitle):
* UserInterface/Views/EventListenerSectionGroup.css:
(.event-listener-section > .content input[type="checkbox"]):

* UserInterface/Views/DetailsSectionSimpleRow.js:
(WI.DetailsSectionSimpleRow.prototype.get label):
(WI.DetailsSectionSimpleRow.prototype.set label):

LayoutTests:

* inspector/dom/setEventListenerDisabled-expected.txt: Added.
* inspector/dom/setEventListenerDisabled.html: Added.

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

23 months agoMove Platform to unified sources.
keith_miller@apple.com [Thu, 26 Oct 2017 03:59:25 +0000 (03:59 +0000)]
Move Platform to unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178829

Rubber-stamped by Tim Horton.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* platform/Cursor.cpp:
* platform/sql/SQLiteDatabase.h:

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

23 months agomessageEvent.source can also be a ServiceWorker
cdumez@apple.com [Thu, 26 Oct 2017 02:57:08 +0000 (02:57 +0000)]
messageEvent.source can also be a ServiceWorker
https://bugs.webkit.org/show_bug.cgi?id=178839

Reviewed by Brady Eidson.

messageEvent.source can also be a ServiceWorker:
- https://html.spec.whatwg.org/multipage/comms.html#messageeventsource

This enables calling postMessage() from a ServiceWorker via Bug 178794.

* dom/MessageEvent.cpp:
(WebCore::MessageEvent::source const): Deleted.
* dom/MessageEvent.h:
* dom/MessageEvent.idl:

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

23 months agoStyle::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor...
rniwa@webkit.org [Thu, 26 Oct 2017 00:30:03 +0000 (00:30 +0000)]
Style::Scope::flushPendingUpdate() can replace the entire document in XSLTProcessor::createDocumentFromSource
https://bugs.webkit.org/show_bug.cgi?id=178715
<rdar://problem/35144665>

Reviewed by Brent Fulgham.

Apply XLS tranforms when a 0s timer fires or the document finishes parsing or loading whichever comes first
instead of in the middle of collecting a list of stylesheets.

* dom/Document.cpp:
(WebCore::Document::Document): Initialize the newly added timer.
(WebCore::Document::implicitClose): Apply any pending XSLT before we fire load events since some of the event
handlers may be expecting to see the document after XSLT had been applied.
(WebCore::Document::scheduleToApplyXSLTransforms): Added.
(WebCore::Document::applyPendingXSLTransformsNowIfScheduled): Added.
(WebCore::Document::applyPendingXSLTransformsTimerFired): Added. Moved the logic to apply XSL transforms from
Style::Scope::collectActiveStyleSheets, and merged applyXSLTransform into this function.
(WebCore::Document::applyXSLTransform): Deleted.
(WebCore::Document::finishedParsing): Apply XSLT right before updating the style. This is where used to apply
inline XSLT and it happens much earlier than implicitClose.
* dom/Document.h:
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet): Schedule XSLT in the document instead of flushing pending
stylesheets, which would have synchronously applied XSLT. We can't apply XSLT synchronously here because this
function can be called from a non-script-resilient call stack.
(WebCore::ProcessingInstruction::sheetLoaded): Ditto.
* style/StyleScope.cpp:
(WebCore::Style::Scope::collectXSLTransforms): Added.
(WebCore::Style::Scope::collectActiveStyleSheets): Removed the code to apply XSLT. Skip ProcessingInstructions
that applies XSLT. Also use RefPtr<StyleSheet> instead of a raw pointer to store StyleSheet.
* style/StyleScope.h:
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd): Apply any pending XSLTs synchronously here as the comment suggests.

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

23 months agoWeb Inspector: Canvas Tab: starting a second recording doesn't show red titlebar...
webkit@devinrousso.com [Wed, 25 Oct 2017 23:50:11 +0000 (23:50 +0000)]
Web Inspector: Canvas Tab: starting a second recording doesn't show red titlebar if the first recording was empty
https://bugs.webkit.org/show_bug.cgi?id=178805
<rdar://problem/35176303>

Reviewed by Brian Burg.

Source/WebCore:

No new tests, updated existing tests.

* inspector/InspectorCanvasAgent.cpp:
(WebCore::InspectorCanvasAgent::didFinishRecordingCanvasFrame):
If the recording was stopped and had no data, reset the CallTracingActive flag to false.

LayoutTests:

* inspector/canvas/recording-2d-expected.txt:
* inspector/canvas/recording-2d.html:

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

23 months agoWeb Inspector: replace TypeVerifier with subclasses of WI.Collection
webkit@devinrousso.com [Wed, 25 Oct 2017 23:49:05 +0000 (23:49 +0000)]
Web Inspector: replace TypeVerifier with subclasses of WI.Collection
https://bugs.webkit.org/show_bug.cgi?id=178045
<rdar://problem/35174307>

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Models/Collection.js:
(WI.Collection):
(WI.Collection.prototype.get displayName):
(WI.Collection.prototype.objectIsRequiredType):
(WI.Collection.prototype.add):
(WI.Collection.prototype.get typeVerifier): Deleted.
Instead of exposing the typeVerifier, we create a public predicate that returns whether the
given object matches the expected type of the Collection. Subclasses can override it to
limit the scope of the collection to a particular type.

* UserInterface/Models/CollectionTypes.js:
(WI.FrameCollection.prototype.get displayName):
(WI.FrameCollection.prototype.objectIsRequiredType):
(WI.FrameCollection): Deleted.
(WI.ScriptCollection.prototype.get displayName):
(WI.ScriptCollection.prototype.objectIsRequiredType):
(WI.ScriptCollection): Deleted.
(WI.CSSStyleSheetCollection.prototype.get displayName):
(WI.CSSStyleSheetCollection.prototype.objectIsRequiredType):
(WI.CSSStyleSheetCollection): Deleted.
(WI.CanvasCollection.prototype.get displayName):
(WI.CanvasCollection.prototype.objectIsRequiredType):
(WI.CanvasCollection): Deleted.
(WI.ShaderProgramCollection.prototype.get displayName):
(WI.ShaderProgramCollection.prototype.objectIsRequiredType):
(WI.ShaderProgramCollection): Deleted.
(WI.RecordingCollection.prototype.get displayName):
(WI.RecordingCollection.prototype.objectIsRequiredType):
(WI.RecordingCollection): Deleted.
* UserInterface/Models/ResourceCollection.js:
(WI.ResourceCollection):
(WI.ResourceCollection.prototype.get displayName):
(WI.ResourceCollection.prototype.objectIsRequiredType):
(WI.ResourceCollection.verifierForType): Deleted.
* UserInterface/Views/TreeOutlineGroup.js:
(WI.TreeOutlineGroup.prototype.objectIsRequiredType):
(WI.TreeOutlineGroup): Deleted.
Introduce additional subclasses of Collection for other model types. Modify existing
subclasses to remove `typeVerifier` and instead extend `objectIsRequiredType`.

* UserInterface/Models/Canvas.js:
(WI.Canvas):
* UserInterface/Models/Frame.js:
(WI.Frame):
* UserInterface/Protocol/Target.js:
(WI.Target):
* UserInterface/Views/ResourceSidebarPanel.js:
(WI.ResourceSidebarPanel.prototype.treeElementForRepresentedObject):
(WI.ResourceSidebarPanel.prototype._addScript):

* UserInterface/Views/CollectionContentView.js:
(WI.CollectionContentView):
(WI.CollectionContentView.titleForCollection): Delete.
* UserInterface/Views/ResourceCollectionContentView.js:
(WI.ResourceCollectionContentView):
Require that subclasses of Collection override `get displayName` if the CollectionContentView
is not provided with a `contentPlaceholderText`.

(WI.CollectionContentView.prototype.initialLayout):
We don't need to create and add ContentView for each item of the Collection, as this is
already done by attached().

(WI.CollectionContentView.prototype._showContentPlaceholder):
Remove the 250ms delay before showing the placeholder TitleView.

* UserInterface/Views/FolderizedTreeElement.js:
(WI.FolderizedTreeElement.prototype._settingsForRepresentedObject):

LayoutTests:

* inspector/unit-tests/collection-expected.txt:
* inspector/unit-tests/collection.html:

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

23 months agoMove html to unified sources
keith_miller@apple.com [Wed, 25 Oct 2017 23:47:26 +0000 (23:47 +0000)]
Move html to unified sources
https://bugs.webkit.org/show_bug.cgi?id=178709

Reviewed by Alex Christensen.

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

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

23 months ago[Curl] Delete temporally downloaded file when it cancelled
commit-queue@webkit.org [Wed, 25 Oct 2017 23:39:09 +0000 (23:39 +0000)]
[Curl] Delete temporally downloaded file when it cancelled
https://bugs.webkit.org/show_bug.cgi?id=134393

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2017-10-25
Reviewed by Alex Christensen.

* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::didCancelTransfer):
(WebCore::CurlRequest::writeDataToDownloadFileIfEnabled):
(WebCore::CurlRequest::closeDownloadFile):
(WebCore::CurlRequest::cleanupDownloadFile):
* platform/network/curl/CurlRequest.h:

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

23 months agoAdd service worker handle fetch support for all subresource requests
commit-queue@webkit.org [Wed, 25 Oct 2017 23:32:49 +0000 (23:32 +0000)]
Add service worker handle fetch support for all subresource requests
https://bugs.webkit.org/show_bug.cgi?id=178769

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-25
Reviewed by Chris Dumez.

Source/WebCore:

Test: http/tests/workers/service/image-fetch.https.html

Moving DocumentThreadableLoader logic to CachedResourceLoader to apply it for all resource loads.
Setting the selected service worker identifier for subresource only at the moment.

Testing is limited to images, future wpt tests should cover other subresource cases.

* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::prepareFetch):
* loader/cache/CachedResourceRequest.cpp:
(WebCore::CachedResourceRequest::setSelectedServiceWorkerIdentifierIfNeeded):
* loader/cache/CachedResourceRequest.h:

LayoutTests:

* http/tests/workers/service/image-fetch.https-expected.txt: Added.
* http/tests/workers/service/image-fetch.https.html: Added.
* http/tests/workers/service/resources/image-fetch-worker.js: Added.
(event.event.request.url.indexOf):
(event.event.request.url.endsWith):
* http/tests/workers/service/resources/image-fetch.js: Added.
(done):
(async.loadedImage):
(async.erroredImage):
(async.logStatus):
(async.test):

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

23 months agoNetwork process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndCo...
pvollan@apple.com [Wed, 25 Oct 2017 23:24:15 +0000 (23:24 +0000)]
Network process crash under WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge.
https://bugs.webkit.org/show_bug.cgi?id=160234
rdar://problem/30675510

Reviewed by Geoffrey Garen.

An exception is raised because we call the method rejectProtectionSpaceAndContinueWithChallenge on the CFNetwork
challenge sender, which does not implement this optional method. The methods on the authentication challenge
sender are deprecated when network session is used, so we should not call them in that case.

* Shared/Authentication/AuthenticationManager.cpp:
(WebKit::AuthenticationManager::useCredentialForSingleChallenge):
(WebKit::AuthenticationManager::continueWithoutCredentialForSingleChallenge):
(WebKit::AuthenticationManager::cancelSingleChallenge):
(WebKit::AuthenticationManager::performDefaultHandlingForSingleChallenge):
(WebKit::AuthenticationManager::rejectProtectionSpaceAndContinueForSingleChallenge):
* Shared/Authentication/cocoa/AuthenticationManagerCocoa.mm:
(WebKit::AuthenticationManager::receivedCredential):
(WebKit::AuthenticationManager::receivedRequestToContinueWithoutCredential):
(WebKit::AuthenticationManager::receivedCancellation):
(WebKit::AuthenticationManager::receivedRequestToPerformDefaultHandling):
(WebKit::AuthenticationManager::receivedChallengeRejection):
* Shared/Authentication/soup/AuthenticationManagerSoup.cpp:

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

23 months agoAliasing of text in CSS specs is blocky and ugly
simon.fraser@apple.com [Wed, 25 Oct 2017 23:21:38 +0000 (23:21 +0000)]
Aliasing of text in CSS specs is blocky and ugly
https://bugs.webkit.org/show_bug.cgi?id=174946
Source/WebCore:

rdar://problem/33594542

Reviewed by Dean Jackson.

The PaintedContentRequest relating to subpixel-antialiased text was failing to be
satisfied if the text content in a composited layer was nested inside descendant
RenderLayers, because RenderLayer::isVisuallyNonEmpty() returned early. If this
function is passed a request, we can't return until we've satisfied the request
(which triggers the checking of descendant layers).

Test: compositing/contents-format/subpixel-antialiased-nested-layer.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateClipRects const):

LayoutTests:

Reviewed by Dean Jackson.

* compositing/contents-format/subpixel-antialiased-nested-layer-expected.txt: Added.
* compositing/contents-format/subpixel-antialiased-nested-layer.html: Added.

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

23 months agoWeb Inspector: Canvas Tab: clicking on a canvas card causes details sidebar to show...
webkit@devinrousso.com [Wed, 25 Oct 2017 23:13:19 +0000 (23:13 +0000)]
Web Inspector: Canvas Tab: clicking on a canvas card causes details sidebar to show and mess up card arrangement
https://bugs.webkit.org/show_bug.cgi?id=178803
<rdar://problem/35176082>

Reviewed by Brian Burg.

* Localizations/en.lproj/localizedStrings.js:
* UserInterface/Views/CanvasDetailsSidebarPanel.css:
(.sidebar > .panel.details.canvas > .content > .empty-content-placeholder):
(.sidebar > .panel.details.canvas > .content > .empty-content-placeholder > .message):
* UserInterface/Views/CanvasDetailsSidebarPanel.js:
(WI.CanvasDetailsSidebarPanel):
(WI.CanvasDetailsSidebarPanel.prototype.inspect):
(WI.CanvasDetailsSidebarPanel.prototype.initialLayout):
(WI.CanvasDetailsSidebarPanel.prototype.layout):

* UserInterface/Views/RecordingNavigationSidebarPanel.js:
(WI.RecordingNavigationSidebarPanel.disallowInstanceForClass): Deleted.
* UserInterface/Views/RecordingStateDetailsSidebarPanel.js:
(WI.RecordingStateDetailsSidebarPanel.disallowInstanceForClass): Deleted.
* UserInterface/Views/RecordingTraceDetailsSidebarPanel.js:
(WI.RecordingTraceDetailsSidebarPanel.disallowInstanceForClass): Deleted.
Drive-by: these sidebar panels are now only used by the Canvas tab, so we no longer need to
provide support for multiple instances of them.

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

23 months agoMove DNS resolution outside of NetworkRTCProvider
commit-queue@webkit.org [Wed, 25 Oct 2017 22:27:06 +0000 (22:27 +0000)]
Move DNS resolution outside of NetworkRTCProvider
https://bugs.webkit.org/show_bug.cgi?id=178796

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-25
Reviewed by Geoffrey Garen.

       Tested through manual testing on external STUN servers.
       Moving NetworkRTCProvider::Resolver into NetworkRTCResolver.
       Updating the implementation to use a completion handler.

* NetworkProcess/webrtc/NetworkRTCProvider.cpp:
(WebKit::NetworkRTCProvider::createResolver):
* NetworkProcess/webrtc/NetworkRTCProvider.h:
* NetworkProcess/webrtc/NetworkRTCResolver.cpp:
(WebKit::NetworkRTCResolver::NetworkRTCResolver):
(WebKit::NetworkRTCResolver::~NetworkRTCResolver):
(WebKit::NetworkRTCResolver::start):
(WebKit::NetworkRTCResolver::stop):
(WebKit::NetworkRTCResolver::completed):
(WebKit::NetworkRTCProvider::Resolver::~Resolver): Deleted.
(WebKit::NetworkRTCProvider::stop): Deleted.
(WebKit::NetworkRTCProvider::resolutionCompleted): Deleted.
* NetworkProcess/webrtc/NetworkRTCResolver.h:
* WebKit.xcodeproj/project.pbxproj:

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

23 months agoUnreviewed, rolling out r223691 and r223729.
commit-queue@webkit.org [Wed, 25 Oct 2017 22:15:39 +0000 (22:15 +0000)]
Unreviewed, rolling out r223691 and r223729.
https://bugs.webkit.org/show_bug.cgi?id=178834

Broke Speedometer 2 React-Redux-TodoMVC test case (Requested
by rniwa on #webkit).

Reverted changesets:

"Turn recursive tail calls into loops"
https://bugs.webkit.org/show_bug.cgi?id=176601
https://trac.webkit.org/changeset/223691

"REGRESSION(r223691): DFGByteCodeParser.cpp:1483:83: warning:
comparison is always false due to limited range of data type
[-Wtype-limits]"
https://bugs.webkit.org/show_bug.cgi?id=178543
https://trac.webkit.org/changeset/223729

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

23 months ago[MediaStream] Clear cached gUM prompt state
eric.carlson@apple.com [Wed, 25 Oct 2017 22:15:05 +0000 (22:15 +0000)]
[MediaStream] Clear cached gUM prompt state
https://bugs.webkit.org/show_bug.cgi?id=178754
<rdar://problem/32742356>

Reviewed by Youenn Fablet.

Source/WebKit:

* Shared/WebPreferences.yaml: Define new settings.

* Shared/WebPreferencesDefinitionsBase.h: New default values.

* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetInactiveMediaCaptureSteamRepromptIntervalInMinutes): New.
(WKPreferencesGetInactiveMediaCaptureSteamRepromptIntervalInMinutes): Ditto.
* UIProcess/API/C/WKPreferencesRefPrivate.h:

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _inactiveMediaCaptureSteamRepromptIntervalInMinutes]): Ditto.
(-[WKPreferences _setInactiveMediaCaptureSteamRepromptIntervalInMinutes:]): Ditto.
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

* UIProcess/UserMediaPermissionRequestManagerProxy.cpp:
(WebKit::UserMediaPermissionRequestManagerProxy::UserMediaPermissionRequestManagerProxy): Initialize
the timer.
(WebKit::UserMediaPermissionRequestManagerProxy::createRequest): Remove unneeded namespace.
(WebKit::toWebCore): Remove unneeded breaks.
(WebKit::UserMediaPermissionRequestManagerProxy::searchForGrantedRequest const): Remove unneeded namespace.
(WebKit::UserMediaPermissionRequestManagerProxy::wasRequestDenied): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::requestUserMediaPermissionForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::getUserMediaPermissionInfo): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::enumerateMediaDevicesForFrame): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::syncWithWebCorePrefs const): Ditto.
(WebKit::UserMediaPermissionRequestManagerProxy::captureStateChanged): Set the watchdog timer
to the correct interval based on capture state.
(WebKit::UserMediaPermissionRequestManagerProxy::watchdogTimerFired): Clear cached state.
* UIProcess/UserMediaPermissionRequestManagerProxy.h:

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: Add new test

* TestWebKitAPI/Tests/WebKit/GetUserMediaReprompt.mm: Added.
(-[GetUserMediaRepromptUIDelegate _webView:requestUserMediaAuthorizationForDevices:url:mainFrameURL:decisionHandler:]):
(-[GetUserMediaRepromptUIDelegate _webView:checkUserMediaPermissionForURL:mainFrameURL:frameIdentifier:decisionHandler:]):
(TestWebKitAPI::TEST):

* TestWebKitAPI/Tests/WebKit/getUserMedia.html:

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

23 months agoAdd committer status for Ross Kirsling
ross.kirsling@sony.com [Wed, 25 Oct 2017 22:06:51 +0000 (22:06 +0000)]
Add committer status for Ross Kirsling
https://bugs.webkit.org/show_bug.cgi?id=178832

Unreviewed.

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

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

23 months agoUnreviewed, add missing copyright header to ServiceWorkerClientType.idl.
cdumez@apple.com [Wed, 25 Oct 2017 21:47:13 +0000 (21:47 +0000)]
Unreviewed, add missing copyright header to ServiceWorkerClientType.idl.

* workers/service/ServiceWorkerClientType.idl:

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

23 months agoMake toJS() do the right thing for ServiceWorkerClient
cdumez@apple.com [Wed, 25 Oct 2017 21:36:39 +0000 (21:36 +0000)]
Make toJS() do the right thing for ServiceWorkerClient
https://bugs.webkit.org/show_bug.cgi?id=178816

Reviewed by Youenn Fablet.

Make toJS() do the right thing for ServiceWorkerClient. In particular,
it needs to construct a JSServiceWorkerWindowClient wrapper if the
implementation object is a ServiceWorkerWindowClient.

Also, ServiceWorkerClient does not need to be an ActiveDOMObject as
it does not have any long-running tasks. Make it a ContextDestructionObject
instead for now.

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
(WebCore::ServiceWorkerClient::create):
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClientType.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.idl.
* workers/service/ServiceWorkerClientType.idl: Added.
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerClients.idl:

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

23 months agoWhen navigating back to a page, compositing layers may not use accelerated drawing
simon.fraser@apple.com [Wed, 25 Oct 2017 21:32:08 +0000 (21:32 +0000)]
When navigating back to a page, compositing layers may not use accelerated drawing
https://bugs.webkit.org/show_bug.cgi?id=178749
rdar://problem/35158946

Reviewed by Dean Jackson.
Source/WebCore:

There were two issues with setting GraphicsLayerCA's "acceleratesDrawing" state which
occurred on back navigation, related to the ordering of style recalcs and layout.

First, at style recalc time, we created a RenderLayerCompositor but hadn't yet called
its cacheAcceleratedCompositingFlags(), so any layers created during style update
didn't get accelerated drawing. Fix by making cacheAcceleratedCompositingFlags() internal
to RenderLayerCompositor and calling it from willRecalcStyle() and updateCompositingLayers().

Secondly, GraphicsLayerCA::commitLayerChangesBeforeSublayers() needs to updateAcceleratesDrawing()
before updating tiles, so that new tiles fetch the right acceleratesDrawing state from
the TileController.

Test: compositing/accelerated-layers-after-back.html

* page/FrameView.cpp:
(WebCore::FrameView::updateCompositingLayersAfterLayout):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::willRecalcStyle):
(WebCore::RenderLayerCompositor::didRecalcStyleWithNoPendingLayout):
(WebCore::RenderLayerCompositor::updateCompositingLayers):
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Avoid assertions when a test enables accelerated drawing (which we can't support
in the iOS simulator).

* Shared/RemoteLayerTree/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::ensureBackingStore):

Tools:

Fix WTR and DRT to parse "useAcceleratedDrawing" out of "webkit-test-runner" options
and use it to set the state of the web view.

* DumpRenderTree/TestOptions.h:
* DumpRenderTree/TestOptions.mm:
(TestOptions::TestOptions):
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):
(WTR::updateTestOptionsFromTestHeader):
* WebKitTestRunner/TestOptions.h:
(WTR::TestOptions::hasSameInitializationOptions const):

LayoutTests:

Moved iframes/resources/page-cache-helper.html up to compositing/resources/go-back.html.

* compositing/accelerated-layers-after-back-expected.txt: Added.
* compositing/accelerated-layers-after-back.html: Added.
* compositing/iframes/page-cache-layer-tree.html:
* compositing/page-cache-back-crash.html:
* compositing/resources/go-back.html: Renamed from LayoutTests/compositing/iframes/resources/page-cache-helper.html.
* platform/ios/compositing/accelerated-layers-after-back-expected.txt: Added.

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

23 months agoWeb Inspector: Display fetch() initiated loads as "fetch" instead of "xhr" in the...
commit-queue@webkit.org [Wed, 25 Oct 2017 21:30:16 +0000 (21:30 +0000)]
Web Inspector: Display fetch() initiated loads as "fetch" instead of "xhr" in the Network Tab
https://bugs.webkit.org/show_bug.cgi?id=178826

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-25
Reviewed by Youenn Fablet.

* UserInterface/Views/NetworkTableContentView.js:
(WI.NetworkTableContentView.shortDisplayNameForResourceType):
Fetch and XHR loads are still grouped under the succinct "XHR" filter, but
at least display the better type name in the "Type" column of the table.

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

23 months agoLayoutTest http/tests/loading/basic-credentials-sent-automatically.html is flaky
achristensen@apple.com [Wed, 25 Oct 2017 21:19:19 +0000 (21:19 +0000)]
LayoutTest http/tests/loading/basic-credentials-sent-automatically.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=159427

Reviewed by Youenn Fablet.

Use setTimeout to make load delegate callback printing more deterministic.
The important part is that the credentials are printed, and they still are.

* http/tests/loading/basic-credentials-sent-automatically-expected.txt:
* http/tests/loading/basic-credentials-sent-automatically.html:
* platform/mac/TestExpectations:
* platform/wk2/http/tests/loading/basic-credentials-sent-automatically-expected.txt:

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

23 months agoEnable ServiceWorker to fetch resources
commit-queue@webkit.org [Wed, 25 Oct 2017 21:17:46 +0000 (21:17 +0000)]
Enable ServiceWorker to fetch resources
https://bugs.webkit.org/show_bug.cgi?id=178673

Patch by Youenn Fablet <youenn@apple.com> on 2017-10-25
Reviewed by Brady Eidson.

Source/WebCore:

Test: http/tests/workers/service/service-worker-fetch.html

Allow reusing of EmptyFrameLoaderClient for network loading in WebKit Service Worker environment.
Allow overriding the creation of a document loader, pageID, frameID and sessionID getters.

Allow the possibility to create synthetic documents for all ports.

Beefing up ServiceWorkerThreadProxy as it owns a Document and a Page that do nothing but server
the purpose of loading resources for a service worker thread.

* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentLoader.h:
(WebCore::DocumentLoader::setResponse):
* loader/EmptyClients.cpp:
(WebCore::EmptyFrameLoaderClient::sessionID const):
(WebCore::EmptyFrameLoaderClient::createNetworkingContext):
(WebCore::createEmptyFrameNetworkingContext):
* loader/EmptyClients.h:
* loader/EmptyFrameLoaderClient.h: Added.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::initForSynthesizedDocument):
* loader/FrameLoader.h:
* loader/FrameLoaderClient.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::ServiceWorkerThread):
(WebCore::m_workerObjectProxy):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/context/ServiceWorkerThreadProxy.cpp:
(WebCore::ServiceWorkerThreadProxy::create):
(WebCore::createPageForServiceWorker):
(WebCore::ServiceWorkerThreadProxy::ServiceWorkerThreadProxy):
(WebCore::ServiceWorkerThreadProxy::postTaskToLoader):
* workers/service/context/ServiceWorkerThreadProxy.h:
Test: http/tests/workers/service/service-worker-fetch.html

Source/WebKit:

ServiceWorkerContextManager makes use of the new ServiceWorkerThreadProxy.
It creates the necessary environment for the thread to make use of network loads, web sockets and cache storage.
Fetch is functional with these changes.

ServiceWorkerProcessProxy is introduced as a UIProcess proxy to the service worker process.
This process proxy is responsible to give the pageID used by all service worker thread instances for network loads.
ServiceWorkerContextManager is responsible to give a unique frameID for all service worker threads.
This is necessary as these two ids are currently needed for any network load.

ServiceWorkerThreadProxy creates its own FrameLoaderClient which is now used to get pageID, frameID and sessionID.

* UIProcess/ServiceWorkerProcessProxy.cpp: Added.
(WebKit::ServiceWorkerProcessProxy::ServiceWorkerProcessProxy):
(WebKit::m_serviceWorkerPageID):
(WebKit::ServiceWorkerProcessProxy::~ServiceWorkerProcessProxy):
(WebKit::ServiceWorkerProcessProxy::start):
* UIProcess/ServiceWorkerProcessProxy.h: Added.
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::getWorkerContextProcessConnection):
(WebKit::WebProcessPool::createNewWebProcess):
(WebKit::WebProcessPool::initializeNewWebProcess):
(WebKit::WebProcessPool::disconnectProcess):
(WebKit::WebProcessPool::createNewWebProcessRespectingProcessCountLimit):
(WebKit::WebProcessPool::createWebPage):
* UIProcess/WebProcessPool.h:
* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::generatePageID):
* UIProcess/WebProcessProxy.h:
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Network/WebLoaderStrategy.cpp:
(WebKit::WebLoaderStrategy::scheduleLoad):
(WebKit::WebLoaderStrategy::scheduleLoadFromNetworkProcess):
(WebKit::WebLoaderStrategy::startPingLoad):
* WebProcess/Network/WebLoaderStrategy.h:
* WebProcess/Storage/ServiceWorkerContextManager.cpp:
(WebKit::ServiceWorkerContextManager::ServiceWorkerContextManager):
(WebKit::ServiceWorkerContextManager::startServiceWorker):
(WebKit::ServiceWorkerContextManager::startFetch):
* WebProcess/Storage/ServiceWorkerContextManager.h:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::pageID const):
(WebKit::WebFrameLoaderClient::frameID const):
(WebKit::WebFrameLoaderClient::sessionID const):
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

Source/WebKitLegacy/mac:

* WebCoreSupport/WebFrameLoaderClient.mm:
(WebFrameLoaderClient::pageID const):
(WebFrameLoaderClient::frameID const):
(WebFrameLoaderClient::sessionID const):

Added implementation to the new getters.
They are noop in the context of WK1.

Source/WebKitLegacy/win:

Added implementation to the new getters.
They are noop in the context of WK1.

* WebCoreSupport/WebFrameLoaderClient.cpp:
(WebFrameLoaderClient::pageID const):
(WebFrameLoaderClient::frameID const):
(WebFrameLoaderClient::sessionID const):
* WebCoreSupport/WebFrameLoaderClient.h:

LayoutTests:

* http/tests/workers/service/resources/service-worker-fetch-worker.js: Added.
* http/tests/workers/service/resources/service-worker-fetch.js: Added.
* http/tests/workers/service/service-worker-fetch-expected.txt: Added.
* http/tests/workers/service/service-worker-fetch.html: Added.

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

23 months agoREGRESSION(r223937): Use of -fobjc-weak causes build failures with older compilers
msaboff@apple.com [Wed, 25 Oct 2017 21:12:38 +0000 (21:12 +0000)]
REGRESSION(r223937): Use of -fobjc-weak causes build failures with older compilers
https://bugs.webkit.org/show_bug.cgi?id=178825

Reviewed by Mark Lam.

Enable ARC for ARM64_32.  This eliminate the need for setting CLANG_ENABLE_OBJC_WEAK.

* Configurations/ToolExecutable.xcconfig:

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

23 months agoWeb Inspector: Canvas Tab: selected canvas card loses selection outline style while...
webkit@devinrousso.com [Wed, 25 Oct 2017 21:12:00 +0000 (21:12 +0000)]
Web Inspector: Canvas Tab: selected canvas card loses selection outline style while recording
https://bugs.webkit.org/show_bug.cgi?id=178814
<rdar://problem/35177317>

Reviewed by Brian Burg.

* UserInterface/Views/CanvasOverviewContentView.css:
(.content-view.canvas-overview .content-view.canvas):
(.content-view.canvas-overview .content-view.canvas > :matches(header, .preview, footer)):
(.content-view.canvas-overview .content-view.canvas.selected > :matches(.preview, footer),):
(.content-view.canvas-overview .content-view.canvas > header):
(.content-view.canvas-overview .content-view.canvas.is-recording > header):
(.content-view.canvas-overview .content-view.canvas > .preview):
(.content-view.canvas-overview .content-view.canvas > footer):
(.content-view.canvas-overview .content-view.canvas.selected:not(.is-recording)): Deleted.
Instead of applying the border to the entire element, apply parts of the border to each of
its children so that we can choose what colors to use for each part.

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

23 months agoWeb Inspector: [PARITY] Styles Redesign: Add color gradient, bezier curve, and spring...
nvasilyev@apple.com [Wed, 25 Oct 2017 21:09:45 +0000 (21:09 +0000)]
Web Inspector: [PARITY] Styles Redesign: Add color gradient, bezier curve, and spring inline widgets
https://bugs.webkit.org/show_bug.cgi?id=178404
<rdar://problem/35035992>

Reviewed by Devin Rousso.

Add inline widgets for the following CSS values:
- Gradients, e.g. `background-image: linear-gradient(yellow, orange)`
- Bezier curves, e.g. `transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55)`
- Spring functions, e.g. `transition-timing-function: spring(1, 2, 2, 4)`

* UserInterface/Models/Color.js:
(WI.Color.prototype.toString):
Don't throw. The are never try/catch blocks on the callsites.

* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty.prototype._renderValue):
(WI.SpreadsheetStyleProperty.prototype._createInlineSwatch):
(WI.SpreadsheetStyleProperty.prototype._addGradientTokens):
(WI.SpreadsheetStyleProperty.prototype._addColorTokens):
(WI.SpreadsheetStyleProperty.prototype._addTimingFunctionTokens):

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

23 months agoVersioning.
jmarcell@apple.com [Wed, 25 Oct 2017 20:44:29 +0000 (20:44 +0000)]
Versioning.

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

23 months agoFix a bug in syncing script that test/build syncer is never set.
dewei_zhu@apple.com [Wed, 25 Oct 2017 19:48:57 +0000 (19:48 +0000)]
Fix a bug in syncing script that test/build syncer is never set.
https://bugs.webkit.org/show_bug.cgi?id=178772

Reviewed by Ryosuke Niwa.

Neither 'buildSyncer' nor 'testSyncer' is ever set.
Added a unit test to cover this case.

* server-tests/tools-sync-buildbot-integration-tests.js:
(createTriggerable): Refactor it to allow customized name.
* tools/js/buildbot-triggerable.js:
(BuildbotTriggerable.prototype._pullBuildbotOnAllSyncers): Update syncer info accordingly.
(BuildbotTriggerable._testGroupMapForBuildRequests): Initialize build and test syncer to null.

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

23 months agoUNPACK_FLIP_Y is broken for MSE-backed videos
jer.noble@apple.com [Wed, 25 Oct 2017 19:42:16 +0000 (19:42 +0000)]
UNPACK_FLIP_Y is broken for MSE-backed videos
https://bugs.webkit.org/show_bug.cgi?id=178774

Reviewed by Dean Jackson.

Source/WebCore:

The global GLSL variable gl_Position can apparently only be set once, and any modifications
made after that initial set are ignored. So rather than implement flipping by changing
gl_Position.y, flip the texture coordinates instead.

Drive-by fix: some of the constants used in VideoTextureCopierCV are not defined on older
macOS versions, so make them optional.

Tests: fast/canvas/webgl/texImage2D-mse-flipY-false.html
       fast/canvas/webgl/texImage2D-mse-flipY-true.html

* platform/graphics/cv/VideoTextureCopierCV.cpp:
(WebCore::transferFunctionFromString):
(WebCore::VideoTextureCopierCV::initializeUVContextObjects):
* platform/cocoa/CoreVideoSoftLink.cpp:
* platform/cocoa/CoreVideoSoftLink.h:

LayoutTests:

* fast/canvas/webgl/resources/orientation-flipped-fragmented.mp4: Added.
* fast/canvas/webgl/resources/orientation-normal-fragmented.mp4: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-false-expected.txt: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-false.html: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-true-expected.txt: Added.
* fast/canvas/webgl/texImage2D-mse-flipY-true.html: Added.
* platform/ios/TestExpectations:

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

23 months ago[Service Worker] Add stubs for serviceWorkerClient.type
cdumez@apple.com [Wed, 25 Oct 2017 19:36:08 +0000 (19:36 +0000)]
[Service Worker] Add stubs for serviceWorkerClient.type
https://bugs.webkit.org/show_bug.cgi?id=178812

Reviewed by Youenn Fablet.

Add stubs for serviceWorkerClient.type to match the latest specification:
- https://w3c.github.io/ServiceWorker/#enumdef-clienttype

* CMakeLists.txt:
* DerivedSources.make:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::type const):
* workers/service/ServiceWorkerClient.h:
* workers/service/ServiceWorkerClient.idl:
* workers/service/ServiceWorkerClientType.h: Added.
* workers/service/ServiceWorkerClientType.idl: Added.
* workers/service/ServiceWorkerClients.h:
* workers/service/ServiceWorkerClients.idl:

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

23 months agoMove mathml and page to unified souces
keith_miller@apple.com [Wed, 25 Oct 2017 19:27:05 +0000 (19:27 +0000)]
Move mathml and page to unified souces
https://bugs.webkit.org/show_bug.cgi?id=178770

Rubber-stamped by Tim Horton.

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

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

23 months agoFix implicit cast of enum, which seems to break the windows build of unified sources.
keith_miller@apple.com [Wed, 25 Oct 2017 19:06:42 +0000 (19:06 +0000)]
Fix implicit cast of enum, which seems to break the windows build of unified sources.
https://bugs.webkit.org/show_bug.cgi?id=178822

Reviewed by Saam Barati.

* bytecode/DFGExitProfile.h:
(JSC::DFG::FrequentExitSite::hash const):

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

23 months agoWeb Inspector: Styles Redesign: Newly added invalid property isn't immediately shown...
nvasilyev@apple.com [Wed, 25 Oct 2017 19:02:28 +0000 (19:02 +0000)]
Web Inspector: Styles Redesign: Newly added invalid property isn't immediately shown as invalid
https://bugs.webkit.org/show_bug.cgi?id=178488

Reviewed by Brian Burg.

* UserInterface/Models/CSSStyleDeclaration.js:
(WI.CSSStyleDeclaration.prototype.newBlankProperty):
Call this.update to update _properties, _allProperties, _visibleProperties, and _allVisibleProperties.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.css:
(.spreadsheet-style-declaration-editor .property:matches(.invalid-name, .other-vendor, .overridden):not(.disabled)):
(.spreadsheet-style-declaration-editor .property.invalid-name:not(.disabled)):
(.spreadsheet-style-declaration-editor .property.invalid-value:not(.disabled) .value):
When the property name is valid, but the value isn't, display red line-through only for the value.
This is how it works in the old styles sidebar as well.

* UserInterface/Views/SpreadsheetCSSStyleDeclarationEditor.js:
(WI.SpreadsheetCSSStyleDeclarationEditor.prototype._propertiesChanged):
(WI.SpreadsheetCSSStyleDeclarationEditor):
* UserInterface/Views/SpreadsheetStyleProperty.js:
(WI.SpreadsheetStyleProperty):
(WI.SpreadsheetStyleProperty.prototype.updateClassNames):
(WI.SpreadsheetStyleProperty.prototype._update):
Introduce updateClassNames method. Unlike _update, it doesn't change text selection or focus and
can be safely called on a property while it's being edited.

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

23 months agofast/images/animated-gif-paint-after-animation.html flaky crash
commit-queue@webkit.org [Wed, 25 Oct 2017 18:54:58 +0000 (18:54 +0000)]
fast/images/animated-gif-paint-after-animation.html flaky crash
https://bugs.webkit.org/show_bug.cgi?id=178510

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-10-25
Reviewed by Said Abou-Hallawa.

ScalableImageDecoder was accessed from the main thread and the
image decoding thread without a mutex.

No new tests because there is no behavior change.

* platform/image-decoders/ScalableImageDecoder.h: Add m_mutex. Lock the mutex in setData.
* platform/image-decoders/ScalableImageDecoder.cpp:
(WebCore::ScalableImageDecoder::frameIsCompleteAtIndex const): Lock the mutex.
(WebCore::ScalableImageDecoder::frameHasAlphaAtIndex const): Ditto.
(WebCore::ScalableImageDecoder::frameBytesAtIndex const): Ditto.
(WebCore::ScalableImageDecoder::frameDurationAtIndex const): Ditto.
(WebCore::ScalableImageDecoder::createFrameImageAtIndex): Ditto.

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

23 months agoMark http/tests/loading/basic-credentials-sent-automatically.html as flaky.
ryanhaddad@apple.com [Wed, 25 Oct 2017 18:42:11 +0000 (18:42 +0000)]
Mark http/tests/loading/basic-credentials-sent-automatically.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=159427

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

23 months ago[WinCairo] Add WebKit platform files for wincairo webkit
commit-queue@webkit.org [Wed, 25 Oct 2017 18:38:48 +0000 (18:38 +0000)]
[WinCairo] Add WebKit platform files for wincairo webkit
https://bugs.webkit.org/show_bug.cgi?id=178000

Patch by Yousuke Kimoto <yousuke.kimoto@sony.com> on 2017-10-25
Reviewed by Alex Christensen.

* Platform/Module.h:
* Platform/SharedMemory.h:
(WebKit::SharedMemory::handle const):
* Platform/win/LoggingWin.cpp: Added. It is based on Source/WebCore/platform/win/LoggingWin.cpp
(WebKit::logLevelString):
* Platform/win/ModuleWin.cpp: Added.
(WebKit::Module::load):
(WebKit::Module::unload):
(WebKit::Module::platformFunctionPointer const):
* Platform/win/SharedMemoryWin.cpp: Added.
(WebKit::SharedMemory::Handle::Handle):
(WebKit::SharedMemory::Handle::~Handle):
(WebKit::SharedMemory::Handle::isNull const):
(WebKit::SharedMemory::Handle::encode const):
(WebKit::SharedMemory::Handle::clear):
(WebKit::getDuplicatedHandle):
(WebKit::SharedMemory::Handle::decode):
(WebKit::protectAttribute):
(WebKit::SharedMemory::allocate):
(WebKit::SharedMemory::create):
(WebKit::accessRights):
(WebKit::SharedMemory::map):
(WebKit::SharedMemory::adopt):
(WebKit::SharedMemory::~SharedMemory):
(WebKit::SharedMemory::createHandle):
(WebKit::SharedMemory::systemPageSize):
* PlatformWin.cmake:

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

23 months agoUnreviewed, rolling out r222945.
commit-queue@webkit.org [Wed, 25 Oct 2017 18:32:46 +0000 (18:32 +0000)]
Unreviewed, rolling out r222945.
https://bugs.webkit.org/show_bug.cgi?id=178818

"It made WasmBench crash" (Requested by saamyjoon on #webkit).

Reverted changeset:

"bmalloc mutex should be adaptive"
https://bugs.webkit.org/show_bug.cgi?id=177839
https://trac.webkit.org/changeset/222945

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

23 months agoAdd support for unregistering a service worker
cdumez@apple.com [Wed, 25 Oct 2017 18:28:54 +0000 (18:28 +0000)]
Add support for unregistering a service worker
https://bugs.webkit.org/show_bug.cgi?id=178735

Reviewed by Brady Eidson.

Source/WebCore:

Add support for unregistering a service worker:
- https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister

Test: http/tests/workers/service/basic-unregister.https.html

* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::jobResolvedWithUnregistrationResult):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerJob.cpp:
(WebCore::ServiceWorkerJob::resolvedWithUnregistrationResult):
* workers/service/ServiceWorkerJob.h:
* workers/service/ServiceWorkerJobClient.h:
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::encode const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/ServiceWorkerJobType.h:
* workers/service/ServiceWorkerRegistration.cpp:
(WebCore::containerForScriptExecutionContext):
(WebCore::ServiceWorkerRegistration::unregister):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::registrationJobResolvedInServer):
(WebCore::SWClientConnection::unregistrationJobResolvedInServer):
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::resolveRegistationJob):
(WebCore::SWServer::resolveUnregistrationJob):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::scriptContextStarted):
(WebCore::SWServerRegistration::startNextJob):
(WebCore::SWServerRegistration::runUnregisterJob):
(WebCore::SWServerRegistration::resolveWithRegistrationOnMainThread):
(WebCore::SWServerRegistration::resolveWithUnregistrationResultOnMainThread):
(WebCore::SWServerRegistration::resolveCurrentRegistrationJob):
(WebCore::SWServerRegistration::resolveCurrentUnregistrationJob):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

Add support for unregistering a service worker:
- https://w3c.github.io/ServiceWorker/#navigator-service-worker-unregister

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::resolveRegistrationJobInClient):
(WebKit::WebSWServerConnection::resolveUnregistrationJobInClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/basic-unregister.https-expected.txt: Added.
* http/tests/workers/service/basic-unregister.https.html: Added.
* http/tests/workers/service/resources/basic-unregister.js: Added.

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

23 months agoMediaSessionManager* needs to catch Obj-C exceptions
simon.fraser@apple.com [Wed, 25 Oct 2017 18:21:41 +0000 (18:21 +0000)]
MediaSessionManager* needs to catch Obj-C exceptions
https://bugs.webkit.org/show_bug.cgi?id=178813

Reviewed by Tim Horton.

Wrap all calls out to Objective-C with BEGIN_BLOCK_OBJC_EXCEPTIONS/END_BLOCK_OBJC_EXCEPTIONS.

* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
(WebCore::MediaSessionManageriOS::~MediaSessionManageriOS):
(WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):
(WebCore::MediaSessionManageriOS::updateNowPlayingInfo):
(WebCore::MediaSessionManageriOS::externalOutputDeviceAvailableDidChange):
(-[WebMediaSessionHelper allocateVolumeView]):
(-[WebMediaSessionHelper initWithCallback:]):
* platform/audio/mac/MediaSessionManagerMac.mm:
(WebCore::MediaSessionManagerMac::updateNowPlayingInfo):

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

23 months ago[Payment Request] Implement the "user aborts the payment request" algorithm
aestes@apple.com [Wed, 25 Oct 2017 18:00:28 +0000 (18:00 +0000)]
[Payment Request] Implement the "user aborts the payment request" algorithm
https://bugs.webkit.org/show_bug.cgi?id=178810

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
(WebCore::ApplePayPaymentHandler::didCancelPaymentSession):
* Modules/applepay/paymentrequest/ApplePayPaymentHandler.h:
* Modules/paymentrequest/PaymentRequest.cpp:
(WebCore::PaymentRequest::cancel):
* Modules/paymentrequest/PaymentRequest.h:
* testing/MockPaymentCoordinator.cpp:
(WebCore::MockPaymentCoordinator::cancelPayment):
* testing/MockPaymentCoordinator.h:
* testing/MockPaymentCoordinator.idl:

LayoutTests:

* http/tests/paymentrequest/payment-request-show-method.https-expected.txt:
* http/tests/paymentrequest/payment-request-show-method.https.html:

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

23 months agoMark test262.yaml/test262/test/language/statements/try/tco-catch.js as passing.
ryanhaddad@apple.com [Wed, 25 Oct 2017 17:42:20 +0000 (17:42 +0000)]
Mark test262.yaml/test262/test/language/statements/try/tco-catch.js as passing.
https://bugs.webkit.org/show_bug.cgi?id=178592

Unreviewed test gardening.

* test262.yaml:

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

23 months agoAutoplay muted videos still stop playback of other streaming apps in the background
jer.noble@apple.com [Wed, 25 Oct 2017 17:39:47 +0000 (17:39 +0000)]
Autoplay muted videos still stop playback of other streaming apps in the background
https://bugs.webkit.org/show_bug.cgi?id=177920

Reviewed by Eric Carlson.

When creating a new <video> or <audio> element, the global AudioSession can sometimes have
its sessionCategory() set to "MediaPlayback", even if the element does not yet have a
source. This is because the constructor for the MediaElementSession is called before
m_isPlayingToWirelessTarget is initialized, and so in the MediaElementSession constructor,
the media element's m_isPlayingToWirelessTarget ivar is sometimes (uninitialized) true.

We could move the MediaElementSession ivar to the very end of the header, so it's
initialized last, but that still leaves the possibility of the MediaElementSession et. all
calling into the HTMLMediaElement before it's subclass's constructors have a chance to
initialize their own ivars (much less their vtables). So instead, we'll create and set the
MediaElementSession in a finishInitialization() method called from the HTMLVideoElement and
HTMLAudioElement's create() factory methods.

* html/HTMLAudioElement.cpp:
(WebCore::HTMLAudioElement::create):
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::finishInitialization):
* html/HTMLMediaElement.h:
* html/HTMLVideoElement.cpp:
(WebCore::HTMLVideoElement::create):

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

23 months agoAttempt to fix flaky test fast/writing-mode/english-bt-text-with-spelling-marker...
dbates@webkit.org [Wed, 25 Oct 2017 17:27:24 +0000 (17:27 +0000)]
Attempt to fix flaky test fast/writing-mode/english-bt-text-with-spelling-marker.html following r223938
(https://bugs.webkit.org/show_bug.cgi?id=178759)

Call internals.updateEditorUINowIfScheduled() to force the editor UI to update and add spelling markers.

* fast/writing-mode/english-bt-text-with-spelling-marker-expected.html:
* fast/writing-mode/english-bt-text-with-spelling-marker.html:

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

23 months agoMake SharedStringHashTable less error prone
cdumez@apple.com [Wed, 25 Oct 2017 17:19:41 +0000 (17:19 +0000)]
Make SharedStringHashTable less error prone
https://bugs.webkit.org/show_bug.cgi?id=178764

Reviewed by Youenn Fablet.

SharedStringHashTable is backed by SharedMemory and this SharedMemory
may be readonly (and is when used in the WebContent process). As a result,
some of the operations on SharedStringHashTable that write to this shared
memory will crash if called and the SharedMemory is readonly.

To make this less error prone, introduce a new SharedStringHashTableReadOnly
base class for SharedStringHashTable and only keep the operations that
write to the shared memory on SharedStringHashTableReadOnly (namely, add() /
remove() / clear(). Update VisitedLinkTableController and WebSWOriginTable
to use SharedStringHashTableReadOnly since they are instantiated in the
WebContent process and use readonly shared memory.

* Shared/SharedStringHashTable.cpp:
(WebKit::SharedStringHashTableReadOnly::SharedStringHashTableReadOnly):
(WebKit::SharedStringHashTableReadOnly::~SharedStringHashTableReadOnly):
(WebKit::SharedStringHashTableReadOnly::setSharedMemory):
(WebKit::doubleHash):
(WebKit::SharedStringHashTableReadOnly::contains const):
(WebKit::SharedStringHashTableReadOnly::findSlot const):
(WebKit::SharedStringHashTable::SharedStringHashTable):
(WebKit::SharedStringHashTable::~SharedStringHashTable):
(WebKit::SharedStringHashTable::add):
(WebKit::SharedStringHashTable::remove):
(WebKit::SharedStringHashTable::clear):
* Shared/SharedStringHashTable.h:
* WebProcess/Storage/WebSWOriginTable.h:
* WebProcess/WebPage/VisitedLinkTableController.cpp:
(WebKit::VisitedLinkTableController::removeAllVisitedLinks):
* WebProcess/WebPage/VisitedLinkTableController.h:

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

23 months agoWeb Inspector: Enable WebKit logging configuration and display
eric.carlson@apple.com [Wed, 25 Oct 2017 17:18:13 +0000 (17:18 +0000)]
Web Inspector: Enable WebKit logging configuration and display
https://bugs.webkit.org/show_bug.cgi?id=177027
<rdar://problem/33964767>

Unreviewed, fix flakey test.

* inspector/console/webcore-logging-expected.txt:
* inspector/console/webcore-logging.html:

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

23 months agoSupport the TailBench9000 benchmark in run-jsc-benchmarks
rmorisset@apple.com [Wed, 25 Oct 2017 16:58:57 +0000 (16:58 +0000)]
Support the TailBench9000 benchmark in run-jsc-benchmarks
https://bugs.webkit.org/show_bug.cgi?id=178451

Reviewed by Saam Barati.

PerformanceTests:

The separation between the definition of the benchmarks (in merge-sort.js and n-body.js) and their loops (in *-run.js)
was causing trouble since the load of the js files only succeeded from the same directory. So I chose to merge them, following
the example of the other benchmarks.

* TailBench9000/merge-sort-run.js: Removed.
* TailBench9000/merge-sort.js:
* TailBench9000/n-body-run.js: Removed.
* TailBench9000/n-body.js:

Tools:

* Scripts/run-jsc-benchmarks:

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

23 months ago[css-grid] Avoid clearing the overrideContainingBlockWidth if possible
jfernandez@igalia.com [Wed, 25 Oct 2017 16:38:14 +0000 (16:38 +0000)]
[css-grid] Avoid clearing the overrideContainingBlockWidth if possible
https://bugs.webkit.org/show_bug.cgi?id=178260

Reviewed by Sergio Villar Senin.

Since the intrinsic width computation uses the same logic than the
track sizing algorithm we are clearing the overrideContainingBlockWidth
of some grid items that are required to laid out them properly.

It's very uncommon that any intrinsic size computation isn't performed
as part of a layout process. However, if it happens, once cleared the
overrideContainingBlockWidth it may lead to an incorrect layout of the
affected grid items.

This change is a defensive approach to avoid the issues caused by
such off-layout preferred size requests, which may imply recomputing
the grid container intrinsic size.

No new tests, because we are only removing some redundant logic.

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::GridTrackSizingAlgorithmStrategy::minContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::maxContentForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::minSizeForChild const):
(WebCore::GridTrackSizingAlgorithmStrategy::updateOverrideContainingBlockContentSizeForChild const):
(WebCore::IndefiniteSizeStrategy::minLogicalWidthForChild const):
(WebCore::DefiniteSizeStrategy::minLogicalWidthForChild const):
* rendering/GridTrackSizingAlgorithm.h:

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

23 months agoUnreviewed follow up changing one more enum value as discussed in the bug
gns@gnome.org [Wed, 25 Oct 2017 15:11:07 +0000 (15:11 +0000)]
Unreviewed follow up changing one more enum value as discussed in the bug
https://bugs.webkit.org/show_bug.cgi?id=177810

* platform/glib/LowPowerModeNotifierGLib.cpp:
(WebCore::LowPowerModeNotifier::updateState): use NONE instead of DISCHARGING, to ensure
it will build even with older upower.

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

23 months ago[WPE] Remove GLib API functions which use Cairo
aperez@igalia.com [Wed, 25 Oct 2017 08:34:13 +0000 (08:34 +0000)]
[WPE] Remove GLib API functions which use Cairo
https://bugs.webkit.org/show_bug.cgi?id=178205

Reviewed by Michael Catanzaro.

Source/WebKit:

Add PLATFORM(GTK) guards for the parts of of the GLib API which use cairo_surface_t (web
page snapshots and favicons), and remove the affected function prototypes from public API
headers. This way, the WPE version of the API is not tied to Cairo.

* PlatformWPE.cmake:
* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
* UIProcess/API/glib/WebKitFaviconDatabasePrivate.h:
* UIProcess/API/glib/WebKitInjectedBundleClient.cpp:
* UIProcess/API/glib/WebKitWebView.cpp:
(webkitWebViewConstructed):
(webkitWebViewGetProperty):
(webkitWebViewDispose):
(webkit_web_view_class_init):
(webkitWebViewLoadChanged):
* UIProcess/API/glib/WebKitWebViewPrivate.h:
* UIProcess/API/wpe/WebKitFaviconDatabase.h:
* UIProcess/API/wpe/WebKitWebView.h:
* WebProcess/InjectedBundle/API/glib/WebKitWebPage.cpp:
(webkitWebPageDidReceiveMessage):

Tools:

Add PLATFORM(GTK) guards for the API tests (or parts of them) which use cairo_surface_t (web
page snapshots and favicons) which are not available in the WPE version of the GLib API.

* TestWebKitAPI/Tests/WebKitGLib/TestWebKitFaviconDatabase.cpp:
(testNotInitialized):
(testPrivateBrowsing):
(testFaviconDatabase):
* TestWebKitAPI/Tests/WebKitGLib/TestWebKitFindController.cpp:
(testFindControllerHide):
(beforeAll):
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.cpp:
* TestWebKitAPI/glib/WebKitGLib/WebViewTest.h:

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

23 months agoWeb Inspector: preserve Recordings for each Canvas after closing the Canvas tab
webkit@devinrousso.com [Wed, 25 Oct 2017 07:39:05 +0000 (07:39 +0000)]
Web Inspector: preserve Recordings for each Canvas after closing the Canvas tab
https://bugs.webkit.org/show_bug.cgi?id=178767
<rdar://problem/35167239>

Reviewed by Brian Burg.

Source/WebInspectorUI:

* UserInterface/Test.html:
Include CollectionTypes for tests.

* UserInterface/Controllers/CanvasManager.js:
(WI.CanvasManager.prototype.recordingFinished):

* UserInterface/Models/Canvas.js:
(WI.Canvas):
(WI.Canvas.prototype.get recordingCollection):

* UserInterface/Models/CollectionTypes.js:
(WI.CanvasCollection):
(WI.RecordingCollection):

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

* UserInterface/Views/CanvasTabContentView.js:
(WI.CanvasTabContentView.prototype.attached):
(WI.CanvasTabContentView.prototype._recordingAdded):

LayoutTests:

* inspector/canvas/resources/recording-utilities.js:
(TestPage.registerInitializer.window.startRecording):
Add assertions that the recording is added to the canvas' RecordingCollection.

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

23 months agoMake SERVICE_WORKER feature buildable on GTK, WPE
zandobersek@gmail.com [Wed, 25 Oct 2017 07:17:21 +0000 (07:17 +0000)]
Make SERVICE_WORKER feature buildable on GTK, WPE
https://bugs.webkit.org/show_bug.cgi?id=178574

Reviewed by Carlos Garcia Campos.

Source/WebCore:

* CMakeLists.txt: Add missing include paths and files to the build.
* Sources.txt: Add missing files to the build.
* WebCore.xcodeproj/project.pbxproj: Remove the JSDOMPromise.cpp and
JSFetchEventCustom.cpp targets, they're now built via unified sources.
* bindings/js/JSFetchEventCustom.cpp: Guard custom JSFetchEvent code
with the ENABLE(SERVICE_WORKER) guards.

Source/WebKit:

* CMakeLists.txt: Add missing files to the build.
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didGetWorkerContextProcessConnection):
IPC::Attachment object should be accessed through an rvalue reference,
making it mutable and enabling releasing the file descriptor.
* StorageProcess/StorageProcess.h: Adjust the method signature.
* WebProcess/Storage/ServiceWorkerClientFetch.cpp:
Explicitly include the ResourceError header from WebCore (using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
Include the CachedResource header from WebCore (again using a forwarding header).
* WebProcess/Storage/WebServiceWorkerProvider.h: Forward-declare the WebCore::CachedResource type.

Source/WTF:

* wtf/Identified.h: Explicitly include the <atomic> header since
std::atomic<> is used in the ThreadSafeIdentified definition.

Tools:

* Scripts/webkitperl/FeatureList.pm: Add the --service-worker option
that enables the SERVICE_WORKER feature flag. For now it's enabled
on Apple's Cocoa ports (even when build-webkit isn't used for those
builds, the flag is enabled here for consistency).

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

23 months ago[Linux] Enable Gigacage in x64 Linux environment
zandobersek@gmail.com [Wed, 25 Oct 2017 06:55:36 +0000 (06:55 +0000)]
[Linux] Enable Gigacage in x64 Linux environment
https://bugs.webkit.org/show_bug.cgi?id=177745
<rdar://problem/34773148>

Reviewed by Yusuke Suzuki.

Re-enable Gigacage on x86_64 Linux platforms after it was disabled in 223877.

The cause for the revert was problems with huge coredumps being generated
while Gigacage was enabled. The feature virtually allocates about 80GB of
memory at the beginning of the process lifetime. This is not a problem in
itself since the memory range is marked as not needed through madvise(),
but all this memory was still included upon core dump generation on Linux.
Since there are reasonable limits enforced upon core dumps, these were
being truncated every time, not yielding any useful information.

To avoid this, on Linux, invocations of madvise() with the MADV_NORMAL and
MADV_DONTNEED advice parameters should be accompanied with respectively
matching MADV_DODUMP and MADV_DONTDUMP madvise() calls. This correctly
avoids core-dumping any memory that's not yet been physically allocated.

* bmalloc/Gigacage.h:
* bmalloc/VMAllocate.h:
(bmalloc::vmDeallocatePhysicalPages):
(bmalloc::vmAllocatePhysicalPages):

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

23 months agoClean up gcc build warnings about reaching the end of a non void function for webrtc...
commit-queue@webkit.org [Wed, 25 Oct 2017 06:26:58 +0000 (06:26 +0000)]
Clean up gcc build warnings about reaching the end of a non void function for webrtc classes
https://bugs.webkit.org/show_bug.cgi?id=178721

Patch by Alejandro G. Castro <alex@igalia.com> on 2017-10-24
Reviewed by Youenn Fablet.

Assert when we reach those situations and return some value after that to avoid warning.

No new tests, this is a clean up.

* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
(WebCore::sessionDescriptionType):
(WebCore::signalingState):
(WebCore::toRTCIceConnectionState):
* Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
(WebCore::bundlePolicyfromConfiguration):
(WebCore::iceTransportPolicyfromConfiguration):

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

23 months agoREGRESSION(r222181): Web Inspector: Augmenting Agents Domains are not getting activated
commit-queue@webkit.org [Wed, 25 Oct 2017 05:37:47 +0000 (05:37 +0000)]
REGRESSION(r222181): Web Inspector: Augmenting Agents Domains are not getting activated
https://bugs.webkit.org/show_bug.cgi?id=178768
<rdar://problem/35081334>

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2017-10-24
Reviewed by Brian Burg.

* UserInterface/Base/Main.js:
Simplify event dispatch.

* UserInterface/Controllers/AppController.js:
(WI.AppController.prototype.activateExtraDomains):
Pass the domains on.

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

23 months agoRenderSVGModelObject::checkIntersection triggers layout
rniwa@webkit.org [Wed, 25 Oct 2017 01:35:45 +0000 (01:35 +0000)]
RenderSVGModelObject::checkIntersection triggers layout
https://bugs.webkit.org/show_bug.cgi?id=178710

Reviewed by Simon Fraser.

Source/WebCore:

Fixed the bug that checkIntersection and checkEnclosure no longer updates the layout after r223882.

Test: svg/custom/check-intersection-basic.svg

* svg/SVGSVGElement.cpp:
(WebCore::SVGSVGElement::collectIntersectionOrEnclosureList):
(WebCore::SVGSVGElement::checkIntersection):
(WebCore::SVGSVGElement::checkEnclosure):
* svg/SVGSVGElement.h:

LayoutTests:

Added the support for SVG documents to js-test.js, and added a basic test for checkIntersection
and checkEnclosure using it.

* resources/js-test.js:
(ensureRootElement): Added. Creates a foreignObject element inside a SVG document.
(moveForeignObjectToTopIfNeeded): Added. In SVG, z-index order is determined by the element order.
In order to make the results visible, we move the foreignObject to the top by appending to the end
of the document element.
(getOrCreate):
(debug): Run innerHTML before appendChild as setting namespaceURI before running innerHTML would
result in span's being parsed as SVG elements.
(insertStyleSheet):
(finishJSTest):
* svg/custom/check-intersection-basic-expected.txt: Added.
* svg/custom/check-intersection-basic.svg: Added.

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