WebKit-https.git
18 months agoSilence OpenGL and OpenGL ES deprecation warnings in newer SDKs
mmaxfield@apple.com [Tue, 6 Mar 2018 02:13:01 +0000 (02:13 +0000)]
Silence OpenGL and OpenGL ES deprecation warnings in newer SDKs
https://bugs.webkit.org/show_bug.cgi?id=183350

Unreviewed.

* Configurations/WebCore.xcconfig:

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

18 months ago[Mac] Teach WebCore::Pasteboard about file promise drags
aestes@apple.com [Tue, 6 Mar 2018 01:36:31 +0000 (01:36 +0000)]
[Mac] Teach WebCore::Pasteboard about file promise drags
https://bugs.webkit.org/show_bug.cgi?id=183314
<rdar://problem/38105493>

Reviewed by Darin Adler.

Source/WebCore:

While WebKit does support receiving file promise drags (since r210360), WebCore::Pasteboard
has not been instructed on how to read their file paths. When the various pasteboard readers
ask for file paths after a file promise drop, they receive an empty vector. This impacts
various features, most notably the DataTransfer API.

Pasteboard actually cannot learn about promised file paths from the pasteboard itself, as
the pasteboard only contains the dragged files' UTIs. Promised file paths aren't known until
the WebKits call -[NSFilePromiseReceiver receivePromisedFilesAtDestination:...], at which
point the file paths are passed to WebCore as part of WebCore::DragData.

When we construct new Pasteboards for drag and drop, we need to store any promised file
paths from the DragData. Then, when the various pasteboard readers ask for file paths and
NSFilesPromisePboardType is on the pasteboard, we can return these promised file paths.

Tests: editing/pasteboard/data-transfer-items-drag-drop-file-promise.html
       editing/pasteboard/data-transfer-items-drop-file-promise.html
       editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html
       editing/pasteboard/datatransfer-types-dropping-text-file-promise.html
       editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html
       editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html
       editing/pasteboard/file-input-files-access-promise.html

* platform/FileSystem.h:
* platform/Pasteboard.h:
(WebCore::Pasteboard::Pasteboard):
* platform/mac/DragDataMac.mm:
(WebCore::DragData::containsPromise const):
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::Pasteboard):
(WebCore::Pasteboard::createForDragAndDrop):
(WebCore::toString):
(WebCore::Pasteboard::read):
(WebCore::Pasteboard::readFilePaths):
(WebCore::absoluteURLsFromPasteboardFilenames): Deleted.
* platform/mac/PlatformPasteboardMac.mm:
(WebCore::PlatformPasteboard::numberOfFiles const):

Source/WebKit:

Added a FIXME comment.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::WebViewImpl::performDragOperation):

Source/WebKitLegacy/mac:

Added a FIXME comment.

* WebView/WebView.mm:
(-[WebView performDragOperation:]):

Tools:

* DumpRenderTree/DumpRenderTreeFileDraggingSource.h:
* DumpRenderTree/DumpRenderTreeFileDraggingSource.m:
(-[DumpRenderTreeFileDraggingSource initWithPromisedFileURLs:]):
(-[DumpRenderTreeFileDraggingSource dealloc]):

Taught DumpRenderTreeFileDraggingSource to store the promised file URLs.

* DumpRenderTree/mac/DumpRenderTree.mm:
(runTest):

Called +[DumpRenderTreeDraggingInfo clearAllFilePromiseReceivers] after running a test.

* DumpRenderTree/mac/DumpRenderTreeDraggingInfo.h:
* DumpRenderTree/mac/DumpRenderTreeDraggingInfo.mm:
(-[DumpRenderTreeFilePromiseReceiver initWithPromisedUTIs:]):
(-[DumpRenderTreeFilePromiseReceiver fileTypes]):
(-[DumpRenderTreeFilePromiseReceiver fileNames]):
(-[DumpRenderTreeFilePromiseReceiver dealloc]):
(copyFile):
(-[DumpRenderTreeFilePromiseReceiver receivePromisedFilesAtDestination:options:operationQueue:reader:]):

We can't instantiate real NSFilePromiseReceivers in DumpRenderTree. They rely on the
pasteboard server to generate unique file URLs, which is incompatible with our swizzled
NSPasteboard.

Instead, create a subclass of NSFilePromiseReceiver that implements its own promise resolution.
-receivePromisedFilesAtDestination:... asks its DumpRenderTreeFileDraggingSource for the
array of file URLs, then copies each to the destination directory on the specified operation
queue. It emulates how NSPasteboard tries to find a unique destination name by appending
numbers to the file name.

All receivers are collected in a global array that is cleared when each test finishes.
DumpRenderTreeFilePromiseReceiver will delete the files it copied in -dealloc.

(+[DumpRenderTreeDraggingInfo clearAllFilePromiseReceivers]):
(-[DumpRenderTreeDraggingInfo enumerateDraggingItemsWithOptions:forView:classes:searchOptions:usingBlock:]):

If NSFilesPromisePboardType is on the pasteboard and classArray contains
NSFilePromiseReceiver, construct a DumpRenderTreeFilePromiseReceiver, add it to the array of
all file promise receivers, then wrap it in an NSDraggingItem and call block.

* DumpRenderTree/mac/EventSendingController.mm:
(+[EventSendingController isSelectorExcludedFromWebScript:]):
(+[EventSendingController webScriptNameForSelector:]):
(-[EventSendingController beginDragWithFilePromises:]):

Implement eventSender.beginDragWithFilePromises() by placing file UTIs on the pasteboard
with type NSFilesPromisePboardType, creating a DumpRenderTreeFileDraggingSource with the
file URLs, and creating a new DumpRenderTreeDraggingInfo and passing it to
-[WebView draggingEntered:].

LayoutTests:

Added versions of file dragging tests in editing/pasteboard/ that use
beginDragWithFilePromises() instead of beginDragWithFiles().

* TestExpectations: Skipped the new tests.
* editing/pasteboard/data-transfer-items-drag-drop-file-promise-expected.txt: Added.
* editing/pasteboard/data-transfer-items-drag-drop-file-promise.html: Added.
* editing/pasteboard/data-transfer-items-drop-file-promise-expected.txt: Added.
* editing/pasteboard/data-transfer-items-drop-file-promise.html: Added.
* editing/pasteboard/datatransfer-items-drop-plaintext-file-promise-expected.txt: Added.
* editing/pasteboard/datatransfer-items-drop-plaintext-file-promise.html: Added.
* editing/pasteboard/datatransfer-types-dropping-text-file-promise-expected.txt: Added.
* editing/pasteboard/datatransfer-types-dropping-text-file-promise.html: Added.
* editing/pasteboard/drag-file-promises-to-editable-element-as-URLs-expected.txt: Added.
* editing/pasteboard/drag-file-promises-to-editable-element-as-URLs.html: Added.
* editing/pasteboard/drag-file-promises-to-editable-element-as-attachment-expected.txt: Added.
* editing/pasteboard/drag-file-promises-to-editable-element-as-attachment.html: Added.
* editing/pasteboard/file-input-files-access-promise-expected.txt: Added.
* editing/pasteboard/file-input-files-access-promise.html: Added.
* platform/mac-wk1/TestExpectations: Un-skipped the new tests.
* platform/win/TestExpectations: Skipped the new tests.

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

18 months ago[webkitpy] Bugzilla class should use NetworkTransaction for network operations
aakash_jain@apple.com [Tue, 6 Mar 2018 01:30:37 +0000 (01:30 +0000)]
[webkitpy] Bugzilla class should use NetworkTransaction for network operations
https://bugs.webkit.org/show_bug.cgi?id=183222

Reviewed by Alexey Proskuryakov.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla.open_url): Method which uses NetworkTransaction for opening url.
(Bugzilla.fetch_user): Used self.open_url instead of directly calling browser.open().
(Bugzilla.add_user_to_groups): Ditto.
(Bugzilla._fetch_bug_page): Ditto.
(Bugzilla.fetch_attachment_contents): Ditto.
(Bugzilla.get_bug_id_for_attachment_id): Ditto.
(Bugzilla.authenticate): Ditto.
(Bugzilla.add_attachment_to_bug): Ditto.
(Bugzilla.add_patch_to_bug): Ditto.
(Bugzilla.create_bug): Ditto.
(Bugzilla.clear_attachment_flags): Ditto.
(Bugzilla.set_flag_on_attachment): Ditto.
(Bugzilla.obsolete_attachment): Ditto.
(Bugzilla.add_cc_to_bug): Ditto.
(Bugzilla.post_comment_to_bug): Ditto.
(Bugzilla.close_bug_as_fixed): Ditto.
(Bugzilla.reassign_bug): Ditto.
(Bugzilla.reopen_bug): Ditto.
(Bugzilla._fetch_bug_page_by_url): Deleted, not required anymore.
* Scripts/webkitpy/common/net/networktransaction.py:
(NetworkTransaction.run): Added a FIXME.

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

18 months ago[Mac] Fix the build
aestes@apple.com [Tue, 6 Mar 2018 00:24:20 +0000 (00:24 +0000)]
[Mac] Fix the build

* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate): Removed unused variables.

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

18 months agoExpose still more WKPreferences SPI to match C SPI
jeffm@apple.com [Mon, 5 Mar 2018 23:19:33 +0000 (23:19 +0000)]
Expose still more WKPreferences SPI to match C SPI
https://bugs.webkit.org/show_bug.cgi?id=183045

Reviewed by Alex Christensen.

* UIProcess/API/Cocoa/WKPreferences.mm:
(-[WKPreferences _setAllowsInlineMediaPlayback:]):
(-[WKPreferences _allowsInlineMediaPlayback]):
(-[WKPreferences _setApplePayEnabled:]):
(-[WKPreferences _applePayEnabled]):
(-[WKPreferences _setDNSPrefetchingEnabled:]):
(-[WKPreferences _dnsPrefetchingEnabled]):
(-[WKPreferences _setInlineMediaPlaybackRequiresPlaysInlineAttribute:]):
(-[WKPreferences _inlineMediaPlaybackRequiresPlaysInlineAttribute]):
(-[WKPreferences _setInvisibleMediaAutoplayNotPermitted:]):
(-[WKPreferences _invisibleMediaAutoplayNotPermitted]):
(-[WKPreferences _setLegacyEncryptedMediaAPIEnabled:]):
(-[WKPreferences _legacyEncryptedMediaAPIEnabled]):
(-[WKPreferences _setMainContentUserGestureOverrideEnabled:]):
(-[WKPreferences _mainContentUserGestureOverrideEnabled]):
(-[WKPreferences _setMediaStreamEnabled:]):
(-[WKPreferences _mediaStreamEnabled]):
(-[WKPreferences _setNeedsStorageAccessFromFileURLsQuirk:]):
(-[WKPreferences _needsStorageAccessFromFileURLsQuirk]):
(-[WKPreferences _setPDFPluginEnabled:]):
(-[WKPreferences _pdfPluginEnabled]):
(-[WKPreferences _setRequiresUserGestureForAudioPlayback:]):
(-[WKPreferences _requiresUserGestureForAudioPlayback]):
(-[WKPreferences _setRequiresUserGestureForVideoPlayback:]):
(-[WKPreferences _requiresUserGestureForVideoPlayback]):
(-[WKPreferences _setServiceControlsEnabled:]):
(-[WKPreferences _serviceControlsEnabled]):
(-[WKPreferences _setShowsToolTipOverTruncatedText:]):
(-[WKPreferences _showsToolTipOverTruncatedText]):
(-[WKPreferences _setTextAreasAreResizable:]):
(-[WKPreferences _textAreasAreResizable]):
(-[WKPreferences _setUseGiantTiles:]):
(-[WKPreferences _useGiantTiles]):
(-[WKPreferences _setWantsBalancedSetDefersLoadingBehavior:]):
(-[WKPreferences _wantsBalancedSetDefersLoadingBehavior]):
(-[WKPreferences _setWebAudioEnabled:]):
(-[WKPreferences _webAudioEnabled]):
* UIProcess/API/Cocoa/WKPreferencesPrivate.h:

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

18 months agoGardening: build fix.
mark.lam@apple.com [Mon, 5 Mar 2018 22:16:49 +0000 (22:16 +0000)]
Gardening: build fix.

Not reviewed.

* interpreter/AbstractPC.h:
(JSC::AbstractPC::AbstractPC):

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

18 months agoUnreviewed, add baseline for fast/text/combining-enclosing-keycap.html.
ryanhaddad@apple.com [Mon, 5 Mar 2018 19:54:29 +0000 (19:54 +0000)]
Unreviewed, add baseline for fast/text/combining-enclosing-keycap.html.

* platform/ios/fast/text/combining-enclosing-keycap-expected.txt: Added.
* platform/mac/fast/text/combining-enclosing-keycap-expected.txt: Added.

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

18 months agodump-class-layout mishandles duplicates base classes and miscomputes padding
commit-queue@webkit.org [Mon, 5 Mar 2018 19:40:18 +0000 (19:40 +0000)]
dump-class-layout mishandles duplicates base classes and miscomputes padding
https://bugs.webkit.org/show_bug.cgi?id=183311

Patch by Joseph Pecoraro <pecoraro@apple.com> on 2018-03-05
Reviewed by Simon Fraser.

* Scripts/dump-class-layout:
(verify_type):
(verify_type_recursive):
Keep a list of seen (offset, type) that we have output and don't re-output them.
The Python types list the base classes as members multiple times as you iterate
through the members, so just ignore them if we have seem them already at a
specific offset.

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

18 months ago[GTK][Wayland] The GTK Wayland bot exits early because of assertions related with...
clopez@igalia.com [Mon, 5 Mar 2018 19:29:44 +0000 (19:29 +0000)]
[GTK][Wayland] The GTK Wayland bot exits early because of assertions related with libsecret since r221925
https://bugs.webkit.org/show_bug.cgi?id=183330

Reviewed by Michael Catanzaro.

Add libsecret to the JHBuild and build it only when the system version is
less than 0.18.6 (unreleased as of writing this) in order to cherry pick
a fix for a bug that causes crashes with layout tests.

* gtk/jhbuild.modules:
* gtk/patches/libsecret-secret-methods-Don-t-unref-NULL-when-search-fails.patch: Added.

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

18 months agoUnreviewed, follow-up after r229209
utatane.tea@gmail.com [Mon, 5 Mar 2018 19:03:59 +0000 (19:03 +0000)]
Unreviewed, follow-up after r229209
https://bugs.webkit.org/show_bug.cgi?id=183312

Add RELEASE_ASSERT to ensure success.

* wtf/cocoa/CPUTimeCocoa.mm:
(WTF::CPUTime::forCurrentThread):
* wtf/unix/CPUTimeUnix.cpp:
(WTF::CPUTime::forCurrentThread):
* wtf/win/CPUTimeWin.cpp:
(WTF::CPUTime::forCurrentThread):

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

18 months agoDon't invalidate all children when doing insertion/deletion in presence of backward...
antti@apple.com [Mon, 5 Mar 2018 18:43:53 +0000 (18:43 +0000)]
Don't invalidate all children when doing insertion/deletion in presence of backward positional selectors
https://bugs.webkit.org/show_bug.cgi?id=183325
<rdar://problem/38134480>

Reviewed by Zalan Bujtas.

It is sufficient to invalidate siblings before the mutation point.

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

We already do sibling walk in the case of forwards positional rules and sibling combinators. The work
done here is insignifant compared to cost of overinvalidating.

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

18 months ago[JSC] Use WTF::ArithmeticOperations for CLoop overflow operations
utatane.tea@gmail.com [Mon, 5 Mar 2018 18:31:40 +0000 (18:31 +0000)]
[JSC] Use WTF::ArithmeticOperations for CLoop overflow operations
https://bugs.webkit.org/show_bug.cgi?id=183324

Reviewed by JF Bastien.

We have WTF::ArithmeticOperations which has operations with overflow checking.
This is suitable for CLoop's overflow checking operations. This patch emits
WTF::ArithmeticOperations for CLoop's overflow checking operations. And it is
lowered to optimized code using CPU's overflow flag.

* offlineasm/cloop.rb:

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

18 months agoimported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element...
cdumez@apple.com [Mon, 5 Mar 2018 18:15:48 +0000 (18:15 +0000)]
imported/w3c/web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html times out with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183297

Patch by Ali Juma <ajuma@chromium.org> on 2018-03-05
Reviewed by Chris Dumez.

Source/WebCore:

When a FrameLoader's policy document loader is cleared after receiving a navigation policy decision
to not continue loading, we still need to trigger a check for load completion, since this loader or
an ancestor loader may have been in state isLoadingInAPISense only because of the existence of
the just-cleared policy document loader. Without triggering this check, these loaders may never
call WebFrameLoaderClient::dispatchDidFinishLoad.

Test: http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::continueLoadAfterNavigationPolicy):

LayoutTests:

Add layout test coverage. Copy expectations from the existing sync-policy version of the test.

* http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt: Added.
* http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404.html: Added.
* http/wpt/html/semantics/text-level-semantics/the-a-element/resources/a-download-404.html: Added.
* platform/ios-wk2/http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt: Added.
* platform/mac-wk1/http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt: Added.
* platform/win/http/wpt/html/semantics/text-level-semantics/the-a-element/a-download-click-404-expected.txt: Added.
* platform/wpe/TestExpectations:

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

18 months agoService worker test gardening
commit-queue@webkit.org [Mon, 5 Mar 2018 18:06:08 +0000 (18:06 +0000)]
Service worker test gardening
https://bugs.webkit.org/show_bug.cgi?id=183264
<rdar://problem/38048743>

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2018-03-05

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

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

18 months ago[GTK] fast/events/blur-focus-window-should-blur-focus-element.html failing
csaavedra@igalia.com [Mon, 5 Mar 2018 15:04:36 +0000 (15:04 +0000)]
[GTK] fast/events/blur-focus-window-should-blur-focus-element.html failing

Unreviewed gardening.

* platform/gtk/TestExpectations: Move this test to the failing test section.

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

18 months ago[GTK] Implement WTR's PlatformWebView::setWindowIsKey()
csaavedra@igalia.com [Mon, 5 Mar 2018 14:44:20 +0000 (14:44 +0000)]
[GTK] Implement WTR's PlatformWebView::setWindowIsKey()
https://bugs.webkit.org/show_bug.cgi?id=183143

Reviewed by Carlos Garcia Campos.

Tools:

Implement ::setWindowIsKey() by keeping a second window to be
presented when the webview's window is to lose its key status.

* WebKitTestRunner/PlatformWebView.h:
* WebKitTestRunner/gtk/PlatformWebViewGtk.cpp:
(WTR::PlatformWebView::PlatformWebView):
(WTR::PlatformWebView::~PlatformWebView):
(WTR::PlatformWebView::setWindowIsKey):

LayoutTests:

* platform/gtk/TestExpectations: Unmark the passing tests

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

18 months ago[CMake] Split JSC header copying into public and private targets
don.olmstead@sony.com [Mon, 5 Mar 2018 13:28:35 +0000 (13:28 +0000)]
[CMake] Split JSC header copying into public and private targets
https://bugs.webkit.org/show_bug.cgi?id=183251

Reviewed by Konstantin Tokarev.

.:

* Source/cmake/WebKitMacros.cmake:

Source/JavaScriptCore:

* CMakeLists.txt:

Source/ThirdParty:

* gtest/CMakeLists.txt:

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

18 months agoUnreviewed, attempt to fix Apple port build
utatane.tea@gmail.com [Mon, 5 Mar 2018 12:26:09 +0000 (12:26 +0000)]
Unreviewed, attempt to fix Apple port build

* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:

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

18 months agoUnreviewed, attempt to fix WPE build
utatane.tea@gmail.com [Mon, 5 Mar 2018 12:21:52 +0000 (12:21 +0000)]
Unreviewed, attempt to fix WPE build

* WebKitTestRunner/InjectedBundle/wpe/TestRunnerWPE.cpp:
(WTR::TestRunner::initializeWaitToDumpWatchdogTimerIfNeeded):
* WebKitTestRunner/wpe/PlatformWebViewWPE.cpp:
(WTR::PlatformWebView::windowSnapshotImage):
* WebKitTestRunner/wpe/TestControllerWPE.cpp:
(WTR::TestController::platformRunUntil):

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

18 months agoUnreviewed, fix MediaTime test
utatane.tea@gmail.com [Mon, 5 Mar 2018 11:12:57 +0000 (11:12 +0000)]
Unreviewed, fix MediaTime test
https://bugs.webkit.org/show_bug.cgi?id=183319

__builtin_xxx_overflow writes overflowed data into ResultType value even if overflow happens.
This is different from the original CheckedArithmetic semantics.

* wtf/CheckedArithmetic.h:

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

18 months agoUnreviewed. Update Selenium WebDriver imported tests.
carlosgc@webkit.org [Mon, 5 Mar 2018 08:40:26 +0000 (08:40 +0000)]
Unreviewed. Update Selenium WebDriver imported tests.

* imported/selenium/importer.json:
* imported/selenium/py/selenium/__init__.py:
* imported/selenium/py/selenium/common/exceptions.py:
* imported/selenium/py/selenium/webdriver/__init__.py:
* imported/selenium/py/selenium/webdriver/remote/webelement.py:
* imported/selenium/py/selenium/webdriver/safari/webdriver.py:
* imported/selenium/py/test/selenium/webdriver/common/select_class_tests.py:

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

18 months agoAutomation: clicking on a disabled option element shouldn't produce an error
carlosgc@webkit.org [Mon, 5 Mar 2018 08:33:58 +0000 (08:33 +0000)]
Automation: clicking on a disabled option element shouldn't produce an error
https://bugs.webkit.org/show_bug.cgi?id=183284

Reviewed by Brian Burg.

This was expected by selenium, but the WebDriver spec says we should simply do nothing in those cases.

14.1 Element Click.
https://w3c.github.io/webdriver/webdriver-spec.html#element-click

Fixes: imported/w3c/webdriver/tests/element_click/select.py::test_option_disabled

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::selectOptionElement):

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

18 months agoWebDriver: Also ignore NoSuchwindow errors when waiting for navigation to complete
carlosgc@webkit.org [Mon, 5 Mar 2018 08:30:59 +0000 (08:30 +0000)]
WebDriver: Also ignore NoSuchwindow errors when waiting for navigation to complete
https://bugs.webkit.org/show_bug.cgi?id=183280

Reviewed by Brian Burg.

We currently ignore NoSuchFrame, but navigation or previous command might have closed the window too.

Fixes: imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py::testClickingOnAButtonThatClosesAnOpenWindowDoesNotCauseTheBrowserToHang
       imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py::testCanCallGetWindowHandlesAfterClosingAWindow

* Session.cpp:
(WebDriver::Session::waitForNavigationToComplete): Ignore NoSuchWindow errors.

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

18 months agoAutomation: stale elements not detected when removed from the DOM
carlosgc@webkit.org [Mon, 5 Mar 2018 08:28:42 +0000 (08:28 +0000)]
Automation: stale elements not detected when removed from the DOM
https://bugs.webkit.org/show_bug.cgi?id=183278

Reviewed by Brian Burg.

We detect stale elements when the page is reloaded because the maps are recreated, but if an element is removed
from the DOM for the same document we keep the nodes in the maps. We should clear stale elements before
accessing the maps.

Fixes: imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py::testExpectedConditionStalenessOf

* WebProcess/Automation/WebAutomationSessionProxy.js:
(let.AutomationSessionProxy.prototype.evaluateJavaScriptFunction): Call _clearStaleNodes()
(let.AutomationSessionProxy.prototype.nodeForIdentifier): Ditto.
(let.AutomationSessionProxy.prototype._clearStaleNodes): Check if cached nodes are still in document and remove them
from the maps if they aren't.

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

18 months ago[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
utatane.tea@gmail.com [Mon, 5 Mar 2018 02:33:55 +0000 (02:33 +0000)]
[WTF] Move currentCPUTime and sleep(Seconds) to CPUTime.h and Seconds.h respectively
https://bugs.webkit.org/show_bug.cgi?id=183312

Reviewed by Mark Lam.

Source/JavaScriptCore:

Remove wtf/CurrentTime.h include pragma.

* API/tests/ExecutionTimeLimitTest.cpp:
(currentCPUTimeAsJSFunctionCallback):
(testExecutionTimeLimit):
* bytecode/SuperSampler.cpp:
* dfg/DFGPlan.cpp:
* heap/BlockDirectory.cpp:
* heap/Heap.cpp:
* heap/IncrementalSweeper.cpp:
* inspector/agents/InspectorConsoleAgent.cpp:
* inspector/agents/InspectorRuntimeAgent.cpp:
* profiler/ProfilerDatabase.cpp:
* runtime/CodeCache.h:
* runtime/JSDateMath.cpp:
* runtime/TypeProfilerLog.cpp:
* runtime/VM.cpp:
* runtime/Watchdog.cpp:
(JSC::Watchdog::shouldTerminate):
(JSC::Watchdog::startTimer):
* testRegExp.cpp:
* wasm/js/JSWebAssemblyCodeBlock.cpp:

Source/WebCore:

Remove wtf/CurrentTime.h include pragma.

* Modules/geolocation/Geolocation.cpp:
* Modules/mediasource/SourceBuffer.cpp:
* Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
* Modules/speech/SpeechSynthesis.cpp:
* contentextensions/ContentExtensionCompiler.cpp:
* contentextensions/ContentExtensionParser.cpp:
* dom/Document.cpp:
* dom/Element.cpp:
* dom/Event.cpp:
* dom/ScriptedAnimationController.cpp:
* dom/SimulatedClick.cpp:
* fileapi/File.cpp:
* fileapi/FileReader.cpp:
* history/CachedPage.cpp:
* html/BaseDateAndTimeInputType.cpp:
* html/DateTimeInputType.cpp:
* html/HTMLMediaElement.cpp:
* html/MediaController.cpp:
* html/MediaElementSession.cpp:
* html/MonthInputType.cpp:
* html/TimeInputType.cpp:
* html/parser/HTMLParserScheduler.h:
* inspector/InspectorCanvas.cpp:
* loader/FrameLoader.cpp:
* loader/LoadTiming.cpp:
* loader/NavigationScheduler.cpp:
* loader/ProgressTracker.cpp:
* loader/cache/CachedCSSStyleSheet.cpp:
* loader/cache/CachedImage.cpp:
* loader/cache/CachedResource.cpp:
* loader/cache/MemoryCache.cpp:
* page/DOMTimer.cpp:
* page/DOMWindow.cpp:
* page/DragController.cpp:
* page/EventHandler.cpp:
* page/FocusController.cpp:
* page/FrameView.cpp:
* page/Page.cpp:
* page/Performance.cpp:
* page/PerformanceTiming.cpp:
* page/animation/AnimationBase.cpp:
* page/animation/CSSAnimationController.cpp:
* page/mac/WheelEventDeltaFilterMac.mm:
* page/scrolling/mac/ScrollingTreeFrameScrollingNodeMac.mm:
* platform/ScrollAnimationKinetic.cpp:
* platform/ScrollAnimationSmooth.cpp:
* platform/ThreadTimers.cpp:
* platform/Timer.cpp:
* platform/audio/mac/AudioSampleDataSource.mm:
* platform/cocoa/ScrollController.mm:
* platform/gamepad/cocoa/GameControllerGamepad.mm:
* platform/gamepad/mac/HIDGamepad.cpp:
* platform/graphics/BitmapImage.cpp:
* platform/graphics/DisplayRefreshMonitorManager.cpp:
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
* platform/graphics/ca/GraphicsLayerCA.cpp:
* platform/graphics/ca/LayerPool.cpp:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/WKCACFViewLayerTreeHost.cpp:
* platform/graphics/cg/GraphicsContextCG.cpp:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
* platform/graphics/ios/DisplayRefreshMonitorIOS.mm:
* platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
* platform/graphics/texmap/BitmapTexturePool.h:
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
* platform/graphics/texmap/TextureMapper.cpp:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
* platform/graphics/win/GraphicsContextDirect2D.cpp:
* platform/graphics/win/GraphicsLayerDirect2D.cpp:
* platform/gtk/PlatformKeyboardEventGtk.cpp:
* platform/gtk/ScrollAnimatorGtk.cpp:
* platform/ios/LegacyTileCache.mm:
* platform/ios/LegacyTileLayerPool.mm:
* platform/ios/ScrollViewIOS.mm:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
* platform/mock/MockRealtimeMediaSource.cpp:
* platform/mock/MockRealtimeVideoSource.cpp:
* platform/network/CacheValidation.cpp:
* platform/network/DNSResolveQueue.cpp:
* platform/network/ResourceResponseBase.cpp:
* platform/network/curl/CurlCacheEntry.cpp:
* platform/network/soup/ResourceHandleSoup.cpp:
* platform/text/TextEncodingRegistry.cpp:
* platform/text/win/LocaleWin.cpp:
* platform/win/MainThreadSharedTimerWin.cpp:
* platform/win/PlatformMouseEventWin.cpp:
* rendering/RenderLayerCompositor.cpp:
* rendering/RenderProgress.cpp:
* svg/animation/SMILTimeContainer.cpp:
* testing/MockGamepad.cpp:
* workers/WorkerRunLoop.cpp:

Source/WebCore/PAL:

Remove wtf/CurrentTime.h include pragma.

* pal/system/ClockGeneric.cpp:

Source/WebKit:

Remove wtf/CurrentTime.h include pragma.

* NetworkProcess/NetworkResourceLoader.cpp:
* NetworkProcess/cache/CacheStorageEngineCache.cpp:
* NetworkProcess/cache/NetworkCacheSpeculativeLoad.cpp:
* Platform/IPC/Connection.cpp:
* Platform/unix/SharedMemoryUnix.cpp:
* PluginProcess/WebProcessConnection.cpp:
* Shared/ios/NativeWebTouchEventIOS.mm:
* UIProcess/DrawingAreaProxyImpl.cpp:
* UIProcess/ios/WKContentView.mm:
* UIProcess/linux/MemoryPressureMonitor.cpp:
* WebProcess/Gamepad/WebGamepad.cpp:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
* WebProcess/WebCoreSupport/WebInspectorClient.cpp:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDisplayRefreshMonitor.mm:
* WebProcess/WebPage/WebURLSchemeTaskProxy.cpp:
* WebProcess/WebProcess.cpp:
* WebProcess/cocoa/WebProcessCocoa.mm:
* WebProcess/gtk/WebProcessMainGtk.cpp:
* WebProcess/win/WebProcessMainWin.cpp:
* WebProcess/wpe/WebProcessMainWPE.cpp:

Source/WebKitLegacy/mac:

Remove wtf/CurrentTime.h include pragma.

* WebView/WebFrame.mm:
* WebView/WebPDFView.mm:

Source/WebKitLegacy/win:

Remove wtf/CurrentTime.h include pragma.

* WebDownload.cpp:
* WebDownloadCFNet.cpp:
* WebDropSource.cpp:

Source/WTF:

1. currentCPUTime to CPUTime.h. It is now defined as CPUTime::forCurrentThread.
We also removes fallback implementation for currentCPUTime since (1) that implementation
is wrong and (2) no environments we support needs this.

2. sleep(Seconds) to Seconds.h. Since sleep(MonotonicTime) and sleep(WallTime) are defined
in MonotonicTime.h and WallTime.h, this code move is natural.

3. Remove wtf/CurrentTime.h since nothing is defined now. But we keep CurrentTime.cpp to
consolidate various time-source implementations in one place.

* WTF.xcodeproj/project.pbxproj:
* benchmarks/ConditionSpeedTest.cpp:
* benchmarks/LockFairnessTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* wtf/CMakeLists.txt:
* wtf/CPUTime.h:
* wtf/CurrentTime.cpp:
(WTF::currentCPUTime): Deleted.
(WTF::sleep): Deleted.
* wtf/CurrentTime.h: Removed.
* wtf/DateMath.cpp:
* wtf/DebugUtilities.h:
* wtf/FastMalloc.cpp:
* wtf/MainThread.cpp:
* wtf/MonotonicTime.cpp:
* wtf/ParkingLot.cpp:
* wtf/Seconds.cpp:
(WTF::sleep):
* wtf/Seconds.h:
* wtf/StackShotProfiler.h:
* wtf/Stopwatch.h:
* wtf/ThreadingPthreads.cpp:
* wtf/ThreadingWin.cpp:
* wtf/cocoa/CPUTimeCocoa.mm:
(WTF::CPUTime::forCurrentThread):
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
* wtf/linux/MemoryPressureHandlerLinux.cpp:
* wtf/unix/CPUTimeUnix.cpp:
(WTF::CPUTime::forCurrentThread):
* wtf/win/CPUTimeWin.cpp:
(WTF::CPUTime::forCurrentThread):
* wtf/win/RunLoopWin.cpp:

Tools:

Remove wtf/CurrentTime.h include pragma.

* DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp:
* DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSWithinNPP_New.cpp:
* DumpRenderTree/TestNetscapePlugIn/Tests/InvokeDestroysPluginWithinNPP_New.cpp:
* DumpRenderTree/TestNetscapePlugIn/Tests/SlowNPPNew.cpp:
* TestWebKitAPI/Tests/WTF/Condition.cpp:
* TestWebKitAPI/Tests/WTF/Signals.cpp:
* TestWebKitAPI/Tests/WTF/ThreadGroup.cpp:
* TestWebKitAPI/Tests/WTF/WorkQueue.cpp:
* TestWebKitAPI/Tests/WebKitCocoa/PictureInPictureDelegate.mm:
* TestWebKitAPI/Tests/ios/DataInteractionTests.mm:
* TestWebKitAPI/jsconly/PlatformUtilitiesJSCOnly.cpp:
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:

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

18 months ago[WTF] Use __builtin_xxx_overflow for CheckedArithmetic
utatane.tea@gmail.com [Mon, 5 Mar 2018 02:15:12 +0000 (02:15 +0000)]
[WTF] Use __builtin_xxx_overflow for CheckedArithmetic
https://bugs.webkit.org/show_bug.cgi?id=183319

Reviewed by Darin Adler.

GCC and Clang has the builtins for arithmetic operations with overflow flags.
CheckedArithmetic operations can be done with this builtins. Since the compiler
can use overflow flags, potentially this is more efficient. CheckedArithmetic
already has TestWebKitAPI tests and we ensured the tests pass.

* wtf/CheckedArithmetic.h:

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

18 months agoMark http/wpt/html/browsers/history/the-location-interface/location-protocol-setter...
pvollan@apple.com [Mon, 5 Mar 2018 00:44:24 +0000 (00:44 +0000)]
Mark http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html as failure on Windows.
https://bugs.webkit.org/show_bug.cgi?id=183322

Unreviewed test gardening.

* platform/win/TestExpectations:

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

18 months agoWeb Automation: script evaluations via WebDriver should have a user gesture indicator
bburg@apple.com [Sun, 4 Mar 2018 22:59:20 +0000 (22:59 +0000)]
Web Automation: script evaluations via WebDriver should have a user gesture indicator
https://bugs.webkit.org/show_bug.cgi?id=183230
<rdar://problem/37959739>

Reviewed by Andy Estes.

APIs that normally require a user gesture should just work when using via WebDriver.
To support cases where tests need to simulate user actions with JavaScript, use a
fake user gesture, similar to how -[WKWebView evaluateJavaScript:] forces a user
gesture when clients evaluate JavaScript in their web view.

No new tests, this is covered by W3C tests that use the Fullscreen API.
This API does nothing if there is no user gesture; with this patch, it just works.

* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::WebAutomationSessionProxy::evaluateJavaScriptFunction):

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

18 months agoMake !ENABLE(DATA_DETECTION) iOS build actually succeed
timothy_horton@apple.com [Sun, 4 Mar 2018 20:03:56 +0000 (20:03 +0000)]
Make !ENABLE(DATA_DETECTION) iOS build actually succeed
https://bugs.webkit.org/show_bug.cgi?id=183283
<rdar://problem/38062148>

Reviewed by Sam Weinig.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _interactionShouldBeginFromPreviewItemController:forPosition:]):
(-[WKContentView _dataForPreviewItemController:atPosition:type:]):
Guard some more code with ENABLE(DATA_DETECTION).

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

18 months agoBuilding with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
mitz@apple.com [Sun, 4 Mar 2018 19:37:23 +0000 (19:37 +0000)]
Building with ONLY_ACTIVE_ARCH=NO and ARCHS=x86_64 fails
https://bugs.webkit.org/show_bug.cgi?id=183320

Reviewed by Tim Horton.

* Configurations/PluginService.32.xcconfig: If the Apple build tool specifies
  RC_ARCHS=x86_64, then let the service build for x86_64, but don’t install it.

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

18 months ago[l10n] Updated Indonesian translation for WebKitGTK+
mcatanzaro@igalia.com [Sun, 4 Mar 2018 16:56:06 +0000 (16:56 +0000)]
[l10n] Updated Indonesian translation for WebKitGTK+
https://bugs.webkit.org/show_bug.cgi?id=183318

Patch by Andika Triwidada <atriwidada@gnome.org> on 2018-03-04
Rubber-stamped by Michael Catanzaro.

* id.po:

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

18 months agoDelete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
commit-queue@webkit.org [Sun, 4 Mar 2018 05:19:13 +0000 (05:19 +0000)]
Delete incorrect version of clampTo() function from SVGToOTFFontConversion.cpp
https://bugs.webkit.org/show_bug.cgi?id=183165

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-03-03
Reviewed by Darin Adler.

Source/WebCore:

Some of the calls in SVGToOTFFontConversion.cpp were directed to the function
in MathExtras.h while the rest were directed to this local static function.
There should not be two versions with the same name while they are supposed
to do the same thing. Besides, the local version does not work correctly
if the type of the argument's max limit is less the max limit of the returned
type, e.g. char -> uint16_t.

* svg/SVGToOTFFontConversion.cpp:
(WebCore::clampTo): Deleted.

LayoutTests:

Re-baseline the results of these two tests since the local version of
clampTo() was not returning the expected results always.

* platform/ios/svg/W3C-SVG-1.1/text-altglyph-01-b-expected.txt:
* platform/ios/svg/text/text-altglyph-01-b-expected.txt:

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

18 months agoNotify the NetworkProcess when a session is servicing an automation client
bfulgham@apple.com [Sat, 3 Mar 2018 23:27:18 +0000 (23:27 +0000)]
Notify the NetworkProcess when a session is servicing an automation client
https://bugs.webkit.org/show_bug.cgi?id=183306
<rdar://problem/37835783>

Reviewed by Brian Burg.

Network loads servicing WebDriver are done through an ephemeral session. While this is great
for protecting a developer's machine from sharing state with test runs, it has the unintended
effect of blocking certain logging operations.

We do not log content in ephemeral sessions to protect user privacy. However, ephemeral sessions
generated by WebDriver should participate in logging so that proper testing (with logging) can
be done.

This patch signals the NetworkProcess when an ephemeral session (created for automation purposes)
is created, so that it can allow logging.

* NetworkProcess/NetworkProcess.cpp:
(WebKit::NetworkProcess::destroySession): Remove controlled-by-automation entry.
(WebKit::NetworkProcess::sessionIsControlledByAutomation const): Added.
(WebKit::NetworkProcess::setSessionIsControlledByAutomation): Added.
* NetworkProcess/NetworkProcess.h:
* NetworkProcess/NetworkProcess.messages.in:
* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::isAlwaysOnLoggingAllowed const): Checks if the relevant session
is servicing an automation client, and returns true if it is.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Signal the network process if this page is being created
for an automation client.

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

18 months ago[RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
zalan@apple.com [Sat, 3 Mar 2018 20:13:42 +0000 (20:13 +0000)]
[RenderTreeBuilder] Move styleDidChange mutation logic to RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=183273
<rdar://problem/38054892>

Reviewed by Antti Koivisto.

Source/WebCore:

Covered by existing tests.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleDidChange):
(WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.
* rendering/RenderElement.h:
* rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):

LayoutTests:

This is just a different repaint order.

* fast/repaint/absolute-position-change-containing-block-expected.txt:

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

18 months ago[GTK] POTFILES.in is out of date
mcatanzaro@igalia.com [Sat, 3 Mar 2018 19:02:23 +0000 (19:02 +0000)]
[GTK] POTFILES.in is out of date
https://bugs.webkit.org/show_bug.cgi?id=183313

Unreviewed, remove WebErrorsGLib.cpp after r229193

* POTFILES.in:

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

18 months agoSource/WebCore:
yoav@yoav.ws [Sat, 3 Mar 2018 08:57:34 +0000 (08:57 +0000)]
Source/WebCore:
Link headers for subresources are not being processes
https://bugs.webkit.org/show_bug.cgi?id=181789

Reviewed by Youenn Fablet.

Triggers Link header processing when the Link headers arrive on a subresource.

Test: http/tests/preload/link-header-on-subresource.html

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::loadLinksFromHeader): Change the media check conditions.
* loader/LinkLoader.h: Add a third state for media checks.
* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::didReceiveResponse): Preload links from headers for subresources.

LayoutTests:
Link headers for subresources are not being processed
https://bugs.webkit.org/show_bug.cgi?id=181789

Reviewed by Youenn Fablet.

Adds tests to make sure Link headers on subresources are being processed.

* http/tests/preload/link-header-on-subresource-expected.txt: Added.
* http/tests/preload/link-header-on-subresource.html: Added.
* http/tests/preload/resources/dummy-preloads-subresource.css.php: Added.

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

18 months ago[WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
utatane.tea@gmail.com [Sat, 3 Mar 2018 07:58:55 +0000 (07:58 +0000)]
[WTF] Remove RunLoop and RunLoop::Timer's interface using double as seconds
https://bugs.webkit.org/show_bug.cgi?id=183293

Reviewed by Alex Christensen.

Source/WebCore:

* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::dropCurrentBufferWhilePreservingTexture):

Source/WebKit:

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::scheduleUpdate):
(WebKit::CompositingRunLoop::compositionCompleted):
(WebKit::CompositingRunLoop::updateCompleted):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
(WebKit::ThreadedDisplayRefreshMonitor::dispatchDisplayRefreshCallback):

Source/WTF:

This patch mainly drops startRepeating(double) and startOneShot(double) interfaces.
Use startRepeating(Seconds) and startOneShot(Seconds) instead.

* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setShouldUsePeriodicMemoryMonitor):
* wtf/RunLoop.h:
(WTF::RunLoop::TimerBase::startRepeating):
(WTF::RunLoop::TimerBase::startOneShot):
(WTF::RunLoop::TimerBase::startInternal):
* wtf/RunLoopTimer.h:
* wtf/RunLoopTimerCF.cpp:
(WTF::RunLoopTimerBase::start):
* wtf/cf/RunLoopCF.cpp:
(WTF::RunLoop::runForDuration):
(WTF::RunLoop::TimerBase::start):
* wtf/generic/RunLoopGeneric.cpp:
(WTF::RunLoop::TimerBase::start):
* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::start):
* wtf/win/MemoryPressureHandlerWin.cpp:
(WTF::MemoryPressureHandler::install):
* wtf/win/RunLoopWin.cpp:
(WTF::RunLoop::TimerBase::start):

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

18 months agoRemove NP_GLContext since it is unsupported
dino@apple.com [Sat, 3 Mar 2018 00:07:51 +0000 (00:07 +0000)]
Remove NP_GLContext since it is unsupported
https://bugs.webkit.org/show_bug.cgi?id=183305
<rdar://problem/36875555>

Reviewed by Simon Fraser.

* plugins/npapi.h: Remove NP_GLContext and mention that
it is not supported.

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

18 months agoShare common WebError implementation
don.olmstead@sony.com [Sat, 3 Mar 2018 00:07:33 +0000 (00:07 +0000)]
Share common WebError implementation
https://bugs.webkit.org/show_bug.cgi?id=183303

Reviewed by Ryosuke Niwa.

* Shared/WebErrors.cpp:
(WebKit::cancelledError):
(WebKit::fileDoesNotExistError):
* Shared/glib/WebErrorsGlib.cpp: Removed.
* SourcesGTK.txt:
* SourcesWPE.txt:

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

18 months agoService worker test gardening
commit-queue@webkit.org [Fri, 2 Mar 2018 23:15:29 +0000 (23:15 +0000)]
Service worker test gardening
https://bugs.webkit.org/show_bug.cgi?id=183264
<rdar://problem/38048743>

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2018-03-02

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

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

18 months agoimported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location...
cdumez@apple.com [Fri, 2 Mar 2018 23:14:33 +0000 (23:14 +0000)]
imported/w3c/web-platform-tests/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html crashes with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183294
<rdar://problem/38073596>

Reviewed by Youenn Fablet.

Source/WebCore:

Drop code that was added to SubresourceLoader::willCancel() in r228852. The purpose of this code
was to make sure that SubresourceLoader::m_policyForResponseCompletionHandler always gets called,
even when the load is cancelled. However, this code is not needed (since m_policyForResponseCompletionHandler
is a CompletionHandler, an assertion will be hit if we fail to call it and we'll know). Calling
the completionHandler inside SubresourceLoader::willCancel() is too early and leads to crashes.

The completionHandler currently gets called DocumentLoader::responseReceived() via a call to
mainResourceLoader->didReceiveResponsePolicy(). Note that in r229177, we made sure that the
call to didReceiveResponsePolicy() happens *after* the call to continueAfterContentPolicy()
to maintain our non-async policy delegate behavior. However, continueAfterContentPolicy()
would end up calling willCancel() and call the completionHandler when shouldContinue was
false.

Test: http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html

* loader/SubresourceLoader.cpp:
(WebCore::SubresourceLoader::willCancel):

LayoutTests:

Add layout test coverage.

* http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate-expected.txt: Added.
* http/wpt/html/browsers/history/the-location-interface/location-protocol-setter-non-broken-async-delegate.html: Added.

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

18 months agoFix the build after r229185 and r229184
timothy_horton@apple.com [Fri, 2 Mar 2018 22:55:12 +0000 (22:55 +0000)]
Fix the build after r229185 and r229184

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):
* platform/ios/DeviceOrientationClientIOS.h:
* platform/ios/DeviceOrientationClientIOS.mm:

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

18 months agoAdd clang-format configuration
don.olmstead@sony.com [Fri, 2 Mar 2018 22:13:12 +0000 (22:13 +0000)]
Add clang-format configuration
https://bugs.webkit.org/show_bug.cgi?id=183302

Reviewed by Ryosuke Niwa.

* .clang-format: Added.

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

18 months agoLayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event...
commit-queue@webkit.org [Fri, 2 Mar 2018 22:10:17 +0000 (22:10 +0000)]
LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179248
<rdar://problem/35377756>

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

In case we go up to the initializeSize step and Caches was cleared
between the time we stated to initialize and the time we got there,
we need to make as if Caches was not initialized,
thus keeping m_isInitialized to false and m_storage to nullptr.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initializeSize):

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

18 months agoBuild fix after r229174
commit-queue@webkit.org [Fri, 2 Mar 2018 22:00:14 +0000 (22:00 +0000)]
Build fix after r229174
https://bugs.webkit.org/show_bug.cgi?id=183301

Patch by Christopher Reid <chris.reid@sony.com> on 2018-03-02
Reviewed by Alex Christensen.

Updating MemoryPressureHandler::holdOff to use Seconds instead of unsigned.

* wtf/MemoryPressureHandler.cpp:

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

18 months agoMake the LLInt probe work for ARM64.
mark.lam@apple.com [Fri, 2 Mar 2018 20:19:17 +0000 (20:19 +0000)]
Make the LLInt probe work for ARM64.
https://bugs.webkit.org/show_bug.cgi?id=183298
<rdar://problem/38077413>

Reviewed by Filip Pizlo.

* llint/LowLevelInterpreter.asm:

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

18 months agoMake the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
timothy_horton@apple.com [Fri, 2 Mar 2018 19:55:09 +0000 (19:55 +0000)]
Make the !ENABLE(DEVICE_ORIENTATION) iOS build succeed
https://bugs.webkit.org/show_bug.cgi?id=183296

Reviewed by Dan Bernstein.

* platform/ios/DeviceMotionClientIOS.h:
* platform/ios/DeviceMotionClientIOS.mm:
* platform/ios/WebCoreMotionManager.h:
* platform/ios/WebCoreMotionManager.mm:

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

18 months agoMake it possible to build for iOS without Celestial
timothy_horton@apple.com [Fri, 2 Mar 2018 19:47:17 +0000 (19:47 +0000)]
Make it possible to build for iOS without Celestial
https://bugs.webkit.org/show_bug.cgi?id=183295
<rdar://problem/38074468>

Reviewed by Dan Bernstein.

Source/WebCore:

* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::exernalDeviceDisplayNameForPlayer):

Source/WTF:

* wtf/Platform.h:

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

18 months agoClients should register to StorageProcess with their service worker registration...
commit-queue@webkit.org [Fri, 2 Mar 2018 19:17:02 +0000 (19:17 +0000)]
Clients should register to StorageProcess with their service worker registration identifier
https://bugs.webkit.org/show_bug.cgi?id=182313
<rdar://problem/38044403>

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

Source/WebCore:

Relanding with fixing matchAll for uncontrolled clients.

No observable change of behavior in regular conditions.
When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
and we will not be able to retrieve the registration from these identifiers.
The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.

* dom/Document.cpp:
(WebCore::Document::setServiceWorkerConnection):
* workers/service/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::matchAll):
(WebCore::SWServer::claim):
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::setClientActiveWorker): Deleted.
* workers/service/server/SWServer.h:
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::activate):

Source/WebKit:

Relanding.

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

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

18 months agoMake it possible to disable WKPDFView
timothy_horton@apple.com [Fri, 2 Mar 2018 18:33:54 +0000 (18:33 +0000)]
Make it possible to disable WKPDFView
https://bugs.webkit.org/show_bug.cgi?id=183281

Reviewed by Dan Bates.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _isBackground]):
(-[WKWebView _isDisplayingPDF]):
(-[WKWebView _dataForDisplayedPDF]):
(-[WKWebView _suggestedFilenameForDisplayedPDF]):
* UIProcess/Cocoa/WKWebViewContentProviderRegistry.mm:
(-[WKWebViewContentProviderRegistry init]):
* UIProcess/ios/WKPDFView.h:
* UIProcess/ios/WKPDFView.mm:

* wtf/FeatureDefines.h:

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

18 months agoLoads for a Document controlled by a Service Worker should not use AppCache
commit-queue@webkit.org [Fri, 2 Mar 2018 18:29:42 +0000 (18:29 +0000)]
Loads for a Document controlled by a Service Worker should not use AppCache
https://bugs.webkit.org/show_bug.cgi?id=183148

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/appcache-ordering-main.https-expected.txt:

Source/WebCore:

Covered by updated test.

Postponing document loading through app cache after matching service worker registration.
Trying to load through app cache only if there is no service worker registration.

Disabling app cache for any load that has a service worker registration identifier.

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::redirectReceived):
(WebCore::DocumentLoader::willSendRequest):
(WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
(WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
(WebCore::DocumentLoader::restartLoadingDueToServiceWorkerRegistrationChange):
(WebCore::DocumentLoader::scheduleSubstituteResourceLoad):
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentLoader.h:
* loader/appcache/ApplicationCacheHost.cpp:
(WebCore::ApplicationCacheHost::maybeLoadMainResource):
(WebCore::ApplicationCacheHost::maybeLoadMainResourceForRedirect):
(WebCore::ApplicationCacheHost::maybeLoadResource):
(WebCore::ApplicationCacheHost::scheduleLoadFallbackResourceFromApplicationCache):
* loader/appcache/ApplicationCacheHost.h:

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

18 months ago[JSC] Annotate more classes with WTF_MAKE_FAST_ALLOCATED
utatane.tea@gmail.com [Fri, 2 Mar 2018 17:55:22 +0000 (17:55 +0000)]
[JSC] Annotate more classes with WTF_MAKE_FAST_ALLOCATED
https://bugs.webkit.org/show_bug.cgi?id=183279

Reviewed by JF Bastien.

Source/JavaScriptCore:

* bytecode/BytecodeIntrinsicRegistry.h:
* ftl/FTLThunks.h:
* heap/CodeBlockSet.h:
* heap/GCSegmentedArray.h:
* heap/MachineStackMarker.h:
* heap/MarkingConstraintSet.h:

Source/WTF:

* wtf/SimpleStats.h:
* wtf/ThreadGroup.h:

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

18 months agofast/events/before-unload-remove-itself.html crashes with async policy delegates
cdumez@apple.com [Fri, 2 Mar 2018 17:52:17 +0000 (17:52 +0000)]
fast/events/before-unload-remove-itself.html crashes with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183290
<rdar://problem/38069045>

Reviewed by Alex Christensen.

Source/WebCore:

When the navigation policy happens asynchronously, it is now possible for the
Frame / FrameLoader to get destroyed between the point that policyChecker().checkNavigationPolicy()
is called and when continueLoadAfterNavigationPolicy() is called.

To address the issue, we now protect the Frame and capture it in the lambda passed
to policyChecker().checkNavigationPolicy().

Test: fast/events/before-unload-remove-itself-async-delegate.html

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadURL):
(WebCore::FrameLoader::loadWithDocumentLoader):

LayoutTests:

Add layout test coverage.

* fast/events/before-unload-remove-itself-async-delegate-expected.txt: Added.
* fast/events/before-unload-remove-itself-async-delegate.html: Added.

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

18 months agoWebProcessProxy should handle its completion handler at destruction time
commit-queue@webkit.org [Fri, 2 Mar 2018 17:48:06 +0000 (17:48 +0000)]
WebProcessProxy should handle its completion handler at destruction time
https://bugs.webkit.org/show_bug.cgi?id=183224

Patch by Youenn Fablet <youenn@apple.com> on 2018-03-02
Reviewed by Brady Eidson.

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::~WebProcessProxy):
* UIProcess/WebProcessProxy.h:

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

18 months agoConverting a load to a download does not work with async policy delegates
cdumez@apple.com [Fri, 2 Mar 2018 17:41:07 +0000 (17:41 +0000)]
Converting a load to a download does not work with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183254
<rdar://problem/38035334>

Reviewed by Youenn Fablet.

Source/WebCore:

Update DocumentLoader::responseReceived() to call didReceiveResponsePolicy()
on the mainResourceLoader *after* calling continueAfterContentPolicy(),
not *before*. This makes sure that the WebResourceLoader sends the
NetworkResourceLoader::ContinueDidReceiveResponse IPC back to the Network
Process *after* the policy decision has been processed, which restores the
pre-r228852 order.

Test: fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html

* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::responseReceived):

Tools:

Add layout test infrastructure for responding to the decidePolicyForNavigationResponse
delegate asynchronously.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::decidePolicyForResponse):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setShouldDecideResponsePolicyAfterDelay):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
(WTR::TestRunner::shouldDecideResponsePolicyAfterDelay const):
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetStateToConsistentValues):
(WTR::TestController::decidePolicyForNavigationResponse):
* WebKitTestRunner/TestController.h:
(WTR::TestController::setShouldDecideResponsePolicyAfterDelay):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

LayoutTests:

Add layout test coverage.

* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate-expected.txt: Added.
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download-async-delegate.html: Added.

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

18 months agoSome RealtimeMediaSource methods do not need to be marked as virtual
commit-queue@webkit.org [Fri, 2 Mar 2018 17:39:50 +0000 (17:39 +0000)]
Some RealtimeMediaSource methods do not need to be marked as virtual
https://bugs.webkit.org/show_bug.cgi?id=183272

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

No change of behavior.

* platform/mediastream/RealtimeMediaSource.h:

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

18 months agoUpdate WebContent process sandbox IOKit properties
bfulgham@apple.com [Fri, 2 Mar 2018 17:37:26 +0000 (17:37 +0000)]
Update WebContent process sandbox IOKit properties
https://bugs.webkit.org/show_bug.cgi?id=183269
<rdar://problem/37853282>

Reviewed by Eric Carlson.

* WebProcess/com.apple.WebProcess.sb.in:

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

18 months agoRemove monotonicallyIncreasingTime
utatane.tea@gmail.com [Fri, 2 Mar 2018 17:13:32 +0000 (17:13 +0000)]
Remove monotonicallyIncreasingTime
https://bugs.webkit.org/show_bug.cgi?id=182911

Reviewed by Michael Catanzaro.

Source/JavaScriptCore:

* debugger/Debugger.cpp:
(JSC::Debugger::willEvaluateScript):
(JSC::Debugger::didEvaluateScript):
* debugger/Debugger.h:
* debugger/ScriptProfilingScope.h:
* inspector/agents/InspectorDebuggerAgent.cpp:
(Inspector::InspectorDebuggerAgent::breakpointActionProbe):
* inspector/agents/InspectorHeapAgent.cpp:
(Inspector::InspectorHeapAgent::snapshot):
(Inspector::InspectorHeapAgent::didGarbageCollect):
(Inspector::InspectorHeapAgent::dispatchGarbageCollectedEvent):
* inspector/agents/InspectorHeapAgent.h:
* inspector/agents/InspectorScriptProfilerAgent.cpp:
(Inspector::InspectorScriptProfilerAgent::startTracking):
(Inspector::InspectorScriptProfilerAgent::willEvaluateScript):
(Inspector::InspectorScriptProfilerAgent::didEvaluateScript):
(Inspector::InspectorScriptProfilerAgent::addEvent):
(Inspector::buildSamples):
* inspector/agents/InspectorScriptProfilerAgent.h:
* runtime/SamplingProfiler.cpp:
(JSC::SamplingProfiler::takeSample):
* runtime/SamplingProfiler.h:

Source/WebCore:

While generic code uses MonotonicTime, CAAnimation uses media time (CFTimeInterval).
At this boundary, we convert MonotonicTime to media time, this is the same logic to
the code before this patch.

* Modules/gamepad/Gamepad.h:
* Modules/mediasource/SourceBuffer.cpp:
(WebCore::SourceBuffer::SourceBuffer):
(WebCore::SourceBuffer::monitorBufferingRate):
* Modules/mediasource/SourceBuffer.h:
* Modules/speech/SpeechSynthesis.cpp:
(WebCore::SpeechSynthesis::startSpeakingImmediately):
(WebCore::SpeechSynthesis::fireEvent):
* Modules/speech/SpeechSynthesisUtterance.h:
* contentextensions/ContentExtensionCompiler.cpp:
(WebCore::ContentExtensions::compileRuleList):
* contentextensions/ContentExtensionParser.cpp:
(WebCore::ContentExtensions::parseRuleList):
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::actionsForResourceLoad const):
* dom/Element.cpp:
(WebCore::Element::setActive):
* history/CachedPage.cpp:
(WebCore::CachedPage::CachedPage):
(WebCore::CachedPage::hasExpired const):
* history/CachedPage.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::startProgressEventTimer):
(WebCore::HTMLMediaElement::progressEventTimerFired):
(WebCore::HTMLMediaElement::refreshCachedTime const):
(WebCore::HTMLMediaElement::invalidateCachedTime const):
(WebCore::HTMLMediaElement::currentMediaTime const):
(WebCore::HTMLMediaElement::startPlaybackProgressTimer):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::removeBehaviorRestriction):
(WebCore::MediaElementSession::mostRecentUserInteractionTime const):
(WebCore::MediaElementSession::resetPlaybackSessionState):
* html/MediaElementSession.h:
* html/parser/HTMLParserScheduler.cpp:
(WebCore::PumpSession::PumpSession):
(WebCore::HTMLParserScheduler::HTMLParserScheduler):
* html/parser/HTMLParserScheduler.h:
(WebCore::HTMLParserScheduler::checkForYield):
* inspector/InspectorCanvas.cpp:
(WebCore::InspectorCanvas::recordAction):
(WebCore::InspectorCanvas::finalizeFrame):
* inspector/InspectorCanvas.h:
* inspector/agents/InspectorMemoryAgent.cpp:
(WebCore::InspectorMemoryAgent::startTracking):
(WebCore::InspectorMemoryAgent::didHandleMemoryPressure):
(WebCore::InspectorMemoryAgent::collectSample):
* inspector/agents/InspectorNetworkAgent.cpp:
(WebCore::InspectorNetworkAgent::buildObjectForTiming):
(WebCore::InspectorNetworkAgent::timestamp):
(WebCore::InspectorNetworkAgent::didFinishLoading):
* inspector/agents/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::timestamp):
* inspector/agents/InspectorTimelineAgent.cpp:
(WebCore::InspectorTimelineAgent::timestamp):
* inspector/agents/WebHeapAgent.cpp:
(WebCore::WebHeapAgent::dispatchGarbageCollectedEvent):
* inspector/agents/WebHeapAgent.h:
* loader/cache/CachedCSSStyleSheet.cpp:
(WebCore::CachedCSSStyleSheet::restoreParsedStyleSheet):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::didDraw):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::didAccessDecodedData):
* loader/cache/CachedResource.h:
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::pruneLiveResourcesToSize):
* page/EventHandler.cpp:
(WebCore::MaximumDurationTracker::MaximumDurationTracker):
(WebCore::MaximumDurationTracker::~MaximumDurationTracker):
* page/FocusController.cpp:
(WebCore::FocusController::setFocusedElement):
(WebCore::FocusController::timeSinceFocusWasSet const):
* page/FocusController.h:
* page/FrameView.cpp:
(WebCore::FrameView::reset):
(WebCore::FrameView::willPaintContents):
(WebCore::FrameView::didPaintContents):
* page/FrameView.h:
* page/animation/AnimationBase.cpp:
(WebCore::AnimationBase::freezeAtTime):
(WebCore::AnimationBase::beginAnimationUpdateTime const):
* page/animation/AnimationBase.h:
(WebCore::AnimationBase::onAnimationStartResponse):
* page/animation/CSSAnimationController.cpp:
(WebCore::CSSAnimationControllerPrivate::beginAnimationUpdateTime):
(WebCore::CSSAnimationControllerPrivate::receivedStartTimeResponse):
(WebCore::CSSAnimationControllerPrivate::startTimeResponse):
(WebCore::CSSAnimationController::notifyAnimationStarted):
* page/animation/CSSAnimationController.h:
* page/animation/CSSAnimationControllerPrivate.h:
* page/mac/WheelEventDeltaFilterMac.h:
* page/mac/WheelEventDeltaFilterMac.mm:
(WebCore::WheelEventDeltaFilterMac::beginFilteringDeltas):
(WebCore::WheelEventDeltaFilterMac::updateFromDelta):
(WebCore::WheelEventDeltaFilterMac::endFilteringDeltas):
* platform/ControlStates.h:
(WebCore::ControlStates::timeSinceControlWasFocused const):
(WebCore::ControlStates::setTimeSinceControlWasFocused):
* platform/PlatformSpeechSynthesisUtterance.h:
(WebCore::PlatformSpeechSynthesisUtterance::startTime const):
(WebCore::PlatformSpeechSynthesisUtterance::setStartTime):
* platform/gamepad/PlatformGamepad.h:
(WebCore::PlatformGamepad::lastUpdateTime const):
(WebCore::PlatformGamepad::connectTime const):
(WebCore::PlatformGamepad::PlatformGamepad):
* platform/gamepad/cocoa/GameControllerGamepad.mm:
(WebCore::GameControllerGamepad::setupAsExtendedGamepad):
(WebCore::GameControllerGamepad::setupAsGamepad):
* platform/gamepad/mac/HIDGamepad.cpp:
(WebCore::HIDGamepad::HIDGamepad):
(WebCore::HIDGamepad::valueChanged):
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::suspendAnimations):
* platform/graphics/GraphicsLayer.h:
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::notifyAnimationStarted):
* platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
(WebCore::LayerClient::platformCALayerAnimationStarted):
(WebCore::AVFWrapper::createImageForTimeInRect):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::createImageForTimeInRect):
(WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage):
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::addAnimation):
(WebCore::GraphicsLayerCA::pauseAnimation):
(WebCore::GraphicsLayerCA::platformCALayerAnimationStarted):
(WebCore::GraphicsLayerCA::setAnimationOnLayer):
(WebCore::GraphicsLayerCA::pauseCAAnimationOnLayer):
(WebCore::GraphicsLayerCA::createAnimationFromKeyframes):
(WebCore::GraphicsLayerCA::appendToUncommittedAnimations):
(WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::LayerPropertyAnimation::LayerPropertyAnimation):
(WebCore::GraphicsLayerCA::AnimationProcessingAction::AnimationProcessingAction):
* platform/graphics/ca/LayerPool.cpp:
(WebCore::LayerPool::LayerPool):
(WebCore::LayerPool::addLayer):
(WebCore::LayerPool::decayedCapacity const):
(WebCore::LayerPool::pruneTimerFired):
* platform/graphics/ca/LayerPool.h:
* platform/graphics/ca/PlatformCAAnimation.h:
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/PlatformCALayerClient.h:
(WebCore::PlatformCALayerClient::platformCALayerAnimationStarted):
* platform/graphics/ca/TileGrid.cpp:
(WebCore::TileGrid::revalidateTiles):
(WebCore::TileGrid::startedNewCohort):
(WebCore::TileGrid::TileCohortInfo::timeUntilExpiration):
(WebCore::TileGrid::cohortRemovalTimerFired):
* platform/graphics/ca/TileGrid.h:
(WebCore::TileGrid::TileCohortInfo::TileCohortInfo):
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(mediaTimeToCurrentTime):
(-[WebAnimationDelegate animationDidStart:]):
(PlatformCALayerCocoa::animationStarted):
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::notifyAnimationsStarted):
* platform/graphics/ca/win/PlatformCALayerWin.cpp:
(PlatformCALayerWin::animationStarted):
(PlatformCALayerWin::layerTreeAsString const):
* platform/graphics/ca/win/PlatformCALayerWin.h:
* platform/graphics/cocoa/WebCoreDecompressionSession.mm:
(WebCore::WebCoreDecompressionSession::decodeSample):
* platform/graphics/texmap/BitmapTexturePool.cpp:
(WebCore::BitmapTexturePool::releaseUnusedTexturesTimerFired):
* platform/graphics/texmap/BitmapTexturePool.h:
(WebCore::BitmapTexturePool::Entry::markIsInUse):
(WebCore::BitmapTexturePool::Entry::canBeReleased const):
(): Deleted.
* platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
(WebCore::GraphicsLayerTextureMapper::GraphicsLayerTextureMapper):
(WebCore::GraphicsLayerTextureMapper::addAnimation):
(WebCore::GraphicsLayerTextureMapper::pauseAnimation):
* platform/graphics/texmap/GraphicsLayerTextureMapper.h:
* platform/graphics/texmap/TextureMapperAnimation.cpp:
(WebCore::TextureMapperAnimation::TextureMapperAnimation):
(WebCore::TextureMapperAnimation::apply):
(WebCore::TextureMapperAnimation::pause):
(WebCore::TextureMapperAnimation::resume):
(WebCore::TextureMapperAnimation::computeTotalRunningTime):
(WebCore::TextureMapperAnimations::pause):
(WebCore::TextureMapperAnimations::suspend):
* platform/graphics/texmap/TextureMapperAnimation.h:
(WebCore::TextureMapperAnimation::startTime const):
(WebCore::TextureMapperAnimation::pauseTime const):
* platform/graphics/texmap/TextureMapperFPSCounter.cpp:
(WebCore::TextureMapperFPSCounter::TextureMapperFPSCounter):
(WebCore::TextureMapperFPSCounter::updateFPSAndDisplay):
* platform/graphics/texmap/TextureMapperFPSCounter.h:
* platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:
(WebCore::TextureMapperPlatformLayerBuffer::markUsed):
(WebCore::TextureMapperPlatformLayerBuffer::lastUsedTime const):
(): Deleted.
* platform/graphics/texmap/TextureMapperPlatformLayerProxy.cpp:
(WebCore::TextureMapperPlatformLayerProxy::releaseUnusedBuffersTimerFired):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
(WebCore::CoordinatedGraphicsLayer::addAnimation):
(WebCore::CoordinatedGraphicsLayer::pauseAnimation):
(WebCore::CoordinatedGraphicsLayer::suspendAnimations):
* platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
* platform/mediastream/RealtimeMediaSource.h:
* platform/mediastream/RealtimeOutgoingVideoSource.cpp:
(WebCore::RealtimeOutgoingVideoSource::sendFrame):
* platform/mediastream/libwebrtc/LibWebRTCAudioModule.cpp:
(WebCore::LibWebRTCAudioModule::StartPlayoutOnAudioThread):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
(WebCore::DisplayCaptureSourceCocoa::startProducingData):
(WebCore::DisplayCaptureSourceCocoa::stopProducingData):
(WebCore::DisplayCaptureSourceCocoa::elapsedTime):
* platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
* platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
(WebCore::MockRealtimeAudioSourceMac::render):
* platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
(WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
* platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
(WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer):
(WebCore::ScreenDisplayCaptureSourceMac::frameAvailable):
* platform/mock/MockRealtimeAudioSource.cpp:
(WebCore::MockRealtimeAudioSource::startProducingData):
(WebCore::MockRealtimeAudioSource::stopProducingData):
(WebCore::MockRealtimeAudioSource::elapsedTime):
(WebCore::MockRealtimeAudioSource::tick):
(WebCore::MockRealtimeAudioSource::delaySamples):
* platform/mock/MockRealtimeAudioSource.h:
(WebCore::MockRealtimeAudioSource::render):
* platform/mock/MockRealtimeVideoSource.cpp:
(WebCore::MockRealtimeVideoSource::startProducingData):
(WebCore::MockRealtimeVideoSource::stopProducingData):
(WebCore::MockRealtimeVideoSource::elapsedTime):
(WebCore::MockRealtimeVideoSource::drawText):
(WebCore::MockRealtimeVideoSource::delaySamples):
(WebCore::MockRealtimeVideoSource::generateFrame):
* platform/mock/MockRealtimeVideoSource.h:
* platform/network/DNSResolveQueue.cpp:
(WebCore::DNSResolveQueue::DNSResolveQueue):
(WebCore::DNSResolveQueue::isUsingProxy):
* platform/network/DNSResolveQueue.h:
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::suspendAnimations):
* rendering/RenderBoxModelObject.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::paintFocusRing):
* rendering/RenderImage.cpp:
(WebCore::RenderImage::paintAreaElementFocusRing):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::notifyAnimationStarted):
(WebCore::RenderLayerBacking::suspendAnimations):
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didPaintBacking):
* rendering/RenderProgress.cpp:
(WebCore::RenderProgress::RenderProgress):
(WebCore::RenderProgress::animationProgress const):
(WebCore::RenderProgress::updateAnimationState):
* rendering/RenderProgress.h:
* rendering/RenderTheme.cpp:
(WebCore::RenderTheme::animationDurationForProgressBar const):
* rendering/RenderTheme.h:
* rendering/RenderThemeGtk.cpp:
(WebCore::RenderThemeGtk::animationDurationForProgressBar const):
* rendering/RenderThemeGtk.h:
* rendering/RenderThemeIOS.h:
* rendering/RenderThemeIOS.mm:
(WebCore::RenderThemeIOS::animationDurationForProgressBar const):
* rendering/RenderThemeMac.h:
* rendering/RenderThemeMac.mm:
(WebCore::RenderThemeMac::animationDurationForProgressBar const):
* svg/animation/SMILTimeContainer.cpp:
(WebCore::SMILTimeContainer::SMILTimeContainer):
(WebCore::SMILTimeContainer::elapsed const):
(WebCore::SMILTimeContainer::isActive const):
(WebCore::SMILTimeContainer::isPaused const):
(WebCore::SMILTimeContainer::isStarted const):
(WebCore::SMILTimeContainer::begin):
(WebCore::SMILTimeContainer::pause):
(WebCore::SMILTimeContainer::resume):
(WebCore::SMILTimeContainer::setElapsed):
(WebCore::SMILTimeContainer::timerFired):
* svg/animation/SMILTimeContainer.h:
* testing/Internals.cpp:
(WebCore::Internals::delayMediaStreamTrackSamples):
* testing/MockGamepad.cpp:
(WebCore::MockGamepad::MockGamepad):
(WebCore::MockGamepad::updateDetails):
(WebCore::MockGamepad::setAxisValue):
(WebCore::MockGamepad::setButtonValue):

Source/WebCore/PAL:

* pal/system/ClockGeneric.cpp:
(PAL::ClockGeneric::currentTime const):
(PAL::ClockGeneric::now const):
* pal/system/ClockGeneric.h:

Source/WebKit:

* NetworkProcess/cache/CacheStorageEngineCache.cpp:
(WebKit::CacheStorage::Cache::toRecordInformation):
* Platform/IPC/ArgumentCoders.cpp:
(IPC::ArgumentCoder<Seconds>::encode):
(IPC::ArgumentCoder<Seconds>::decode):
(IPC::ArgumentCoder<MonotonicTime>::encode):
(IPC::ArgumentCoder<MonotonicTime>::decode):
* Platform/IPC/ArgumentCoders.h:
* Shared/Gamepad/GamepadData.cpp:
(WebKit::GamepadData::GamepadData):
* Shared/Gamepad/GamepadData.h:
(WebKit::GamepadData::lastUpdateTime const):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<MonotonicTime>::encode): Deleted.
(IPC::ArgumentCoder<MonotonicTime>::decode): Deleted.
(IPC::ArgumentCoder<Seconds>::encode): Deleted.
(IPC::ArgumentCoder<Seconds>::decode): Deleted.
ArgumentCoders for MonotonicTime and Seconds are now used internally.
Move them to Platform/IPC/ArgumentCoders.h.

* Shared/WebCoreArgumentCoders.h:
* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::iconDatabaseSyncThread):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::start):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::stop):
(WebKit::DrawingAreaProxyImpl::DrawingMonitor::didDraw):
* UIProcess/DrawingAreaProxyImpl.h:
* UIProcess/Gamepad/UIGamepad.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::acceleratedAnimationDidStart):
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.h:
* UIProcess/RemoteLayerTree/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::animationDidStart):
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::acceleratedAnimationDidStart):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.h:
* WebProcess/WebPage/RemoteLayerTree/PlatformCAAnimationRemote.mm:
(mediaTimeToCurrentTime):
(-[WKAnimationDelegate animationDidStart:]):
* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::animationStarted):
This argument `beginTime` is not CFTimeInverval actually. We add currentTimeToMediaTime
conversion here to fix this issue.

* WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::animationDidStart):
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::acceleratedAnimationDidStart):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::destroyRenderingResources):

Source/WebKitLegacy/win:

* FullscreenVideoController.cpp:
(FullscreenVideoController::LayerClient::platformCALayerAnimationStarted):
* Plugins/PluginMessageThrottlerWin.cpp:
(WebCore::PluginMessageThrottlerWin::PluginMessageThrottlerWin):
(WebCore::PluginMessageThrottlerWin::appendMessage):
* Plugins/PluginMessageThrottlerWin.h:
* WebView.cpp:
(WebView::notifyAnimationStarted):
* WebView.h:

Source/WTF:

This patch drops monotonicallyIncreasingTime and monotonicallyIncreasingTimeMS.
We have MonotonicTime API instead. This offers strongly typed MonotonicTime,
Seconds etc. This reduces the chance of bugs mixing doubles which represent milliseconds
and seconds.

Large part of this patch is mechanical one: replacing monotonicallyIncreasingTime with
MonotonicTime, using MonotonicTime and Seconds instead of raw doubles.

But this patch actually finds some bugs (but it is a bit difficult to show it as a test).
One is mixing media time (CACurrentMediaTime()) and MonotonicTime. Basically they are
super close because both uses mach_absolute_time(). But they would be slightly different.
So we should not mix them.

The second bug is GraphicsLayer::suspendAnimations(double). While CA ports (Apple, AppleWin,
iOS etc.) use this double as MonotonicTime, GTK and WPE use this double as Seconds (timeOffset).
This patch fixes it and now the signature becomes GraphicsLayer::suspendAnimations(MonotonicTime).

In this patch, we still uses bunch of double for Seconds. But fixing them at this patch increases
the size of this larger and larger. So some of them remains double. This should be fixed in
subsequent patches.

* benchmarks/ConditionSpeedTest.cpp:
* benchmarks/LockSpeedTest.cpp:
* wtf/CurrentTime.cpp:
(WTF::MonotonicTime::now):
(WTF::monotonicallyIncreasingTime): Deleted.
* wtf/CurrentTime.h:
(WTF::monotonicallyIncreasingTimeMS): Deleted.
* wtf/MemoryPressureHandler.h:
* wtf/MonotonicTime.cpp:
(WTF::MonotonicTime::now): Deleted.
* wtf/MonotonicTime.h:
* wtf/ParkingLot.cpp:
* wtf/Seconds.h:
(WTF::Seconds::nan):
* wtf/Stopwatch.h:
(WTF::Stopwatch::reset):
(WTF::Stopwatch::start):
(WTF::Stopwatch::stop):
(WTF::Stopwatch::elapsedTime):
(WTF::Stopwatch::elapsedTimeSince):
* wtf/cocoa/MemoryPressureHandlerCocoa.mm:
(WTF::MemoryPressureHandler::holdOff):
(WTF::MemoryPressureHandler::respondToMemoryPressure):
* wtf/linux/MemoryPressureHandlerLinux.cpp:
(WTF::MemoryPressureHandler::EventFDPoller::EventFDPoller):
(WTF::MemoryPressureHandler::holdOff):
(WTF::MemoryPressureHandler::respondToMemoryPressure):
* wtf/win/MemoryPressureHandlerWin.cpp:
(WTF::MemoryPressureHandler::holdOff):

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

18 months ago[iOS] whitelist missing AppleJPEG logging feature
bfulgham@apple.com [Fri, 2 Mar 2018 16:55:20 +0000 (16:55 +0000)]
[iOS] whitelist missing AppleJPEG logging feature
https://bugs.webkit.org/show_bug.cgi?id=183270
<rdar://problem/37808612>

Reviewed by Alex Christensen.

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

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

18 months agoIOChannel::read and IOChannel::write can destroy the completion handler in the thread...
commit-queue@webkit.org [Fri, 2 Mar 2018 16:52:32 +0000 (16:52 +0000)]
IOChannel::read and IOChannel::write can destroy the completion handler in the thread used to manipulate thread
https://bugs.webkit.org/show_bug.cgi?id=183261

Patch by Youenn Fablet <youenn@apple.com> on 2018-03-02
Reviewed by Antti Koivisto.

Moving the completion handler when being called so that it gets desttroyed in the thread it is called.

* NetworkProcess/cache/NetworkCacheIOChannelCocoa.mm:
(WebKit::NetworkCache::IOChannel::read):
(WebKit::NetworkCache::IOChannel::write):

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

18 months ago[GTK] Unreviewed gardening
csaavedra@igalia.com [Fri, 2 Mar 2018 10:47:23 +0000 (10:47 +0000)]
[GTK] Unreviewed gardening

* platform/gtk/TestExpectations: Add
imported/w3c/web-platform-tests/css/css-ui/text-overflow-022.html,
which started failing in the bots.

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

18 months ago[GTK][WPE] Update js/dom static properties after r229112
csaavedra@igalia.com [Fri, 2 Mar 2018 10:00:07 +0000 (10:00 +0000)]
[GTK][WPE] Update js/dom static properties after r229112

Unreviewed gardening.
* platform/gtk/js/dom/dom-static-property-for-in-iteration-expected.txt:
* platform/wpe/js/dom/dom-static-property-for-in-iteration-expected.txt:

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

18 months agoMake LibWebRTCProvider port agnostic again after r215424
commit-queue@webkit.org [Fri, 2 Mar 2018 09:23:10 +0000 (09:23 +0000)]
Make LibWebRTCProvider port agnostic again after r215424
https://bugs.webkit.org/show_bug.cgi?id=183080

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-03-02
Reviewed by Youenn Fablet.

In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
we have moved that code to the cocoa class and created a glib implementation that will be used in the future
to implement the LibWebRTCProviderGlib class.

No new tests, this is a refactor.

* Sources.txt: Add the compilation of the new file.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
(WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
linking libwebrtc for the moment in these situations.

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

18 months agoSafari uses WebContent.Development when loading injected bundle embedded in its app...
mitz@apple.com [Fri, 2 Mar 2018 08:20:56 +0000 (08:20 +0000)]
Safari uses WebContent.Development when loading injected bundle embedded in its app bundle
https://bugs.webkit.org/show_bug.cgi?id=183275

Reviewed by Tim Horton.

Source/WebKit:

* UIProcess/mac/WebProcessProxyMac.mm:
(WebKit::WebProcessProxy::shouldAllowNonValidInjectedCode const): Return false if this is
  a platform binary. We can also return false unconditionally when building for any shipping
  major macOS release.

Source/WTF:

* wtf/spi/cocoa/SecuritySPI.h: Declared SecTaskGetCodeSignStatus.

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

18 months agoUnreviewed gardening. Skip new action tests added in r229166.
carlosgc@webkit.org [Fri, 2 Mar 2018 07:58:38 +0000 (07:58 +0000)]
Unreviewed gardening. Skip new action tests added in r229166.

* TestExpectations.json:

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

18 months agoUnreviewed. Update W3C WebDriver imported tests.
carlosgc@webkit.org [Fri, 2 Mar 2018 07:56:41 +0000 (07:56 +0000)]
Unreviewed. Update W3C WebDriver imported tests.

* imported/w3c/importer.json:
* imported/w3c/tools/webdriver/webdriver/transport.py:
* imported/w3c/tools/wptrunner/MANIFEST.in:
* imported/w3c/tools/wptrunner/README.rst:
* imported/w3c/tools/wptrunner/requirements.txt:
* imported/w3c/tools/wptrunner/requirements_chrome.txt:
* imported/w3c/tools/wptrunner/requirements_edge.txt:
* imported/w3c/tools/wptrunner/requirements_firefox.txt:
* imported/w3c/tools/wptrunner/requirements_ie.txt:
* imported/w3c/tools/wptrunner/requirements_opera.txt:
* imported/w3c/tools/wptrunner/requirements_sauce.txt:
* imported/w3c/tools/wptrunner/requirements_servo.txt:
* imported/w3c/tools/wptrunner/setup.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/chrome.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/chrome_android.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/edge.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/firefox.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/ie.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/opera.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/sauce.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/server-locations.txt: Removed.
* imported/w3c/tools/wptrunner/wptrunner/browsers/servo.py:
* imported/w3c/tools/wptrunner/wptrunner/browsers/servodriver.py:
* imported/w3c/tools/wptrunner/wptrunner/config.json: Removed.
* imported/w3c/tools/wptrunner/wptrunner/environment.py:
* imported/w3c/tools/wptrunner/wptrunner/executors/executorservo.py:
* imported/w3c/tools/wptrunner/wptrunner/font.py:
* imported/w3c/tools/wptrunner/wptrunner/hosts.py: Removed.
* imported/w3c/tools/wptrunner/wptrunner/testrunner.py:
* imported/w3c/tools/wptrunner/wptrunner/tests/browsers/__init__.py: Added.
* imported/w3c/tools/wptrunner/wptrunner/tests/test_hosts.py: Removed.
* imported/w3c/tools/wptrunner/wptrunner/webdriver_server.py:
* imported/w3c/tools/wptrunner/wptrunner/wptrunner.py:
* imported/w3c/webdriver/OWNERS:
* imported/w3c/webdriver/tests/actions/mouse.py:
* imported/w3c/webdriver/tests/actions/mouse_dblclick.py:
* imported/w3c/webdriver/tests/actions/pointer_origin.py: Added.
* imported/w3c/webdriver/tests/actions/support/mouse.py:
* imported/w3c/webdriver/tests/element_click/bubbling.py:
* imported/w3c/webdriver/tests/element_click/select.py:
* imported/w3c/webdriver/tests/element_send_keys/form_controls.py:
* imported/w3c/webdriver/tests/element_send_keys/interactability.py:
* imported/w3c/webdriver/tests/execute_script/cyclic.py:
* imported/w3c/webdriver/tests/fullscreen_window.py:
* imported/w3c/webdriver/tests/interface.html:
* imported/w3c/webdriver/tests/state/get_element_property.py:

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

18 months agoREGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
carlosgc@webkit.org [Fri, 2 Mar 2018 06:43:14 +0000 (06:43 +0000)]
REGRESSION(r222843): [HarfBuzz] Combining enclosed keycap not correctly handled
https://bugs.webkit.org/show_bug.cgi?id=183246

Reviewed by Michael Catanzaro.

Source/WebCore:

We are not correctly handling the combining enclosed keycap since we switched to use
ComplexTextController. This is because fontForCombiningCharacterSequence() always returns the font of the first
character, without checking if that font can render the whole sequence or not. Before 222843, the shaper did
that check when creating the text runs. In this case the sequence was split and a different font was used for the
text and the mark. This patch makes fontForCombiningCharacterSequence() try to find a suitable font for the
whole sequence, first looking at the CSS fallbacks and finally at system ones. The result is much better than
the old one, because we use the same font for both the text and the mark. If there isn't any font to render the
mark, then we fallback to use the first character font, since we will end up rendering the missing glyph
character, it's better to use the same font than the first character one.

Test: fast/text/combining-enclosing-keycap.html

* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Check if the first charatcer font can render
the whole sequence, trying with fallbacks otherwise.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Check if the font face has glyphs for the whole
sequence not just the first character.

LayoutTests:

* fast/text/combining-enclosing-keycap-expected.txt: Added.
* platform/gtk/fast/text/combining-enclosing-keycap.html: Added.
* platform/gtk/TestExpectations:

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

18 months ago[FreeType] Remove FontPlatformData fallbacks
carlosgc@webkit.org [Fri, 2 Mar 2018 06:40:56 +0000 (06:40 +0000)]
[FreeType] Remove FontPlatformData fallbacks
https://bugs.webkit.org/show_bug.cgi?id=183210

Reviewed by Michael Catanzaro.

Source/WebCore:

They are only used by FontCache::systemFallbackForCharacters() where a direct FcFontMatch provides the same
or better results.

* platform/graphics/FontPlatformData.h: Remove fallbacks.
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::systemFallbackForCharacters): Use FcFontMatch() only.
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::fallbacks): Removed.

LayoutTests:

Rebaseline 3 tests that progressed.

* platform/gtk/fast/text/international/bidi-LDB-2-CSS-expected.png:
* platform/gtk/fast/text/international/bidi-LDB-2-CSS-expected.txt:
* platform/gtk/fast/text/international/bidi-LDB-2-HTML-expected.png:
* platform/gtk/fast/text/international/bidi-LDB-2-HTML-expected.txt:
* platform/gtk/fast/text/international/bidi-LDB-2-formatting-characters-expected.png:
* platform/gtk/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt:

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

18 months agoUnreviewed, rolling out r229153.
commit-queue@webkit.org [Fri, 2 Mar 2018 06:04:24 +0000 (06:04 +0000)]
Unreviewed, rolling out r229153.
https://bugs.webkit.org/show_bug.cgi?id=183274

it is breaking imported/w3c/web-platform-tests/service-workers
/service-worker/clients-matchall-exact-controller.https.html
(Requested by youenn on #webkit).

Reverted changeset:

"Clients should register to StorageProcess with their service
worker registration identifier"
https://bugs.webkit.org/show_bug.cgi?id=182313
https://trac.webkit.org/changeset/229153

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

18 months agoASSERTION FAILED: matchContextualKeyword(m_vm->propertyNames->async)
utatane.tea@gmail.com [Fri, 2 Mar 2018 05:55:39 +0000 (05:55 +0000)]
ASSERTION FAILED: matchContextualKeyword(m_vm->propertyNames->async)
https://bugs.webkit.org/show_bug.cgi?id=183173

Reviewed by Saam Barati.

JSTests:

* stress/async-arrow-function-in-class-heritage.js: Added.
(testSyntax):
(testSyntaxError):
(SyntaxError):

Source/JavaScriptCore:

Classifier could propagate an error which does not occur at the first token
of the given expression. We should check whether the given token is "async"
instead of assertion.

* parser/Parser.cpp:
(JSC::Parser<LexerType>::parseAssignmentExpression):

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

18 months agoWe need to clear cached structures when having a bad time
sbarati@apple.com [Fri, 2 Mar 2018 05:00:06 +0000 (05:00 +0000)]
We need to clear cached structures when having a bad time
https://bugs.webkit.org/show_bug.cgi?id=183256
<rdar://problem/36245022>

Reviewed by Mark Lam.

JSTests:

* stress/having-a-bad-time-with-derived-arrays.js: Added.
(assert):
(defineSetter):
(iterate):
(doSlice):

Source/JavaScriptCore:

This patch makes both InternalFunctionAllocationProfile and the VM's
structure cache having-a-bad-time aware. For InternalFunctionAllocationProfile,
we clear them when they'd produce an object with a bad indexing type.
For the VM's Structure cache, we conservatively clear the entire cache
since it may be housing Structures with bad indexing types.

* runtime/FunctionRareData.h:
(JSC::FunctionRareData::clearInternalFunctionAllocationProfile):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::haveABadTime):
* runtime/StructureCache.h:
(JSC::StructureCache::clear):

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

18 months agoService worker test gardening
commit-queue@webkit.org [Fri, 2 Mar 2018 01:41:17 +0000 (01:41 +0000)]
Service worker test gardening
https://bugs.webkit.org/show_bug.cgi?id=183264

Unreviewed.

Patch by Youenn Fablet <youenn@apple.com> on 2018-03-01

* TestExpectations: Unflake/Unskip some tests that seem stable now.

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

18 months ago[CMake] configure failure for aarch64
mcatanzaro@igalia.com [Fri, 2 Mar 2018 01:01:26 +0000 (01:01 +0000)]
[CMake] configure failure for aarch64
https://bugs.webkit.org/show_bug.cgi?id=183268

Unreviewed build fix. This failure is caused by a simple typo.

* Source/cmake/OptionsCommon.cmake:

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

18 months agoAdd the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin...
bfulgham@apple.com [Fri, 2 Mar 2018 00:31:25 +0000 (00:31 +0000)]
Add the "com.apple.security.cs.disable-library-validation” entitlement to the Plugin Process
https://bugs.webkit.org/show_bug.cgi?id=183252
<rdar://problem/37887136>

Reviewed by David Kilzer.

* Configurations/PluginService.entitlements:

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

18 months agoClients should register to StorageProcess with their service worker registration...
commit-queue@webkit.org [Fri, 2 Mar 2018 00:04:06 +0000 (00:04 +0000)]
Clients should register to StorageProcess with their service worker registration identifier
https://bugs.webkit.org/show_bug.cgi?id=182313

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

Source/WebCore:

No observable change of behavior in regular conditions.
When service worker process crashes, the service worker identifiers sent by the WebProcess might be wrong
and we will not be able to retrieve the registration from these identifiers.
The storage process will be able to still process correctly messages coming from the WebProcess to register clients of the registration.
Otherwise, there is a chance that WebProcess clients will not be added to the SWServerRegistration.m_clientsUsingRegistration maps.

* dom/Document.cpp:
(WebCore::Document::setServiceWorkerConnection):
* workers/service/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::registerServiceWorkerClient):
* workers/service/server/SWServer.h:

Source/WebKit:

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

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

18 months agoMove resource load statistics tests from js-test-pre.js to js-test.js
wilander@apple.com [Thu, 1 Mar 2018 23:22:11 +0000 (23:22 +0000)]
Move resource load statistics tests from js-test-pre.js to js-test.js
https://bugs.webkit.org/show_bug.cgi?id=183249
<rdar://problem/38033096>

Unreviewed test gardening.

* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-non-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-sub-frame-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-under-top-frame-origins.html:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to-expected.txt:
* http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-subresource-unique-redirects-to.html:
* http/tests/resourceLoadStatistics/classify-as-very-prevalent-based-on-mixed-statistics.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-expected.txt:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour-expected.txt:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store-one-hour.html:
* http/tests/resourceLoadStatistics/clear-in-memory-and-persistent-store.html:
* http/tests/resourceLoadStatistics/grandfathering-expected.txt:
* http/tests/resourceLoadStatistics/grandfathering.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/non-prevalent-resource-without-user-interaction.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-deletion.html:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-and-unpartitioned-cookie-with-partitioning-timeout.html:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/partitioned-cookies-with-and-without-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-handled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-unhandled-keydown.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout-expected.txt:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction-timeout.html:
* http/tests/resourceLoadStatistics/prevalent-resource-with-user-interaction.html:
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction-expected.txt:
* http/tests/resourceLoadStatistics/prevalent-resource-without-user-interaction.html:

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

18 months agoLayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event...
commit-queue@webkit.org [Thu, 1 Mar 2018 23:19:07 +0000 (23:19 +0000)]
LayoutTest imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-within-sw.https.html is a flaky failure
https://bugs.webkit.org/show_bug.cgi?id=179248
<rdar://problem/35377756>

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

Source/WebKit:

WebKitTestRunner is clearing caches for every test but there might still be some on-going cache activity due to a previous test.
In that case, the activity might try to open the Caches object at the same time the files are deleted by the clearing task.
If the new test is trying to open the same caches, it will also receive the same error, hence the console log message.

To fix that issue, we clear the initialization pending callbacks when clearing the caches.
This prevents the new test to receive the error since the new test should only start some cache activity after the cache clear task is done.
Made refactoring to append the first callback into the list of pending callbacks.

* NetworkProcess/cache/CacheStorageEngineCaches.cpp:
(WebKit::CacheStorage::Caches::initialize):
(WebKit::CacheStorage::Caches::initializeSize):
(WebKit::CacheStorage::Caches::clear):
* NetworkProcess/cache/CacheStorageEngineCaches.h:

LayoutTests:

* TestExpectations:

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

18 months agoAdd API test to validate setting of service worker and cache storage directories
commit-queue@webkit.org [Thu, 1 Mar 2018 23:18:28 +0000 (23:18 +0000)]
Add API test to validate setting of service worker and cache storage directories
https://bugs.webkit.org/show_bug.cgi?id=182543

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

Source/WebCore:

Covered by API tests.

Add getters to service worker registration directory.

* testing/Internals.cpp:
(WebCore::Internals::serviceWorkerRegistrationDirectory):
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/SWClientConnection.h:
* workers/service/server/RegistrationDatabase.h:
(WebCore::RegistrationDatabase::serviceWorkerRegistrationDirectory const):
* workers/service/server/RegistrationStore.h:
(WebCore::RegistrationStore::serviceWorkerRegistrationDirectory const):
* workers/service/server/SWServer.h:
(WebCore::SWServer::serviceWorkerRegistrationDirectory const):

Source/WebKit:

Add cache engine directory path to its representation dump.
This is used in API tests to check that the path is correctly set.

Add a way for to know whether a service worker was registered from a WKWebsiteDataStore.
This is used in API tests to check that the path is correctly set.

* NetworkProcess/cache/CacheStorageEngine.cpp:
(WebKit::CacheStorage::Engine::representation):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _hasRegisteredServiceWorker]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:

LayoutTests:

Updated tests according new engine representation.

* http/tests/cache-storage/cache-clearing-origin.https.html:
* http/tests/cache-storage/cache-origins.https.html:
* http/tests/cache-storage/cache-representation.https.html:

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

18 months agoSWServer::removeClientServiceWorkerRegistration should not log an error if there...
commit-queue@webkit.org [Thu, 1 Mar 2018 23:14:45 +0000 (23:14 +0000)]
SWServer::removeClientServiceWorkerRegistration should not log an error if there is no registration
https://bugs.webkit.org/show_bug.cgi?id=183248

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

No change of behavior.
Removed the error logging.
As can be seen from running api and layout tests, a web process can ask a registration to be unregistered
and by the time it goes to the StorageProcess, the registration is already cleared.

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

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

18 months agoFix some errors due to some mach port APIs being unavailable on watchOS
wenson_hsieh@apple.com [Thu, 1 Mar 2018 23:11:46 +0000 (23:11 +0000)]
Fix some errors due to some mach port APIs being unavailable on watchOS
https://bugs.webkit.org/show_bug.cgi?id=183262
<rdar://problem/38028521>

Reviewed by Tim Horton.

Minor build fix; mach_port_guard and mach_port_unguard are not available on this platform.

* Platform/IPC/mac/ConnectionMac.mm:
(IPC::Connection::platformInvalidate):
(IPC::Connection::platformInitialize):
(IPC::Connection::open):

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

18 months agoCSS ::selection stroke-color and stroke-width are not applied to selected text in...
dbates@webkit.org [Thu, 1 Mar 2018 22:35:38 +0000 (22:35 +0000)]
CSS ::selection stroke-color and stroke-width are not applied to selected text in text fields
and ::selection:window-inactive stroke-color and stroke-width are never applied
https://bugs.webkit.org/show_bug.cgi?id=183178

Reviewed by David Hyatt.

Source/WebCore:

This change fixes the following two issues:
    1. Properties stroke-color and stroke-width are not applied to the ::selection pseudo-
       element of text fields.
    2. Properties stroke-color and stroke-width are never applied to ::selection:window-inactive
       pseudo elements.

Currently when computing the paint styles for selected text we query the cached styles for
the ::selection pseudo element on the renderer. Text fields are implemented using a User Agent
shadow DOM. With regards to issue (1) the renderer queried was the inner most renderer for
the text in the text field. But it should have been the shadow host renderer (i.e. the renderer
for the <input>). With regards to issue (2) we cannot retrieve cached styles for the
::selection pseudo element because it can be effected by a pseudo class, :window-inactive,
which matches when the page is deactivated (i.e. the window is in the background as the user
made another window the frontmost window). Both of these issues are fixed by making use
of RenderElement::selectionPseudoStyle().

Tests: fast/selectors/selection-window-inactive-stroke-color.html
       fast/selectors/selection-window-inactive-text-shadow.html
       fast/selectors/text-field-selection-stroke-color.html
       fast/selectors/text-field-selection-text-shadow.html
       fast/selectors/text-field-selection-window-inactive-stroke-color.html
       fast/selectors/text-field-selection-window-inactive-text-shadow.html

* rendering/RenderText.h:
(WebCore::RenderText::selectionPseudoStyle const): Add a convenience function that turns
around and calls the function of the same name on its parent.
* rendering/TextPaintStyle.cpp:
(WebCore::computeTextSelectionPaintStyle): Modified to use RenderText::selectionPseudoStyle()
instead of directly querying for the cached styles for the ::selection pseudo element.

LayoutTests:

Add tests to ensure that we paint ::selection stroke-color and stroke-width for selected text
in text fields. Add tests to ensure that we apply ::selection:window-inactive stroke-color
and stroke-width to selected text when the page is deactivated.

* fast/selectors/selection-window-inactive-stroke-color-expected.html: Added.
* fast/selectors/selection-window-inactive-stroke-color.html: Added.
* fast/selectors/selection-window-inactive-text-shadow-expected.html: Added.
* fast/selectors/selection-window-inactive-text-shadow.html: Added.
* fast/selectors/text-field-selection-stroke-color-expected.html: Added.
* fast/selectors/text-field-selection-stroke-color.html: Added.
* fast/selectors/text-field-selection-text-shadow-expected.html: Added.
* fast/selectors/text-field-selection-text-shadow.html: Added.
* fast/selectors/text-field-selection-window-inactive-stroke-color-expected.html: Added.
* fast/selectors/text-field-selection-window-inactive-stroke-color.html: Added.
* fast/selectors/text-field-selection-window-inactive-text-shadow-expected.html: Added.
* fast/selectors/text-field-selection-window-inactive-text-shadow.html: Added.
* platform/gtk/TestExpectations: Skip the ::selection:window-inactive tests until we fix
<https://bugs.webkit.org/show_bug.cgi?id=183143>.
* platform/ios/TestExpectations: Mark the tests as won't fix since UIKit draws selection on iOS.
* platform/win/TestExpectations: Mark tests as image failures an associated with <https://bugs.webkit.org/show_bug.cgi?id=117322>.
Windows does not seem to be updating selectors when the window is deactivated or window deactivation,
testRunner.setWindowIsKey() is broken.
* platform/wpe/TestExpectations: Skip the ::selection:window-inactive tests until we fix
<https://bugs.webkit.org/show_bug.cgi?id=183144>.

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

18 months agoUnreviewed build fix after r229140.
pvollan@apple.com [Thu, 1 Mar 2018 22:21:29 +0000 (22:21 +0000)]
Unreviewed build fix after r229140.

* WebProcess/cocoa/WebProcessCocoa.mm:

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

18 months ago[Win][DRT] Implement setSpatialNavigationEnabled.
ross.kirsling@sony.com [Thu, 1 Mar 2018 21:50:41 +0000 (21:50 +0000)]
[Win][DRT] Implement setSpatialNavigationEnabled.
https://bugs.webkit.org/show_bug.cgi?id=183166

Reviewed by Per Arne Vollan.

Source/WebKitLegacy/win:

Create a non-dummy implementation of the private preference in Win WKL to support layout tests.

* Interfaces/IWebPreferencesPrivate.idl:
* WebPreferenceKeysPrivate.h:
* WebPreferences.cpp:
(WebPreferences::initializeDefaultSettings):
(WebPreferences::spatialNavigationEnabled):
(WebPreferences::setSpatialNavigationEnabled):
* WebPreferences.h:
* WebView.cpp:
(WebView::notifyPreferencesChanged):

Tools:

* DumpRenderTree/TestRunner.cpp:
(setSpatialNavigationEnabledCallback):
* DumpRenderTree/win/DumpRenderTree.cpp:
(resetWebPreferencesToConsistentValues):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::setSpatialNavigationEnabled):

LayoutTests:

* platform/win/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt:
* platform/wincairo/fast/spatial-navigation/snav-multiple-select-focusring-expected.txt: Added.
This test requires an expectation for every platform. AppleWin had one but it must've been a copy-paste job?

* platform/win/TestExpectations:
Enable fast/spatial-navigation tests on AppleWin too.

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

18 months ago[webkitpy] Use shell=False to launch apache http server.
commit-queue@webkit.org [Thu, 1 Mar 2018 21:26:19 +0000 (21:26 +0000)]
[webkitpy] Use shell=False to launch apache http server.
https://bugs.webkit.org/show_bug.cgi?id=183191

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-03-01
Reviewed by Aakash Jain.

* Scripts/webkitpy/layout_tests/servers/apache_http_server.py:
(LayoutTestApacheHttpd.__init__):
(LayoutTestApacheHttpd._run):

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

18 months agoScrollbar preferences are ignored when the WebContent process doesn't have access...
pvollan@apple.com [Thu, 1 Mar 2018 21:16:16 +0000 (21:16 +0000)]
Scrollbar preferences are ignored when the WebContent process doesn't have access to the WindowServer.
https://bugs.webkit.org/show_bug.cgi?id=183231
<rdar://problem/37793457>

Reviewed by Brent Fulgham.

When the WebContent process doesn't have access to the WindowServer, the scrollbars are always of the overlay type.
The notification about scrollbar preferences is never received by the WebContent process when there is no
WindowServer access. This can be fixed by adding an observer of scrollbar preferences in the UI process, and
notifying the WebProcess about this by sending it a message. This message should also contain the preferred
scrollbar type, since the call '[NSScroller preferredScrollerStyle]' will always return the overlay style when
there is no WindowServer access.

Source/WebCore:

No new tests, covered by existing tests.

* WebCore.xcodeproj/project.pbxproj:
* platform/mac/NSScrollerImpDetails.h:
* platform/mac/NSScrollerImpDetails.mm:
(WebCore::ScrollerStyle::recommendedScrollerStyle):
(WebCore::ScrollerStyle::setUseOverlayScrollbars):
(WebCore::recommendedScrollerStyle): Deleted.
* platform/mac/ScrollAnimatorMac.mm:
(WebCore::ScrollAnimatorMac::ScrollAnimatorMac):
(WebCore::ScrollAnimatorMac::mouseEnteredScrollbar const):
(WebCore::ScrollAnimatorMac::mouseExitedScrollbar const):
(WebCore::ScrollAnimatorMac::shouldScrollbarParticipateInHitTesting):
* platform/mac/ScrollbarThemeMac.mm:
(WebCore::ScrollbarThemeMac::registerScrollbar):
(WebCore::ScrollbarThemeMac::scrollbarThickness):
(WebCore::ScrollbarThemeMac::usesOverlayScrollbarsChanged):

Source/WebKit:

* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::registerNotificationObservers):
(WebKit::WebProcessPool::unregisterNotificationObservers):
* UIProcess/WebProcessPool.h:
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::scrollerStylePreferenceChanged):

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

18 months agoTemporarily enable user-installed-fonts everywhere until we can stop crashing on...
mmaxfield@apple.com [Thu, 1 Mar 2018 21:11:49 +0000 (21:11 +0000)]
Temporarily enable user-installed-fonts everywhere until we can stop crashing on launch
https://bugs.webkit.org/show_bug.cgi?id=183255

Unreviewed.

Tests are already disabled.

* platform/graphics/cocoa/FontCacheCoreText.cpp:

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

18 months ago[Curl] Split DNS cache expiration and connection timeout setting.
commit-queue@webkit.org [Thu, 1 Mar 2018 20:39:00 +0000 (20:39 +0000)]
[Curl] Split DNS cache expiration and connection timeout setting.
https://bugs.webkit.org/show_bug.cgi?id=182979

It was mis-implemented and was named ambiguous name 'enableTimeout'.
Implement each feature correctly.

Patch by Basuke Suzuki <Basuke.Suzuki@sony.com> on 2018-03-01
Reviewed by Per Arne Vollan.

* platform/network/curl/CurlContext.cpp:
(WebCore::EnvironmentVariableReader::read):
(WebCore::EnvironmentVariableReader::defined):
(WebCore::EnvironmentVariableReader::readAs):
(WebCore::EnvironmentVariableReader::sscanTemplate):
(WebCore::EnvironmentVariableReader::sscanTemplate<unsigned>):
(WebCore::CurlContext::CurlContext):
(WebCore::safeTimeValue):
(WebCore::CurlHandle::setDnsCacheTimeout):
(WebCore::CurlHandle::setConnectTimeout):
(WebCore::CurlHandle::setTimeout):
(WebCore::CurlHandle::enableTimeout): Deleted.
* platform/network/curl/CurlContext.h:
(WebCore::CurlContext::dnsCacheTimeout const):
(WebCore::CurlContext::connectTimeout const):
* platform/network/curl/CurlRequest.cpp:
(WebCore::CurlRequest::setupTransfer):

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

18 months agoRemove RenderElement::s_noLongerAffectsParentBlock
zalan@apple.com [Thu, 1 Mar 2018 20:20:46 +0000 (20:20 +0000)]
Remove RenderElement::s_noLongerAffectsParentBlock
https://bugs.webkit.org/show_bug.cgi?id=183196
<rdar://problem/38030797>

Reviewed by Antti Koivisto.

Remove the hack to track floating/out-of-flow changes between styleWillChange and styleDidChange.

Covered by existing tests.

* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::styleDidChange):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::styleWillChange):
(WebCore::RenderElement::noLongerAffectsParentBlock const):
(WebCore::RenderElement::styleDidChange):
* rendering/RenderElement.h:
(WebCore::RenderElement::noLongerAffectsParentBlock const): Deleted.

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

18 months agoUnreviewed, update WebKit.CustomHeaderFields API test after r229133.
cdumez@apple.com [Thu, 1 Mar 2018 18:41:41 +0000 (18:41 +0000)]
Unreviewed, update WebKit.CustomHeaderFields API test after r229133.

We no longer do policy checks for 'about:blank'.

* TestWebKitAPI/Tests/WebKitCocoa/WebsitePolicies.mm:
(-[CustomHeaderFieldsDelegate webView:startURLSchemeTask:]):
(TEST):

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

18 months agoCrash when updating cache entry after validation in apps that uses class A file prote...
antti@apple.com [Thu, 1 Mar 2018 17:11:33 +0000 (17:11 +0000)]
Crash when updating cache entry after validation in apps that uses class A file protection
https://bugs.webkit.org/show_bug.cgi?id=183242
<rdar://problem/33289058>

Reviewed by Chris Dumez.

When validating a cache entry, we keep it alive until we get a network response. With 304 response
we then update the headers of this existing entry. This accesses the body data of the entry which
may be backed by a mapped file. If the app uses class A protection, user might have locked
the device and the entry might have become inaccessible, leading to a crash.

* NetworkProcess/cache/NetworkCacheEntry.cpp:
(WebKit::NetworkCache::Entry::setNeedsValidation):

In case of class A protection, pull the data to a memory buffer immediately before starting a revalidation request.
This makes the window where the file could become inaccessible much shorter (since it no longer depends on network).

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

18 months agoimported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails...
cdumez@apple.com [Thu, 1 Mar 2018 17:05:23 +0000 (17:05 +0000)]
imported/w3c/web-platform-tests/html/browsers/windows/browsing-context.html fails with async policy delegates
https://bugs.webkit.org/show_bug.cgi?id=183225
<rdar://problem/38003828>

Reviewed by Alex Christensen.

Source/WebCore:

Bypass navigation policy check when loading about:blank. This does not seem necessary and it would not
be Web-compatible for such policy check to happen synchronously. This is because an iframe without src
or src="about:blank" should load synchronously as per HTML specification.

Test: http/wpt/html/browsers/windows/browsing-context.html

* loader/PolicyChecker.cpp:
(WebCore::PolicyChecker::checkNavigationPolicy):

LayoutTests:

* http/wpt/html/browsers/windows/browsing-context-expected.txt: Added.
* http/wpt/html/browsers/windows/browsing-context.html: Added.
Add layout test coverage.

* fast/loader/iframe-src-invalid-url-expected.txt:
* fast/loader/policy-delegate-action-hit-test-zoomed-expected.txt:
* loader/navigation-policy/should-open-external-urls/subframe-click-target-self-expected.txt:
* loader/navigation-policy/should-open-external-urls/subframe-click-target-top-expected.txt:
Rebaseline a few layout tests now that the log lines for the about:blank policy checks are
gone.

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

18 months ago[Curl] Linker errors in some curl files due to missing exports
commit-queue@webkit.org [Thu, 1 Mar 2018 16:59:43 +0000 (16:59 +0000)]
[Curl] Linker errors in some curl files due to missing exports
https://bugs.webkit.org/show_bug.cgi?id=183238

Patch by Christopher Reid <chris.reid@sony.com> on 2018-03-01
Reviewed by Alex Christensen.

No new tests, no change in behavior.

Adding WEBCORE_EXPORT to functions now used in WebKit.

* platform/network/NetworkStorageSession.h:
* platform/network/curl/CookieJarDB.h:
* platform/network/curl/CurlContext.h:

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

18 months agoUnreviewed, rolling out r229130.
commit-queue@webkit.org [Thu, 1 Mar 2018 14:00:39 +0000 (14:00 +0000)]
Unreviewed, rolling out r229130.
https://bugs.webkit.org/show_bug.cgi?id=183244

It breaks AppleWin compilation (Requested by alexg__ on
#webkit).

Reverted changeset:

"Make LibWebRTCProvider port agnostic again after r215424"
https://bugs.webkit.org/show_bug.cgi?id=183080
https://trac.webkit.org/changeset/229130

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

18 months agoMake LibWebRTCProvider port agnostic again after r215424
commit-queue@webkit.org [Thu, 1 Mar 2018 13:27:23 +0000 (13:27 +0000)]
Make LibWebRTCProvider port agnostic again after r215424
https://bugs.webkit.org/show_bug.cgi?id=183080

Patch by Alejandro G. Castro <alex@igalia.com> on 2018-03-01
Reviewed by Youenn Fablet.

In the r215424 commit the webRTCAvailable function started to use a function from the DARWIN platform,
we have moved that code to the cocoa class and created a glib implementation that will be used in the future
to implement the LibWebRTCProviderGlib class.

No new tests, this is a refactor.

* Sources.txt: Add the compilation of the new file.
* platform/mediastream/libwebrtc/LibWebRTCProvider.cpp: Remove the webRTCAvailable function from this file.
(WebCore::LibWebRTCProvider::create): We want to use this even when LIBWEBRTC is not used.
* platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Moved the code from the LibWebRTCProvider class.
* platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp:
(WebCore::LibWebRTCProvider::webRTCAvailable): Add the glib implementation, basically true, we are always
linking libwebrtc for the moment in these situations.

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

18 months agoUnreviewed, fix exception check for ExceptionScope
utatane.tea@gmail.com [Thu, 1 Mar 2018 10:24:33 +0000 (10:24 +0000)]
Unreviewed, fix exception check for ExceptionScope
https://bugs.webkit.org/show_bug.cgi?id=183175

* jsc.cpp:
(GlobalObject::moduleLoaderFetch):

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

18 months ago[FreeType] Color emojis in WebKitGTK+ for great justice
carlosgc@webkit.org [Thu, 1 Mar 2018 09:26:08 +0000 (09:26 +0000)]
[FreeType] Color emojis in WebKitGTK+ for great justice
https://bugs.webkit.org/show_bug.cgi?id=183155

Reviewed by Michael Catanzaro.

Emojis are actually rendered if there's an emoji font installed in the system, but the size is so tiny that we
don't see them. This is because for some reason the matrix we are getting from fontconfig contains a scale,
which we don't expect. We only get the fontconfig matrix to apply rotations in case of oblique fonts, and then we
always apply the scale for the computed pixel font size. Ignoring the fontconfig matrix scale fixes the issue.

* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::fontWeightToFontconfigWeight): Moved here since it's now used by configurePatternForFontDescription().
(WebCore::configurePatternForFontDescription): Helper function to apply the same options for fallback pattern.
(WebCore::createFontConfigPatternForCharacters): Use configurePatternForFontDescription().
(WebCore::findBestFontGivenFallbacks): Adopt the returned reference.
(WebCore::FontCache::systemFallbackForCharacters): Clean it up.
(WebCore::FontCache::createFontPlatformData): Use configurePatternForFontDescription().
* platform/graphics/freetype/FontPlatformDataFreeType.cpp:
(WebCore::FontPlatformData::buildScaledFont): Ignore the scale returned by fontconfig matrix.

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

18 months ago[GStreamer] text samples no longer processed
philn@webkit.org [Thu, 1 Mar 2018 09:24:54 +0000 (09:24 +0000)]
[GStreamer] text samples no longer processed
https://bugs.webkit.org/show_bug.cgi?id=183212

Reviewed by Xabier Rodriguez-Calvar.

* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::newTextSample): Refer to
track stream ID instead of (potentially) manually generated track
ID stored as hashmap keys.

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

18 months agoREGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface...
carlosgc@webkit.org [Thu, 1 Mar 2018 09:24:24 +0000 (09:24 +0000)]
REGRESSION(r221514): [GTK] UI process crash in WebKit::WaylandCompositor::Surface::flushPendingFrameCallbacks
https://bugs.webkit.org/show_bug.cgi?id=183091

Reviewed by Michael Catanzaro.

Invalidate the surface in the page map when the backing store is destroyed.

* UIProcess/gtk/WaylandCompositor.cpp:
(WebKit::WaylandCompositor::willDestroySurface):
* UIProcess/gtk/WaylandCompositor.h:

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

18 months ago[ARM] Fix compile error in debug builds by invoking unpoisoned().
commit-queue@webkit.org [Thu, 1 Mar 2018 07:35:30 +0000 (07:35 +0000)]
[ARM] Fix compile error in debug builds by invoking unpoisoned().

Patch by Dominik Infuehr <dinfuehr@igalia.com> on 2018-02-28
Reviewed by Mark Lam.

* assembler/MacroAssemblerCodeRef.h:
(JSC::MacroAssemblerCodePtr::MacroAssemblerCodePtr): Fix compile error.
(JSC::MacroAssemblerCodePtr::createFromExecutableAddress()): Ditto.
(JSC::MacroAssemblerCodePtr::dataLocation()): Ditto.
* yarr/YarrInterpreter.cpp:
(JSC::Yarr::ByteCompiler::dumpDisjunction): use %zu for printf'ing size_t.

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

18 months agoPush WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it...
timothy_horton@apple.com [Thu, 1 Mar 2018 06:47:43 +0000 (06:47 +0000)]
Push WTF_PLATFORM_IOS down into preprocessor.pm instead of trying to determine it inside
https://bugs.webkit.org/show_bug.cgi?id=183193

Reviewed by Andy Estes.

* DerivedSources.make:
* bindings/scripts/preprocessor.pm:
(applyPreprocessor):
Instead of trying to discern WTF_PLATFORM_IOS inside preprocessor.pm,
push it down from DerivedSources.make. Also clean up DerivedSources.make
a tiny bit by adding a variable, FEATURE_AND_PLATFORM_DEFINES, which
contains both FEATURE_DEFINES and WTF_PLATFORM macros if needed.

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