WebKit-https.git
23 months agoConfigure serviceWorkerRegistrationDirectory on the web site data store and move...
commit-queue@webkit.org [Fri, 2 Feb 2018 19:25:21 +0000 (19:25 +0000)]
Configure serviceWorkerRegistrationDirectory on the web site data store and move it to a Caches subfolder as a default
https://bugs.webkit.org/show_bug.cgi?id=182403

Patch by Youenn Fablet <youenn@apple.com> on 2018-02-02
Reviewed by Alex Christensen.

Source/WebKit:

WebsiteDataStore is the place to set configuration information such as service worker registration path.
This patch updates WebKit code accordingly.
By default, the service worker registration path is in a Caches subfolder, similarly to cache API path.

* UIProcess/API/APIProcessPoolConfiguration.cpp:
(API::ProcessPoolConfiguration::createWithLegacyOptions):
(API::ProcessPoolConfiguration::createWithWebsiteDataStoreConfiguration):
(API::ProcessPoolConfiguration::ProcessPoolConfiguration):
(API::ProcessPoolConfiguration::copy):
* UIProcess/API/APIProcessPoolConfiguration.h:
* UIProcess/API/C/WKContextConfigurationRef.cpp:
(WKContextConfigurationCopyServiceWorkerDatabaseDirectory): Deleted.
(WKContextConfigurationSetServiceWorkerDatabaseDirectory): Deleted.
* UIProcess/API/C/WKContextConfigurationRef.h:
* UIProcess/API/Cocoa/APIWebsiteDataStoreCocoa.mm:
(API::WebsiteDataStore::defaultServiceWorkerRegistrationDirectory):
* UIProcess/API/Cocoa/WKWebsiteDataStore.mm:
(-[WKWebsiteDataStore _serviceWorkerRegistrationDirectory]):
(-[WKWebsiteDataStore _setServiceWorkerRegistrationDirectory:]):
* UIProcess/API/Cocoa/WKWebsiteDataStorePrivate.h:
* UIProcess/WebProcessPool.cpp:
(WebKit::WebProcessPool::ensureStorageProcessAndWebsiteDataStore):
(WebKit::WebProcessPool::initializeNewWebProcess):
* UIProcess/WebsiteData/WebsiteDataStore.h:
(WebKit::WebsiteDataStore::serviceWorkerRegistrationDirectory const):
(WebKit::WebsiteDataStore::setServiceWorkerRegistrationDirectory):
* UIProcess/gtk/WebProcessPoolGtk.cpp:
* UIProcess/gtk/WebProcessPoolWPE.cpp:

Tools:

* WebKitTestRunner/TestController.cpp:
(WTR::TestController::generateContextConfiguration const):
* WebKitTestRunner/cocoa/TestControllerCocoa.mm:
(WTR::initializeWebViewConfiguration):

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

23 months agoMapHash should return true to doesGC in the DFG depending on useKind because it might...
sbarati@apple.com [Fri, 2 Feb 2018 19:07:31 +0000 (19:07 +0000)]
MapHash should return true to doesGC in the DFG depending on useKind because it might resolve a rope
https://bugs.webkit.org/show_bug.cgi?id=182402

Reviewed by Yusuke Suzuki.

* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):

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

23 months ago[Modern Media Controls] Turn media/modern-media-controls/volume-* back on
graouts@webkit.org [Fri, 2 Feb 2018 18:51:37 +0000 (18:51 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/volume-* back on
https://bugs.webkit.org/show_bug.cgi?id=182438

Reviewed by Dean Jackson.

Update tests to match the modern-media-controls design and expectations.
One test was reworked as a Slider test since VolumeSlider no longer exists.

* media/modern-media-controls/slider/slider-value-expected.txt: Renamed from LayoutTests/media/modern-media-controls/volume-slider/volume-slider-value-expected.txt.
* media/modern-media-controls/slider/slider-value.html: Renamed from LayoutTests/media/modern-media-controls/volume-slider/volume-slider-value.html.
* media/modern-media-controls/volume-down-support/volume-down-support-expected.txt:
* media/modern-media-controls/volume-down-support/volume-down-support.html:
* media/modern-media-controls/volume-slider/volume-slider-expected.txt: Removed.
* media/modern-media-controls/volume-slider/volume-slider-value-expected.txt: Removed.
* media/modern-media-controls/volume-slider/volume-slider.html: Removed.
* media/modern-media-controls/volume-support/volume-support-click-expected.txt:
* media/modern-media-controls/volume-support/volume-support-click.html:
* media/modern-media-controls/volume-support/volume-support-drag-expected.txt:
* media/modern-media-controls/volume-support/volume-support-drag.html:
* media/modern-media-controls/volume-up-support/volume-up-support-expected.txt:
* media/modern-media-controls/volume-up-support/volume-up-support.html:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

23 months ago[Extra Zoom Mode] Implement support for indirect mainframe scrolling
wenson_hsieh@apple.com [Fri, 2 Feb 2018 17:44:36 +0000 (17:44 +0000)]
[Extra Zoom Mode] Implement support for indirect mainframe scrolling
https://bugs.webkit.org/show_bug.cgi?id=182421
<rdar://problem/35142694>

Reviewed by Tim Horton.

Makes a few small adjustments to WKScrollView to improve mainframe scrolling, and disable the pinch gesture for
zooming. See below for more details.

* UIProcess/API/Cocoa/WKWebView.mm:

Remove a now-unneeded WebKitAdditions import.

* UIProcess/ios/WKScrollView.mm:
(-[WKScrollView initWithFrame:]):

Add imports for -Before and -After versions of WKScrollViewAdditions.

(-[WKScrollView addGestureRecognizer:]):

Override -addGestureRecognizer here to prevent touches on the pinch gesture recognizer from being recognized.
I chose this approach instead of just disabling the gesture in -initWithFrame: because (1) the pinch gesture
recognizer is lazily created when setting minimum or maximum zoom scales, rather than immediately in
-initWithFrame:, and (2) even if we set the -enabled to NO, UIKit later resets it to YES in other codepaths.

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

23 months agoClearing a registration should null out its workers before setting their state to...
cdumez@apple.com [Fri, 2 Feb 2018 17:33:53 +0000 (17:33 +0000)]
Clearing a registration should null out its workers before setting their state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182418
<rdar://problem/37142874>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that all checks are passing. I verified that this test is passing
in both Firefox and Chrome.

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

Source/WebCore:

Clearing a registration should null out its workers before setting their state to "redundant".
This seems to match Firefox and Chrome.

No new tests, rebaselined existing test.

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::clear):
(WebCore::clearRegistrationWorker): Deleted.

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

23 months ago[GTK] WebDriver: tests step always times out in the bot
carlosgc@webkit.org [Fri, 2 Feb 2018 17:25:24 +0000 (17:25 +0000)]
[GTK] WebDriver: tests step always times out in the bot
https://bugs.webkit.org/show_bug.cgi?id=182437

Reviewed by Carlos Alberto Lopez Perez.

The process itself is not timing out, but the buildbot step is. This is because we are leaking the Xvfb
processes. We should ensure that only one driver is executed and it's stopped before the process finishes.

* Scripts/run-webdriver-tests: Call teardown() after run().
* Scripts/webkitpy/webdriver_tests/webdriver_selenium_executor.py:
(WebDriverSeleniumExecutor.__init__): Receive the env directly instead of the display driver.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner.py:
(WebDriverTestRunner.__init__): Use the driver class directly instead of using the DriverProxy. Get the env from
the display driver once and pass it to the test runners.
(WebDriverTestRunner.teardown): Stop the display server.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_selenium.py:
(WebDriverTestRunnerSelenium.__init__): Receive the env directly instead of the display driver.
(WebDriverTestRunnerSelenium.collect_tests): Pass the env to the executor.
(WebDriverTestRunnerSelenium.run): Ditto.
* Scripts/webkitpy/webdriver_tests/webdriver_test_runner_w3c.py:
(WebDriverTestRunnerW3C.__init__): Receive the env directly instead of the display driver.
(WebDriverTestRunnerW3C.run): Pass the env to the executor.
* Scripts/webkitpy/webdriver_tests/webdriver_w3c_executor.py:
(WebDriverW3CExecutor.__init__): Receive the env directly instead of the display driver.

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

23 months agoUnreviewed, rolling out r227999.
carlosgc@webkit.org [Fri, 2 Feb 2018 17:20:12 +0000 (17:20 +0000)]
Unreviewed, rolling out r227999.

It didn't fix the problem

Reverted changeset:

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

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

23 months ago[JSC] Clean up ArraySpeciesCreate
utatane.tea@gmail.com [Fri, 2 Feb 2018 17:12:23 +0000 (17:12 +0000)]
[JSC] Clean up ArraySpeciesCreate
https://bugs.webkit.org/show_bug.cgi?id=182434

Reviewed by Saam Barati.

We have duplicate code in filter, map, concatSlowPath.
This patch creates a new global private function @arraySpeciesCreate,
and use it.

* builtins/ArrayPrototype.js:
(globalPrivate.arraySpeciesCreate):
(filter):
(map):
(globalPrivate.concatSlowPath):

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

23 months agoJSTests: Skip mozilla/js1_5/Array/regress-157652.js on all memory limited platforms
guijemont@igalia.com [Fri, 2 Feb 2018 16:38:55 +0000 (16:38 +0000)]
JSTests: Skip mozilla/js1_5/Array/regress-157652.js on all memory limited platforms
https://bugs.webkit.org/show_bug.cgi?id=182411

Reviewed by Carlos Alberto Lopez Perez.

This is skipped only on arm memory limited platforms. Until recently
it was not a problem on MIPS as the butterfly was not initialized. But
since r227435, the butterfly is initialized in that test and therefore
memory is allocated, and the test typically takes around 512M, which
means it generally gets OOM-killed on the MIPS buildbot.

* mozilla/mozilla-tests.yaml:

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

23 months ago[Modern Media Controls] Turn media/modern-media-controls/tracks-panel and media/moder...
commit-queue@webkit.org [Fri, 2 Feb 2018 16:30:13 +0000 (16:30 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/tracks-panel and media/modern-media-controls/tracks-support back on
https://bugs.webkit.org/show_bug.cgi?id=182426

Patch by Antoine Quint <graouts@apple.com> on 2018-02-02
Reviewed by Dean Jackson.

Source/WebCore:

Ensure that the tracks panel isn't dismissed by updating the layout.

* Modules/modern-media-controls/controls/inline-media-controls.js:
(InlineMediaControls.prototype.layout):

LayoutTests:

Update tests to match the modern-media-controls design and expectations. One test fails currently due to an issue with the
auto-hide behavior, it is tracked in webkit.org/b/182425.

* media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it-expected.txt:
* media/modern-media-controls/tracks-panel/tracks-panel-controls-bar-remains-visible-after-clicking-over-it.html:
* media/modern-media-controls/tracks-panel/tracks-panel-position-and-size-expected.txt:
* media/modern-media-controls/tracks-panel/tracks-panel-position-and-size.html:
* media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading-expected.txt:
* media/modern-media-controls/tracks-panel/tracks-panel-prevent-controls-bar-from-fading.html:
* media/modern-media-controls/tracks-support/tracks-support-audio-tracks-expected.txt:
* media/modern-media-controls/tracks-support/tracks-support-audio-tracks.html:
* media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar-expected.txt:
* media/modern-media-controls/tracks-support/tracks-support-captions-offset-with-controls-bar.html:
* media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen-expected.txt:
* media/modern-media-controls/tracks-support/tracks-support-show-panel-fullscreen.html:
* media/modern-media-controls/tracks-support/tracks-support-text-tracks-expected.txt:
* media/modern-media-controls/tracks-support/tracks-support-text-tracks.html:
* platform/mac/TestExpectations:

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

23 months agoimagebitmap gardening
Ms2ger@igalia.com [Fri, 2 Feb 2018 15:24:11 +0000 (15:24 +0000)]
imagebitmap gardening
https://bugs.webkit.org/show_bug.cgi?id=182430

Unreviewed test gardening.

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

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

23 months ago[GTK][Wayland][WPE] fast/canvas/canvas-createPattern-video-modify.html failing
csaavedra@igalia.com [Fri, 2 Feb 2018 15:14:09 +0000 (15:14 +0000)]
[GTK][Wayland][WPE] fast/canvas/canvas-createPattern-video-modify.html failing
https://bugs.webkit.org/show_bug.cgi?id=182432

Unreviewed gardening.
* platform/gtk-wayland/TestExpectations:
* platform/wpe/TestExpectations:

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

23 months agoUnreviewed build fix for JSCOnly on macOS after r227845.
annulen@yandex.ru [Fri, 2 Feb 2018 15:02:04 +0000 (15:02 +0000)]
Unreviewed build fix for JSCOnly on macOS after r227845.
https://bugs.webkit.org/show_bug.cgi?id=182274

Reverted part of r227845 that moved CommonCryptoSPI.h
handling into PlatformMac, because it is needed for all
ports which can be built on macOS.

* wtf/CMakeLists.txt:
* wtf/PlatformMac.cmake:

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

23 months agoUnreviewed, rolling out r227964.
commit-queue@webkit.org [Fri, 2 Feb 2018 13:54:14 +0000 (13:54 +0000)]
Unreviewed, rolling out r227964.
https://bugs.webkit.org/show_bug.cgi?id=182423

It broke several unit tests (Requested by KaL on #webkit).

Reverted changeset:

"[SOUP] Ensure domain is valid when converting a WebCore
Cookie to Soup"
https://bugs.webkit.org/show_bug.cgi?id=182328
https://trac.webkit.org/changeset/227964

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

23 months agoStart timeout for the run-buildbot-test script is too aggressive
clopez@igalia.com [Fri, 2 Feb 2018 13:46:47 +0000 (13:46 +0000)]
Start timeout for the run-buildbot-test script is too aggressive
https://bugs.webkit.org/show_bug.cgi?id=182429

Reviewed by Carlos Garcia Campos.

15 seconds is not enough waiting for the update database process
to complete on a system backed with rotational HDDs. Raise it to 60.

* BuildSlaveSupport/build.webkit.org-config/run-buildbot-test.py:
(wait_for_master_ready):

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

23 months agore-add ARM JSCOnly bots on buildbot waterfall
clopez@igalia.com [Fri, 2 Feb 2018 12:36:16 +0000 (12:36 +0000)]
re-add ARM JSCOnly bots on buildbot waterfall
https://bugs.webkit.org/show_bug.cgi?id=182428

Reviewed by Csaba Osztrogonác.

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

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

23 months agoUpdate imagebitmap tests.
Ms2ger@igalia.com [Fri, 2 Feb 2018 12:33:51 +0000 (12:33 +0000)]
Update imagebitmap tests.
https://bugs.webkit.org/show_bug.cgi?id=182335
<rdar://problem/37110684>

Unreviewed test gardening.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/common.sub.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/common.js.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html: Added.
* web-platform-tests/2dcontext/imagebitmap/w3c-import.log:
* web-platform-tests/common/namespaces.js: Added.
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/images/pattern.mp4: Added.
* web-platform-tests/images/pattern.svg: Added.
* web-platform-tests/images/w3c-import.log:

LayoutTests:

* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Removed.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: Added.
* platform/mac/TestExpectations:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Removed.
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: Added.

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

23 months agoRemove ARM JSCOnly bots from buildbot waterfall
ossy@webkit.org [Fri, 2 Feb 2018 12:19:26 +0000 (12:19 +0000)]
Remove ARM JSCOnly bots from buildbot waterfall
https://bugs.webkit.org/show_bug.cgi?id=182398

Reviewed by Alexey Proskuryakov.

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

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

23 months ago[GTK] fast/events/message-channel-gc-4.html is flaky
commit-queue@webkit.org [Fri, 2 Feb 2018 10:53:30 +0000 (10:53 +0000)]
[GTK] fast/events/message-channel-gc-4.html is flaky
https://bugs.webkit.org/show_bug.cgi?id=182104

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-02
Reviewed by Carlos Garcia Campos.

Source/WTF:

RELEASE_ASSERT of ThreadSpecific::set fails because
RunLoop::current is called even in GC thread since r227275.

* wtf/RunLoop.cpp:
(WTF::RunLoop::current):
Let the second template argument of ThreadSpecific CanBeGCThread::True.

LayoutTests:

* platform/gtk/TestExpectations:
Unmarked fast/events/message-channel-gc-4.html and fast/workers/worker-cloneport.html.

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

23 months agoUnreviewed. Update Selenium WebDriver imported tests.
carlosgc@webkit.org [Fri, 2 Feb 2018 09:24:22 +0000 (09:24 +0000)]
Unreviewed. Update Selenium WebDriver imported tests.

* imported/selenium/importer.json:
* imported/selenium/py/selenium/__init__.py:
* imported/selenium/py/selenium/webdriver/remote/errorhandler.py:
* imported/selenium/py/selenium/webdriver/remote/remote_connection.py:
* imported/selenium/py/test/selenium/webdriver/common/alerts_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/click_scrolling_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/correct_event_firing_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/driver_element_finding_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/element_attribute_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/executing_async_javascript_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/frame_switching_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/interactions_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/page_load_timeout_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/page_loading_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/rendered_webelement_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/stale_reference_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/webdriverwait_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/window_switching_tests.py:
* imported/selenium/py/test/selenium/webdriver/common/window_tests.py:

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

23 months agoUnreviewed. Try to avoid webdriver tests step timing out in the bots.
carlosgc@webkit.org [Fri, 2 Feb 2018 08:47:38 +0000 (08:47 +0000)]
Unreviewed. Try to avoid webdriver tests step timing out in the bots.

This is another speculative workaround. Carlos Lopez suggested to use os._exit() instead of sys.exit() as a
workaround for a bug in python2.7 when using multiprocess module.

* Scripts/run-webdriver-tests:

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

23 months agoFix broken bounds check in FTL's compileGetMyArgumentByVal().
mark.lam@apple.com [Fri, 2 Feb 2018 07:30:30 +0000 (07:30 +0000)]
Fix broken bounds check in FTL's compileGetMyArgumentByVal().
https://bugs.webkit.org/show_bug.cgi?id=182419
<rdar://problem/37044945>

Reviewed by Saam Barati.

JSTests:

* stress/regress-182419.js: Added.

Source/JavaScriptCore:

In compileGetMyArgumentByVal(), it computes:
    limit = m_out.sub(limit, m_out.constInt32(m_node->numberOfArgumentsToSkip()));
    ...
    LValue isOutOfBounds = m_out.aboveOrEqual(originalIndex, limit);

where the original "limit" is the number of arguments passed in by the caller.
If the original limit is less than numberOfArgumentsToSkip, the resultant limit
will be a large unsigned number.  As a result, this will defeat the bounds check
that follows it.

Note: later on in compileGetMyArgumentByVal(), we have to adjust adjust the index
value by adding numberOfArgumentsToSkip to it, in order to determine the actual
entry in the arguments array to get.

The fix is to just add numberOfArgumentsToSkip to index upfront (instead of
subtracting it from limit), and doing an overflow speculation check on that
addition before doing the bounds check.

* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetMyArgumentByVal):

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

23 months agoWhen SW install fails, null out registration.installing before setting worker state...
cdumez@apple.com [Fri, 2 Feb 2018 07:09:25 +0000 (07:09 +0000)]
When SW install fails, null out registration.installing before setting worker state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182416
<rdar://problem/37141997>

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline WPT test now that one more check is passing.

* web-platform-tests/service-workers/service-worker/register-same-scope-different-script-url.https-expected.txt:

Source/WebCore:

When SW install fails, null out registration.installing before setting worker state to "redundant".
This does not match the spec but this is what Firefox and Chrome do. This is also what the
web-platform-tests expect.

Test: http/tests/workers/service/install-fails.html

* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::didFinishInstall):

LayoutTests:

Add layout test coverage. I have verified that this test is passing in both Firefox and Chrome.

* http/tests/workers/service/install-fails-expected.txt: Added.
* http/tests/workers/service/install-fails.html: Added.
* http/tests/workers/service/resources/install-fails-worker.js: Added.
(event.event.waitUntil.new.Promise):

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

23 months agoCreate BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format
aakash_jain@apple.com [Fri, 2 Feb 2018 07:06:19 +0000 (07:06 +0000)]
Create BuildbotBuildEntry in Buildbot syncer in Buildbot 0.9 format
https://bugs.webkit.org/show_bug.cgi?id=182036

Reviewed by Ryosuke Niwa.

* tools/js/buildbot-syncer.js:
(BuildbotBuildEntry): Class for Buildbot entry in Buildbot 0.9 data format.
(BuildbotBuildEntryDeprecated): Renamed from BuildbotBuildEntry, sub-classed from BuildBotEntry. Handles Buildbot 0.8 data format.
(BuildbotBuildEntryDeprecated.prototype.url): URL in buildbot 0.8 format.
(BuildbotSyncer.prototype.builderID): Added.
(BuildbotSyncer.prototype.pathForPendingBuildsJSONDeprecated): Renamed from BuildbotSyncer.prototype.pathForPendingBuildsJSON.
(BuildbotSyncer.prototype.pathForPendingBuilds): Path for pending builds in Buildbot 0.9 format.
(BuildbotSyncer.prototype.urlForBuildNumberDeprecated): Deprecated. Renamed from urlForBuildNumber.
(BuildbotSyncer.prototype.urlForBuildNumber): Updated in Buildbot 0.9 format.
(BuildbotSyncer.prototype.urlForPendingBuild): Buildbot 0.9 has individual webpage for pending buildrequests as well. URL to that page.
* unit-tests/buildbot-syncer-tests.js: Renamed BuildbotBuildEntry to BuildbotBuildEntryDeprecated.
(sampleBuildData): Sample build data. Common method for in-progress and finished build data.
(samplePendingBuildData): Sample data for a pending build. Separate method so that we can easily create sample data with multiple builds.
(sampleInProgressBuildData): Ditto for in-progress build.
(sampleFinishedBuildData): Ditto for finished build.
(samplePendingBuild): Sample data for single pending build.
(sampleInProgressBuild): Ditto for in-progress build.
(sampleFinishedBuild): Ditto for finished build.
(samplePendingBuildDeprecated): Renamed from samplePendingBuild.
(sampleInProgressBuildDeprecated): Renamed from sampleInProgressBuild.
(sampleFinishedBuildDeprecated): Renamed from sampleFinishedBuild.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for pending build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for in-progress build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for finished build.
(BuildbotBuildEntry.it: Added unit-test for creating BuildbotBuildEntry for mix of in-progress and finished build.

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

23 months agoTest fix after r227848.
mmaxfield@apple.com [Fri, 2 Feb 2018 04:46:23 +0000 (04:46 +0000)]
Test fix after r227848.
https://bugs.webkit.org/show_bug.cgi?id=180951

Unreviewed.

Using kCTFontNameAttribute on an in-memory font causes CTFontDescriptorCreateMatchingFontDescriptor()
to return nullptr. Luckily, we weren't using that attribute anyway.

Covered by existing tests.

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

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

23 months agoFix crashes due to mishandling custom sections.
keith_miller@apple.com [Fri, 2 Feb 2018 04:30:37 +0000 (04:30 +0000)]
Fix crashes due to mishandling custom sections.
https://bugs.webkit.org/show_bug.cgi?id=182404
<rdar://problem/36935863>

Reviewed by Saam Barati.

JSTests:

* wasm/Builder.js:
(export.default.Builder.prototype._registerSectionBuilders.const.section.in.WASM.description.section.switch.section.case.string_appeared_here.this.section):
* wasm/js-api/validate.js:
(assert.truthy):

Source/JavaScriptCore:

This also cleans up some of our validation code. We also
mistakenly, allowed unknown (different from custom sections with
id: 0) section ids.

* wasm/WasmModuleParser.cpp:
(JSC::Wasm::ModuleParser::parse):
* wasm/WasmModuleParser.h:
* wasm/WasmSections.h:
(JSC::Wasm::isKnownSection):
(JSC::Wasm::decodeSection):
(JSC::Wasm::validateOrder):
(JSC::Wasm::makeString):
(JSC::Wasm::isValidSection): Deleted.

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

23 months agoWebKit fails to build (_startAssistingNode has conflicting parameters)
timothy_horton@apple.com [Fri, 2 Feb 2018 04:20:48 +0000 (04:20 +0000)]
WebKit fails to build (_startAssistingNode has conflicting parameters)
https://bugs.webkit.org/show_bug.cgi?id=182417
<rdar://problem/36965318>

Reviewed by Dan Bernstein.

* UIProcess/ios/WKContentViewInteraction.h:
Use Big BOOL like in the implementation.

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

23 months agoFix race-condition in fast/forms/ios/ipad/select-form-run-twice.html
megan_gardner@apple.com [Fri, 2 Feb 2018 02:13:40 +0000 (02:13 +0000)]
Fix race-condition in fast/forms/ios/ipad/select-form-run-twice.html
https://bugs.webkit.org/show_bug.cgi?id=182370

Reviewed by Tim Horton.

There is the potential for multiple button clicks, due to looping function calls that can cause timed functions to
still be running in the next test, causing crashes. Guarding against repeated clicks, and cancelling the timers should
clean up this problem.

* fast/forms/ios/ipad/select-form-run-twice.html:
* fast/forms/ios/ipad/unfocus-inside-fixed-hittest.html:

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

23 months agoImprove NetworkResourceLogger to report blocked (versus non-partitioned) cookies
bfulgham@apple.com [Fri, 2 Feb 2018 00:54:43 +0000 (00:54 +0000)]
Improve NetworkResourceLogger to report blocked (versus non-partitioned) cookies
https://bugs.webkit.org/show_bug.cgi?id=182408
<rdar://problem/36918028>

Reviewed by Chris Dumez.

Update the logging method to report blocked origins, rather than logging them as non-partitioned
loads that have no cookies or other content.

* NetworkProcess/NetworkResourceLoader.cpp:
(WebKit::NetworkResourceLoader::logCookieInformation const):

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

23 months agoREGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem...
ddkilzer@apple.com [Fri, 2 Feb 2018 00:40:31 +0000 (00:40 +0000)]
REGRESSION (r222824): UI process crashes in WebKit::WebBackForwardList::backItem const
<https://webkit.org/b/182409>
<rdar://problem/35495094>

Reviewed by Alex Christensen.

* UIProcess/WebBackForwardList.cpp:
(WebKit::WebBackForwardList::goToItem): Fix typo so the for loop
actually checks each value in m_entries.

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

23 months agoDelay service worker process creation until actually needed by SWServer
commit-queue@webkit.org [Fri, 2 Feb 2018 00:25:12 +0000 (00:25 +0000)]
Delay service worker process creation until actually needed by SWServer
https://bugs.webkit.org/show_bug.cgi?id=182301

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

Source/WebCore:

Rename SWServer::Connection::scheduleJobInServer to scheduleJob.
Add sessionID getter from an SWServer.

* workers/service/server/SWServer.h:
(WebCore::SWServer::sessionID const):

Source/WebKit:

Do not create a service worker process at creation of the first SWServerConnection.
Wait for a WebProcess message that needs it:
- postMessage message
- fetchEvent message
- job scheduling.

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
(WebKit::WebSWServerConnection::scheduleJobInServer):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::establishSWServerConnection):

Tools:

* TestWebKitAPI/Tests/WebKitCocoa/ServiceWorkerBasic.mm:
(function):

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

23 months agoREGRESSION(r227594) [WinCairo] NULL pointer crash in GraphicsContext::getWindowsContext
commit-queue@webkit.org [Fri, 2 Feb 2018 00:16:50 +0000 (00:16 +0000)]
REGRESSION(r227594) [WinCairo] NULL pointer crash in GraphicsContext::getWindowsContext
https://bugs.webkit.org/show_bug.cgi?id=182282

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2018-02-01
Reviewed by Žan Doberšek.

ImageBufferCairo has been changed to use GraphicsContextImplCairo
in r227594. But, GraphicsContext::getWindowsContext doesn't care
the case of using GraphicsContextImpl and crashes due to null
dereference of GraphicsContext::m_data.

GraphicsContext::getWindowsContext should create a HDC in that case.

Remove the argument mayCreateBitmap because it is always
true at the moment.

No new tests (Covered by the existing tests)

* platform/graphics/GraphicsContext.h:
Removed a argument mayCreateBitmap of getWindowsContext and releaseWindowsContext.
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Ditto.
* platform/graphics/win/GraphicsContextCairoWin.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Ditto.
* platform/graphics/win/GraphicsContextDirect2D.cpp:
(WebCore::GraphicsContext::releaseWindowsContext): Ditto.
* platform/graphics/win/GraphicsContextWin.cpp:
(WebCore::GraphicsContext::getWindowsContext):
Create a HDC if m_impl is null. Removed a argument mayCreateBitmap.
* platform/graphics/win/LocalWindowsContext.h:
(WebCore::LocalWindowsContext::LocalWindowsContext):
Removed m_mayCreateBitmap.
(WebCore::LocalWindowsContext::~LocalWindowsContext): Ditto.

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

23 months ago[Curl] Use SQLite database in cookie jar implementation for Curl port
commit-queue@webkit.org [Fri, 2 Feb 2018 00:08:41 +0000 (00:08 +0000)]
[Curl] Use SQLite database in cookie jar implementation for Curl port
https://bugs.webkit.org/show_bug.cgi?id=174942

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

No new tests, Set-Cookie is already tested in Layout tests.

Adding an initial SQLite CookieJar implementation to the curl network layer.
WebCore will now parse and handle both HTTP and DOM cookies instead of using libcurl.
This currently supports cookie storage and retrieval.
Cookie deletion is not yet implemented.

* platform/Curl.cmake:
* platform/network/NetworkStorageSession.h: Added cookieDB storage in curl.
* platform/network/curl/CookieJarCurl.cpp: Removed the old curl cookie handling.
* platform/network/curl/CookieJarCurl.h:
* platform/network/curl/CookieJarCurlDatabase.cpp: Added.
* platform/network/curl/CookieJarCurlDatabase.h: Added.
* platform/network/curl/CookieJarDB.cpp: Added.
* platform/network/curl/CookieJarDB.h: Added.
* platform/network/curl/CookieUtil.cpp: Added.
* platform/network/curl/CookieUtil.h: Added.
* platform/network/curl/CurlContext.cpp: Removed the old curl cookie handling.
* platform/network/curl/CurlContext.h:
* platform/network/curl/CurlRequest.cpp: Added handlers for HTTP response cookies.
* platform/network/curl/NetworkStorageSessionCurl.cpp:
* platform/network/curl/ResourceHandleCurlDelegate.cpp:

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

23 months agoSkipped http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interactio...
jlewis3@apple.com [Thu, 1 Feb 2018 23:42:47 +0000 (23:42 +0000)]
Skipped http/tests/resourceLoadStatistics/non-prevalent-resource-with-user-interaction.html on macOS WK2.
https://bugs.webkit.org/show_bug.cgi?id=182366

Unreviewed test gardening.

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

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

23 months agoAdd missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
cdumez@apple.com [Thu, 1 Feb 2018 23:33:19 +0000 (23:33 +0000)]
Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>()
https://bugs.webkit.org/show_bug.cgi?id=182392
<rdar://problem/37119215>

Reviewed by Geoffrey Garen.

LayoutTests/imported/w3c:

Rebaseline WPT test now that all checks are passing.

* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event-constructor.https-expected.txt:

Source/WebCore:

Add missing RETURN_IF_EXCEPTION() after object->get() calls in convertDictionary<>(),
given that getting the property from the object can throw an exception.

No new tests, rebaselined existing test.

* bindings/scripts/CodeGeneratorJS.pm:
(GenerateDictionaryImplementationContent):
* bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
(WebCore::convertDictionary<TestCallbackInterface::Dictionary>):
* bindings/scripts/test/JS/JSTestEventConstructor.cpp:
(WebCore::convertDictionary<TestEventConstructor::Init>):
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::convertDictionary<TestObj::Dictionary>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldNotTolerateNull>):
(WebCore::convertDictionary<TestObj::DictionaryThatShouldTolerateNull>):
(WebCore::convertDictionary<AlternateDictionaryName>):
(WebCore::convertDictionary<TestObj::ParentDictionary>):
(WebCore::convertDictionary<TestObj::ChildDictionary>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryA>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryB>):
(WebCore::convertDictionary<TestObj::ConditionalDictionaryC>):
* bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
(WebCore::convertDictionary<TestPromiseRejectionEvent::Init>):
* bindings/scripts/test/JS/JSTestStandaloneDictionary.cpp:
(WebCore::convertDictionary<DictionaryImplName>):

LayoutTests:

Rebaseline existing test now that output is slightly different.

* fast/events/constructors/message-event-constructor-expected.txt:

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

23 months ago[Extra zoom mode] Implement basic support for interacting with text form controls
wenson_hsieh@apple.com [Thu, 1 Feb 2018 23:17:22 +0000 (23:17 +0000)]
[Extra zoom mode] Implement basic support for interacting with text form controls
https://bugs.webkit.org/show_bug.cgi?id=182401
<rdar://problem/35143035>

Reviewed by Tim Horton.

Add UI support for interacting with and editing text form controls when extra zoom mode is enabled. See below
for more details.

* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration encodeWithCoder:]):
(-[WKWebViewConfiguration initWithCoder:]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _textInteractionGesturesEnabled]):
(-[WKWebViewConfiguration _setTextInteractionGesturesEnabled:]):
(-[WKWebViewConfiguration _longPressActionsEnabled]):
(-[WKWebViewConfiguration _setLongPressActionsEnabled:]):

Introduce two new web view configuration flags: `textInteractionGesturesEnabled` and `longPressActionsEnabled`.
The former determines whether text interaction gestures (i.e. text selection, moving the caret, showing UI for
IME, etc.) are enabled. The latter determines whether or not long press actions (i.e. touch callout, share
sheet, etc.) are enabled. These are disabled by default only in extra zoom mode.

* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::setTextAsync):

Add a way to set the text value of a currently edited text form control. This will either set the text value of
an input, a. la. autofill, or overwrite the contents of a contenteditable area by selecting everything and
inserting the given text.

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::focusNextAssistedNode):

Add a default argument for the completion callback.

* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _displayFormNodeInputView]):
(-[WKContentView _actionForLongPressFromPositionInformation:]):
(-[WKContentView hasSelectablePositionAtPoint:]):
(-[WKContentView pointIsNearMarkedText:]):
(-[WKContentView textInteractionGesture:shouldBeginAtPoint:]):
(-[WKContentView insertionPointColor]):

Respect the web view configuration flags above by bailing early from text interaction and long press action
sheet methods.

(-[WKContentView _startAssistingKeyboard]):
(-[WKContentView _startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:]):

Add a flag indicating whether we are in the process of changing focus from one node to another. We use this to
decide whether or not we want to present the text input view controller right away, or just reload the focused
form control overlay. When we stop "assisting" a node, we also keep the focused form control overlay up if we're
only changing focus to another form control.

(-[WKContentView _stopAssistingNode]):
(-[WKContentView presentFocusedFormControlViewController:]):
(-[WKContentView dismissFocusedFormControlViewController:]):
(-[WKContentView shouldPresentTextInputViewController:]):
(-[WKContentView presentTextInputViewController:]):
(-[WKContentView dismissTextInputViewController:]):

Introduce helpers for managing presentation of the focused form control overlay and text input view controller.
All -present and -dismiss helpers here are idempotent. These view controllers are presented from the content
view's view controller for fullscreen presentation.

(-[WKContentView textInputController:didCommitText:]):
(-[WKContentView textInputController:didRequestDismissalWithAction:]):
(-[WKContentView focusedFormControlControllerDidSubmit:]):
(-[WKContentView focusedFormControlControllerDidCancel:]):
(-[WKContentView focusedFormControlControllerDidBeginEditing:]):
(-[WKContentView highlightedRectForFocusedFormControlController:inCoordinateSpace:]):
(-[WKContentView actionNameForFocusedFormControlController:]):
(-[WKContentView focusedFormControlControllerDidRequestNextNode:]):
(-[WKContentView focusedFormControlControllerDidRequestPreviousNode:]):
(-[WKContentView hasNextNodeForFocusedFormControlController:]):
(-[WKContentView hasPreviousNodeForFocusedFormControlController:]):

Implement delegate methods for the focused form control and text input view controllers. This mainly involves
straightforward plumbing of pieces of AssistedNodeInformation on the content view.

(-[WKContentView pointIsInAssistedNode:]): Deleted.

Remove a method that was still implemented only for binary compatibility with iOS 10.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setTextAsync):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:

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

23 months agoSome test cases in accessibility/mac/selection-notification-focus-change.html fail
rniwa@webkit.org [Thu, 1 Feb 2018 23:11:13 +0000 (23:11 +0000)]
Some test cases in accessibility/mac/selection-notification-focus-change.html fail
https://bugs.webkit.org/show_bug.cgi?id=182212
<rdar://problem/36937147>

Reviewed by Antti Koivisto and Wenson Hsieh.

Source/WebCore:

The failure was caused by the async update of the selection appearance not preserving selection reveal intent.
Fixed the bug by storing the intent in a member variable and using it later.

* dom/Element.cpp:
(WebCore::Element::focus): Removed an unnecessary synchronous layout update.
* editing/FrameSelection.cpp:
(WebCore::FrameSelection::setNeedsSelectionUpdate): Use the default intent to preserve the old behavior.
(WebCore::FrameSelection::respondToNodeModification): Ditto.
(WebCore::FrameSelection::setSelection): Save the selection reveal intent.
(WebCore::FrameSelection::updateAppearanceAfterLayoutOrStyleChange): Use the saved intent.
* editing/FrameSelection.h:
* page/FocusController.cpp:
(WebCore::FocusController::advanceFocusDirectionally): Always update the layout before invoking
nodeRectInAbsoluteCoordinates.

LayoutTests:

Updated and rebaselined the tests.

* accessibility/ios-simulator/header-elements.html: Force the layout after each call to element.focus
now that element.focus no longer updates the layout synchronously. Ordinarily, this will happen next time
the layout is updated for paint, by JS API, etc... but we have to force the accessibility tree to be
up-to-date for testing purposes.
* accessibility/ios-simulator/table-cell-for-row-col.html: Ditto.
* accessibility/mac/selection-notification-focus-change-expected.txt: Now all the test cases are passing.
* accessibility/mac/table-with-row-col-of-headers.html: Force the layout after each call to element.focus.
* accessibility/mac/table-with-zebra-rows.html: Ditto.
* accessibility/scroll-to-global-point-main-window.html: Ditto.
* accessibility/scroll-to-make-visible-with-subfocus.html: Ditto.
* editing/input/caret-at-the-edge-of-input.html: Wait for the focused element to reveal itself by a timer.
* fast/forms/input-text-scroll-left-on-blur.html: Ditto.
* fast/forms/textarea-no-scroll-on-blur.html: Ditto.
* fast/forms/textarea-scrolled-type.html: Ditto.
* platform/mac-wk2/accessibility/mac/selection-notification-focus-change-expected.txt: Rebaselined. We now
get one less AXTextSelectionChangedFocus notification because selection updates are now coalesced as expected.

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

23 months ago[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
zalan@apple.com [Thu, 1 Feb 2018 21:48:36 +0000 (21:48 +0000)]
[RenderTreeBuilder] Move RenderRubyRun::rubyBaseSafe to RenderTreeBuilder::Ruby
https://bugs.webkit.org/show_bug.cgi?id=182306
<rdar://problem/37041440>

Reviewed by Darin Adler.

Addressing post-review comment.

* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):
(WebCore::RenderTreeBuilder::Ruby::rubyBaseSafe):
* rendering/updating/RenderTreeBuilderRuby.h:

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

23 months ago[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls...
graouts@webkit.org [Thu, 1 Feb 2018 20:30:04 +0000 (20:30 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/ios-inline-media-controls back on
https://bugs.webkit.org/show_bug.cgi?id=182390

Reviewed by Eric Carlson.

Update tests to match the modern-media-controls design and expectations.

* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding-expected.txt: Removed.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-button-padding.html: Removed.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles-expected.txt: Removed.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-buttons-styles.html: Removed.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-constructor-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-constructor.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-controls-bar-styles-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-controls-bar-styles.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-layout.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label-enabled-hidden-controls-bar-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label-enabled-hidden-controls-bar.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-status-label.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding-expected.txt: Removed.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-tight-padding.html: Removed.
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-time-control-styles-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-time-control-styles.html:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-dropping-controls-expected.txt:
* media/modern-media-controls/ios-inline-media-controls/ios-inline-media-dropping-controls.html:
* platform/ios/TestExpectations:

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

23 months agoUnreviewed, rebaseline imported/w3c/web-platform-tests/service-workers/service-worker...
cdumez@apple.com [Thu, 1 Feb 2018 19:47:28 +0000 (19:47 +0000)]
Unreviewed, rebaseline imported/w3c/web-platform-tests/service-workers/service-worker/performance-timeline.https.html

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/service-worker/performance-timeline.https-expected.txt:

LayoutTests:

* TestExpectations:

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

23 months ago[RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild()
zalan@apple.com [Thu, 1 Feb 2018 19:42:32 +0000 (19:42 +0000)]
[RenderTreeBuilder] Introduce RenderTreeBuilder to takeChild()
https://bugs.webkit.org/show_bug.cgi?id=182373
<rdar://problem/37101484>

Reviewed by Antti Koivisto.

This is in preparation for moving mutation code out of takeChild.

No change in functionality.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::takeChild):
* rendering/RenderBlock.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::takeChild):
* rendering/RenderBlockFlow.h:
* rendering/RenderButton.cpp:
(WebCore::RenderButton::takeChild):
* rendering/RenderButton.h:
* rendering/RenderElement.cpp:
(WebCore::RenderElement::takeChild):
(WebCore::RenderElement::removeAndDestroyChild):
(WebCore::RenderElement::destroyLeftoverChildren):
* rendering/RenderElement.h:
* rendering/RenderFullScreen.cpp:
(WebCore::RenderFullScreen::wrapExistingRenderer):
(WebCore::RenderFullScreen::unwrapRenderer):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::takeChild):
* rendering/RenderGrid.h:
* rendering/RenderMenuList.cpp:
(RenderMenuList::takeChild):
* rendering/RenderMenuList.h:
* rendering/RenderMultiColumnFlow.cpp:
(WebCore::RenderMultiColumnFlow::processPossibleSpannerDescendant):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::removeFromParentAndDestroy):
* rendering/RenderRuby.cpp:
(WebCore::RenderRubyAsInline::takeChild):
(WebCore::RenderRubyAsBlock::takeChild):
* rendering/RenderRuby.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::takeChild):
* rendering/RenderRubyRun.h:
* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
* rendering/RenderTableRow.h:
* rendering/svg/RenderSVGContainer.cpp:
(WebCore::RenderSVGContainer::takeChild):
* rendering/svg/RenderSVGContainer.h:
* rendering/svg/RenderSVGInline.cpp:
(WebCore::RenderSVGInline::takeChild):
* rendering/svg/RenderSVGInline.h:
* rendering/svg/RenderSVGRoot.cpp:
(WebCore::RenderSVGRoot::takeChild):
* rendering/svg/RenderSVGRoot.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::takeChild):
* rendering/svg/RenderSVGText.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::collapseAndDestroyAnonymousSiblingRows):
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilder.h:
* rendering/updating/RenderTreeBuilderFirstLetter.cpp:
(WebCore::RenderTreeBuilder::FirstLetter::updateStyle):
(WebCore::RenderTreeBuilder::FirstLetter::createRenderers):
* rendering/updating/RenderTreeBuilderList.cpp:
(WebCore::RenderTreeBuilder::List::updateItemMarker):
* rendering/updating/RenderTreeBuilderMultiColumn.cpp:
(WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
(WebCore::RenderTreeBuilder::MultiColumn::destroyFragmentedFlow):
* rendering/updating/RenderTreeBuilderRuby.cpp:
(WebCore::RenderTreeBuilder::Ruby::insertChild):

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

23 months ago[WPE][GTK] Make RunLoop::TimerBase robust to its own deletion inside its source callback
mcatanzaro@igalia.com [Thu, 1 Feb 2018 19:41:11 +0000 (19:41 +0000)]
[WPE][GTK] Make RunLoop::TimerBase robust to its own deletion inside its source callback
https://bugs.webkit.org/show_bug.cgi?id=182271

Reviewed by Carlos Garcia Campos.

RunLoopTimer::fired executes the user's callback, which could delete the RunLoopTimer
itself. But the source callback is not prepared to handle this case. We can detect it
easily, because TimerBase's destructor will call g_source_destroy(), which confusingly
removes the GSource from its GMainContext without actually destroying the GSource. Then we
can check if the GSource is still attached using g_source_is_destroyed().

* wtf/glib/RunLoopGLib.cpp:
(WTF::RunLoop::TimerBase::TimerBase):

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

23 months agoFollowup test expectation adjustment from r227947.
jlewis3@apple.com [Thu, 1 Feb 2018 19:07:48 +0000 (19:07 +0000)]
Followup test expectation adjustment from r227947.

Unreviewed test expectations.

* platform/ios-simulator/TestExpectations:

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

23 months agoREGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the...
dino@apple.com [Thu, 1 Feb 2018 18:59:38 +0000 (18:59 +0000)]
REGRESSION (r219342): Scaled HTML widget is not responding to a clicks outside the body
https://bugs.webkit.org/show_bug.cgi?id=182394
<rdar://problem/34840816>

Reviewed by Simon Fraser.

Source/WebCore:

If a scale < 1 is applied to the page, then the visual viewport will be bigger
than the layout viewport. Our hit testing code would then ignore any hits
that were outside the layout viewport.

The fix is to only apply a hit testing clip if the page is scaling up, not down.

Update the existing fast/dom/elementFromPoint-scaled-scrolled.html test.

* page/FrameView.cpp:
(WebCore::FrameView::layoutViewportToAbsoluteRect const): Deleted. This helper is
no longer used, and it would have probably been more confusing to have it accept
a flag to ignore the scale if it is less than 1.
* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::hitTest): No need to take the layout rect, remove the origin,
and pass it to a helper that added the origin back. The only thing the helper was
doing for us was applying a scale factor, which we only want to do if it was
scaling up.

LayoutTests:

Add a test for a scaled down page.

* fast/dom/elementFromPoint-scaled-scrolled-expected.txt:
* fast/dom/elementFromPoint-scaled-scrolled.html:

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

23 months agoUnreviewed, rolling out r227958 and r227972.
jlewis3@apple.com [Thu, 1 Feb 2018 18:31:06 +0000 (18:31 +0000)]
Unreviewed, rolling out r227958 and r227972.
https://bugs.webkit.org/show_bug.cgi?id=182393

This caused a consistent crash on macOS. (Requested by
mlewis13 on #webkit).

Reverted changesets:

"Update imagebitmap tests."
https://bugs.webkit.org/show_bug.cgi?id=182335
https://trac.webkit.org/changeset/227958

"[WPE] Update test expectations for r227958"
https://bugs.webkit.org/show_bug.cgi?id=182391
https://trac.webkit.org/changeset/227972

Patch by Commit Queue <commit-queue@webkit.org> on 2018-02-01

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

23 months ago[WPE] Update test expectations for r227958
Ms2ger@igalia.com [Thu, 1 Feb 2018 18:01:28 +0000 (18:01 +0000)]
[WPE] Update test expectations for r227958
https://bugs.webkit.org/show_bug.cgi?id=182391

Unreviewed test gardening.

* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Removed.
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/wpe/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: Added.

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

23 months agoBubbles intermittently disappear from bot watchers dashboard
aakash_jain@apple.com [Thu, 1 Feb 2018 17:30:26 +0000 (17:30 +0000)]
Bubbles intermittently disappear from bot watchers dashboard
https://bugs.webkit.org/show_bug.cgi?id=182085

Reviewed by Alexey Proskuryakov.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
(BuildbotIteration.prototype.failureLogURL): failureLogURL doesn't depend on step in Buildbot 0.9.
Return the Build Page URL for Buildbot Buildbot 0.9. Earlier code was also doing the same using a
confusing if (!this._firstFailedStep.logs) statement which is always false for Buildbot 0.9.

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

23 months ago-Wreturn-type warning in DFGObjectAllocationSinkingPhase.cpp
mcatanzaro@igalia.com [Thu, 1 Feb 2018 17:27:06 +0000 (17:27 +0000)]
-Wreturn-type warning in DFGObjectAllocationSinkingPhase.cpp
https://bugs.webkit.org/show_bug.cgi?id=182389

Reviewed by Yusuke Suzuki.

Fix the warning.

As a bonus, remove a couple unreachable breaks for good measure.

* dfg/DFGObjectAllocationSinkingPhase.cpp:

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

23 months agoStructured cloning a Symbol should throw
utatane.tea@gmail.com [Thu, 1 Feb 2018 17:22:35 +0000 (17:22 +0000)]
Structured cloning a Symbol should throw
https://bugs.webkit.org/show_bug.cgi?id=182380

Reviewed by Darin Adler.

Source/WebCore:

Test: js/dom/post-message-symbol.html

* bindings/js/SerializedScriptValue.cpp:
(WebCore::CloneSerializer::dumpIfTerminal):
Structured cloning should throw "DataCloneError" DOMException if it finds Symbol.
Remove unused `isNumber()` case. It is done in dumpImmediate.
(WebCore::CloneSerializer::serializeUndefined): Deleted.
(WebCore::CloneSerializer::serializeBoolean): Deleted.
(WebCore::CloneSerializer::serializeNumber): Deleted.
Remove unused functions.

LayoutTests:

* js/dom/post-message-symbol-expected.txt: Added.
* js/dom/post-message-symbol.html: Added.

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

23 months ago[Modern Media Controls] Turn media/modern-media-controls/macos-fullscreen-media-contr...
commit-queue@webkit.org [Thu, 1 Feb 2018 17:20:24 +0000 (17:20 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/macos-fullscreen-media-controls back on
https://bugs.webkit.org/show_bug.cgi?id=182385

Patch by Antoine Quint <graouts@apple.com> on 2018-02-01
Reviewed by Eric Carlson.

Update tests to match the modern-media-controls design and expectations.

* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-containers-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-buttons-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-constructor.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-controls-bar-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-right-container-margin.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-time-control-styles.html:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles-expected.txt:
* media/modern-media-controls/macos-fullscreen-media-controls/macos-fullscreen-media-controls-volume-styles.html:
* platform/mac/TestExpectations:

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

23 months agoWe no longer need to queue service worker jobs until the connection to the service...
cdumez@apple.com [Thu, 1 Feb 2018 17:10:18 +0000 (17:10 +0000)]
We no longer need to queue service worker jobs until the connection to the service worker process has been established
https://bugs.webkit.org/show_bug.cgi?id=182375

Reviewed by Youenn Fablet.

We no longer need to queue service worker jobs until the connection to the service worker process
has been established. We initially did this to work around the fact that registrations restored
from disk would not have an active worker until the service worker process had been established.
However, this issue has been fixed in r227696.

This is basically a revert of r227220, which is no longer needed after r227696.

No new tests, initial fix was covered by an API test that still passes.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::scheduleJob):
(WebCore::SWServer::serverToContextConnectionCreated):
* workers/service/server/SWServer.h:

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

23 months ago[GTK] Shift + mouse scroll should scroll horizontally
carlosgc@webkit.org [Thu, 1 Feb 2018 16:04:09 +0000 (16:04 +0000)]
[GTK] Shift + mouse scroll should scroll horizontally
https://bugs.webkit.org/show_bug.cgi?id=181629

Reviewed by Michael Catanzaro.

Source/WebCore:

We currently turn vertical scroll into horizontal when scrolling over the horizontal scrollbar. When Shift key is
pressed, we still want to scroll in the scrollbar direction when scrolling over a scrollbar, so we need to swap
directions in both scrollbars depending on whther the Shift key is pressed or not.

* page/EventHandler.cpp:
(WebCore::EventHandler::shouldSwapScrollDirection const): Renamed.
(WebCore::EventHandler::handleWheelEvent): Use the new name.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.
* page/EventHandler.h:
* platform/PlatformWheelEvent.h:
(WebCore::PlatformWheelEvent::copySwappingDirection const): Swap the direction of the event.
(WebCore::PlatformWheelEvent::copyTurningVerticalTicksIntoHorizontalTicks const): Deleted.
* platform/glib/EventHandlerGLib.cpp:
(WebCore::EventHandler::shouldSwapScrollDirection const): Take into account whether the Shift key is present.
(WebCore::EventHandler::shouldTurnVerticalTicksIntoHorizontal const): Deleted.

Source/WebKit:

Swap scroll direction when Shift is pressed for consistency with GtkScrolledWindow.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(webkitWebViewBaseScrollEvent):

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

23 months ago[GTK] Problem with Washington Post images
carlosgc@webkit.org [Thu, 1 Feb 2018 15:55:14 +0000 (15:55 +0000)]
[GTK] Problem with Washington Post images
https://bugs.webkit.org/show_bug.cgi?id=181421

Reviewed by Carlos Alberto Lopez Perez.

Source/WebCore:

This is because Washington Post is using the user agent to decide the image formats it serves. In the case of
chromium the images are served as webp, for firefox jpeg is used and in our case it's assuming we are safari and
it's providing jp2 images that we don't support. Add a user agent quirk to pretend to be chromium for
washingtonpost.com.

* platform/UserAgentQuirks.cpp:
(WebCore::urlRequiresChromeBrowser):

Tools:

Add test case for the new user agent quirk.

* TestWebKitAPI/Tests/WebCore/UserAgentQuirks.cpp:
(TestWebKitAPI::TEST):

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

23 months ago[SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
carlosgc@webkit.org [Thu, 1 Feb 2018 15:53:42 +0000 (15:53 +0000)]
[SOUP] Ensure domain is valid when converting a WebCore Cookie to Soup
https://bugs.webkit.org/show_bug.cgi?id=182328

Reviewed by Michael Catanzaro.

soup_cookie_parse() adds the initial '.' to the domain if missing before creating the SoupCookie, but
soup_cookie_new() allows for domain to be a hostname that needs to match exactly. When converting a WebCore
Cookie into a SoupCookie we always want the domain to be considered as such and not as a hostname, so we need to
prepend the '.' if missing.

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

* platform/network/soup/CookieSoup.cpp:
(WebCore::Cookie::toSoupCookie const):

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

23 months ago[RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to...
zalan@apple.com [Thu, 1 Feb 2018 15:52:33 +0000 (15:52 +0000)]
[RenderTreeBuilder] Move RenderTableRow::collapseAndDestroyAnonymousSiblingRows to RenderTreeBuilder
https://bugs.webkit.org/show_bug.cgi?id=182374
<rdar://problem/37102005>

Reviewed by Antti Koivisto.

It's only called from RenderTreeBuilder.

No change in functionality.

* rendering/RenderTableRow.cpp:
(WebCore::RenderTableRow::collapseAndDestroyAnonymousSiblingRows): Deleted.
* rendering/RenderTableRow.h:
* rendering/updating/RenderTreeBuilder.cpp:
(WebCore::RenderTreeBuilder::removeFromParentAndDestroyCleaningUpAnonymousWrappers):
* rendering/updating/RenderTreeBuilderTable.cpp:
(WebCore::RenderTreeBuilder::Table::collapseAndDestroyAnonymousSiblingRows):
* rendering/updating/RenderTreeBuilderTable.h:

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

23 months agoRewrite fast/events/scroll-in-scaled-page-with-overflow-hidden.html to conform with...
fred.wang@free.fr [Thu, 1 Feb 2018 14:03:45 +0000 (14:03 +0000)]
Rewrite fast/events/scroll-in-scaled-page-with-overflow-hidden.html to conform with CSSOM View
https://bugs.webkit.org/show_bug.cgi?id=182287

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

Per the CSSOM View specification, it is wrong to use document.body.scrollTop to retrieve the
vertical offset of the viewport in this test, because the body is potentially scrollable.
This commit relies on window.scrollY instead so that the test still works after bug 5991.

* fast/events/scroll-in-scaled-page-with-overflow-hidden-expected.txt:
* fast/events/scroll-in-scaled-page-with-overflow-hidden.html:

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

23 months agoREGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests...
carlosgc@webkit.org [Thu, 1 Feb 2018 13:58:22 +0000 (13:58 +0000)]
REGRESSION(r227893): fast/events/touch/touch-stale-node-crash.html and other tests crash
https://bugs.webkit.org/show_bug.cgi?id=182350

Reviewed by Carlos Alberto Lopez Perez.

Ensure events synthesized from touch gestures have a valid window, screen and device.

* UIProcess/API/gtk/WebKitWebViewBase.cpp:
* UIProcess/gtk/GestureController.h: Add virtual destructor to GestureControllerclient.

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

23 months ago[Modern Media Controls] Turn media/modern-media-controls/media-controls back on
commit-queue@webkit.org [Thu, 1 Feb 2018 13:38:01 +0000 (13:38 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/media-controls back on
https://bugs.webkit.org/show_bug.cgi?id=182377

Patch by Antoine Quint <graouts@apple.com> on 2018-02-01
Reviewed by Dean Jackson.

Update tests to match the modern-media-controls design and expectations, moving 3 tests under
media/modern-media-controls/macos-inline-media-controls since they are testing functionality
that is now specific to inline media controls.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-bar-always-ltr-expected.txt: Renamed from LayoutTests/media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr-expected.txt.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-bar-always-ltr.html: Renamed from LayoutTests/media/modern-media-controls/media-controls/media-controls-controls-bar-always-ltr.html.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-placard-expected.txt: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-placard.html: Added.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-shows-start-button-expected.txt: Renamed from LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button-expected.txt.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-shows-start-button.html: Renamed from LayoutTests/media/modern-media-controls/media-controls/media-controls-start-button.html.
* media/modern-media-controls/media-controls/media-controls-appear-when-focus-expected.txt:
* media/modern-media-controls/media-controls/media-controls-appear-when-focus.html:
* media/modern-media-controls/media-controls/media-controls-constructor-expected.txt:
* media/modern-media-controls/media-controls/media-controls-constructor.html:
* media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics-expected.txt:
* media/modern-media-controls/media-controls/media-controls-placard-compressed-metrics.html:
* media/modern-media-controls/media-controls/media-controls-placard-expected.txt: Removed.
* media/modern-media-controls/media-controls/media-controls-placard.html: Removed.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

23 months agoQueue a microtask when a waitUntil() promise is settled
cdumez@apple.com [Thu, 1 Feb 2018 11:50:47 +0000 (11:50 +0000)]
Queue a microtask when a waitUntil() promise is settled
https://bugs.webkit.org/show_bug.cgi?id=182372
<rdar://problem/37101019>

Reviewed by Mark Lam.

LayoutTests/imported/w3c:

Reaseline WPT test now that all checks are passing.

* web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt:

Source/JavaScriptCore:

Export a symbol so it can be used in WebCore.

* runtime/JSGlobalObject.h:

Source/WebCore:

Queue a microtask when a waitUntil() promise is settled, as per:
- https://w3c.github.io/ServiceWorker/#dom-extendableevent-waituntil (step 5)

Otherwise, we decrement m_pendingPromiseCount too quickly and it may cause
following calls to waitUntil() to throw when they shouldn't.

No new tests, rebaselined existing test.

* workers/service/ExtendableEvent.cpp:
(WebCore::ExtendableEvent::addExtendLifetimePromise):

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

23 months agoUpdate imagebitmap tests.
Ms2ger@igalia.com [Thu, 1 Feb 2018 11:16:09 +0000 (11:16 +0000)]
Update imagebitmap tests.
https://bugs.webkit.org/show_bug.cgi?id=182335

Unreviewed test gardening.

LayoutTests/imported/w3c:

* web-platform-tests/2dcontext/imagebitmap/common.sub.js: Renamed from LayoutTests/imported/w3c/web-platform-tests/2dcontext/imagebitmap/common.js.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage.html:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args.html:
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: Added.
* web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub.html: Added.
* web-platform-tests/2dcontext/imagebitmap/w3c-import.log:
* web-platform-tests/common/namespaces.js: Added.
* web-platform-tests/common/w3c-import.log:
* web-platform-tests/images/pattern.mp4: Added.
* web-platform-tests/images/pattern.svg: Added.
* web-platform-tests/images/w3c-import.log:

LayoutTests:

* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-drawImage-expected.txt: Removed.
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-invalid-args-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/2dcontext/imagebitmap/createImageBitmap-origin.sub-expected.txt: Added.

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

23 months ago[GTK] MiniBrowser settings are just a list of names
carlosgc@webkit.org [Thu, 1 Feb 2018 09:44:39 +0000 (09:44 +0000)]
[GTK] MiniBrowser settings are just a list of names
https://bugs.webkit.org/show_bug.cgi?id=182005

Reviewed by Sergio Villar Senin.

The default size we are using is too small to show the values column, and the window is not resizable because
GObjectClass::constructed() is not called in the parent class.

* MiniBrowser/gtk/BrowserSettingsDialog.c:
(browser_settings_dialog_init): Use 600x400 as default size.
(browserSettingsDialogConstructed): Chain up to parent constructed.

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

23 months agoInvalidate style for sibling combinators accurately on class change
antti@apple.com [Thu, 1 Feb 2018 09:01:01 +0000 (09:01 +0000)]
Invalidate style for sibling combinators accurately on class change
https://bugs.webkit.org/show_bug.cgi?id=182336

Reviewed by Zalan Bujtas.

Source/WebCore:

Use Style::Invalidator to invalidate only those elements that may be affected by a class
change for sibling combinators and nth pseudo classes.

* css/RuleFeature.cpp:

Add new AllSiblings MatchElement to use for nth pseudo classes with subselectors.

(WebCore::isSiblingOrSubject):

Add a helper.

(WebCore::RuleFeatureSet::computeNextMatchElement):
(WebCore::RuleFeatureSet::computeSubSelectorMatchElement):

Compute and propage MatchElement::AllSiblings.

* css/RuleFeature.h:
* dom/Node.cpp:
(WebCore::Node::updateAncestorsForStyleRecalc):

Don't need to test for childrenAffectedByPropertyBasedBackwardPositionalRules anymore (an oddly named bit for nth pseudo classes).

* style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateStyleWithMatchElement):

Invalidate only the potentially affected elements.
The old code would just unconditionally invalidate the current element. This would propagate to descedants of siblings via
affectedByPreviousSibling bits. That mechanism can be removed when everything has been switched to accurate invalidation.

LayoutTests:

Adapt to progressions.

* fast/css/direct-adjacent-style-update-optimization-expected.txt:
* fast/css/direct-adjacent-style-update-optimization.html:
* fast/css/indirect-adjacent-style-update-optimization-expected.txt:
* fast/css/indirect-adjacent-style-update-optimization.html:
* fast/css/nth-last-child-of-style-update-optimization.html:

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

23 months agoUnreviewed. Remove WebInspectorUI watchlist and remove myself from 2 watchlists more
carlosgc@webkit.org [Thu, 1 Feb 2018 08:52:43 +0000 (08:52 +0000)]
Unreviewed. Remove WebInspectorUI watchlist and remove myself from 2 watchlists more

Patch by Andres Gomez <agomez@igalia.com> on 2018-01-31

* Scripts/webkitpy/common/config/watchlist:

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

23 months agoUse different debug red colors for different contexts
simon.fraser@apple.com [Thu, 1 Feb 2018 07:28:10 +0000 (07:28 +0000)]
Use different debug red colors for different contexts
https://bugs.webkit.org/show_bug.cgi?id=182362

Reviewed by Tim Horton.
Source/WebCore:

Pure red is used elsehwere in the system as a debug color indicator, so use different
shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
so they are identifiable.

* page/FrameView.cpp:
(WebCore::FrameView::paintContents):

Source/WebKit:

Pure red is used elsehwere in the system as a debug color indicator, so use different
shades of red for WebKit in the two places where we paint a reddish wash in debug builds,
so they are identifiable.

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

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

23 months ago[Modern Media Controls] Turn media/modern-media-controls/macos-inline-media-controls...
graouts@webkit.org [Thu, 1 Feb 2018 07:12:09 +0000 (07:12 +0000)]
[Modern Media Controls] Turn media/modern-media-controls/macos-inline-media-controls back on
https://bugs.webkit.org/show_bug.cgi?id=182338

Reviewed by Eric Carlson.

Update tests to match the modern-media-controls designs and expectations. Certain tests didn't make any sense anymore
and were removed, for instance tests related to the compact mode.

* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-audio-background.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-buttons-styles.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-buttons-styles.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-controls-bar-styles.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact-expected.txt: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-compact.html: Removed.
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-controls-bar-styles.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-layout.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-resize-with-hidden-controls-bar.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-start-button-style-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-start-button-style.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-status-label.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-time-control-styles.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-slider-visibility.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-volume-styles.html:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls-expected.txt:
* media/modern-media-controls/macos-inline-media-controls/macos-inline-media-dropping-controls.html:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

23 months ago[CMake] Make JavaScriptCore headers copies
don.olmstead@sony.com [Thu, 1 Feb 2018 06:50:23 +0000 (06:50 +0000)]
[CMake] Make JavaScriptCore headers copies
https://bugs.webkit.org/show_bug.cgi?id=182303

Reviewed by Alex Christensen.

Source/JavaScriptCore:

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

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:
* PlatformMac.cmake:
* PlatformWPE.cmake:
* PlatformWin.cmake:
* PlatformWinCairo.cmake:

Source/WebKit:

* CMakeLists.txt:
* Scripts/generate-forwarding-headers.pl:

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

23 months agoReplace tryLargeMemalignVirtual with tryLargeZeroedMemalignVirtual and use it to...
sbarati@apple.com [Thu, 1 Feb 2018 05:36:40 +0000 (05:36 +0000)]
Replace tryLargeMemalignVirtual with tryLargeZeroedMemalignVirtual and use it to allocate large zeroed memory in Wasm
https://bugs.webkit.org/show_bug.cgi?id=182064
<rdar://problem/36840132>

Reviewed by Geoffrey Garen.

Source/bmalloc:

This patch replaces the tryLargeMemalignVirtual API with tryLargeZeroedMemalignVirtual.
By doing that, we're able to remove the AllocationKind enum. To zero the memory,
tryLargeZeroedMemalignVirtual uses mmap(... MAP_ANON ...) over previously mmapped
memory. This both purges the any resident memory for the virtual range and ensures
that the pages in the range are zeroed. Most OSs should implement this by taking a
page fault and zero filling on first access. Therefore, this API is returning pages
that will result in page faults on first access. Hence, the name 'virtual' in the API.
This API differs from the old API in that users of it need not call madvise themselves.
The memory is ready to go.

* bmalloc.xcodeproj/project.pbxproj:
* bmalloc/AllocationKind.h: Removed.
* bmalloc/DebugHeap.cpp:
(bmalloc::DebugHeap::memalignLarge):
(bmalloc::DebugHeap::freeLarge):
* bmalloc/DebugHeap.h:
* bmalloc/Heap.cpp:
(bmalloc::Heap::splitAndAllocate):
(bmalloc::Heap::tryAllocateLarge):
(bmalloc::Heap::allocateLarge):
(bmalloc::Heap::shrinkLarge):
(bmalloc::Heap::deallocateLarge):
* bmalloc/Heap.h:
* bmalloc/IsoPage.cpp:
(bmalloc::IsoPageBase::allocatePageMemory):
* bmalloc/VMAllocate.h:
(bmalloc::vmZeroAndPurge):
* bmalloc/VMHeap.cpp:
(bmalloc::VMHeap::tryAllocateLargeChunk):
* bmalloc/VMHeap.h:
* bmalloc/bmalloc.cpp:
(bmalloc::api::tryLargeZeroedMemalignVirtual):
(bmalloc::api::freeLargeVirtual):
(bmalloc::api::tryLargeMemalignVirtual): Deleted.
* bmalloc/bmalloc.h:

Source/JavaScriptCore:

This patch switches WebAssembly Memory to always use bmalloc's
zeroed virtual allocation API. This makes it so that we don't
dirty the memory to zero it. It's a huge compile time speedup
on WasmBench on iOS.

* wasm/WasmMemory.cpp:
(JSC::Wasm::Memory::create):
(JSC::Wasm::Memory::~Memory):
(JSC::Wasm::Memory::addressIsInActiveFastMemory):
(JSC::Wasm::Memory::grow):
(JSC::Wasm::commitZeroPages): Deleted.

Source/WTF:

* wtf/Gigacage.cpp:
(Gigacage::tryAllocateZeroedVirtualPages):
(Gigacage::freeVirtualPages):
(Gigacage::tryAllocateVirtualPages): Deleted.
* wtf/Gigacage.h:
* wtf/OSAllocator.h:

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

23 months agoLayout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
pvollan@apple.com [Thu, 1 Feb 2018 04:18:38 +0000 (04:18 +0000)]
Layout Test fast/events/beforeunload-dom-manipulation-crash.html is crashing
https://bugs.webkit.org/show_bug.cgi?id=181204
<rdar://problem/36256274>

Reviewed by Ryosuke Niwa.

Source/WebCore:

When a frame element is moved in the DOM tree during the execution of a beforeunload handler,
the frame will be detached when removed from its previous position in the DOM tree. When being
detached, an attempt will also be made to stop the load by calling FrameLoader::stopAllLoaders().
However, this method will return early when executed in a beforeunload handler, since navigation
is not allowed then. The end result is a detached frame which will continue to load, and hitting
asserts in DocumentLoader::dataReceived(), and DocumentLoader::notifyFinished(). It should be
possible to stop a frame load, even when executing a beforeunload handler.

No new tests. Covered by the existing test fast/events/beforeunload-dom-manipulation-crash.html.

* history/PageCache.cpp:
(WebCore::PageCache::addIfCacheable): Fix a failing API test by allowing scripts to be executed
under the PageCache::prune method.
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::isStopLoadingAllowed const):
(WebCore::FrameLoader::stopAllLoaders):
* loader/FrameLoader.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::~SVGImage): Disable scripts disallowed assertions in this scope, since it is
safe in this context.

Tools:

Implement 'testRunner.forceImmediateCompletion()' for WK1.

* DumpRenderTree/TestRunner.cpp:
(forceImmediateCompletionCallback):
(TestRunner::staticFunctions):

LayoutTests:

* fast/events/beforeunload-dom-manipulation-crash.html: Make it clear that the
frame element is a child of the 'del' element.
* fast/events/beforeunload-dom-manipulation-crash-expected.html:
* platform/mac-wk1/TestExpectations: Unskip test.

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

23 months agoinline-block baseline not computed correctly for vertical-lr
jfernandez@igalia.com [Thu, 1 Feb 2018 01:56:52 +0000 (01:56 +0000)]
inline-block baseline not computed correctly for vertical-lr
https://bugs.webkit.org/show_bug.cgi?id=170176

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

When computing the baseline position of inline-block elements we use the
InlineFlow logicalTop and the FontMetrics ascent. The issue comes from
the fact that these units are incompatible. The logicalTop of a
vertical-lr element is offset to the left edge, while the ascent is the
distance from the right edge.

We need to either use logical value for the FontMetrics ascent so we can
compute the correctly the baselines of vertical-lr elements, or just using
the logicalBottom for these cases.

The approach based on a logicalAscent API for FontMetrics would require
a lot of work because inline-block logic assumes everything is vertical-rl
and at some point, flips the elements along the block-axis in case of
vertical-lr mode.

While it'd be desirable to get rid of this flipping logic, this patch tries
first the simpler approach of using logicalBottom, which aligns with the
currently implemented logic.

Tests: fast/inline-block/baseline-vertical-01.html
       fast/inline-block/baseline-vertical-02.html
       fast/inline-block/baseline-vertical-03.html
       fast/inline-block/baseline-vertical-04.html
       fast/inline-block/baseline-vertical-05.html
       fast/inline-block/baseline-vertical-06.html
       fast/inline-block/baseline-vertical-07.html
       fast/inline-block/baseline-vertical-08.html

* rendering/InlineFlowBox.cpp:
(WebCore::InlineFlowBox::placeBoxesInBlockDirection):
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::inlineBlockBaseline const):

LayoutTests:

Tests to evaluate the baseline alignment in vertical modes.
Additionally, several tests were rebaselined.

Some of the new tests are marked as Failure for the ios-sim
platform because of pixel rounding errors in the absolute
positioned elements used as reference.

Finally, there are color differences in the border-styles-vertical-lr-expected.png
caused by changes in the gtk+ platform. Those differences were not noticeable until
now that the patch causes diffs in the expected.txt files.

* fast/inline-block/baseline-vertical-01-expected.html: Added.
* fast/inline-block/baseline-vertical-01.html: Added.
* fast/inline-block/baseline-vertical-02-expected.html: Added.
* fast/inline-block/baseline-vertical-02.html: Added.
* fast/inline-block/baseline-vertical-03-expected.html: Added.
* fast/inline-block/baseline-vertical-03.html: Added.
* fast/inline-block/baseline-vertical-04-expected.html: Added.
* fast/inline-block/baseline-vertical-04.html: Added.
* fast/inline-block/baseline-vertical-05-expected.html: Added.
* fast/inline-block/baseline-vertical-05.html: Added.
* fast/inline-block/baseline-vertical-06-expected.html: Added.
* fast/inline-block/baseline-vertical-06.html: Added.
* fast/inline-block/baseline-vertical-07-expected.html: Added.
* fast/inline-block/baseline-vertical-07.html: Added.
* fast/inline-block/baseline-vertical-08-expected.html: Added.
* fast/inline-block/baseline-vertical-08.html: Added.
* fast/text/emphasis-avoid-ruby-expected.png:
* fast/text/emphasis-avoid-ruby-expected.txt:
* fast/text/emphasis-overlap-expected.png:
* fast/text/emphasis-overlap-expected.txt:
* platform/gtk/fast/backgrounds/background-leakage-transforms-expected.png:
* platform/gtk/fast/backgrounds/background-leakage-transforms-expected.txt:
* platform/gtk/fast/writing-mode/border-styles-vertical-lr-expected.png:
* platform/gtk/fast/writing-mode/border-styles-vertical-lr-expected.txt:
* platform/ios-simulator/TestExpectations:
* platform/ios/fast/backgrounds/background-leakage-transforms-expected.png: Added.
* platform/ios/fast/backgrounds/background-leakage-transforms-expected.txt:
* platform/ios/fast/writing-mode/border-styles-vertical-lr-expected.png:
* platform/ios/fast/writing-mode/border-styles-vertical-lr-expected.txt:
* platform/mac/fast/backgrounds/background-leakage-transforms-expected.png:
* platform/mac/fast/backgrounds/background-leakage-transforms-expected.txt:
* platform/mac/fast/writing-mode/border-styles-vertical-lr-expected.txt:
* platform/win/fast/writing-mode/text-orientation-basic-expected.txt:

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

23 months agoMake run-perf-tests work with StyleBench and re-enable it
rniwa@webkit.org [Thu, 1 Feb 2018 01:42:34 +0000 (01:42 +0000)]
Make run-perf-tests work with StyleBench and re-enable it
https://bugs.webkit.org/show_bug.cgi?id=182322

Reviewed by Antti Koivisto.

This patch updates the test harness to report new metrics of StyleBench.

Replaced the total time by the geometric mean of the time spent in each suite, and added scores
as a metric in addition to time. Also, updated the PerfTestRunner harness and the results template
to support "Score" metric with "pt" as its unit.

* Skipped: Unskipped the test.
* StyleBench/resources/benchmark-report.js:
(window.benchmarkClient.willStartFirstIteration..createTest): Added the unit as an optional argument
to report the score in addition to time. Also report the geomean of time instead of the total time.
(window.benchmarkClient.willStartFirstIteration): Report the geomean of time.
(window.benchmarkClient.didRunSuites): Record the entire measuredValues instead of just tests.
(window.benchmarkClient.didFinishLastIteration): Report the scores.
* resources/results-template.html: Added "Score" as a metric and "pt" as its unit.
* resources/runner.js:
(PerfTestRunner..finish): Ditto.

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

23 months agoUnreviewed GTK+ test gardening.
aboya@igalia.com [Thu, 1 Feb 2018 01:40:09 +0000 (01:40 +0000)]
Unreviewed GTK+ test gardening.

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

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

Reviewed by Alex Christensen.

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

* ReadMe.md:

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

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

r227875 should not have been rolled out.

Reverted changeset:

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

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

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

Missing cross-platform TestController implementation

Reverted changeset:

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

Source/WebKit:

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

Tools:

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

LayoutTests:

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

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

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

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

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

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

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

Reviewed by Michael Saboff.

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

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

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

Reviewed by Ryosuke Niwa.

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

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

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

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

Reviewed by Ryosuke Niwa.

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

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

Added a browser test to guard against this bug.

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

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

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

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

Source/WebCore:

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

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

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

LayoutTests:

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

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

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

Reviewed by Ryosuke Niwa.

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

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

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

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

Reviewed by David Kilzer.

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

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

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

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

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

Reviewed by Alex Christensen.

Source/WebKit:

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

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

Tools:

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

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

LayoutTests:

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

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

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

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

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

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

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

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

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

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

Not reviewed.

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

* offlineasm/cloop.rb:

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

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

Reviewed by Antti Koivisto.

All the callsites are in the RenderTreeUpdater by now.

No change in functionality.

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

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

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

Reviewed by Simon Fraser.

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

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

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

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

Reviewed by Chris Dumez.

Source/WebCore:

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

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

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

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

LayoutTests:

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

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

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

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

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

Reviewed by Antti Koivisto.

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

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

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

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

Reviewed by Carlos Garcia Campos.

* PlatformGTK.cmake:

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

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

Unreviewed test gardening.

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

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

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

Reviewed by Andy Estes.

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

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

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

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

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

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

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

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

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

Reviewed by Sam Weinig.

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

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

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

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

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

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

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

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

Reviewed by Michael Saboff.

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

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

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

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

Reviewed by Jon Lee and Eric Carlson.

Source/WebCore:

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

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

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

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

LayoutTests:

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

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

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

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

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

Reviewed by Antti Koivisto.

resolveMovedChild() is only called from RenderTreeBuilder.

No change in functionality.

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

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

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

Reviewed by Carlos Garcia Campos.

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

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

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

Reviewed by Carlos Alberto Lopez Perez.

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

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

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