WebKit-https.git
2 years ago[HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
commit-queue@webkit.org [Wed, 16 Aug 2017 16:36:35 +0000 (16:36 +0000)]
[HarfBuzz] Decomposed Vietnamese characters are rendered incorrectly
https://bugs.webkit.org/show_bug.cgi?id=174418

Patch by Fujii Hironori <Hironori.Fujii@sony.com> on 2017-08-16
Reviewed by Michael Catanzaro.

Source/WebCore:

HarfBuzzShaper should normalize the input text before collecting
HarfBuzzRuns. Actually, HarfBuzzShaper::setNormalizedBuffer does
the task. But, this function hasn't been called from anywhere
since Bug 90951.

Test: fast/text/international/vietnamese-nfd.html
      imported/blink/fast/text/international/text-shaping-arabic-diffs.html

* platform/graphics/harfbuzz/HarfBuzzShaper.cpp:
(WebCore::HarfBuzzShaper::HarfBuzzShaper):
Call setNormalizedBuffer instead of normalizeCharacters.
(WebCore::normalizeCharacters): Deleted.
(WebCore::normalizeSpacesAndMirrorChars) Use
FontCascade::treatAsZeroWidthSpaceInComplexScript instead of
FontCascade::treatAsZeroWidthSpace to preserve ZWJ and ZWNJ.

LayoutTests:

* fast/text/international/vietnamese-nfd-expected.html: Added.
* fast/text/international/vietnamese-nfd.html: Added.

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

2 years agoUnreviewed, rebaseline a few tests after r220779.
cdumez@apple.com [Wed, 16 Aug 2017 15:43:26 +0000 (15:43 +0000)]
Unreviewed, rebaseline a few tests after r220779.

* http/tests/blink/sendbeacon/beacon-same-origin-expected.txt:
* http/wpt/beacon/cors/cors-preflight-arraybufferview-failure.html:
* http/wpt/beacon/cors/cors-preflight-arraybufferview-success.html:

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

2 years agoMove first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
antti@apple.com [Wed, 16 Aug 2017 13:15:20 +0000 (13:15 +0000)]
Move first-letter renderer mutation code out of RenderBlock and into RenderTreeUpdater
https://bugs.webkit.org/show_bug.cgi?id=175627

Reviewed by Andreas Kling.

Render tree should not mutate itself. We already fixed this for first-letter, supporting code
can now move to RenderTreeUpdater too.

* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* rendering/RenderBlock.cpp:
(WebCore::styleForFirstLetter): Deleted.
(WebCore::isPunctuationForFirstLetter): Deleted.
(WebCore::shouldSkipForFirstLetter): Deleted.
(WebCore::RenderBlock::updateFirstLetterStyle): Deleted.
(WebCore::RenderBlock::createFirstLetterRenderer): Deleted.
(WebCore::RenderBlock::updateFirstLetter): Deleted.
* rendering/RenderBlock.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter): Deleted.
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter): Deleted.
* rendering/RenderTable.h:

    Virtual overrides just disabled first letter for some RenderBlock subclasses. This is now achieved via
    supportsFirstLetter test in the first letter updater.

* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingValue::adjustTextNodeSizes):
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter): Deleted.
* rendering/svg/RenderSVGText.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::popParent):
* style/RenderTreeUpdater.h:
* style/RenderTreeUpdaterFirstLetter.cpp: Added.
(WebCore::styleForFirstLetter):
(WebCore::isPunctuationForFirstLetter):
(WebCore::shouldSkipForFirstLetter):
(WebCore::updateFirstLetterStyle):
(WebCore::createFirstLetterRenderer):
(WebCore::supportsFirstLetter):
(WebCore::RenderTreeUpdater::FirstLetter::update):
* style/RenderTreeUpdaterFirstLetter.h: Added.

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

2 years agoWebDriver: fix return value of close window command
carlosgc@webkit.org [Wed, 16 Aug 2017 11:38:22 +0000 (11:38 +0000)]
WebDriver: fix return value of close window command
https://bugs.webkit.org/show_bug.cgi?id=174861

Reviewed by Brian Burg.

We are currently returning null, but we should return the list of window handles, and try to close the session
if there aren't more window handles.

10.2 Close Window
https://w3c.github.io/webdriver/webdriver-spec.html#close-window

3. If there are no more open top-level browsing contexts, then try to close the session.
4. Return the result of running the remote end steps for the Get Window Handles command.

* Session.cpp:
(WebDriver::Session::closeAllToplevelBrowsingContexts): Helper function to close the given toplevel browsing
context and the next one if there are more.
(WebDriver::Session::close): Call closeAllToplevelBrowsingContexts() to delete all toplevel browsing contexts of
the session.
(WebDriver::Session::closeTopLevelBrowsingContext): Close the given toplevel browsing context and call
getWindowHandles() when done.
(WebDriver::Session::closeWindow): Call closeTopLevelBrowsingContext() passing the current toplevel browsing context.
(WebDriver::Session::getWindowHandles): Remove the early return, this command doesn't depend on a current
toplevel browsing context.
* Session.h:
* SessionHost.h:
* WebDriverService.cpp:
(WebDriver::WebDriverService::run): Disconnect the server when main loop quits.
(WebDriver::WebDriverService::deleteSession): Do not fail if the given session is not active.
(WebDriver::WebDriverService::closeWindow): Remove the session if the closed window was the last one.
* WebDriverService.h: Remove unused quit() method.
* glib/SessionHostGlib.cpp:
(WebDriver::SessionHost::isConnected): Return whether host is connected to a browser instance.
(WebDriver::SessionHost::dbusConnectionClosedCallback): Delete m_browser.

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

2 years ago[GTK] Crash of WebProcess with on-demand AC
magomez@igalia.com [Wed, 16 Aug 2017 11:26:39 +0000 (11:26 +0000)]
[GTK] Crash of WebProcess with on-demand AC
https://bugs.webkit.org/show_bug.cgi?id=171161

Reviewed by Carlos Garcia Campos.

Set the viewOverlayRootLayer to the previous layerTreeHost if it exists. This avoids a
crash when reusing the previous layerTreeHost, because it would keep a reference to an
already destroyed viewOverlayRootLayer.

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

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

2 years ago[CoordGraphics] Simplify CoordinatedGraphicsScene state updates
zandobersek@gmail.com [Wed, 16 Aug 2017 11:21:41 +0000 (11:21 +0000)]
[CoordGraphics] Simplify CoordinatedGraphicsScene state updates
https://bugs.webkit.org/show_bug.cgi?id=175528
<rdar://problem/33876795>

Reviewed by Carlos Garcia Campos.

Hold the information about state updates in ThreadedCompositor, in the
m_attributes struct. This way we don't need to store the updates in
functors and accumulate them in the CoordinatedGraphicsScene class, but
instead just apply any pending state update or atlas removal before the
scene is rendered.

This removes the need to update the CoordinatedGraphicsScene object from
the main thread with data that ultimately has to be handled on the
composition thread. Similarly, when updating CoordinatedGraphicsScene, we
only need to synchronize on the m_attributes lock object once in order to
retrieve the scene update information, instead of having each functor do
that repeatedly.

Outside of CoordinatedGraphicsScene and ThreadedCompositor classes, the
CompositingCoordinator class now passes the atlases-to-remove Vector by
a const lvalue reference down to ThreadedCompositor, and then manually
clears the Vector. Before the Vector was passed as an rvalue reference,
depending on the ThreadedCompositor code to clear out the original Vector
object by moving its resources into the functor object. This doesn't occur
anymore because the Vector object is now appended to another Vector.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::applyStateChanges):
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
(WebKit::CoordinatedGraphicsScene::detach):
(WebKit::CoordinatedGraphicsScene::setActive):
(WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted.
(WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::updateSceneState):
(WebKit::ThreadedCompositor::releaseUpdateAtlases):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.cpp:
(WebKit::CompositingCoordinator::flushPendingLayerChanges):
(WebKit::CompositingCoordinator::releaseAtlases):
(WebKit::CompositingCoordinator::clearUpdateAtlases):
* WebProcess/WebPage/CoordinatedGraphics/CompositingCoordinator.h:
* WebProcess/WebPage/CoordinatedGraphics/CoordinatedLayerTreeHost.h:
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.cpp:
(WebKit::ThreadedCoordinatedLayerTreeHost::releaseUpdateAtlases):
* WebProcess/WebPage/CoordinatedGraphics/ThreadedCoordinatedLayerTreeHost.h:

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

2 years agoFix JSCOnly ARM buildbots after r220047 and r220184
ossy@webkit.org [Wed, 16 Aug 2017 10:06:14 +0000 (10:06 +0000)]
Fix JSCOnly ARM buildbots after r220047 and r220184
https://bugs.webkit.org/show_bug.cgi?id=174993

Reviewed by Carlos Alberto Lopez Perez.

* CMakeLists.txt: Generate only one backend on Linux to save build time.

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

2 years ago[GStreamer][EME] Rework handling key systems and UUIDs
calvaris@igalia.com [Wed, 16 Aug 2017 08:25:45 +0000 (08:25 +0000)]
[GStreamer][EME] Rework handling key systems and UUIDs
https://bugs.webkit.org/show_bug.cgi?id=175567

Reviewed by Žan Doberšek.

The UUIDs and key system strings were moved to the
GStreamerEMEUtilities class because so far they were managed by
the decryptors and that was ugly.

* platform/GStreamer.cmake:
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
(WebCore::MediaPlayerPrivateGStreamerBase::supportsKeySystem):
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp: Added.
* platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h: Added.
(WebCore::GStreamerEMEUtilities::isClearKeyKeySystem):
(WebCore::GStreamerEMEUtilities::keySystemToUuid):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webkit_media_clear_key_decrypt_class_init):
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.h:

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

2 years ago[Payment Request] Add an ENABLE flag and an experimental feature preference
aestes@apple.com [Wed, 16 Aug 2017 07:34:15 +0000 (07:34 +0000)]
[Payment Request] Add an ENABLE flag and an experimental feature preference
https://bugs.webkit.org/show_bug.cgi?id=175622

Reviewed by Tim Horton.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* Configurations/FeatureDefines.xcconfig:
* page/Settings.in:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetPaymentRequestEnabled):
(WKPreferencesGetPaymentRequestEnabled):
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::resetPreferencesToConsistentValues):

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

2 years ago[GTK][WPE] WebKitAutomationSession should set session client to nullptr on dispose
carlosgc@webkit.org [Wed, 16 Aug 2017 06:09:38 +0000 (06:09 +0000)]
[GTK][WPE] WebKitAutomationSession should set session client to nullptr on dispose
https://bugs.webkit.org/show_bug.cgi?id=175564

Reviewed by Carlos Alberto Lopez Perez.

WebAutomationSession expects its client to be nullptr in the destructor.

* UIProcess/API/glib/WebKitAutomationSession.cpp:
(webkitAutomationSessionDispose):

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

2 years ago[Payment Request] Import test suite from web-platform-tests
aestes@apple.com [Wed, 16 Aug 2017 03:52:22 +0000 (03:52 +0000)]
[Payment Request] Import test suite from web-platform-tests
https://bugs.webkit.org/show_bug.cgi?id=175612
<rdar://problem/33906070>

Reviewed by Tim Horton.

LayoutTests/imported/w3c:

Imported the payment-request test suite using import-w3c-tests. Generated failing expected
results for each test and skipped 5 tests that currently time out.

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/payment-request/OWNERS: Added.
* web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/active-document-cross-origin.https.sub.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/active-document-same-origin.https.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-cross-origin-bc-containers.https.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/allowpaymentrequest-attribute-same-origin-bc-containers.https.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/basic.https-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/basic.https.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/common.sub.js: Added.
(window.onmessage):
(string_appeared_here.forEach):
* web-platform-tests/payment-request/allowpaymentrequest/echo-PaymentRequest.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/no-attribute-cross-origin-bc-containers.https.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/no-attribute-same-origin-bc-containers.https.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/removing-allowpaymentrequest.https.sub.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest-timing.https.sub.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub-expected.txt: Added.
* web-platform-tests/payment-request/allowpaymentrequest/setting-allowpaymentrequest.https.sub.html: Added.
* web-platform-tests/payment-request/allowpaymentrequest/w3c-import.log: Added.
* web-platform-tests/payment-request/historical.https-expected.txt: Added.
* web-platform-tests/payment-request/historical.https.html: Added.
* web-platform-tests/payment-request/interfaces.https-expected.txt: Added.
* web-platform-tests/payment-request/interfaces.https.html: Added.
* web-platform-tests/payment-request/payment-request-abort-method.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-abort-method.https.html: Added.
* web-platform-tests/payment-request/payment-request-canmakepayment-method.https.http: Added.
* web-platform-tests/payment-request/payment-request-constructor-crash.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-constructor-crash.https.html: Added.
* web-platform-tests/payment-request/payment-request-constructor.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-constructor.https.html: Added.
* web-platform-tests/payment-request/payment-request-id.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-id.https.html: Added.
* web-platform-tests/payment-request/payment-request-in-iframe-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-in-iframe.html: Added.
* web-platform-tests/payment-request/payment-request-onshippingaddresschange-attribute.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-onshippingaddresschange-attribute.https.html: Added.
* web-platform-tests/payment-request/payment-request-onshippingoptionchange-attribute.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-onshippingoptionchange-attribute.https.html: Added.
* web-platform-tests/payment-request/payment-request-response-id.html: Added.
* web-platform-tests/payment-request/payment-request-show-method.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-show-method.https.html: Added.
* web-platform-tests/payment-request/payment-request-update-event-constructor.http-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-update-event-constructor.http.html: Added.
* web-platform-tests/payment-request/payment-request-update-event-constructor.https-expected.txt: Added.
* web-platform-tests/payment-request/payment-request-update-event-constructor.https.html: Added.
* web-platform-tests/payment-request/w3c-import.log: Added.

LayoutTests:

* TestExpectations: Skipped payment-request tests that currently time out.

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

2 years agoWKSnapshotConfiguration is missing from the WebKit umbrella header
timothy_horton@apple.com [Wed, 16 Aug 2017 03:06:42 +0000 (03:06 +0000)]
WKSnapshotConfiguration is missing from the WebKit umbrella header
https://bugs.webkit.org/show_bug.cgi?id=175614
<rdar://problem/33812691>

Reviewed by Dan Bernstein.

* Shared/API/Cocoa/WebKit.h:
Add WKSnapshotConfiguration, which is a public header.

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

2 years agoWe are too conservative about the effects of PushWithScope
commit-queue@webkit.org [Wed, 16 Aug 2017 02:49:04 +0000 (02:49 +0000)]
We are too conservative about the effects of PushWithScope
https://bugs.webkit.org/show_bug.cgi?id=175584

Patch by Robin Morisset <rmorisset@apple.com> on 2017-08-15
Reviewed by Saam Barati.

PushWithScope converts its argument to an object (this can throw a type error,
but has no other observable effect), and allocates a new scope, that it then
makes the new current scope. We were a bit too
conservative in saying that it clobbers the world.

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

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

2 years agoMake DataTransferItemList work with plain text entries
rniwa@webkit.org [Wed, 16 Aug 2017 02:23:41 +0000 (02:23 +0000)]
Make DataTransferItemList work with plain text entries
https://bugs.webkit.org/show_bug.cgi?id=175596

Reviewed by Wenson Hsieh.

Source/JavaScriptCore:

Added DataTransferItem as a common identifier since it's a runtime enabled feature.

* runtime/CommonIdentifiers.h:

Source/WebCore:

Added the basic machinery to get the list of plain text items to DataTransferItemList and DataTransferItem.

Each DataTransferItem now depends on DataTransfer so it does ref-forwarding like DataTransferItemList to make
DataTransfer alive as long as any DataTransferItem is alive.

Specifications: https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitem-interface
                https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface

Tests: editing/pasteboard/datatransfer-items-drop-plaintext-file.html
       editing/pasteboard/datatransfer-items-paste-plaintext.html

* dom/DataTransferItem.cpp:
(WebCore::DataTransferItem::DataTransferItem): Added two variants one for plain text and another one for a file.
(WebCore::DataTransferItem::kind const): Rewritten.
(WebCore::DataTransferItem::getAsString const): Implemented.
(WebCore::DataTransferItem::getAsFile const): Implemented.
* dom/DataTransferItem.h:
(WebCore::DataTransferItem::ref): Added.
(WebCore::DataTransferItem::deref): Added.
(WebCore::DataTransferItem::type const): Returns String instead of AtomicString.
(WebCore::DataTransferItem::kind const): Moved to cpp.
* dom/DataTransferItem.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.
* dom/DataTransferItemList.cpp:
(WebCore::DataTransferItemList::length): Implemented.
(WebCore::DataTransferItemList::item): Ditto.
(WebCore::isSupportedType): Added. For now, we only support text/plain.
(WebCore::DataTransferItemList::ensureItems): Added. Constructs the list of DataTransferItems.
* dom/DataTransferItemList.h:
(DataTransferItemList): Added m_items. The list is filled lazily by ensureItems.
* dom/DataTransferItemList.idl: Removed NoInterfaceObject since the interface object should exist on DOMWindow.

LayoutTests:

Rebaselined the tests and added two regression tests for pasting plain text and dropping a plain text file.

Unfortunately, dropping a file is only supported by DumpRenderTree on Mac :( so it's disabled elsewhere.

* editing/pasteboard/datatransfer-idl-expected.txt: Rebaselined now that NoInterfaceObject has been dropped from
DataTransferItem.idl and DataTransferItemList.idl as expected.
* editing/pasteboard/datatransfer-idl.html: Fixed the bug that it wasn't testing IDL for DataTransferItem.
* editing/pasteboard/datatransfer-items-drop-plaintext-file-expected.txt: Added.
* editing/pasteboard/datatransfer-items-drop-plaintext-file.html: Added.
* editing/pasteboard/datatransfer-items-paste-plaintext-expected.txt: Added.
* editing/pasteboard/datatransfer-items-paste-plaintext.html: Added.
* editing/resources/text-pasteboard-data.txt: Added.
* platform/gtk/js/dom/global-constructors-attributes-expected.txt:
* platform/ios/TestExpectations:
* platform/mac-elcapitan-wk2/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-elcapitan/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-highsierra-wk1/js/dom/global-constructors-attributes-expected.txt:
* platform/mac-highsierra/js/dom/global-constructors-attributes-expected.txt:
* platform/mac/js/dom/global-constructors-attributes-expected.txt:
* platform/win/TestExpectations:
* platform/wk2/TestExpectations:
* platform/wpe/js/dom/global-constructors-attributes-expected.txt:

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

2 years agoRemove ScrollView::clipsRepaints() which was only used by Chromium
simon.fraser@apple.com [Wed, 16 Aug 2017 02:05:28 +0000 (02:05 +0000)]
Remove ScrollView::clipsRepaints() which was only used by Chromium
https://bugs.webkit.org/show_bug.cgi?id=175594

Reviewed by Tim Horton.

clipsRepaints() was added in r74568 but was only used by Chromium. It's always
true for other platforms, so remove conditionals that test for it and assume true.

* page/FrameView.cpp:
(WebCore::FrameView::scrollContentsFastPath):
* platform/ScrollView.cpp:
(WebCore::ScrollView::repaintContentRectangle):
(WebCore::ScrollView::setClipsRepaints): Deleted.
* platform/ScrollView.h:
(WebCore::ScrollView::clipsRepaints const): Deleted.

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

2 years agoAllow WebCore logging channels to be set from the UI process
simon.fraser@apple.com [Wed, 16 Aug 2017 01:37:30 +0000 (01:37 +0000)]
Allow WebCore logging channels to be set from the UI process
https://bugs.webkit.org/show_bug.cgi?id=175608

Reviewed by Tim Horton.

Source/WebCore:

Change initializeLogChannelsIfNecessary() to take an optional String, which can
be a list of log channels passed from the UI process.

* platform/LogInitialization.h:
* platform/Logging.cpp:
(WebCore::initializeLogChannelsIfNecessary):

Source/WebKit:

The UI process can now read the "WebCoreLogging" default, and pass it to the web process
via WebProcessCreationParameters, where WebProcess::platformInitializeWebProcess() uses
it to set up WebCore logging channels. Note that these will override channels read from
the web process user defaults domain (but those are hard to set anyway).

* Shared/WebProcessCreationParameters.cpp:
(WebKit::WebProcessCreationParameters::encode const):
(WebKit::WebProcessCreationParameters::decode):
* Shared/WebProcessCreationParameters.h:
* UIProcess/Cocoa/WebProcessPoolCocoa.mm:
(WebKit::WebProcessPool::platformInitializeWebProcess):
* WebProcess/cocoa/WebProcessCocoa.mm:
(WebKit::WebProcess::platformInitializeWebProcess):

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

2 years agoFetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type...
cdumez@apple.com [Wed, 16 Aug 2017 01:23:50 +0000 (01:23 +0000)]
Fetch / Beacon: Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView
https://bugs.webkit.org/show_bug.cgi?id=175600

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/beacon/headers/header-content-type-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers.any-expected.txt:
* web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt:

Source/WebCore:

Use "application/octet-stream" Content-Type for payloads of type ArrayBuffer / ArrayBufferView in Fetch & Beacon.
If we don't set a Content-Type header, our underlying network stack is going to add a "application/x-www-form-urlencoded"
Content-Type header, which is worse.

Chrome is already using "application/octet-stream" Content-Type in Beacon, but use no Content-Type in Fetch.
The Fetch/Beacon specification says we should have no Content-Type header in this case but this is unfortunately
not something we can support at the moment. Using "application/octet-stream" Content-Type for now seems like the
lesser evil.

Test: http/wpt/fetch/fetch-request-arraybuffer-content-type.html

* Modules/fetch/FetchBody.cpp:
(WebCore::FetchBody::extract):
* platform/network/HTTPHeaderValues.cpp:
(WebCore::HTTPHeaderValues::octetStreamContentType):
* platform/network/HTTPHeaderValues.h:

LayoutTests:

* http/wpt/fetch/fetch-request-arraybuffer-content-type-expected.txt: Added.
* http/wpt/fetch/fetch-request-arraybuffer-content-type.html: Added.
* platform/mac-highsierra/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any-expected.txt:
* platform/mac-highsierra/imported/w3c/web-platform-tests/fetch/api/basic/request-headers.any.worker-expected.txt:

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

2 years agoJSTests:
commit-queue@webkit.org [Wed, 16 Aug 2017 01:10:01 +0000 (01:10 +0000)]
JSTests:
Support the 'with' keyword in FTL.
https://bugs.webkit.org/show_bug.cgi?id=175585

Patch by Robin Morisset <rmorisset@apple.com> on 2017-08-15
Reviewed by Saam Barati.

Also improve the JSTest/stress/with.js file to test
what happens when non-objects are passed to with.

* stress/with.js:
(foo):
(i.catch):
(i.with): Deleted.

Source/JavaScriptCore:
Support the 'with' keyword in FTL
https://bugs.webkit.org/show_bug.cgi?id=175585

Patch by Robin Morisset <rmorisset@apple.com> on 2017-08-15
Reviewed by Saam Barati.

Also makes sure that the order of arguments of PushWithScope, op_push_with_scope, JSWithScope::create()
and so on is consistent (always parentScope first, the new scopeObject second). We used to go from one
to the other at different step which was quite confusing. I picked this order for consistency with CreateActivation
that takes its parentScope argument first.

* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitPushWithScope):
* debugger/DebuggerCallFrame.cpp:
(JSC::DebuggerCallFrame::evaluateWithScopeExtension):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePushWithScope):
* ftl/FTLCapabilities.cpp:
(JSC::FTL::canCompile):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileNode):
(JSC::FTL::DFG::LowerDFGToB3::compilePushWithScope):
* jit/JITOperations.cpp:
* runtime/CommonSlowPaths.cpp:
(JSC::SLOW_PATH_DECL):
* runtime/Completion.cpp:
(JSC::evaluateWithScopeExtension):
* runtime/JSWithScope.cpp:
(JSC::JSWithScope::create):
* runtime/JSWithScope.h:

Source/WebCore:
Change the order of arguments of JSWithScope::create() for consistency
https://bugs.webkit.org/show_bug.cgi?id=175585

Patch by Robin Morisset <rmorisset@apple.com> on 2017-08-15
Reviewed by Saam Barati.

No change of behavior.

* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::JSHTMLElement::pushEventHandlerScope const):

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

2 years agoMake VM::scratchBufferForSize thread safe
sbarati@apple.com [Wed, 16 Aug 2017 00:03:45 +0000 (00:03 +0000)]
Make VM::scratchBufferForSize thread safe
https://bugs.webkit.org/show_bug.cgi?id=175604

Reviewed by Geoffrey Garen and Mark Lam.

I want to use the VM::scratchBufferForSize in another patch I'm writing.
The use case for my other patch is to call it from the compiler thread.
When reading the code, I saw that this API was not thread safe. This patch
makes it thread safe. It actually turns out we were calling this API from
the compiler thread already when we created FTL::State for an FTL OSR entry
compilation, and from FTLLowerDFGToB3. That code was racy and wrong, but
is now correct with this patch.

* runtime/VM.cpp:
(JSC::VM::VM):
(JSC::VM::~VM):
(JSC::VM::gatherConservativeRoots):
(JSC::VM::scratchBufferForSize):
* runtime/VM.h:
(JSC::VM::scratchBufferForSize): Deleted.

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

2 years agoSkipped media/modern-media-controls/time-labels-support/elapsed-time.html.
jlewis3@apple.com [Wed, 16 Aug 2017 00:02:51 +0000 (00:02 +0000)]
Skipped media/modern-media-controls/time-labels-support/elapsed-time.html.
<rdar://problem/33731086>

Unreviewed test gardening.

* platform/mac-highsierra/TestExpectations:

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

2 years agoLayoutTests: test that an XMLHttpRequest with Content-Encoding: gzip is properly...
jfbastien@apple.com [Tue, 15 Aug 2017 23:48:46 +0000 (23:48 +0000)]
LayoutTests: test that an XMLHttpRequest with Content-Encoding: gzip is properly decompressed
https://bugs.webkit.org/show_bug.cgi?id=175579

Also test that without Content-Encoding proper sniffing takes place, and gzip
decoding occurs. This test is disabled and tracked by #175597.

Reviewed by Daniel Bates.

* TestExpectations:
* http/tests/xmlhttprequest/gzip-content-type-expected.txt: Added.
* http/tests/xmlhttprequest/gzip-content-type-no-content-encoding-expected.txt: Added.
* http/tests/xmlhttprequest/gzip-content-type-no-content-encoding.html: Added.
* http/tests/xmlhttprequest/gzip-content-type.html: Added.
* http/tests/xmlhttprequest/resources/gzip-lorem-no-content-encoding.php: Added.
* http/tests/xmlhttprequest/resources/gzip-lorem.php: Added.

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

2 years agoRe-sync DOM Web-Platform-Tests from upstream
cdumez@apple.com [Tue, 15 Aug 2017 23:23:51 +0000 (23:23 +0000)]
Re-sync DOM Web-Platform-Tests from upstream
https://bugs.webkit.org/show_bug.cgi?id=175588

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Re-sync DOM Web-Platform-Tests from upstream b5129e92ce.

* web-platform-tests/dom/abort/event.any-expected.txt: Added.
* web-platform-tests/dom/abort/event.any.html: Added.
* web-platform-tests/dom/abort/event.any.js: Added.
* web-platform-tests/dom/abort/event.any.worker-expected.txt: Added.
* web-platform-tests/dom/abort/event.any.worker.html: Added.
* web-platform-tests/dom/abort/w3c-import.log: Added.
* web-platform-tests/dom/events/Event-dispatch-click-expected.txt:
* web-platform-tests/dom/events/Event-dispatch-click.html:
* web-platform-tests/dom/events/Event-timestamp-high-resolution-expected.txt: Added.
* web-platform-tests/dom/events/Event-timestamp-high-resolution.html: Added.
* web-platform-tests/dom/events/Event-timestamp-safe-resolution-expected.txt: Added.
* web-platform-tests/dom/events/Event-timestamp-safe-resolution.html: Added.
* web-platform-tests/dom/events/EventTarget-constructible.any-expected.txt: Added.
* web-platform-tests/dom/events/EventTarget-constructible.any.html: Added.
* web-platform-tests/dom/events/EventTarget-constructible.any.js: Added.
(test.listener):
(test):
(test.prototype.on):
(test.prototype.off):
(test.prototype.dispatch):
* web-platform-tests/dom/events/EventTarget-constructible.any.worker-expected.txt: Added.
* web-platform-tests/dom/events/EventTarget-constructible.any.worker.html: Added.
* web-platform-tests/dom/events/EventTarget-dispatchEvent-expected.txt:
* web-platform-tests/dom/events/w3c-import.log:
* web-platform-tests/dom/interface-objects-expected.txt:
* web-platform-tests/dom/interface-objects.html:
* web-platform-tests/dom/interfaces-expected.txt:
* web-platform-tests/dom/interfaces.html:
* web-platform-tests/dom/nodes/Document-constructor-svg.svg: Removed.
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01-expected.txt: Removed.
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_01.html: Removed.
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02-expected.txt:
* web-platform-tests/dom/nodes/Document-contentType/contentType/contenttype_datauri_02.html:
* web-platform-tests/dom/nodes/Document-contentType/contentType/w3c-import.log:
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.html: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.svg: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xhtml: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/empty.xml: Added.
* web-platform-tests/dom/nodes/Document-createElement-namespace-tests/w3c-import.log:
* web-platform-tests/dom/nodes/Document-createEvent-expected.txt:
* web-platform-tests/dom/nodes/Document-createEvent.html:
* web-platform-tests/dom/nodes/Document-createEvent.js:
* web-platform-tests/dom/nodes/Element-classlist-expected.txt:
* web-platform-tests/dom/nodes/Element-classlist.html:
* web-platform-tests/dom/nodes/Element-matches-init.js: Copied from LayoutTests/imported/w3c/web-platform-tests/dom/nodes/Element-matches.html.
(init):
* web-platform-tests/dom/nodes/Element-matches.html:
* web-platform-tests/dom/nodes/Element-webkitMatchesSelector.html:
* web-platform-tests/dom/nodes/Node-cloneNode-expected.txt:
* web-platform-tests/dom/nodes/Node-cloneNode.html:
* web-platform-tests/dom/nodes/w3c-import.log:
* web-platform-tests/interfaces/OWNERS: Added.
* web-platform-tests/interfaces/clipboard.idl: Added.
* web-platform-tests/interfaces/cssom.idl: Added.
* web-platform-tests/interfaces/dedicated-workers.idl: Added.
* web-platform-tests/interfaces/dom.idl: Added.
* web-platform-tests/interfaces/fullscreen.idl: Added.
* web-platform-tests/interfaces/geometry.idl: Added.
* web-platform-tests/interfaces/html.idl: Added.
* web-platform-tests/interfaces/mediacapture-main.idl: Added.
* web-platform-tests/interfaces/remoteplayback.idl: Added.
* web-platform-tests/interfaces/touchevents.idl: Added.
* web-platform-tests/interfaces/uievents.idl: Added.
* web-platform-tests/interfaces/web-share.idl: Added.
* web-platform-tests/interfaces/webrtc-pc.idl: Added.
* web-platform-tests/interfaces/webusb.idl: Added.

LayoutTests:

* platform/mac/TestExpectations:

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

2 years agoundefined URL in PopoverTracker for failed step
aakash_jain@apple.com [Tue, 15 Aug 2017 22:58:17 +0000 (22:58 +0000)]
undefined URL in PopoverTracker for failed step
https://bugs.webkit.org/show_bug.cgi?id=175593
<rdar://problem/33898769>

Reviewed by Daniel Bates.

This fix is a workaround for Buildbot 0.9 bug <https://github.com/buildbot/buildbot/issues/3529> where it
does not provide a URL to stdio for a build step. Buildbot 0.8 always included a URL to the stdio of the step.

* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotIteration.js:
(BuildbotIteration.prototype._parseData): Pass the URL while instantiating BuildbotTestResults.
(BuildbotIteration.prototype._urlForStep): Method to get the URL for a step.
* BuildSlaveSupport/build.webkit.org-config/public_html/dashboard/Scripts/BuildbotTestResults.js:
(BuildbotTestResults): Accept URL in constructor.

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

2 years agoJSC named bytecode offsets should use references rather than pointers
keith_miller@apple.com [Tue, 15 Aug 2017 22:54:50 +0000 (22:54 +0000)]
JSC named bytecode offsets should use references rather than pointers
https://bugs.webkit.org/show_bug.cgi?id=175601

Reviewed by Saam Barati.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):

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

2 years agoMark http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store...
ryanhaddad@apple.com [Tue, 15 Aug 2017 22:43:14 +0000 (22:43 +0000)]
Mark http/tests/loading/resourceLoadStatistics/clear-in-memory-and-persistent-store.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=175263

Unreviewed test gardening.

* platform/wk2/TestExpectations:

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

2 years ago[Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields...
commit-queue@webkit.org [Tue, 15 Aug 2017 22:38:24 +0000 (22:38 +0000)]
[Cache API] Ensure ResourceResponse is not null when redirected/tainting/type fields are set
https://bugs.webkit.org/show_bug.cgi?id=175538

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

No change of behavior.
This change ensures that response type is preserved when encoding/decoding ResourceResponse, in particular the error type.
This will allow Cache API to preserve responses when reading them from a different process.

* platform/network/ResourceResponseBase.cpp:
(WebCore::ResourceResponseBase::setType):
* platform/network/ResourceResponseBase.h:
(WebCore::ResourceResponseBase::setType):

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

2 years agoMark fast/images/animated-gif-scrolling-crash.html as flaky.
ryanhaddad@apple.com [Tue, 15 Aug 2017 22:34:48 +0000 (22:34 +0000)]
Mark fast/images/animated-gif-scrolling-crash.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=175345.

Unreviewed test gardening.

* platform/mac-wk1/TestExpectations:

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

2 years agoMark fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html as flaky.
ryanhaddad@apple.com [Tue, 15 Aug 2017 22:06:14 +0000 (22:06 +0000)]
Mark fast/mediacapturefromelement/CanvasCaptureMediaStream-webgl-events.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=175592

Unreviewed test gardening.

* platform/mac/TestExpectations:

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

2 years agoMark http/tests/appcache/deferred-events-delete-while-raising-timer.html as flaky.
ryanhaddad@apple.com [Tue, 15 Aug 2017 21:44:00 +0000 (21:44 +0000)]
Mark http/tests/appcache/deferred-events-delete-while-raising-timer.html as flaky.
https://bugs.webkit.org/show_bug.cgi?id=87633

Unreviewed test gardening.

* TestExpectations: Add expectation that was removed with r220750.

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

2 years agoUpdate CachedResourceLoader::requestResource() to return a WTF::Expected
cdumez@apple.com [Tue, 15 Aug 2017 21:15:09 +0000 (21:15 +0000)]
Update CachedResourceLoader::requestResource() to return a WTF::Expected
https://bugs.webkit.org/show_bug.cgi?id=175505

Reviewed by Youenn Fablet.

Update CachedResourceLoader::requestResource() to return a WTF::Expected
type instead of using an out parameter for the ResourceError in case of
synchronous failure.

* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* bindings/js/CachedScriptFetcher.cpp:
(WebCore::CachedScriptFetcher::requestScriptWithCache const):
* css/CSSFontFaceSrcValue.cpp:
(WebCore::CSSFontFaceSrcValue::cachedFont):
* css/CSSImageSetValue.cpp:
(WebCore::CSSImageSetValue::loadBestFitImage):
* css/CSSImageValue.cpp:
(WebCore::CSSImageValue::loadImage):
* css/StyleRuleImport.cpp:
(WebCore::StyleRuleImport::requestStyleSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::checkStyleSheet):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::process):
* loader/CrossOriginPreflightChecker.cpp:
(WebCore::CrossOriginPreflightChecker::startPreflight):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::startLoadingMainResource):
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/FrameLoader.cpp:
(WebCore::FrameLoader::loadedResourceFromMemoryCache):
* loader/FrameLoader.h:
* loader/ImageLoader.cpp:
(WebCore::ImageLoader::updateFromElement):
* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/MediaResourceLoader.cpp:
(WebCore::MediaResourceLoader::requestResource):
* loader/TextTrackLoader.cpp:
(WebCore::TextTrackLoader::load):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::castCachedResourceTo):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestFont):
(WebCore::CachedResourceLoader::requestTextTrack):
(WebCore::CachedResourceLoader::requestCSSStyleSheet):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestScript):
(WebCore::CachedResourceLoader::requestXSLStyleSheet):
(WebCore::CachedResourceLoader::requestSVGDocument):
(WebCore::CachedResourceLoader::requestLinkResource):
(WebCore::CachedResourceLoader::requestMedia):
(WebCore::CachedResourceLoader::requestIcon):
(WebCore::CachedResourceLoader::requestRawResource):
(WebCore::CachedResourceLoader::requestBeaconResource):
(WebCore::CachedResourceLoader::requestMainResource):
(WebCore::CachedResourceLoader::shouldContinueAfterNotifyingLoadedFromMemoryCache):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::preload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/CachedSVGDocumentReference.cpp:
(WebCore::CachedSVGDocumentReference::load):
* loader/icon/IconLoader.cpp:
(WebCore::IconLoader::startLoading):
* platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
(WebCore::WebCoreAVFResourceLoader::startLoading):
* svg/SVGFEImageElement.cpp:
(WebCore::SVGFEImageElement::requestImageResource):
* svg/SVGFontFaceUriElement.cpp:
(WebCore::SVGFontFaceUriElement::loadFont):
* svg/SVGUseElement.cpp:
(WebCore::SVGUseElement::updateExternalDocument):
* xml/XSLImportRule.cpp:
(WebCore::XSLImportRule::loadSheet):

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

2 years ago[PAL] Move Sleep classes into PAL
don.olmstead@sony.com [Tue, 15 Aug 2017 21:08:21 +0000 (21:08 +0000)]
[PAL] Move Sleep classes into PAL
https://bugs.webkit.org/show_bug.cgi?id=175456

Reviewed by Ryosuke Niwa.

Source/WebCore:

No new tests. No change in behavior.

* CMakeLists.txt:
* PlatformMac.cmake:
* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
* html/HTMLMediaElement.h:
* platform/audio/PlatformMediaSessionManager.cpp:
* platform/audio/PlatformMediaSessionManager.h:
* platform/mac/WebVideoFullscreenController.h:
* platform/mac/WebVideoFullscreenController.mm:

Source/WebCore/PAL:

* PAL.xcodeproj/project.pbxproj:
* pal/CMakeLists.txt:
* pal/PlatformMac.cmake:
* pal/system/SleepDisabler.cpp: Renamed from Source/WebCore/platform/SleepDisabler.cpp.
* pal/system/SleepDisabler.h: Renamed from Source/WebCore/platform/SleepDisabler.h.
* pal/system/SystemSleepListener.cpp: Renamed from Source/WebCore/platform/SystemSleepListener.cpp.
* pal/system/SystemSleepListener.h: Renamed from Source/WebCore/platform/SystemSleepListener.h.
* pal/system/cocoa/SleepDisablerCocoa.cpp: Renamed from Source/WebCore/platform/cocoa/SleepDisablerCocoa.cpp.
* pal/system/cocoa/SleepDisablerCocoa.h: Renamed from Source/WebCore/platform/cocoa/SleepDisablerCocoa.h.
* pal/system/mac/SystemSleepListenerMac.h: Renamed from Source/WebCore/platform/mac/SystemSleepListenerMac.h.
* pal/system/mac/SystemSleepListenerMac.mm: Renamed from Source/WebCore/platform/mac/SystemSleepListenerMac.mm.

Source/WebKit:

* UIProcess/mac/WKFullScreenWindowController.h:
* UIProcess/mac/WKFullScreenWindowController.mm:

Source/WebKitLegacy/mac:

* WebView/WebFullScreenController.h:

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

2 years ago[Cache API] Adding generic support for CacheStorage and Cache methods
commit-queue@webkit.org [Tue, 15 Aug 2017 21:04:38 +0000 (21:04 +0000)]
[Cache API] Adding generic support for CacheStorage and Cache methods
https://bugs.webkit.org/show_bug.cgi?id=175455

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

LayoutTests/imported/w3c:

* web-platform-tests/service-workers/cache-storage/serviceworker/credentials.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-storage-match.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/window/cache-storage.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/worker/cache-storage-match.https-expected.txt:
* web-platform-tests/service-workers/cache-storage/worker/cache-storage.https-expected.txt:

Source/WebCore:

Covered by existing tests.

Adding a CacheStorageProvider abstraction that creates a CacheStorageConnection.
The CacheStorageProvider is accessed from the page for Document calls.
The CacheStorageConnection is responsible to implement the read/write operations on the cache database.
At the moment, it does nothing but return not implemented errors.

Implementing CacheStorage APIs and Cache APIs based on the CacheStorageConnection except for Cache add and addAll which will be implemented later on.
CacheStoragConnection is responsible to read/write CacheStorage list of caches and each individual cache.
The CacheStorageConnection is a generic connection and not tied to any document/context.
CacheStorage objects are manipulated by providing to the connection the origin of the context.
CacheStorage are global to all contexts with the same origin.
Cache objects are manipulated by an ID that is given initially by the CacheStorageEngine when opening the Cache object.

Adding various accessors and constructors for Fetch constructs as needed by the Cache API implementation.

* Modules/cache/Cache.cpp:
(WebCore::Cache::Cache):
(WebCore::Cache::~Cache):
The CacheStorageConnection is a generic connection and not tied to any document/context.
(WebCore::Cache::match): Implementation of https://www.w3.org/TR/service-workers-1/#cache-match.
Redirect to matchAll as per spec.
(WebCore::Cache::matchAll): Implementation of https://www.w3.org/TR/service-workers-1/#cache-matchAll.
Checks for request as per spec. Then either refresh the request to response map and return all responses.
Or call the query cache algorithm and return copies of the responses (using clone).
(WebCore::Cache::put):
Check the request and response as per spec.
Add temporary rejection cases (being loaded responses, responses with ReadableStream) as there is no support for them right now.
Call the batch put operation.
(WebCore::Cache::remove):
Check the request and response as per spec.
Call the batch delete operation.
(WebCore::Cache::keys):
Refresh the request to response map and return corresponding requests.
Making sure to reuse the same request objects as per spec.
As per spec, the request to response map is ordered. We implement it as a Vector.
(WebCore::Cache::refreshRequestToResponseMap):
Use the cache storage connection to get an up-to-date list of cached records.
(WebCore::Cache::queryCacheMatch):
Implements the match algorithm defined in https://www.w3.org/TR/service-workers-1/#query-cache-algorithm.
This is split for queryCache as cache storage engine will need to use it when implementing the delete operation.
(WebCore::Cache::queryCache):
Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with no targetStorage argument.
(WebCore::Cache::queryCacheWithTargetStorage):
Full implementation of https://www.w3.org/TR/service-workers-1/#query-cache-algorithm with a provided targetStorage argument.
(WebCore::Cache::batchDeleteOperation):
Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm but dedicated to a delete operation.
Delete operation are always done one at a time.
(WebCore::Cache::batchPutOperation):
Implementation of https://www.w3.org/TR/service-workers-1/#batch-cache-operations-algorithm dedicated to a put operation.
Put operation takes one record for put but can take several records in the case of addAll, hence the current design.
(WebCore::Cache::updateRequestToResponseMap):
Update the cache request to response map based on the records retrieved from the cache storage connection.
* Modules/cache/Cache.h:
(WebCore::Cache::create):
(WebCore::Cache::name const):
* Modules/cache/Cache.idl:
* Modules/cache/CacheStorage.cpp:
(WebCore::CacheStorage::origin const):
Computing the cache origin that is passed to the CacheStorageConnection.
(WebCore::CacheStorage::has):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-has.
Call the cache storage connection to refresh its cache map.
Then use it to check whether a cache exists.
(WebCore::CacheStorage::refreshCacheMap):
Use the cache storage connection to get the list of existing caches.
(WebCore::CacheStorage::open):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-open.
Refreshing the cache map so as to return a pre-existing cache if any.
(WebCore::CacheStorage::remove):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-delete-method.
Refreshing the cache map so as to do nothing if there is no cache to remove.
(WebCore::CacheStorage::keys):
Implementation of https://www.w3.org/TR/service-workers-1/#cache-storage-keys-method.
Refreshing the cache map and returnin its keys.
As per spec, the cache map is ordered. We implement it as a Vector.
(WebCore::CacheStorage::cacheMap):
Get the list of cache objects, used as a private accessor for JS built-ins.
* Modules/cache/CacheStorage.h:
(WebCore::CacheStorage::create):
(WebCore::CacheStorage::CacheStorage):
* Modules/cache/CacheStorageConnection.cpp: Added.
(WebCore::CacheStorageConnection::exceptionFromError):
* Modules/cache/CacheStorageConnection.h: Added.
Makes the link between Web facing Cache API and the cache storage engine.
Envisioned implementation are:
- One main thread connection used by all documents in the given process.
- One connection per worker that forwards the calls to the main thread and use the main thread connection afterwards.
(WebCore::CacheStorageConnection::create):
(WebCore::CacheStorageConnection::open):
(WebCore::CacheStorageConnection::remove):
(WebCore::CacheStorageConnection::refreshCacheMap):
(WebCore::CacheStorageConnection::refreshRequestToResponseMap):
(WebCore::CacheStorageConnection::batchDeleteOperation):
(WebCore::CacheStorageConnection::batchPutOperation):
* Modules/cache/CacheStorageRecord.h: Added. A fetch record from the Web facing cache API perspective.
* Modules/cache/DOMWindowCaches.cpp:
(WebCore::DOMWindowCaches::caches const):
* Modules/cache/WorkerGlobalScopeCaches.cpp:
(WebCore::WorkerGlobalScopeCaches::from):
(WebCore::WorkerGlobalScopeCaches::caches const):
* Modules/cache/WorkerGlobalScopeCaches.h:
(WebCore::WorkerGlobalScopeCaches::WorkerGlobalScopeCaches):
* Modules/fetch/FetchBodyOwner.h:
(WebCore::FetchBodyOwner::isReadableStreamBody const): Added getter as it is used by cache API.
* Modules/fetch/FetchHeaders.h:
(WebCore::FetchHeaders::create): Add another create as used by the cache API.
(WebCore::FetchHeaders::guard const): Added getter and IPC serializer as this is something that will be stored by the cache engine.
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
* Modules/fetch/FetchRequest.cpp:
(WebCore::buildOptions): In case FetchRequest::create is called from C++, there is no need to set init.window to a null value.
Add a check so that no value at all is the same as a null/undefined value.
(WebCore::FetchRequest::resourceRequest const):
* Modules/fetch/FetchRequest.h:
* Modules/fetch/FetchResponse.h:
* WebCore.xcodeproj/project.pbxproj:
* inspector/InspectorOverlay.cpp:
(WebCore::InspectorOverlay::overlayPage):
* page/CacheStorageProvider.h: Added.
Interface to create main thread cache storage connection for the given page.
There will be one provider for each process.
Passing a sessionID so that we will create a connection per session.
* page/Page.cpp:
(WebCore::Page::Page):
* page/Page.h:
(WebCore::Page::cacheStorageProvider):
* page/PageConfiguration.cpp:
(WebCore::PageConfiguration::PageConfiguration):
* page/PageConfiguration.h:
* svg/graphics/SVGImage.cpp:
(WebCore::SVGImage::dataChanged):

Source/WebKit:

* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Cache/WebCacheStorageProvider.h: Added.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::WebProcess):
* WebProcess/WebProcess.h:
(WebKit::WebProcess::cacheStorageProvider):

Source/WebKitLegacy/mac:

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

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::initWithFrame):

LayoutTests:

* TestExpectations: Skipping a test that would timeout otherwise due to the current implementation limitations.

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

2 years agoWPT harness errors on leaks bot
commit-queue@webkit.org [Tue, 15 Aug 2017 20:21:26 +0000 (20:21 +0000)]
WPT harness errors on leaks bot
https://bugs.webkit.org/show_bug.cgi?id=175269

Patch by Youenn Fablet <youenn@apple.com> on 2017-08-15
Reviewed by Alexey Proskuryakov.

To try debugging these errors, let's check whether the WPT server is
sending back resources of the expected size.

* web-platform-tests/tools/wptserve/wptserve/response.py:
(Response.write_content):
(ResponseWriter.write_content):
(ResponseWriter.write):
(ResponseWriter.write_content_file):

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

2 years agoEnable named offsets into JSC bytecodes
keith_miller@apple.com [Tue, 15 Aug 2017 20:13:54 +0000 (20:13 +0000)]
Enable named offsets into JSC bytecodes
https://bugs.webkit.org/show_bug.cgi?id=175561

Reviewed by Mark Lam.

This patch adds the ability to add named offsets into JSC's
bytecodes.  In the bytecode json file, instead of listing a
length, you can now list a set of names and their types. Each
opcode with an offsets property will have a struct named after the
opcode by in our C++ naming style. For example,
op_overrides_has_instance would become OpOverridesHasInstance. The
struct has the same memory layout as the instruction list has but
comes with handy named accessors.

As a first cut I converted the various instanceof bytecodes to use
named offsets.

As an example op_overrides_has_instance produces the following struct:

struct OpOverridesHasInstance {
public:
    Opcode& opcode() { return *reinterpret_cast<Opcode*>(&m_opcode); }
    const Opcode& opcode() const { return *reinterpret_cast<const Opcode*>(&m_opcode); }
    int& dst() { return *reinterpret_cast<int*>(&m_dst); }
    const int& dst() const { return *reinterpret_cast<const int*>(&m_dst); }
    int& constructor() { return *reinterpret_cast<int*>(&m_constructor); }
    const int& constructor() const { return *reinterpret_cast<const int*>(&m_constructor); }
    int& hasInstanceValue() { return *reinterpret_cast<int*>(&m_hasInstanceValue); }
    const int& hasInstanceValue() const { return *reinterpret_cast<const int*>(&m_hasInstanceValue); }

private:
    friend class LLIntOffsetsExtractor;
    std::aligned_storage<sizeof(Opcode), sizeof(Instruction)>::type m_opcode;
    std::aligned_storage<sizeof(int), sizeof(Instruction)>::type m_dst;
    std::aligned_storage<sizeof(int), sizeof(Instruction)>::type m_constructor;
    std::aligned_storage<sizeof(int), sizeof(Instruction)>::type m_hasInstanceValue;
};

* CMakeLists.txt:
* DerivedSources.make:
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/BytecodeList.json:
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* generate-bytecode-files:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
* llint/LLIntOffsetsExtractor.cpp:
* llint/LowLevelInterpreter.asm:
* llint/LowLevelInterpreter32_64.asm:
* llint/LowLevelInterpreter64.asm:

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

2 years agoAdd Offline Assembler parsing test to RexBench
msaboff@apple.com [Tue, 15 Aug 2017 20:11:57 +0000 (20:11 +0000)]
Add Offline Assembler parsing test to RexBench
https://bugs.webkit.org/show_bug.cgi?id=175581

Reviewed by Saam Barati.

This is a port of the JavaScriptCore offline assmebler's lexer, parser, AST and
supporting code from Ruby to JavaScript turned into a benchmark.  The benchmark
timing includes parsing through AST.  The validation processing time is not
part of the benchmark measurement.

The input data is the current tip of tree LLInt .asm source files.  Those file
were converted to JavaScript using the python script, convert_asm_to_js.py.
There is also a new JavaScript file, generate_expected.js, to create the
expected output JavaScript file.

* RexBench/OfflineAssembler: Added.
* RexBench/OfflineAssembler/ast.js: Added.
* RexBench/OfflineAssembler/instructions.js: Added.
* RexBench/OfflineAssembler/parser.js: Added.
* RexBench/OfflineAssembler/registers.js: Added.
These are JavaScript translation of the Ruby Offline Assembler.  Code not
needed for the benchmark was not translated and therefore missing.

* RexBench/OfflineAssembler/InitBytecodes.asm: Added.
* RexBench/OfflineAssembler/InitBytecodes.js: Added.
* RexBench/OfflineAssembler/LowLevelInterpreter.asm: Added.
* RexBench/OfflineAssembler/LowLevelInterpreter.js: Added.
* RexBench/OfflineAssembler/LowLevelInterpreter32_64.asm: Added.
* RexBench/OfflineAssembler/LowLevelInterpreter32_64.js: Added.
* RexBench/OfflineAssembler/LowLevelInterpreter64.asm: Added.
* RexBench/OfflineAssembler/LowLevelInterpreter64.js: Added.
Copies of the current LLInt source and conversion to JavaScript.

* RexBench/OfflineAssembler/file.js: Added.
(File):
(File.open):
(File.prototype.read):
Mock File class used to simulate filesystem access.

* RexBench/OfflineAssembler/expected.js: Added.
Expected output of the AST dumped and split into individual lines.

* RexBench/OfflineAssembler/benchmark.js: Added.
(OfflineAssemblerBenchmark):
(OfflineAssemblerBenchmark.prototype.runOnce):
(OfflineAssemblerBenchmark.prototype.validate):
Benchmark sub class for this test.

* RexBench/OfflineAssembler/convert_asm_to_js.py: Added.
(convertFile):
Converts .asm into .js files compatible to the benchmark.

* RexBench/OfflineAssembler/generate_expected.js: Added.
Converts AST output into the expected file format.

* RexBench/about.html: Added description of this sub-benchmark test.

* RexBench/cli.js:
* RexBench/glue.js:
* RexBench/index.html:
* RexBench/offline_assembler_benchmark.js: Added.
Updates to add this sub-benchmark.

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

2 years agoImplement quota limitation for keepalive Fetch requests
cdumez@apple.com [Tue, 15 Aug 2017 19:35:11 +0000 (19:35 +0000)]
Implement quota limitation for keepalive Fetch requests
https://bugs.webkit.org/show_bug.cgi?id=175482

Reviewed by Sam Weinig and Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker-expected.txt:
* web-platform-tests/fetch/http-cache/cc-request-expected.txt:
Rebaseline tests now that we provide a more helpful error message when rejecting
the fetch() promise.

* web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
Rebaseline test for keepalive Fetch requests quota which is now passing.

Source/WebCore:

Implement quota limitation for keepalive Fetch requests as per:
- https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)

This partly works for Beacon as well, meaning that no Beacon with a body
over 64Kb can be sent. However, we don't keep track about wether or not
beacon loads are inflight or not.

Also update CachedResourceLoader::requestResource() so that the caller
can get a ResourceError when it returns null. This is useful for both
Fetch and Beacon to return better error messages.

Test: http/wpt/beacon/beacon-quota.html

* CMakeLists.txt:
* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
(WebCore::FetchBodyOwner::BlobLoader::didFail):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
(WebCore::FetchLoader::didFail):
* Modules/fetch/FetchLoaderClient.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestFont):
(WebCore::CachedResourceLoader::requestTextTrack):
(WebCore::CachedResourceLoader::requestCSSStyleSheet):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestScript):
(WebCore::CachedResourceLoader::requestXSLStyleSheet):
(WebCore::CachedResourceLoader::requestSVGDocument):
(WebCore::CachedResourceLoader::requestLinkResource):
(WebCore::CachedResourceLoader::requestMedia):
(WebCore::CachedResourceLoader::requestIcon):
(WebCore::CachedResourceLoader::requestRawResource):
(WebCore::CachedResourceLoader::requestBeaconResource):
(WebCore::CachedResourceLoader::requestMainResource):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::preload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/KeepaliveRequestTracker.cpp: Added.
(WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
(WebCore::KeepaliveRequestTracker::canLoadRequest):
(WebCore::KeepaliveRequestTracker::registerRequest):
(WebCore::KeepaliveRequestTracker::responseReceived):
(WebCore::KeepaliveRequestTracker::notifyFinished):
(WebCore::KeepaliveRequestTracker::unregisterRequest):
* loader/cache/KeepaliveRequestTracker.h: Added.
* platform/network/FormData.cpp:
(WebCore::FormDataElement::lengthInBytes const):
(WebCore::FormData::lengthInBytes const):
* platform/network/FormData.h:

LayoutTests:

* fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt:
* http/tests/contentextensions/async-xhr-onerror-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt:
* http/tests/security/mixedContent/insecure-xhr-in-main-frame-expected.txt:
Rebaseline a few tests now that we provide a more helpful error message when an XHR is failing synchronously.

* http/wpt/beacon/beacon-quota-expected.txt: Added.
* http/wpt/beacon/beacon-quota.html: Added.
Add layout test coverage for keepalive Fetch requests quota in the context of sendBeacon().
The second part of the test is still failing because WebCore does not currently know when
ping loads (e.g. beacon loads) complete. This will be addressed via Bug 175443.

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

2 years agoREGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer...
darin@apple.com [Tue, 15 Aug 2017 18:13:57 +0000 (18:13 +0000)]
REGRESSION(r220052): http/tests/appcache/deferred-events-delete-while-raising-timer.html is crashing.
https://bugs.webkit.org/show_bug.cgi?id=175107

Reviewed by Alexey Proskuryakov.

Source/WebCore:

* loader/FrameLoader.cpp:
(WebCore::FrameLoader::checkLoadComplete): Moved the assertion to after the null page check.

LayoutTests:

* TestExpectations: Removed the flakiness expectation for this test.

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

2 years agoUnreviewed GTK test gardening
mcatanzaro@igalia.com [Tue, 15 Aug 2017 17:47:10 +0000 (17:47 +0000)]
Unreviewed GTK test gardening

* TestExpectations:
* platform/gtk/TestExpectations:
* platform/gtk/fast/events/input-events-paste-rich-datatransfer-expected.txt:
* platform/gtk/imported/w3c/web-platform-tests/eventsource/format-field-id-2-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/eventsource/format-field-id-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/eventsource/format-mime-bogus-expected.txt: Added.
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:

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

2 years agoUnreviewed, rolling out r219504.
commit-queue@webkit.org [Tue, 15 Aug 2017 17:15:47 +0000 (17:15 +0000)]
Unreviewed, rolling out r219504.
https://bugs.webkit.org/show_bug.cgi?id=175580

Broke Arabic text shaping (Requested by mcatanzaro on
#webkit).

Reverted changeset:

"[HarfBuzz] Decomposed Vietnamese characters are rendered
incorrectly"
https://bugs.webkit.org/show_bug.cgi?id=174418
http://trac.webkit.org/changeset/219504

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

2 years agoUpdate testmasm to use new CPUState APIs.
mark.lam@apple.com [Tue, 15 Aug 2017 16:42:41 +0000 (16:42 +0000)]
Update testmasm to use new CPUState APIs.
https://bugs.webkit.org/show_bug.cgi?id=175573

Reviewed by Keith Miller.

1. Applied convenience CPUState accessors to minimize casting.
2. Converted the CHECK macro to CHECK_EQ to get more friendly failure debugging
   messages.
3. Removed the CHECK_DOUBLE_BITWISE_EQ macro.  We can just use CHECK_EQ now since
   casting is (mostly) no longer an issue.
4. Replaced the use of testDoubleWord(id) with bitwise_cast<double>(testWord64(id))
   to make it clear that we're comparing against the bit values of testWord64(id).
5. Added a "Completed N tests" message at the end of running all tests.
   This makes it easy to tell at a glance that testmasm completed successfully
   versus when it crashed midway in a test.  The number of tests also serves as
   a quick checksum to confirm that we ran the number of tests we expected.

* assembler/testmasm.cpp:
(WTF::printInternal):
(JSC::testSimple):
(JSC::testProbeReadsArgumentRegisters):
(JSC::testProbeWritesArgumentRegisters):
(JSC::testProbePreservesGPRS):
(JSC::testProbeModifiesStackPointer):
(JSC::testProbeModifiesProgramCounter):
(JSC::run):

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

2 years agoUnreviewed, rolling out r220700.
mcatanzaro@igalia.com [Tue, 15 Aug 2017 14:16:29 +0000 (14:16 +0000)]
Unreviewed, rolling out r220700.

Broke debug bot

Reverted changeset:

"[CoordGraphics] Simplify CoordinatedGraphicsScene state
updates"
https://bugs.webkit.org/show_bug.cgi?id=175528
http://trac.webkit.org/changeset/220700

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

2 years agoWebDriver: timeout when JavaScript alert is shown in onload handler
carlosgc@webkit.org [Tue, 15 Aug 2017 07:17:38 +0000 (07:17 +0000)]
WebDriver: timeout when JavaScript alert is shown in onload handler
https://bugs.webkit.org/show_bug.cgi?id=175315
<rdar://problem/33788294>

Reviewed by Brian Burg.

When a JavaScript alert is shown in an onload handler, the alert prevents the load from finishing in case of
normal page load strategy, so navigation commands or any other command for which we wait for navigation to
complete end up timing out. There are two selenium tests covering this that are currently timing out:
testShouldHandleAlertOnPageLoad and testShouldHandleAlertOnPageLoadUsingGet. The spec says that in case of page
load timeout we should only fail with timeout error when there isn't an active alert dialog. If the next command
expects an alert it will just work, otherwise it will fail with UnexpectedAlertOpen error when trying to handle
user prompts.

9 Navigation.
https://w3c.github.io/webdriver/webdriver-spec.html#dfn-wait-for-navigation-to-complete

* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::waitForNavigationToComplete): Do not wait for the timeout when the page is
loading and there's an active alert in case of normal page load strategy.
(WebKit::WebAutomationSession::respondToPendingPageNavigationCallbacksWithTimeout): Respond with timeout unless
the page is showing a JavaScript dialog.
(WebKit::WebAutomationSession::respondToPendingFrameNavigationCallbacksWithTimeout): Ditto.
(WebKit::WebAutomationSession::loadTimerFired): Use respondToPendingPageNavigationCallbacksWithTimeout() and
respondToPendingFrameNavigationCallbacksWithTimeout().
(WebKit::WebAutomationSession::willShowJavaScriptDialog): The page is about to show a JavaScript dialog, so
we wait until the next run loop iteration to give time for the client to show the dialog, then check if page is
loading and the dialog is still present. If that's the case we finish all normal strategy pending navigations.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::runJavaScriptAlert): If controlled by automation, notify the session.
(WebKit::WebPageProxy::runJavaScriptConfirm): Ditto.
(WebKit::WebPageProxy::runJavaScriptPrompt): Ditto.
(WebKit::WebPageProxy::runBeforeUnloadConfirmPanel): Ditto.

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

2 years agoWebDriver: handle click events on option elements
carlosgc@webkit.org [Tue, 15 Aug 2017 07:03:13 +0000 (07:03 +0000)]
WebDriver: handle click events on option elements
https://bugs.webkit.org/show_bug.cgi?id=174710
<rdar://problem/33459305>

Reviewed by Brian Burg.

Source/WebCore:

Export WebCore symbols required by WebKit layer.

* html/HTMLOptGroupElement.h:
* html/HTMLOptionElement.h:

Source/WebDriver:

Option elements are considered as a special case by the specification. When clicking an option element, we
should get its container and use it when scrolling into view and calculating in-view center point instead of the
option element itself. Then, we should not emulate a click, but change the selected status of the option element
like if it were done by a user action, firing the corresponding events. Now we check whether the element is an
option to call selectOptionElement() or performMouseInteraction().

This fixes more than 20 selenium tests.

* CommandResult.cpp:
(WebDriver::CommandResult::CommandResult): Handle ElementNotSelectable protocol error.
(WebDriver::CommandResult::httpStatusCode const): Add ElementNotSelectable.
(WebDriver::CommandResult::errorString const): Ditto.
* CommandResult.h:
* Session.cpp:
(WebDriver::Session::selectOptionElement): Ask automation to select the given option element.
(WebDriver::Session::elementClick): Call selectOptionElement() or performMouseInteraction() depending on whether
the element is an option or not.
* Session.h:

Source/WebKit:

Add selectOptionElement method to automation to select an option element according to the WebDriver
specification.

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

* UIProcess/Automation/Automation.json: Add selectOptionElement method and ElementNotSelectable error.
* UIProcess/Automation/WebAutomationSession.cpp:
(WebKit::WebAutomationSession::selectOptionElement):Send SelectOptionElement message to the web process.
(WebKit::WebAutomationSession::didSelectOptionElement): Notify the driver.
* UIProcess/Automation/WebAutomationSession.h:
* UIProcess/Automation/WebAutomationSession.messages.in: Add DidSelectOptionElement message.
* WebProcess/Automation/WebAutomationSessionProxy.cpp:
(WebKit::elementContainer): Helper to get the container of an element according to the spec.
(WebKit::WebAutomationSessionProxy::computeElementLayout): Use the container element to scroll the view and
compute the in-view center point.
(WebKit::WebAutomationSessionProxy::selectOptionElement): Use HTMLSelectElement::optionSelectedByUser().
* WebProcess/Automation/WebAutomationSessionProxy.h:
* WebProcess/Automation/WebAutomationSessionProxy.messages.in: Add SelectOptionElement message.

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

2 years agoAdd testing tool to lie to the DFG about profiles
keith_miller@apple.com [Tue, 15 Aug 2017 04:18:56 +0000 (04:18 +0000)]
Add testing tool to lie to the DFG about profiles
https://bugs.webkit.org/show_bug.cgi?id=175487

Reviewed by Saam Barati.

JSTests:

* stress/compare-eq-incomplete-profile.js: Added.
(const.test.createBuiltin):

Source/JavaScriptCore:

This patch adds a new bytecode identity_with_profile that lets
us lie to the DFG about what profiles it has seen as the input to
another bytecode. Previously, there was no reliable way to force
a given profile when we tired up.

* bytecode/BytecodeDumper.cpp:
(JSC::BytecodeDumper<Block>::dumpBytecode):
* bytecode/BytecodeIntrinsicRegistry.h:
* bytecode/BytecodeList.json:
* bytecode/BytecodeUseDef.h:
(JSC::computeUsesForBytecodeOffset):
(JSC::computeDefsForBytecodeOffset):
* bytecode/SpeculatedType.cpp:
(JSC::speculationFromString):
* bytecode/SpeculatedType.h:
* bytecompiler/BytecodeGenerator.cpp:
(JSC::BytecodeGenerator::emitIdWithProfile):
* bytecompiler/BytecodeGenerator.h:
* bytecompiler/NodesCodegen.cpp:
(JSC::BytecodeIntrinsicNode::emit_intrinsic_idWithProfile):
* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGMayExit.cpp:
* dfg/DFGNode.h:
(JSC::DFG::Node::getForcedPrediction):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGValidate.cpp:
* jit/JIT.cpp:
(JSC::JIT::privateCompileMainPass):
* jit/JIT.h:
* jit/JITOpcodes.cpp:
(JSC::JIT::emit_op_identity_with_profile):
* jit/JITOpcodes32_64.cpp:
(JSC::JIT::emit_op_identity_with_profile):
* llint/LowLevelInterpreter.asm:

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

2 years agoRemove Proximity Events and related code
simon.fraser@apple.com [Tue, 15 Aug 2017 01:49:16 +0000 (01:49 +0000)]
Remove Proximity Events and related code
https://bugs.webkit.org/show_bug.cgi?id=175545

Reviewed by Daniel Bates.

No platform enables Proximity Events, so remove code inside ENABLE(PROXIMITY_EVENTS)
and other related code.

.:

* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* DerivedSources.cpp:
* Modules/proximity/DeviceProximityClient.h: Removed.
* Modules/proximity/DeviceProximityController.cpp: Removed.
* Modules/proximity/DeviceProximityController.h: Removed.
* Modules/proximity/DeviceProximityEvent.cpp: Removed.
* Modules/proximity/DeviceProximityEvent.h: Removed.
* Modules/proximity/DeviceProximityEvent.idl: Removed.
* dom/EventNames.h:
* dom/EventNames.in:
* history/PageCache.cpp:
(WebCore::canCachePage):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::addEventListener):
(WebCore::DOMWindow::removeEventListener):
(WebCore::DOMWindow::removeAllEventListeners):
* page/DOMWindow.idl:
* page/DiagnosticLoggingKeys.cpp:
(WebCore::DiagnosticLoggingKeys::deviceProximityKey): Deleted.
* page/DiagnosticLoggingKeys.h:
* testing/Internals.cpp:
(WebCore::Internals::setDeviceProximity): Deleted.
* testing/Internals.h:
* testing/Internals.idl:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebInspectorUI:

* UserInterface/Models/ScriptTimelineRecord.js:
(WI.ScriptTimelineRecord.EventType.displayName):

Source/WebKit:

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebCoreSupport/WebDeviceProximityClient.cpp: Removed.
* WebProcess/WebCoreSupport/WebDeviceProximityClient.h: Removed.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::m_cpuLimit):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

* fast/events/constructors/device-proximity-event-constructor-expected.txt: Removed.
* fast/events/constructors/device-proximity-event-constructor.html: Removed.
* platform/gtk/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:
* proximity/add-listener-from-callback-expected.txt: Removed.
* proximity/add-listener-from-callback.html: Removed.
* proximity/basic-operation-expected.txt: Removed.
* proximity/basic-operation.html: Removed.
* proximity/check-event-deviceproximity-expected.txt: Removed.
* proximity/check-event-deviceproximity.html: Removed.
* proximity/create-event-deviceproximity-expected.txt: Removed.
* proximity/create-event-deviceproximity.html: Removed.
* proximity/create-event-expected.txt: Removed.
* proximity/create-event.html: Removed.
* proximity/event-after-navigation-expected.txt: Removed.
* proximity/event-after-navigation.html: Removed.
* proximity/multiple-frames-expected.txt: Removed.
* proximity/multiple-frames.html: Removed.
* proximity/no-page-cache-expected.txt: Removed.
* proximity/no-page-cache.html: Removed.
* proximity/optional-event-properties-expected.txt: Removed.
* proximity/optional-event-properties.html: Removed.
* proximity/resources/cached-page-1.html: Removed.
* proximity/resources/cached-page-2.html: Removed.
* proximity/resources/event-after-navigation-new.html: Removed.
* proximity/updates-expected.txt: Removed.
* proximity/updates.html: Removed.
* proximity/window-property-expected.txt: Removed.
* proximity/window-property.html: Removed.

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

2 years agoImport eventsource Web-Platform-Tests
cdumez@apple.com [Tue, 15 Aug 2017 01:44:07 +0000 (01:44 +0000)]
Import eventsource Web-Platform-Tests
https://bugs.webkit.org/show_bug.cgi?id=175556

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

* resources/import-expectations.json:
* resources/resource-files.json:
* web-platform-tests/eventsource/OWNERS: Added.
* web-platform-tests/eventsource/README.md: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-close-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-close.htm: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-constructor-url-bogus-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-constructor-url-bogus.htm: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-eventtarget.worker-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-eventtarget.worker.html: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-eventtarget.worker.js: Added.
(async_test):
* web-platform-tests/eventsource/dedicated-worker/eventsource-onmesage-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-onmesage.htm: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-onopen-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-onopen.htm: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-prototype-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-prototype.htm: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-url-expected.txt: Added.
* web-platform-tests/eventsource/dedicated-worker/eventsource-url.htm: Added.
* web-platform-tests/eventsource/dedicated-worker/w3c-import.log: Added.
* web-platform-tests/eventsource/event-data-expected.txt: Added.
* web-platform-tests/eventsource/event-data.html: Added.
* web-platform-tests/eventsource/eventsource-close-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-close.htm: Added.
* web-platform-tests/eventsource/eventsource-constructor-document-domain-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-constructor-document-domain.htm: Added.
* web-platform-tests/eventsource/eventsource-constructor-non-same-origin-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-constructor-non-same-origin.htm: Added.
* web-platform-tests/eventsource/eventsource-constructor-stringify-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-constructor-stringify.htm: Added.
* web-platform-tests/eventsource/eventsource-constructor-url-bogus-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-constructor-url-bogus.htm: Added.
* web-platform-tests/eventsource/eventsource-constructor-url-multi-window-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-constructor-url-multi-window.htm: Added.
* web-platform-tests/eventsource/eventsource-eventtarget-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-eventtarget.htm: Added.
* web-platform-tests/eventsource/eventsource-onmessage-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-onmessage-realm-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-onmessage-realm-support.htm: Added.
* web-platform-tests/eventsource/eventsource-onmessage-realm.htm: Added.
* web-platform-tests/eventsource/eventsource-onmessage-trusted-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-onmessage-trusted.htm: Added.
* web-platform-tests/eventsource/eventsource-onmessage.htm: Added.
* web-platform-tests/eventsource/eventsource-onopen-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-onopen.htm: Added.
* web-platform-tests/eventsource/eventsource-prototype-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-prototype.htm: Added.
* web-platform-tests/eventsource/eventsource-reconnect-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-reconnect.htm: Added.
* web-platform-tests/eventsource/eventsource-url-expected.txt: Added.
* web-platform-tests/eventsource/eventsource-url.htm: Added.
* web-platform-tests/eventsource/format-bom-2-expected.txt: Added.
* web-platform-tests/eventsource/format-bom-2.htm: Added.
* web-platform-tests/eventsource/format-bom-expected.txt: Added.
* web-platform-tests/eventsource/format-bom.htm: Added.
* web-platform-tests/eventsource/format-comments-expected.txt: Added.
* web-platform-tests/eventsource/format-comments.htm: Added.
* web-platform-tests/eventsource/format-data-before-final-empty-line-expected.txt: Added.
* web-platform-tests/eventsource/format-data-before-final-empty-line.htm: Added.
* web-platform-tests/eventsource/format-field-data-expected.txt: Added.
* web-platform-tests/eventsource/format-field-data.htm: Added.
* web-platform-tests/eventsource/format-field-event-empty-expected.txt: Added.
* web-platform-tests/eventsource/format-field-event-empty.htm: Added.
* web-platform-tests/eventsource/format-field-event-expected.txt: Added.
* web-platform-tests/eventsource/format-field-event.htm: Added.
* web-platform-tests/eventsource/format-field-id-2-expected.txt: Added.
* web-platform-tests/eventsource/format-field-id-2.htm: Added.
* web-platform-tests/eventsource/format-field-id-expected.txt: Added.
* web-platform-tests/eventsource/format-field-id.htm: Added.
* web-platform-tests/eventsource/format-field-parsing-expected.txt: Added.
* web-platform-tests/eventsource/format-field-parsing.htm: Added.
* web-platform-tests/eventsource/format-field-retry-bogus-expected.txt: Added.
* web-platform-tests/eventsource/format-field-retry-bogus.htm: Added.
* web-platform-tests/eventsource/format-field-retry-empty-expected.txt: Added.
* web-platform-tests/eventsource/format-field-retry-empty.htm: Added.
* web-platform-tests/eventsource/format-field-retry-expected.txt: Added.
* web-platform-tests/eventsource/format-field-retry.htm: Added.
* web-platform-tests/eventsource/format-field-unknown-expected.txt: Added.
* web-platform-tests/eventsource/format-field-unknown.htm: Added.
* web-platform-tests/eventsource/format-leading-space-expected.txt: Added.
* web-platform-tests/eventsource/format-leading-space.htm: Added.
* web-platform-tests/eventsource/format-mime-bogus-expected.txt: Added.
* web-platform-tests/eventsource/format-mime-bogus.htm: Added.
* web-platform-tests/eventsource/format-mime-trailing-semicolon-expected.txt: Added.
* web-platform-tests/eventsource/format-mime-trailing-semicolon.htm: Added.
* web-platform-tests/eventsource/format-mime-valid-bogus-expected.txt: Added.
* web-platform-tests/eventsource/format-mime-valid-bogus.htm: Added.
* web-platform-tests/eventsource/format-newlines-expected.txt: Added.
* web-platform-tests/eventsource/format-newlines.htm: Added.
* web-platform-tests/eventsource/format-null-character-expected.txt: Added.
* web-platform-tests/eventsource/format-null-character.html: Added.
* web-platform-tests/eventsource/format-utf-8-expected.txt: Added.
* web-platform-tests/eventsource/format-utf-8.htm: Added.
* web-platform-tests/eventsource/interfaces-expected.txt: Added.
* web-platform-tests/eventsource/interfaces.html: Added.
* web-platform-tests/eventsource/request-accept-expected.txt: Added.
* web-platform-tests/eventsource/request-accept.htm: Added.
* web-platform-tests/eventsource/request-redirect-expected.txt: Added.
* web-platform-tests/eventsource/request-redirect.htm: Added.
* web-platform-tests/eventsource/request-status-error-expected.txt: Added.
* web-platform-tests/eventsource/request-status-error.htm: Added.
* web-platform-tests/eventsource/resources/accept.event_stream: Added.
* web-platform-tests/eventsource/resources/cache-control.event_stream: Added.
* web-platform-tests/eventsource/resources/cors-cookie.py: Added.
(main):
* web-platform-tests/eventsource/resources/cors.py: Added.
(run_other):
(main):
* web-platform-tests/eventsource/resources/init.htm: Added.
* web-platform-tests/eventsource/resources/last-event-id.py: Added.
(main):
* web-platform-tests/eventsource/resources/message.py: Added.
(main):
* web-platform-tests/eventsource/resources/message2.py: Added.
(main):
* web-platform-tests/eventsource/resources/reconnect-fail.py: Added.
(main):
* web-platform-tests/eventsource/resources/status-error.py: Added.
(main):
* web-platform-tests/eventsource/resources/status-reconnect.py: Added.
(main):
* web-platform-tests/eventsource/resources/w3c-import.log: Added.
* web-platform-tests/eventsource/w3c-import.log: Added.

LayoutTests:

* tests-options.json:

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

2 years agoRemove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
simon.fraser@apple.com [Tue, 15 Aug 2017 01:39:10 +0000 (01:39 +0000)]
Remove ENABLE(REQUEST_AUTOCOMPLETE) code, which was disabled everywhere
https://bugs.webkit.org/show_bug.cgi?id=175504

Reviewed by Sam Weinig.
Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

REQUEST_AUTOCOMPLETE was added in r133396 then removed in r148731, but brought back in r173596,
however no further work was done, and it was left disabled. So remove the code.

* Configurations/FeatureDefines.xcconfig:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* dom/AutocompleteErrorEvent.h: Removed.
* dom/AutocompleteErrorEvent.idl: Removed.
* dom/EventNames.in:
* dom/GlobalEventHandlers.idl:
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::HTMLFormElement):
(WebCore::HTMLFormElement::requestAutocomplete): Deleted.
(WebCore::HTMLFormElement::finishRequestAutocomplete): Deleted.
(WebCore::HTMLFormElement::requestAutocompleteTimerFired): Deleted.
* html/HTMLFormElement.h:
* html/HTMLFormElement.idl:
* loader/EmptyClients.cpp:
* loader/FrameLoaderClient.h:

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

* Configurations/FeatureDefines.xcconfig:
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::didRequestAutocomplete): Deleted.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.h:

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig:
* DOM/DOMHTMLFormElement.mm:
(-[DOMHTMLFormElement requestAutocomplete]): Deleted.
* WebCoreSupport/WebFrameLoaderClient.h:

Source/WTF:

* wtf/FeatureDefines.h:

Tools:

* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

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

2 years agoXHR should only fire an abort event if the cancellation was requested by the client
cdumez@apple.com [Tue, 15 Aug 2017 01:36:04 +0000 (01:36 +0000)]
XHR should only fire an abort event if the cancellation was requested by the client
https://bugs.webkit.org/show_bug.cgi?id=175546

Reviewed by Youenn Fablet.

LayoutTests/imported/w3c:

Rebaseline several WPT tests now that a different error is sometimes used and that
more checks are passing.

* web-platform-tests/XMLHttpRequest/open-url-multi-window-4-expected.txt:
* web-platform-tests/XMLHttpRequest/send-network-error-sync-events.sub-expected.txt:
* web-platform-tests/cors/allow-headers-expected.txt:
* web-platform-tests/cors/origin-expected.txt:
* web-platform-tests/cors/request-headers-expected.txt:
* web-platform-tests/cors/response-headers-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_match_origin-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_match_wildcard-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_multi-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_null-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_origin-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_origin_uppercase-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_space-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_wildcard-expected.txt:
* web-platform-tests/resource-timing/resource_TAO_zero-expected.txt:

Source/WebCore:

XHR should only fire an abort event if the cancellation was requested by the client, otherwise it should fire an error event.
Blink and Gecko already match the specification.

Specification:
- https://xhr.spec.whatwg.org/#handle-errors
- https://xhr.spec.whatwg.org/#the-abort()-method

Test: http/tests/navigation/page-cache-xhr-in-pagehide.html

* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::open):
(WebCore::XMLHttpRequest::abort):
(WebCore::XMLHttpRequest::abortError):
(WebCore::XMLHttpRequest::didFail):
* xml/XMLHttpRequest.h:

LayoutTests:

* http/tests/navigation/page-cache-xhr-expected.txt:
* http/tests/navigation/page-cache-xhr-in-pagehide-expected.txt: Copied from LayoutTests/http/tests/navigation/page-cache-xhr-expected.txt.
* http/tests/navigation/page-cache-xhr-in-pagehide.html: Copied from LayoutTests/http/tests/navigation/page-cache-xhr.html.
* http/tests/navigation/page-cache-xhr.html:
When an XHR is pending and navigating away, we would send an abort event before the navigation and an error event after
restoring from PageCache. This bug was not seen before because the test only checked for error events, not abort ones.
The expected behavior is now that we fire an error event before navigating away, similar to the non-PageCache case.
The only case where the error event should be fired after restoring from PageCache is when an XHR is done in the pagehide
event handler, because it is too late to send the error event to the page before navigating in this case. I added test
coverage for this case.

* http/tests/xmlhttprequest/navigation-should-abort-expected.txt:
* http/tests/xmlhttprequest/navigation-should-abort.html:
This test was expecting an abort event on navigation which is against spec. This test was failing in Blink too.
Update the test to expect an error event instead.

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

2 years agoRemove ENABLE_VIEW_MODE_CSS_MEDIA and related code
simon.fraser@apple.com [Tue, 15 Aug 2017 00:53:57 +0000 (00:53 +0000)]
Remove ENABLE_VIEW_MODE_CSS_MEDIA and related code
https://bugs.webkit.org/show_bug.cgi?id=175557

Reviewed by Jon Lee.
.:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWPE.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* Configurations/FeatureDefines.xcconfig:

Source/WebCore:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* Configurations/FeatureDefines.xcconfig:
* css/CSSValueKeywords.in:
* css/MediaFeatureNames.h:
* css/MediaQueryEvaluator.cpp:
(WebCore::viewModeEvaluate): Deleted.
* css/MediaQueryExpression.cpp:
(WebCore::featureWithValidIdent):
(WebCore::isFeatureValidWithoutValue):
* page/Page.cpp:
(WebCore::Page::stringToViewMode): Deleted.
(WebCore::Page::setViewMode): Deleted.
* page/Page.h:
(WebCore::Page::viewMode const): Deleted.

Source/WebCore/PAL:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* Configurations/FeatureDefines.xcconfig:

Source/WebKitLegacy/mac:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* Configurations/FeatureDefines.xcconfig:

Source/WTF:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* wtf/FeatureDefines.h:

Tools:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* DumpRenderTree/TestRunner.cpp:
(TestRunner::staticFunctions):
(setViewModeMediaFeatureCallback): Deleted.
* DumpRenderTree/TestRunner.h:
* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::setViewModeMediaFeature): Deleted.
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::setViewModeMediaFeature): Deleted.
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig:

LayoutTests:

No port cares about the ENABLE(VIEW_MODE_CSS_MEDIA) feature, so remove it.

* fast/media/media-query-list-02-expected.txt: Removed.
* fast/media/media-query-list-02.html: Removed.
* fast/media/media-query-list-03-expected.txt: Removed.
* fast/media/media-query-list-03.html: Removed.
* fast/media/media-query-list-04-expected.txt: Removed.
* fast/media/media-query-list-04.html: Removed.
* fast/media/media-query-list-05-expected.txt: Removed.
* fast/media/media-query-list-05.html: Removed.
* fast/media/media-query-list-06-expected.txt: Removed.
* fast/media/media-query-list-06.html: Removed.
* fast/media/view-mode-media-feature-expected.html: Removed.
* fast/media/view-mode-media-feature.html: Removed.
* platform/gtk/TestExpectations:
* platform/ios-wk2/TestExpectations:
* platform/ios/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:

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

2 years agoRebaseline editing/mac/input/firstrectforcharacterrange-styled.html.
ryanhaddad@apple.com [Tue, 15 Aug 2017 00:33:15 +0000 (00:33 +0000)]
Rebaseline editing/mac/input/firstrectforcharacterrange-styled.html.

Unreviewed test gardening.

* platform/mac-highsierra/editing/mac/input/firstrectforcharacterrange-styled-expected.txt: Added.

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

2 years agoParse font-display
mmaxfield@apple.com [Tue, 15 Aug 2017 00:03:56 +0000 (00:03 +0000)]
Parse font-display
https://bugs.webkit.org/show_bug.cgi?id=175382

Reviewed by Simon Fraser.

Source/WebCore:

The syntax is very simple: font-display: auto | block | swap | fallback | optional.
So, parsing support is quite straightfoward.

Test: fast/text/font-display/parse.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::setLoadingBehavior):
* css/CSSFontFace.h:
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
* css/CSSPrimitiveValueMappings.h:
(WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
(WebCore::CSSPrimitiveValue::operator FontLoadingBehavior const):
* css/CSSProperties.json:
* css/CSSProperty.cpp:
(WebCore::CSSProperty::isDescriptorOnly):
* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontFaceFontDisplay):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
* rendering/style/RenderStyleConstants.h:

LayoutTests:

* fast/text/font-display/parse-expected.txt: Added.
* fast/text/font-display/parse.html: Added.

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

2 years agoJSTests:
commit-queue@webkit.org [Mon, 14 Aug 2017 23:37:06 +0000 (23:37 +0000)]
JSTests:
Support the with keyword in DFG
https://bugs.webkit.org/show_bug.cgi?id=175470

Patch by Robin Morisset <rmorisset@apple.com> on 2017-08-14
Reviewed by Saam Barati.

Added a new stress-test for the 'with' keyword, that caught a bug in a
previous version of this code.

* stress/with.js: Added.
(i.with):

Source/JavaScriptCore:
Support the 'with' keyword in DFG
https://bugs.webkit.org/show_bug.cgi?id=175470

Patch by Robin Morisset <rmorisset@apple.com> on 2017-08-14
Reviewed by Saam Barati.

Not particularly optimized at the moment, the goal is just to avoid
the DFG bailing out of any function with this keyword.

* dfg/DFGAbstractInterpreterInlines.h:
(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):
* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::parseBlock):
* dfg/DFGCapabilities.cpp:
(JSC::DFG::capabilityLevel):
* dfg/DFGClobberize.h:
(JSC::DFG::clobberize):
* dfg/DFGDoesGC.cpp:
(JSC::DFG::doesGC):
* dfg/DFGFixupPhase.cpp:
(JSC::DFG::FixupPhase::fixupNode):
* dfg/DFGNodeType.h:
* dfg/DFGPredictionPropagationPhase.cpp:
* dfg/DFGSafeToExecute.h:
(JSC::DFG::safeToExecute):
* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compilePushWithScope):
* dfg/DFGSpeculativeJIT.h:
(JSC::DFG::SpeculativeJIT::callOperation):
* dfg/DFGSpeculativeJIT32_64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* dfg/DFGSpeculativeJIT64.cpp:
(JSC::DFG::SpeculativeJIT::compile):
* jit/JITOperations.cpp:
* jit/JITOperations.h:

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

2 years agoObj-C exception crash in AVStreamSession when using EME in Private Browsing mode
jer.noble@apple.com [Mon, 14 Aug 2017 23:33:27 +0000 (23:33 +0000)]
Obj-C exception crash in AVStreamSession when using EME in Private Browsing mode
https://bugs.webkit.org/show_bug.cgi?id=175547

Reviewed by Eric Carlson.

When the storagePath() is empty, do not use those AVStreamSession APIs which require a valid file path to stored
proof-of-key-release data.

Drive-by fix: return emptyString() from HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory() when in Private
Browsing mode, to match the behavior of WebKitMediaKeySession.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::mediaPlayerMediaKeysStorageDirectory const):
* platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
(WebCore::CDMSessionAVStreamSession::releaseKeys):
(WebCore::CDMSessionAVStreamSession::update):
(WebCore::CDMSessionAVStreamSession::generateKeyReleaseMessage):

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

2 years agoREGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a Resour...
aestes@apple.com [Mon, 14 Aug 2017 23:21:03 +0000 (23:21 +0000)]
REGRESSION (r220456): Crash in PreviewLoader::shouldCreateForMIMEType() when a ResourceResponse has a null MIME type
https://bugs.webkit.org/show_bug.cgi?id=175548
<rdar://problem/33866206>

Reviewed by Brady Eidson.

Source/WebCore:

New API test: QuickLook.ShouldCreateForMIMEType

* WebCore.xcodeproj/project.pbxproj:
* loader/ios/PreviewLoader.h:
* loader/ios/PreviewLoader.mm:
(WebCore::PreviewLoader::shouldCreateForMIMEType): Check if mimeType is a null String before
calling HashSet::contains().

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebCore/ios/PreviewLoader.cpp: Added.
(TestWebKitAPI::TEST): Added an API test for PreviewLoader::shouldCreateForMIMEType().

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

2 years agoSkip flaky JSC test test/fieldopts/objtypespec-newobj-invalidation.1.js
ryanhaddad@apple.com [Mon, 14 Aug 2017 23:04:58 +0000 (23:04 +0000)]
Skip flaky JSC test test/fieldopts/objtypespec-newobj-invalidation.1.js
https://bugs.webkit.org/show_bug.cgi?id=175544

Unreviewed test gardening.

* ChakraCore.yaml:

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

2 years agoAdd some convenience utility accessor methods to MacroAssembler::CPUState.
mark.lam@apple.com [Mon, 14 Aug 2017 22:55:31 +0000 (22:55 +0000)]
Add some convenience utility accessor methods to MacroAssembler::CPUState.
https://bugs.webkit.org/show_bug.cgi?id=175549
<rdar://problem/33884868>

Reviewed by Saam Barati.

Previously, in order to read ProbeContext CPUState registers, we used to need to
do it this way:

    ExecState* exec = reinterpret_cast<ExecState*>(cpu.fp());
    uint32_t i32 = static_cast<uint32_t>(cpu.gpr(GPRInfo::regT0));
    void* p = reinterpret_cast<void*>(cpu.gpr(GPRInfo::regT1));
    uint64_t u64 = bitwise_cast<uint64_t>(cpu.fpr(FPRInfo::fpRegT0));

With this patch, we can now read them this way instead:

    ExecState* exec = cpu.fp<ExecState*>();
    uint32_t i32 = cpu.gpr<uint32_t>(GPRInfo::regT0);
    void* p = cpu.gpr<void*>(GPRInfo::regT1);
    uint64_t u64 = cpu.fpr<uint64_t>(FPRInfo::fpRegT0);

* assembler/MacroAssembler.h:
(JSC:: const):
(JSC::MacroAssembler::CPUState::fpr const):
(JSC::MacroAssembler::CPUState::pc const):
(JSC::MacroAssembler::CPUState::fp const):
(JSC::MacroAssembler::CPUState::sp const):
(JSC::ProbeContext::pc):
(JSC::ProbeContext::fp):
(JSC::ProbeContext::sp):

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

2 years agoWPT server should be able to do logging even if its output folder is not created...
commit-queue@webkit.org [Mon, 14 Aug 2017 22:38:41 +0000 (22:38 +0000)]
WPT server should be able to do logging even if its output folder is not created at launch time
https://bugs.webkit.org/show_bug.cgi?id=175543

Patch by Youenn Fablet <youenn@apple.com> on 2017-08-14
Reviewed by Alexey Proskuryakov.

Removing no longer used stdout/stderr member variables.
Creating if needed the output folder so that we can create WPT server output log folder at WPT server launch time.

* Scripts/webkitpy/layout_tests/servers/web_platform_test_server.py:
(WebPlatformTestServer.__init__):
(WebPlatformTestServer._prepare_config):
(WebPlatformTestServer._spawn_process):
(WebPlatformTestServer._stop_running_server):

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

2 years ago[Apple Pay] Add support for phonetic contact names
aestes@apple.com [Mon, 14 Aug 2017 22:03:56 +0000 (22:03 +0000)]
[Apple Pay] Add support for phonetic contact names
https://bugs.webkit.org/show_bug.cgi?id=175537
<rdar://problem/32002644>

Reviewed by Tim Horton.

Source/WebCore:

* Modules/applepay/ApplePayError.idl: Defined "phoneticName" in ApplePayErrorContactField.
* Modules/applepay/ApplePayPaymentContact.h: Defined phoneticGivenName and phoneticFamilyName
in ApplePayPaymentContact.
* Modules/applepay/ApplePayPaymentContact.idl: Ditto.
* Modules/applepay/ApplePayPaymentRequest.h: Defined PhoneticName in
ApplePayPaymentRequest::ContactField.
* Modules/applepay/ApplePayPaymentRequest.idl: Defined "phoneticName" in ApplePayContactField.
* Modules/applepay/ApplePaySession.cpp:
(WebCore::convertAndValidate): Added a version parameter. Added code to convert
ContactField::PhoneticName, throwing an exception if version is less than 3.
* Modules/applepay/PaymentContact.h: Added a version parameter to fromApplePayPaymentContact().
* Modules/applepay/PaymentRequest.h: Defined phoneticName in PaymentRequest::ContactFields
and defined PhoneticName in PaymentError::ContactField.
* Modules/applepay/cocoa/PaymentContactCocoa.mm:
(WebCore::convert): Added a version parameter. Set a phoneticRepresentation on the
PKContact's name if there are non-empty phonetic names and version is 3 or greater.
(WebCore::PaymentContact::fromApplePayPaymentContact): Passed version to convert().

Source/WebKit:

* UIProcess/ApplePay/cocoa/WebPaymentCoordinatorProxyCocoa.mm: Soft-linked PKContactFieldPhoneticName.
(WebKit::toPKContactFields): Added code to append PKContactFieldPhoneticName to result if
contactFields.phoneticName is true.
(WebKit::toNSError): Specified PKContactFieldPhoneticName as the contact field for
PaymentError::ContactField::PhoneticName.

LayoutTests:

* http/tests/ssl/applepay/ApplePayError-expected.txt:
* http/tests/ssl/applepay/ApplePayError.html:
* http/tests/ssl/applepay/ApplePaySession-expected.txt:
* http/tests/ssl/applepay/ApplePaySession.html:
* http/tests/ssl/applepay/ApplePaySessionV3-expected.txt:
* http/tests/ssl/applepay/ApplePaySessionV3.html:

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

2 years agoThe none smooth stroke applied to an SVG shape breaks its hit testing
commit-queue@webkit.org [Mon, 14 Aug 2017 22:00:27 +0000 (22:00 +0000)]
The none smooth stroke applied to an SVG shape breaks its hit testing
https://bugs.webkit.org/show_bug.cgi?id=175506

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2017-08-14
Reviewed by Simon Fraser.

Source/WebCore:

Clear RenderSVGShape::m_path when calling RenderSVGRect::updateShapeFromElement().
The m_path will be recalculated when RenderSVGShape::updateShapeFromElement()
is called from RenderSVGRect::shapeDependentStrokeContains().

Test: svg/stroke/stroke-linejoin-click.html

* rendering/svg/RenderSVGRect.cpp:
(WebCore::RenderSVGRect::updateShapeFromElement):
* rendering/svg/RenderSVGShape.h:
(WebCore::RenderSVGShape::clearPath):

LayoutTests:

* svg/stroke/stroke-linejoin-click-expected.html: Added.
* svg/stroke/stroke-linejoin-click.html: Added.

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

2 years agowebkit-patch: Passing --no-review should submit patch to EWS by default
dbates@webkit.org [Mon, 14 Aug 2017 21:14:10 +0000 (21:14 +0000)]
webkit-patch: Passing --no-review should submit patch to EWS by default
https://bugs.webkit.org/show_bug.cgi?id=148899

Reviewed by David Kilzer.

Make "webkit-patch upload --no-review" and "webkit-patch post-commits --no-review" submit
the patch(es) for EWS analysis by default. Add a new optional command line argument, --no-ews,
to these commands to not submit a non-reviewed patch(es) for EWS analysis.

Frequently I want to post a draft of a patch without review to have the EWS bots process
it to catch build and test breakage before I clean it up and post it for formal review.
Currently this requires using "webkit-patch upload --no-review --open-bug" to upload the
patch and open the bug in Safari so that I can click the Submit for EWS analysis button.
We should teach "webkit-patch upload" and "webkit-patch post-commits" how to do this.

* Scripts/webkitpy/common/net/bugzilla/bugzilla.py:
(Bugzilla._parse_attachment_id_from_add_patch_to_bug_response): Add helper function to
parse the attachment id from the response page after adding an attachment to the bug.
(Bugzilla.add_patch_to_bug): Modified to parse and return the attachment id from the
HTTP response after uploading the patch.
* Scripts/webkitpy/common/net/bugzilla/bugzilla_mock.py:
(MockBugzilla.add_patch_to_bug): Return a dummy attachment id for testing purposes.
* Scripts/webkitpy/common/net/bugzilla/bugzilla_unittest.py:
(test__parse_attachment_id_from_add_patch_to_bug_response): Added.
* Scripts/webkitpy/tool/commands/upload.py:
(Upload): Add step SubmitToEWS to the list of steps when uploading a patch.
(PostCommits.__init__): Add --no-ews option to the list of applicable option flags for
this command.
(PostCommits.execute): Submit the patch to EWS, if applicable.
* Scripts/webkitpy/tool/commands/upload_unittest.py:
(test_upload): Set options.ews to False as the upload command expects this option
to be specified.
(test_upload_with_no_review_and_ews): Added.
* Scripts/webkitpy/tool/steps/__init__.py: Import module SubmitToEWS.
* Scripts/webkitpy/tool/steps/options.py:
(Options): Added command line option --no-ews (defaults: False - submit to EWS).
* Scripts/webkitpy/tool/steps/postdiff.py:
(PostDiff.options): Add --no-ews option to the list of applicable option flags for
this command.
(PostDiff.run): Submit the patch to EWS, if applicable.
* Scripts/webkitpy/tool/steps/submittoews.py: Added.
(SubmitToEWS):
(SubmitToEWS.options): Return an empty array as we this step does not have any command line options.
(SubmitToEWS.run): Submit the specified attachment ids for EWS analysis.

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

2 years ago[css-ui] Implement caret-color support
dbates@webkit.org [Mon, 14 Aug 2017 19:28:33 +0000 (19:28 +0000)]
[css-ui] Implement caret-color support
https://bugs.webkit.org/show_bug.cgi?id=166572
<rdar://problem/33852589>

Update GTK expected results following r220706.

* platform/gtk/editing/style/5065910-expected.txt:
* platform/gtk/editing/style/5084241-expected.txt:

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

2 years ago[WPE] Implement WebCore::standardUserAgent()
aperez@igalia.com [Mon, 14 Aug 2017 18:42:26 +0000 (18:42 +0000)]
[WPE] Implement WebCore::standardUserAgent()
https://bugs.webkit.org/show_bug.cgi?id=175507

Reviewed by Michael Catanzaro.

Remove "_GLIB" from user-agent version macros.

.:

* Source/cmake/OptionsGTK.cmake:
* Source/cmake/OptionsWPE.cmake:

Source/WebCore:

* platform/glib/UserAgentGLib.cpp:
(WebCore::versionForUAString):

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

2 years agoPut the ScopedArgumentsTable's ScopeOffset array in some gigacage
fpizlo@apple.com [Mon, 14 Aug 2017 18:33:16 +0000 (18:33 +0000)]
Put the ScopedArgumentsTable's ScopeOffset array in some gigacage
https://bugs.webkit.org/show_bug.cgi?id=174921

Reviewed by Mark Lam.

Source/JavaScriptCore:

Uses CagedUniquePtr<> to cage the ScopeOffset array.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitScopedArgumentsGetByVal):
* runtime/ScopedArgumentsTable.cpp:
(JSC::ScopedArgumentsTable::create):
(JSC::ScopedArgumentsTable::setLength):
* runtime/ScopedArgumentsTable.h:

Source/WTF:

If you want to std::unique_ptr a class that knows that it should be in the Gigacage, then we
would create the Gigacage equivalent of WTF_MAKE_FAST_ALLOCATED and it would just work.

But this does not work if we want to std::unique_ptr a primitive type. So, this patch adds a
solution for this problem: CagedUniquePtr<>. This will handle allocation
(CagedUniquePtr<>::create()) and deallocation (in the style of std::unique_ptr). It has three
variants:

- Non-array types.
- Arrays that don't have destructors.
- Arrays that have destructors.

Just like std::unique_ptr, the array case is triggered by saying "[]" at the end of the type.

Unlike std::unique_ptr and most other smart pointers, the whole point of this smart pointer is
to dictate where the thing you're pointing at is allocated. For this reason, it has to know how
to do things like the array destructor protocol. So it creates its own: the CagedUniquePtr for
arrays with destructors is a fat pointer that remembers the length of the array.

CagedUniquePtr<> makes it impossible to leak/release the pointer. This is stricter than what
std::unique_ptr does, and is probably appropriate for all of the places where we would use this
type.

So far, we only use it for ScopedArgumentsTable::m_arguments, but I suspect that it will be
useful in other places.

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/CagedUniquePtr.h: Added.
(WTF::CagedUniquePtr::CagedUniquePtr):
(WTF::CagedUniquePtr::create):
(WTF::CagedUniquePtr::operator=):
(WTF::CagedUniquePtr::~CagedUniquePtr):
(WTF::CagedUniquePtr::get const):
(WTF::CagedUniquePtr::getMayBeNull const):
(WTF::CagedUniquePtr::operator== const):
(WTF::CagedUniquePtr::operator!= const):
(WTF::CagedUniquePtr::operator bool const):
(WTF::CagedUniquePtr::operator* const):
(WTF::CagedUniquePtr::operator-> const):
(WTF::CagedUniquePtr::operator[] const):
(WTF::CagedUniquePtr::destroy):
* wtf/Gigacage.cpp:
(Gigacage::tryMallocArray):
(Gigacage::malloc):
(Gigacage::mallocArray):
* wtf/Gigacage.h:

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

2 years agoDisable two flaky VideoControlsManager API tests.
ryanhaddad@apple.com [Mon, 14 Aug 2017 18:32:28 +0000 (18:32 +0000)]
Disable two flaky VideoControlsManager API tests.

Unreviewed test gardening.

* TestWebKitAPI/Tests/WebKit2Cocoa/VideoControlsManager.mm:
(TestWebKitAPI::TEST):

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

2 years agoWeb Inspector: Remove text-shadow and gradient backgrounds
mattbaker@apple.com [Mon, 14 Aug 2017 17:56:56 +0000 (17:56 +0000)]
Web Inspector: Remove text-shadow and gradient backgrounds
https://bugs.webkit.org/show_bug.cgi?id=175430

Reviewed by Brian Burg.

Inspector should more closely match flat system look. Remove text-shadow
embossing and replace linear gradients in popover backgrounds and selected
tree item background color.

* UserInterface/Views/CSSStyleDetailsSidebarPanel.css:
(.sidebar > .panel.details.css-style > .content > .pseudo-classes > .group > label):
* UserInterface/Views/CompletionSuggestionsView.css:
(.completion-suggestions-container:not(:active) > .item.selected,):
* UserInterface/Views/DebuggerDashboardView.css:
(.toolbar .dashboard.debugger):
* UserInterface/Views/HierarchicalPathComponent.css:
(.hierarchical-path-component > .title):
* UserInterface/Views/Main.css:
(.bouncy-highlight):
* UserInterface/Views/NavigationSidebarPanel.css:
(.sidebar > .panel.navigation > .content .empty-content-placeholder > .message):
* UserInterface/Views/Popover.js:
(WI.Popover.prototype._drawBackground):
* UserInterface/Views/RecordingTraceDetailsSidebarPanel.css:
(.sidebar > .details.recording-trace > .content > .no-trace-data > .message):
* UserInterface/Views/RulesStyleDetailsPanel.css:
(.sidebar > .panel.details.css-style .rules .label):
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules.filter-non-matching > .no-filter-results > .no-filter-results-message):
(@media (-webkit-min-device-pixel-ratio: 2)): Deleted.
(.sidebar > .panel.details.css-style > .content.filter-in-progress > .rules .label.filter-matching-label,): Deleted.
* UserInterface/Views/RulesStyleSpreadsheetDetailsPanel.css:
(.style-spreadsheet .inherited):
* UserInterface/Views/TimelineDataGrid.css:
(.tree-outline.timeline-data-grid .item:hover):
* UserInterface/Views/TimelineDataGrid.js:
(WI.TimelineDataGrid.prototype._createPopoverContent):
* UserInterface/Views/Variables.css:
(:root):

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

2 years agoOnly create directory and sandbox extension handle for storage directories if they...
timothy_horton@apple.com [Mon, 14 Aug 2017 17:56:47 +0000 (17:56 +0000)]
Only create directory and sandbox extension handle for storage directories if they are set
https://bugs.webkit.org/show_bug.cgi?id=175522

Reviewed by Brady Eidson.

Source/WebKit:

* UIProcess/WebsiteData/WebsiteDataStore.cpp:
(WebKit::WebsiteDataStore::resolveDirectoriesIfNecessary):
If using a non-persistent WebsiteDataStore, all the storage directories
are unset, but we still try to create them and make sandbox extensions
for them. This has no effect except a ton of noisy logging, but that
is reason enough to stop.

This is similar to r216053, but for more directories.

Tools:

* TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
* TestWebKitAPI/Tests/WebKit2Cocoa/WKWebViewDoesNotLogDuringInitialization.mm: Added.
(TEST):
Add a test that making a WKWebView with an ephemeral WKWebsiteDataStore
doesn't log anything to stderr.

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

2 years agosub-categorize Sandbox violation logs
jbedard@apple.com [Mon, 14 Aug 2017 17:44:35 +0000 (17:44 +0000)]
sub-categorize Sandbox violation logs
https://bugs.webkit.org/show_bug.cgi?id=175536
<rdar://problem/33834416>

Reviewed by David Kilzer.

* Scripts/webkitpy/common/system/crashlogs.py:
(CrashLogs._parse_darwin_crash_log): Add 'Sandbox-' to the log name if the log is
a Sandbox violation.
(CrashLogs._find_all_logs_darwin): Update comment.
* Scripts/webkitpy/common/system/crashlogs_unittest.py:
(make_mock_sandbox_report_darwin): Create a Sandbox violation log for testing.
(CrashLogsTest.create_crash_logs_darwin): Add Sandbox violation to list of crashes.
(CrashLogsTest.test_find_all_log_darwin): 8 logs in testing instead of 7.
(CrashLogsTest.test_duplicate_log_darwin): Check for Sandbox violation log.
* Scripts/webkitpy/port/darwin.py:
(DarwinPort._merge_crash_logs): Handle Sandbox violation case.

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

2 years agoUnreviewed, rollout r220622 & r220696
cdumez@apple.com [Mon, 14 Aug 2017 17:42:09 +0000 (17:42 +0000)]
Unreviewed, rollout r220622 & r220696
https://bugs.webkit.org/show_bug.cgi?id=175482
<rdar://problem/33860695>

Seems to have caused failures on iOS.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-expected.txt:
* web-platform-tests/fetch/api/redirect/redirect-count-worker-expected.txt:
* web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
* web-platform-tests/fetch/http-cache/cc-request-expected.txt:

Source/WebCore:

* CMakeLists.txt:
* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
(WebCore::FetchBodyOwner::BlobLoader::didFail):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
(WebCore::FetchLoader::didFail):
* Modules/fetch/FetchLoaderClient.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::finishLoading):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestFont):
(WebCore::CachedResourceLoader::requestTextTrack):
(WebCore::CachedResourceLoader::requestCSSStyleSheet):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestScript):
(WebCore::CachedResourceLoader::requestXSLStyleSheet):
(WebCore::CachedResourceLoader::requestSVGDocument):
(WebCore::CachedResourceLoader::requestLinkResource):
(WebCore::CachedResourceLoader::requestMedia):
(WebCore::CachedResourceLoader::requestIcon):
(WebCore::CachedResourceLoader::requestRawResource):
(WebCore::CachedResourceLoader::requestBeaconResource):
(WebCore::CachedResourceLoader::requestMainResource):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::preload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/KeepaliveRequestTracker.cpp: Removed.
* loader/cache/KeepaliveRequestTracker.h: Removed.
* platform/network/FormData.cpp:
(WebCore::FormData::appendFile):
(WebCore::FormData::appendFileRange):
(WebCore::FormData::appendBlob):
(WebCore::FormData::expandDataStore):
* platform/network/FormData.h:

LayoutTests:

* fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt:
* http/tests/contentextensions/async-xhr-onerror-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt:
* http/tests/security/mixedContent/insecure-xhr-in-main-frame-expected.txt:
* http/wpt/beacon/beacon-quota-expected.txt: Removed.
* http/wpt/beacon/beacon-quota.html: Removed.
* inspector/worker/resources-in-worker-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/api/request/request-cache-only-if-cached-expected.txt:
* platform/mac-wk1/imported/w3c/web-platform-tests/fetch/http-cache/cc-request-expected.txt:

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

2 years ago[css-ui] Implement caret-color support
dbates@webkit.org [Mon, 14 Aug 2017 17:29:34 +0000 (17:29 +0000)]
[css-ui] Implement caret-color support
https://bugs.webkit.org/show_bug.cgi?id=166572
<rdar://problem/33852589>

Reviewed by David Hyatt.

Source/WebCore:

Add support for the CSS property caret-color as per <https://www.w3.org/TR/css-ui-3/#caret-color> (02 March 2017).
The property caret-color specifies the color of the text insertion caret in an editable element,
say an HTML textarea element.

Unlike other CSS color properties caret-color can have value "auto" and this is its initial
value. Internally we treat value "auto" as an invalid caret color to simplify the code.

Tests: editing/pasteboard/preserve-caret-color.html
       fast/css/caret-color-auto.html
       fast/css/caret-color-fallback-to-color.html
       fast/css/caret-color-inherit.html
       fast/css/caret-color-span-inside-editable-parent.html
       fast/css/caret-color.html
       fast/history/visited-link-caret-color.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSProperties.json: Add property caret-color. We represent the initial  "auto" Also, fix up
wording in a comment while I am here.
* css/StyleResolver.cpp:
(WebCore::isValidVisitedLinkProperty): Add caret-color to the list of properties that can be
applied to visited hyperlinks.
* css/parser/CSSParserFastPaths.cpp:
(WebCore::parseCaretColor): Added.
(WebCore::CSSParserFastPaths::maybeParseValue): Unlike other CSS color properties caret-color
can be defined to be "auto". We explicitly check if the property is caret-color and use
parseCaretColor() to parse its value.
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeCaretColor): Added.
(WebCore::CSSPropertyParser::parseSingleValue): Similar to the change to CSSParserFastPaths::maybeParseValue()
use a dedicated code path to parse caret-color.
* editing/EditingStyle.cpp: Preserve caret-color during editing operations.
* editing/FrameSelection.cpp:
(WebCore::CaretBase::paintCaret const): Modified code to query property caret-color instead of
color for the color of the text insertion caret. Always honor the caret-color of the editable
element if it is valid color. Note that "caret-color: auto" is treated as an invalid color
internally. A caret-color can have an invalid color if its inherits from the CSS color property
with an invalid color. If caret-color is a valid color then we take it to be the color of the
text insertion caret. Otherwise, we do what we do today and use a heuristic to determine the
color of the text-insertion caret.
(WebCore::disappearsIntoBackground): Deleted; moved logic into CaretBase::paintCaret().
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap): Add property wrapper
to support animating caret-color.
* rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::changeRequiresRepaintIfTextOrBorderOrOutline const): Modified to consider
changes to caret color.
(WebCore::RenderStyle::colorIncludingFallback const): Modified to compute the appropriate
color for property caret-color with respect to an unvisited or visited link.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::setCaretColor): Added.
(WebCore::RenderStyle::setVisitedLinkCaretColor): Added.
(WebCore::RenderStyle::caretColor const): Added.
(WebCore::RenderStyle::visitedLinkCaretColor const): Added.
* rendering/style/StyleRareInheritedData.cpp:
(WebCore::StyleRareInheritedData::StyleRareInheritedData): Modified to consider caret color.
(WebCore::StyleRareInheritedData::operator== const): Ditto.
* rendering/style/StyleRareInheritedData.h:

LayoutTests:

Add reference tests to ensure that we do not regress CSS property caret-color.

* TestExpectations: Unskip Web Platform Tests that now pass.
* editing/deleting/maintain-style-after-delete-expected.txt: Updated expected result.
* editing/inserting/insert-paragraph-with-font-and-background-color-expected.txt: Ditto.
* editing/pasteboard/do-not-copy-unnecessary-styles-2-expected.txt: Ditto.
* editing/pasteboard/onpaste-text-html-expected.txt: Ditto.
* editing/pasteboard/preserve-caret-color-expected.txt: Added.
* editing/pasteboard/preserve-caret-color.html: Added.
* editing/pasteboard/preserve-underline-color-expected.txt:
* fast/css/caret-color-auto-expected.html: Added.
* fast/css/caret-color-auto.html: Added.
* fast/css/caret-color-expected.html: Added.
* fast/css/caret-color-fallback-to-color-expected.html: Added.
* fast/css/caret-color-fallback-to-color.html: Added.
* fast/css/caret-color-inherit-expected.html: Added.
* fast/css/caret-color-inherit.html: Added.
* fast/css/caret-color-span-inside-editable-parent-expected.html: Added.
* fast/css/caret-color-span-inside-editable-parent.html: Added.
* fast/css/caret-color.html: Added.
* fast/events/before-input-events-prevent-drag-and-drop-expected.txt: Updated expected result.
* fast/events/input-events-paste-rich-datatransfer-expected.txt: Ditto.
* fast/events/ondrop-text-html-expected.txt: Ditto.
* fast/history/visited-link-caret-color-expected.html: Added.
* fast/history/visited-link-caret-color.html: Added.
* platform/ios/TestExpectations: Skip the tests on iOS as iOS does not enable
ENABLE(TEXT_CARET). UIKit renders the text insertion caret on iOS.
* platform/mac/editing/style/5065910-expected.txt: Updated expected result.
* platform/mac/editing/style/5084241-expected.png: Ditto.
* platform/mac/editing/style/5084241-expected.txt: Ditto.
* platform/ios-wk2/editing/style/5084241-expected.txt: Ditto.

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

2 years agoAdd Automator service to copy permalink to Clipboard
dbates@webkit.org [Mon, 14 Aug 2017 17:25:18 +0000 (17:25 +0000)]
Add Automator service to copy permalink to Clipboard
https://bugs.webkit.org/show_bug.cgi?id=170978

Reviewed by Joseph Pecoraro.

It is helpful to reference using a hyperlink a particular line of code when having
a discussion on IRC or in a bug. You can get such a link by navigating to the file
in the Trac Browse Source viewer and selecting the line your are interested in.
I found myself doing this often enough that I wrote an Automator service to do it
for me.

This Automator service works with Xcode 8 and Xcode 9 beta 5 (9M202q) or later.

* CopyPermalink/Copy WebKit Permalink.workflow/Contents/Info.plist: Added.
* CopyPermalink/Copy WebKit Permalink.workflow/Contents/document.wflow: Added.
* CopyPermalink/README: Added.

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

2 years agoAddress flakiness related to download tests
cdumez@apple.com [Mon, 14 Aug 2017 17:09:41 +0000 (17:09 +0000)]
Address flakiness related to download tests
https://bugs.webkit.org/show_bug.cgi?id=175338
<rdar://problem/33865119>

Unreviewed, forgot in r220626 to reset m_shouldLogDownloadCallbacks to false
between tests.

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

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

2 years agoGardening: fix Windows build.
mark.lam@apple.com [Mon, 14 Aug 2017 16:41:47 +0000 (16:41 +0000)]
Gardening: fix Windows build.
https://bugs.webkit.org/show_bug.cgi?id=175446

Not reviewed.

* assembler/MacroAssemblerX86Common.cpp:
(JSC::booleanTrueForAvoidingNoReturnDeclaration):
(JSC::ctiMasmProbeTrampoline):

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

2 years ago[CoordGraphics] Simplify CoordinatedGraphicsScene state updates
zandobersek@gmail.com [Mon, 14 Aug 2017 16:41:18 +0000 (16:41 +0000)]
[CoordGraphics] Simplify CoordinatedGraphicsScene state updates
https://bugs.webkit.org/show_bug.cgi?id=175528

Reviewed by Carlos Garcia Campos.

Hold the information about state updates in ThreadedCompositor, in the
m_attributes struct. This way we don't need to store the updates in
functors and accumulate them in the CoordinatedGraphicsScene class, but
instead just apply any pending state update or atlas removal before the
scene is rendered.

This removes the need to update the CoordinatedGraphicsScene object from
the main thread with data that ultimately has to be handled on the
composition thread. Similarly, when updating CoordinatedGraphicsScene, we
only need to synchronize on the m_attributes lock object once in order to
retrieve the scene update information, instead of having each functor do
that repeatedly.

* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.cpp:
(WebKit::CoordinatedGraphicsScene::applyStateChanges):
(WebKit::CoordinatedGraphicsScene::paintToCurrentGLContext):
(WebKit::CoordinatedGraphicsScene::detach):
(WebKit::CoordinatedGraphicsScene::setActive):
(WebKit::CoordinatedGraphicsScene::syncRemoteContent): Deleted.
(WebKit::CoordinatedGraphicsScene::appendUpdate): Deleted.
* Shared/CoordinatedGraphics/CoordinatedGraphicsScene.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::renderLayerTree):
(WebKit::ThreadedCompositor::updateSceneState):
(WebKit::ThreadedCompositor::releaseUpdateAtlases):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:

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

2 years agoREGRESSION(r220517-r220521) [GTK] Various compositing tests fail
zandobersek@gmail.com [Mon, 14 Aug 2017 16:37:01 +0000 (16:37 +0000)]
REGRESSION(r220517-r220521) [GTK] Various compositing tests fail
https://bugs.webkit.org/show_bug.cgi?id=175478

Reviewed by Sergio Villar Senin.

Source/WebCore:

Fix a regression introduced in r220519. Move a framebuffer binding in TextureMapperGL
away from GraphicsContext3D and onto the OpenGL API to work around the framebuffer
binding state that's kept in the GraphicsContext3D class. This mismatch in how the
framebuffer was bound was causing a couple of test failures in compositing tests.

No new tests -- regressed tests have their failure expectations removed.

* platform/graphics/texmap/TextureMapperGL.cpp:
(WebCore::TextureMapperGL::bindDefaultSurface): Don't use GraphicsContext3D for the
glBindFramebuffer() call. This would be done in subsequent patches that would move
TextureMapperGL off the GraphicsContext3D usage, but this specific use case clashes
with the framebuffer binding that's done in BitmapTextureGL and was causing test
failures.

LayoutTests:

* platform/gtk/TestExpectations: Remove failure and flakiness expectations.

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

2 years agoUnreviewed fix after r220622 to address crashes on iOS.
cdumez@apple.com [Mon, 14 Aug 2017 15:54:12 +0000 (15:54 +0000)]
Unreviewed fix after r220622 to address crashes on iOS.

* loader/cache/CachedRawResource.cpp:
(WebCore::CachedRawResource::finishLoading):

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

2 years ago[GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while...
carlosgc@webkit.org [Mon, 14 Aug 2017 15:44:02 +0000 (15:44 +0000)]
[GTK][WPE] Avoid emitting WebKitFaviconDatabase::favicon-changed multiple times while setting an icon
https://bugs.webkit.org/show_bug.cgi?id=175531

Reviewed by Michael Catanzaro.

When webkitFaviconDatabaseSetIconForPageURL() is called, both setIconURLForPageURL() and setIconDataForIconURL()
might notify the client, which ends up emitting the WebKitFaviconDatabase::favicon-changed signal and calling
webkitFaviconDatabaseSetIconURLForPageURL(). Both things are already done by
webkitFaviconDatabaseSetIconForPageURL() itself, so we can just ignore the client notification while setting a
new icon.

* UIProcess/API/glib/WebKitFaviconDatabase.cpp:
(webkitFaviconDatabaseSetIconURLForPageURL): Return early if isSettingIcon is true.
(webkitFaviconDatabaseSetIconForPageURL): Set isSettingIcon to true for the scope.

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

2 years agoFactor text autosizing into a class
antti@apple.com [Mon, 14 Aug 2017 13:20:47 +0000 (13:20 +0000)]
Factor text autosizing into a class
https://bugs.webkit.org/show_bug.cgi?id=175530

Reviewed by Andreas Kling.

Move the remaining parts out of Document.

* css/StyleBuilderCustom.h:
(WebCore::computeLineHeightMultiplierDueToFontSize):
* dom/Document.cpp:
(WebCore::Document::destroyRenderTree):
(WebCore::Document::textAutoSizing):
(WebCore::TextAutoSizingTraits::constructDeletedValue): Deleted.
(WebCore::TextAutoSizingTraits::isDeletedValue): Deleted.
(WebCore::Document::addAutoSizedNode): Deleted.
(WebCore::Document::updateAutoSizedNodes): Deleted.
(WebCore::Document::clearAutoSizedNodes): Deleted.
* dom/Document.h:
* rendering/RenderBlockFlow.cpp:
(WebCore::RenderBlockFlow::adjustComputedFontSizes):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustComputedFontSizesOnBlocks):
(WebCore::RenderElement::resetTextAutosizing):
* rendering/TextAutoSizing.cpp:
(WebCore::TextAutoSizingTraits::constructDeletedValue):
(WebCore::TextAutoSizingTraits::isDeletedValue):
(WebCore::TextAutoSizing::addTextNode):
(WebCore::TextAutoSizing::updateRenderTree):
(WebCore::TextAutoSizing::reset):
* rendering/TextAutoSizing.h:

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

2 years agoGTK-focused gardening.
commit-queue@webkit.org [Mon, 14 Aug 2017 12:28:51 +0000 (12:28 +0000)]
GTK-focused gardening.
https://bugs.webkit.org/show_bug.cgi?id=175529

Unreviewed test gardening.

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-14

* http/wpt/css/css-pseudo-4/marker-font-properties-expected.html: Set line-height for more reliable rendering.
* http/wpt/css/css-pseudo-4/marker-font-properties.html: Set line-height for more reliable rendering.
* media/video-fullscreen-restriction-removed-expected.txt: DOMException's toString was changed in r219663; rebaseline. (The test is marked as flaky on mac.)
* platform/gtk/TestExpectations:
* platform/gtk/http/tests/dom/document-attributes-null-handling-expected.txt: SecurityError got a new message in r220376; rebaseline.
* platform/gtk/imported/w3c/web-platform-tests/FileAPI/historical.https-expected.txt: Added: GTK does not yet enable the in-progress ServiceWorker implementation.
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt: TypeError got a new message in r220622; rebaseline.
* platform/gtk/imported/w3c/web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt: Added: TypeError uses a different message on GTK.

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

2 years ago[GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
carlosgc@webkit.org [Mon, 14 Aug 2017 11:12:23 +0000 (11:12 +0000)]
[GTK][WPE] Crash in IconDatabase::IconRecord::setImageData()
https://bugs.webkit.org/show_bug.cgi?id=175527

Reviewed by Žan Doberšek.

The problem is that when setImageData() is called from IconDatabase::readFromDatabase() the shared buffer might
be nullptr, because getImageDataForIconURLFromSQLDatabase() returns nullptr if the icon data is not in the database.

* UIProcess/API/glib/IconDatabase.cpp:
(WebKit::IconDatabase::IconRecord::setImageData): Return early if passed in buffer is nullptr.

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

2 years ago[ThreadedCompositor] Improve composition and update state handling
zandobersek@gmail.com [Mon, 14 Aug 2017 10:23:35 +0000 (10:23 +0000)]
[ThreadedCompositor] Improve composition and update state handling
https://bugs.webkit.org/show_bug.cgi?id=172448

Reviewed by Carlos Garcia Campos.

In the ThreadedCompositor and related classes, we now track composition
and scene update states separately. This enables properly piping in the
DisplayRefreshMonitor object, leveraging it for both display refresh
notifications and signalling to the client that the scene update is
completed.

In CompositingRunLoop, two separate states are now used, one for
compositing and the other for scene update. Access to both should be done
while the related Lock object is held. The pending update state is also
tracked in order to schedule any required updates as soon as the current
state update is completed.

In ThreadedCompositor, the information about client notification and
update completion coordination is now also kept under a Lock object,
moving away from atomics. DisplayRefreshMonitor can now utilize just
two methods in order to either schedule an update or report that update
as finished.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::CompositingRunLoop):
(WebKit::CompositingRunLoop::scheduleUpdate):
(WebKit::CompositingRunLoop::stopUpdates):
(WebKit::CompositingRunLoop::compositionCompleted):
(WebKit::CompositingRunLoop::updateCompleted):
(WebKit::CompositingRunLoop::updateTimerFired):
(WebKit::CompositingRunLoop::isActive): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
(WebKit::CompositingRunLoop::stateLock):
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::m_displayRefreshMonitor):
(WebKit::ThreadedCompositor::sceneUpdateFinished):
(WebKit::ThreadedCompositor::updateSceneState):
(WebKit::ThreadedCompositor::requestDisplayRefreshMonitorUpdate):
(WebKit::ThreadedCompositor::handleDisplayRefreshMonitorUpdate):
(WebKit::ThreadedCompositor::renderNextFrameIfNeeded): Deleted.
(WebKit::ThreadedCompositor::completeCoordinatedUpdateIfNeeded): Deleted.
(WebKit::ThreadedCompositor::coordinateUpdateCompletionWithClient): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedDisplayRefreshMonitor.cpp:
(WebKit::ThreadedDisplayRefreshMonitor::requestRefreshCallback):
(WebKit::ThreadedDisplayRefreshMonitor::displayRefreshCallback):

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

2 years ago[GTK] Update some test expectations.
commit-queue@webkit.org [Mon, 14 Aug 2017 08:28:14 +0000 (08:28 +0000)]
[GTK] Update some test expectations.
https://bugs.webkit.org/show_bug.cgi?id=175480

Unreviewed test gardening.

Patch by Ms2ger <Ms2ger@igalia.com> on 2017-08-14

* platform/gtk/TestExpectations:
* platform/gtk/imported/w3c/web-platform-tests/html/semantics/selectors/pseudo-classes/inrange-outofrange-expected.txt: Added.
* platform/gtk/imported/w3c/web-platform-tests/webrtc/simplecall-expected.txt: Added.

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

2 years ago[Render Tree Mutation] First letter should not mutate the render tree while in layout.
antti@apple.com [Mon, 14 Aug 2017 07:10:17 +0000 (07:10 +0000)]
[Render Tree Mutation] First letter should not mutate the render tree while in layout.
https://bugs.webkit.org/show_bug.cgi?id=163848
Source/WebCore:

Reviewed by Zalan Bujtas.

RenderBlock::updateFirstLetter shouldn't be called during layout. Instead it should
be invoked by the RenderTreeUpdater.

With this future patches can move updateFirstLetter() and the related functions
completely out of the render tree.

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

    No more updateFirstLetter calls during layout...

(WebCore::RenderBlock::computePreferredLogicalWidths):

    ...or preferred width computation.

(WebCore::RenderBlock::updateFirstLetter):
* rendering/RenderBlock.h:
* rendering/RenderRubyRun.cpp:
(WebCore::RenderRubyRun::updateFirstLetter):
* rendering/RenderRubyRun.h:
* rendering/RenderTable.cpp:
(WebCore::RenderTable::updateFirstLetter):
* rendering/RenderTable.h:
* rendering/svg/RenderSVGText.cpp:
(WebCore::RenderSVGText::updateFirstLetter):
* rendering/svg/RenderSVGText.h:
* style/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::popParent):

    Call updateFirstLetter when closing the element. All of of descedant renderers are known here
    so this can be resolved correctly.

LayoutTests:

<rdar://problem/33402718>

Reviewed by Zalan Bujtas.

* fast/text-autosizing/ios/first-letter-expected.html: Added.

    Turn into reftest for easier debugging and robustness.

* imported/blink/fast/css/first-letter-range-insert-expected.txt:

    This is crash-or-assert test and the output change here doesn't matter.

* platform/ios/fast/text-autosizing/ios/first-letter-expected.txt: Removed.
* platform/mac/fast/text-autosizing/ios/first-letter-expected.txt: Removed.

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

2 years agoComposition underline color is always black
rego@igalia.com [Mon, 14 Aug 2017 06:31:35 +0000 (06:31 +0000)]
Composition underline color is always black
https://bugs.webkit.org/show_bug.cgi?id=174675

Reviewed by Ryosuke Niwa.

Source/WebCore:

This patch uses the current color of the text instead of black
for the composition underline marker.
This makes it visible in the case we have a black/dark background.

Test: editing/composition-underline-color.html

* editing/CompositionUnderline.h:
(WebCore::CompositionUnderline::CompositionUnderline):
Added new attribute compositionUnderlineColor.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintCompositionUnderline):
Use the text color if compositionUnderlineColor is TextColor.

Source/WebKit:

This patch uses the current color of the text instead of black
for the composition underline marker.
This makes it visible in the case we have a black/dark background.

* UIProcess/Cocoa/WebViewImpl.mm:
(WebKit::extractUnderlines): If NSUnderlineColorAttributeName
is not present use text color for composition underline.
(WebKit::WebViewImpl::setMarkedText): Use text color
for composition underline in the plain text case.
* UIProcess/gtk/InputMethodFilter.cpp:
(WebKit::InputMethodFilter::handleKeyboardEventWithCompositionResults):
Use text color for composition underline.
(WebKit::InputMethodFilter::updatePreedit): Ditto.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setCompositionForTesting): Ditto.

Source/WebKitLegacy/mac:

* WebView/WebHTMLView.mm:
(extractUnderlines): If NSUnderlineColorAttributeName
is not present use text color for composition underline.
(-[WebHTMLView setMarkedText:selectedRange:]): Use text color
for composition underline in the plain text case.

Source/WebKitLegacy/win:

* WebView.cpp:
(WebView::setCompositionForTesting): Use text color for
composition underline.

LayoutTests:

Added new test to check that the composition underline
is using the text color.
The test hides the text and the caret, so it only shows
the composition underline and checks against an -expected-mismatch
that the color of the composition marker is different.

* editing/composition-underline-color-expected-mismatch.html: Added.
* editing/composition-underline-color.html: Added.

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

2 years ago[GTK] stop kinetic scrolling when a zero movement is reached
carlosgc@webkit.org [Mon, 14 Aug 2017 06:23:27 +0000 (06:23 +0000)]
[GTK] stop kinetic scrolling when a zero movement is reached
https://bugs.webkit.org/show_bug.cgi?id=175468

Reviewed by Michael Catanzaro.

This is GTK+ change by Christian Hergert.
https://git.gnome.org/browse/gtk+/commit/?h=gtk-3-22&id=4f63d839550f7a9038b391e7d3e1e6fc8bdfafa6

When the kinetic scrolling reduces its speed, there can be multiple frames where the movement is zero pixels,
followed by a 1 pixel movement later on. This causes a "jitter" right at the end of the scroll which makes it
feel less quality than other platforms. Instead, we should just clamp it as soon as we get a zero movement.

* platform/ScrollAnimationKinetic.cpp:
(WebCore::ScrollAnimationKinetic::PerAxisData::animateScroll):

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

2 years agoDrop non-const getter for CachedResource::resourceRequest()
cdumez@apple.com [Sun, 13 Aug 2017 21:07:55 +0000 (21:07 +0000)]
Drop non-const getter for CachedResource::resourceRequest()
https://bugs.webkit.org/show_bug.cgi?id=175524

Reviewed by Youenn Fablet.

Drop non-const getter for CachedResource::resourceRequest(). It would be unsafe to modify the request of a CachedResource
after it has been cached. Exposing such a getter is therefore a footgun.

* loader/LinkLoader.cpp:
(WebCore::LinkLoader::preloadIfNeeded):
* loader/cache/CachedImage.cpp:
(WebCore::CachedImage::CachedImage):
* loader/cache/CachedImage.h:
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::CachedResource):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::resourceRequest const):
(WebCore::CachedResource::ignoreForRequestCount const):
(WebCore::CachedResource::setIgnoreForRequestCount):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::CachedResourceLoader::requestResource):
* loader/cache/CachedResourceRequest.h:
(WebCore::CachedResourceRequest::ignoreForRequestCount const):
(WebCore::CachedResourceRequest::setIgnoreForRequestCount):
* loader/cache/MemoryCache.cpp:
(WebCore::MemoryCache::addImageToCache):
* platform/network/ResourceRequestBase.h:

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

2 years ago[WPE] Implement WebCore::standardUserAgent()
aperez@igalia.com [Sun, 13 Aug 2017 12:13:27 +0000 (12:13 +0000)]
[WPE] Implement WebCore::standardUserAgent()
https://bugs.webkit.org/show_bug.cgi?id=175507

Reviewed by Carlos Alberto Lopez Perez.

Implement missing User-Agent handling for the WPE port by sharing the code with the GTK+ port.

.:

* Source/cmake/OptionsGTK.cmake: Rename "GTK" with "GLIB" in UA version macros.
* Source/cmake/OptionsWPE.cmake: Add UA version macros.

Source/WebCore:

* PlatformGTK.cmake: Handlde renaming of UserAgentGtk.cpp to UserAgentGLib.cpp.
* PlatformWPE.cmake: Add UserAgentGLib.cpp and UserAgentQuirks.cpp to the list of built WebCore sources.
* platform/glib/UserAgentGLib.cpp: Renamed from Source/WebCore/platform/gtk/UserAgentGtk.cpp.
(WebCore::versionForUAString): Change "GTK" in UA version macros to "GLIB".

Source/WebKit:

* UIProcess/API/glib/WebKitSettings.cpp: Remove preprocessor conditionals for the WPE port.
(webkit_settings_set_user_agent):
(webkit_settings_set_user_agent_with_application_details):
* UIProcess/wpe/WebPageProxyWPE.cpp:
(WebKit::WebPageProxy::standardUserAgent): Remove hardcoded value and make use of WebCore::standardUserAgent().

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

2 years ago[ARM64] Use x29 and x30 instead of fp and lr to make GCC happy
ossy@webkit.org [Sun, 13 Aug 2017 06:47:49 +0000 (06:47 +0000)]
[ARM64] Use x29 and x30 instead of fp and lr to make GCC happy
https://bugs.webkit.org/show_bug.cgi?id=175512
<rdar://problem/33863584>

Reviewed by Mark Lam.

* CMakeLists.txt: Added MacroAssemblerARM64.cpp.
* assembler/MacroAssemblerARM64.cpp: Use x29 and x30 instead of fp and lr to make GCC happy.

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

2 years agoARM_TRADITIONAL: static assertion failed: ProbeContext_size_matches_ctiMasmProbeTramp...
ossy@webkit.org [Sun, 13 Aug 2017 06:22:44 +0000 (06:22 +0000)]
ARM_TRADITIONAL: static assertion failed: ProbeContext_size_matches_ctiMasmProbeTrampoline
https://bugs.webkit.org/show_bug.cgi?id=175513

Reviewed by Mark Lam.

* assembler/MacroAssemblerARM.cpp: Added d16-d31 FP registers too.

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

2 years agoFTL's compileGetTypedArrayByteOffset needs to do caging
fpizlo@apple.com [Sun, 13 Aug 2017 01:59:16 +0000 (01:59 +0000)]
FTL's compileGetTypedArrayByteOffset needs to do caging
https://bugs.webkit.org/show_bug.cgi?id=175366

Reviewed by Saam Barati.

While implementing boxing in the DFG, I noticed that there was some missing boxing in the FTL. This
fixes the case in GetTypedArrayByteOffset, and files FIXMEs for more such cases.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetTypedArrayByteOffset):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetTypedArrayByteOffset):
(JSC::FTL::DFG::LowerDFGToB3::cagedMayBeNull):
* runtime/ArrayBuffer.h:
* runtime/ArrayBufferView.h:
* runtime/JSArrayBufferView.h:

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

2 years agoReplace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
rniwa@webkit.org [Sat, 12 Aug 2017 22:14:53 +0000 (22:14 +0000)]
Replace DATA_TRANSFER_ITEMS by a runtime flag and add a stub implementation
https://bugs.webkit.org/show_bug.cgi?id=175474
.:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

* Source/cmake/OptionsMac.cmake:
* Source/cmake/OptionsWin.cmake:
* Source/cmake/WebKitFeatures.cmake:
* Source/cmake/tools/vsprops/FeatureDefines.props:
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props:

Source/JavaScriptCore:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

* Configurations/FeatureDefines.xcconfig:
* runtime/CommonIdentifiers.h:

Source/WebCore:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

Replaced the build flag by a runtime flag and added a stub implementation for DataTransferItemList
and DataTransferItem to make it compile. DataTransferItemList is created lazily by DataTransfer.items,
and its lifetime is tied to DataTransfer by forwarding ref and deref.

See https://html.spec.whatwg.org/multipage/dnd.html#the-datatransferitemlist-interface

Tests: editing/pasteboard/datatransfer-idl.html

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig:
* WebCore.xcodeproj/project.pbxproj:
* dom/DataTransfer.cpp:
(WebCore::DataTransfer::items): Added. Create DataTransferItemList lazily
* dom/DataTransfer.h:
* dom/DataTransfer.idl:
* dom/DataTransferItem.cpp:
(WebCore::DataTransferItem::DataTransferItem): Added a stub implementation.
(WebCore::DataTransferItem::~DataTransferItem): Ditto.
(WebCore::DataTransferItem::getAsString const): Ditto.
(WebCore::DataTransferItem::getAsFile const): Ditto.
* dom/DataTransferItem.h:
(WebCore::DataTransferItemList): Devirtualized functions.
(WebCore::DataTransferItemList::kind const):
(WebCore::DataTransferItemList::type const):
* dom/DataTransferItem.idl:
* dom/DataTransferItemList.cpp: Added.
(WebCore::DataTransferItemList::length const): Added a stub implementation.
(WebCore::DataTransferItemList::item): Ditto.
(WebCore::DataTransferItemList::add): Ditto.
(WebCore::DataTransferItemList::remove): Ditto.
(WebCore::DataTransferItemList::clear): Ditto.
* dom/DataTransferItemList.h:
(WebCore::DataTransferItemList::DataTransferItemList):
(WebCore::DataTransferItemList::~DataTransferItemList): Deleted.
(WebCore::DataTransferItemList::ref): Forwards to DataTransfer's ref.
(WebCore::DataTransferItemList::deref): Ditto.
* dom/DataTransferItemList.idl: Updated to match the latest specification.
* page/RuntimeEnabledFeatures.h:
(WebCore::RuntimeEnabledFeatures::setDataTransferItemsEnabled): Added.
(WebCore::RuntimeEnabledFeatures::dataTransferItemsEnabled const): Added.

Source/WebCore/PAL:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

* Configurations/FeatureDefines.xcconfig:

Source/WebKit:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

Replaced the build flag by a runtime flag and disabled the feature by default.

* Configurations/FeatureDefines.xcconfig:
* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/C/WKPreferences.cpp:
(WKPreferencesSetDataTransferItemsEnabled): Added to be used by WebKitTestRunner.
(WKPreferencesGetDataTransferItemsEnabled): Ditto.
* UIProcess/API/C/WKPreferencesRefPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

Source/WebKitLegacy/mac:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

Replaced the build flag by a runtime flag and disabled the feature by default.

* Configurations/FeatureDefines.xcconfig:
* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]): Disables dataTransfer.items by default.
(-[WebPreferences dataTransferItemsEnabled]): Added.
(-[WebPreferences setDataTransferItemsEnabled:]): Added.
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WTF:

Reviewed by Wenson Hsieh.

* wtf/FeatureDefines.h:

Tools:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

Enable dataTransfer.items by default in DumpRenderTree and WebKitTestRunner for testing purposes.

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

LayoutTests:

<rdar://problem/33844628>

Reviewed by Wenson Hsieh.

Added a W3C-style IDL test.

* editing/pasteboard/datatransfer-idl.html: Added.

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

2 years agoAddress flakiness related to download tests
cdumez@apple.com [Sat, 12 Aug 2017 21:58:45 +0000 (21:58 +0000)]
Address flakiness related to download tests
https://bugs.webkit.org/show_bug.cgi?id=175338

Reviewed by Ryosuke Niwa.

LayoutTests/imported/w3c:

Rebaseline several WPT tests now that download callbacks are no longer logged.

* web-platform-tests/html/semantics/embedded-content/the-area-element/area-download-click-expected.txt:
* web-platform-tests/html/semantics/text-level-semantics/the-a-element/a-download-click-expected.txt:

Tools:

- Update WKTR so that the flag set by testRunner.waitUntilDownloadFinished()
  is actually queried when a download completes. Previously, this would be
  identical to a call to testRunner.waitUntilDone() because any download
  completion would call testRunner.notifyDone().
- Disable logging of download callbacks by default and add a
  testRunner.setShouldLogDownloadCallbacks(true) API to allow tests to
  enable such logging.

* WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::didReceiveMessageToPage):
* WebKitTestRunner/InjectedBundle/TestRunner.cpp:
(WTR::TestRunner::setShouldLogDownloadCallbacks):
* WebKitTestRunner/InjectedBundle/TestRunner.h:
* WebKitTestRunner/TestController.cpp:
(WTR::TestController::downloadDidStart):
(WTR::TestController::decideDestinationWithSuggestedFilename):
(WTR::TestController::downloadDidFinish):
(WTR::TestController::downloadDidFail):
(WTR::TestController::downloadDidCancel):
* WebKitTestRunner/TestController.h:
(WTR::TestController::setShouldLogDownloadCallbacks):
* WebKitTestRunner/TestInvocation.cpp:
(WTR::TestInvocation::didReceiveMessageFromInjectedBundle):

LayoutTests:

* TestExpectations:
Unmark several download tests as flaky.

* fast/dom/HTMLAnchorElement/anchor-download-synthetic-click.html:
* fast/dom/HTMLAnchorElement/anchor-download-user-triggered-synthetic-click.html:
* fast/dom/HTMLAnchorElement/anchor-download.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-convert-to-download.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-doublequote.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-slashes.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-unicode.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-no-extension.html:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download.html:
* fast/dom/HTMLAnchorElement/anchor-nodownload-set.html:
* http/tests/download/anchor-download-attribute-content-disposition.html:
* http/tests/download/anchor-download-no-extension.html:
* http/tests/download/anchor-download-no-value.html:
* http/tests/download/area-download-expected.txt:
* http/tests/download/area-download.html:
* http/tests/security/anchor-download-allow-blob-expected.txt:
* http/tests/security/anchor-download-allow-blob.html:
* http/tests/security/anchor-download-allow-data-expected.txt:
* http/tests/security/anchor-download-allow-data.html:
* http/tests/security/anchor-download-allow-sameorigin.html:
Update download tests to explicitly enable download callbacks logging.

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

2 years agoCaging shouldn't have to use a patchpoint for adding
fpizlo@apple.com [Sat, 12 Aug 2017 18:44:48 +0000 (18:44 +0000)]
Caging shouldn't have to use a patchpoint for adding
https://bugs.webkit.org/show_bug.cgi?id=175483

Reviewed by Mark Lam.
Source/JavaScriptCore:

Caging involves doing a Add(ptr, largeConstant). All of B3's heuristics for how to deal with
constants and associative operations dictate that you always want to sink constants. For example,
Add(Add(a, constant), b) always becomes Add(Add(a, b), constant). This is profitable because in
typical code, it reveals downstream optimizations. But it's terrible in the case of caging, because
we want the large constant (which is shared by all caging operations) to be hoisted. Reassociating to
sink constants obscures the constant in this case. Currently, moveConstants is not smart enough to
reassociate, so instead of sinking largeConstant, it tries (and often fails) to sink some other
constants instead. Without some hacks, this is a 5% Kraken regression and a 1.6% Octane regression.
It's not clear that moveConstants could ever be smart enough to rematerialize that constant and then
hoist it - that would require quite a bit of algebraic reasoning. But the only case we know of where
our current constant reassociation heuristics are wrong is caging. So, we can get away with some
hacks for just stopping B3's reassociation only in this specific case.

Previously, we achieved this by concealing the Add(ptr, largeConstant) inside a patchpoint. That's
OK, but patchpoints are expensive. They require a SharedTask instance. They require callbacks from
the backend, including during register allocation. And they cannot be CSE'd. We do want B3 to know
that if we cage the same pointer in two places, both places will compute the same value.

This patch improves the situation by introducing the Opaque opcode. This is handled by LowerToAir as
if it was Identity, but all prior phases treat it as an unknown pure unary idempotent operation. I.e.
they know that Opaque(x) == Opaque(x) and that Opaque(Opaque(x)) == Opaque(x). But they don't know
that Opaque(x) == x until LowerToAir. So, you can use Opaque exactly when you know that B3 will mess
up your code but Air won't. (Currently we know of no cases where Air messes things up on a large
enough scale to warrant new opcodes.)

This change is perf-neutral, but may start to help as I add more uses of caged() in the FTL. It also
makes the code a bit less ugly.

* b3/B3LowerToAir.cpp:
(JSC::B3::Air::LowerToAir::shouldCopyPropagate):
(JSC::B3::Air::LowerToAir::lower):
* b3/B3Opcode.cpp:
(WTF::printInternal):
* b3/B3Opcode.h:
* b3/B3ReduceStrength.cpp:
* b3/B3Validate.cpp:
* b3/B3Value.cpp:
(JSC::B3::Value::effects const):
(JSC::B3::Value::key const):
(JSC::B3::Value::isFree const):
(JSC::B3::Value::typeFor):
* b3/B3Value.h:
* b3/B3ValueKey.cpp:
(JSC::B3::ValueKey::materialize const):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::caged):
* ftl/FTLOutput.cpp:
(JSC::FTL::Output::opaque):
* ftl/FTLOutput.h:

Websites/webkit.org:

Write documentation for the new Opaque opcode.

* docs/b3/intermediate-representation.html:

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

2 years agoScopedArguments overflow storage needs to be in the JSValue gigacage
fpizlo@apple.com [Sat, 12 Aug 2017 18:40:07 +0000 (18:40 +0000)]
ScopedArguments overflow storage needs to be in the JSValue gigacage
https://bugs.webkit.org/show_bug.cgi?id=174923

Reviewed by Saam Barati.

ScopedArguments overflow storage sits at the end of the ScopedArguments object, so we put that
object into the JSValue gigacage.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
* jit/JITPropertyAccess.cpp:
(JSC::JIT::emitScopedArgumentsGetByVal):
* runtime/ScopedArguments.h:
(JSC::ScopedArguments::subspaceFor):
(JSC::ScopedArguments::overflowStorage const):

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

2 years agoMove files inside WebCore/workers to WebCore/workers/service.
beidson@apple.com [Sat, 12 Aug 2017 05:18:27 +0000 (05:18 +0000)]
Move files inside WebCore/workers to WebCore/workers/service.
https://bugs.webkit.org/show_bug.cgi?id=175495

Rubberstamped by Tim Horton.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:

* workers/service/ServiceWorker.cpp: Renamed from Source/WebCore/workers/ServiceWorker.cpp.
* workers/service/ServiceWorker.h: Renamed from Source/WebCore/workers/ServiceWorker.h.
* workers/service/ServiceWorker.idl: Renamed from Source/WebCore/workers/ServiceWorker.idl.
* workers/service/ServiceWorkerContainer.cpp: Renamed from Source/WebCore/workers/ServiceWorkerContainer.cpp.
* workers/service/ServiceWorkerContainer.h: Renamed from Source/WebCore/workers/ServiceWorkerContainer.h.
* workers/service/ServiceWorkerContainer.idl: Renamed from Source/WebCore/workers/ServiceWorkerContainer.idl.
* workers/service/ServiceWorkerGlobalScope.cpp: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.cpp.
* workers/service/ServiceWorkerGlobalScope.h: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.h.
* workers/service/ServiceWorkerGlobalScope.idl: Renamed from Source/WebCore/workers/ServiceWorkerGlobalScope.idl.
* workers/service/ServiceWorkerJob.cpp: Renamed from Source/WebCore/workers/ServiceWorkerJob.cpp.
* workers/service/ServiceWorkerJob.h: Renamed from Source/WebCore/workers/ServiceWorkerJob.h.
* workers/service/ServiceWorkerJobClient.h: Renamed from Source/WebCore/workers/ServiceWorkerJobClient.h.
* workers/service/ServiceWorkerProvider.cpp: Renamed from Source/WebCore/workers/ServiceWorkerProvider.cpp.
* workers/service/ServiceWorkerProvider.h: Renamed from Source/WebCore/workers/ServiceWorkerProvider.h.
* workers/service/ServiceWorkerRegistration.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.cpp.
* workers/service/ServiceWorkerRegistration.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.h.
* workers/service/ServiceWorkerRegistration.idl: Renamed from Source/WebCore/workers/ServiceWorkerRegistration.idl.
* workers/service/ServiceWorkerRegistrationOptions.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationOptions.h.
* workers/service/ServiceWorkerRegistrationParameters.cpp: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.cpp.
* workers/service/ServiceWorkerRegistrationParameters.h: Renamed from Source/WebCore/workers/ServiceWorkerRegistrationParameters.h.
* workers/service/ServiceWorkerUpdateViaCache.h: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.h.
* workers/service/ServiceWorkerUpdateViaCache.idl: Renamed from Source/WebCore/workers/ServiceWorkerUpdateViaCache.idl.

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

2 years agoImplement quota limitation for keepalive Fetch requests
cdumez@apple.com [Sat, 12 Aug 2017 02:51:13 +0000 (02:51 +0000)]
Implement quota limitation for keepalive Fetch requests
https://bugs.webkit.org/show_bug.cgi?id=175482

Reviewed by Sam Weinig and Youenn Fablet.

LayoutTests/imported/w3c:

* web-platform-tests/fetch/api/basic/scheme-about.any-expected.txt:
* web-platform-tests/fetch/api/basic/scheme-about.any.worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-expected.txt:
* web-platform-tests/fetch/api/cors/cors-multiple-origins-worker-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any-expected.txt:
* web-platform-tests/fetch/api/cors/cors-preflight-star.any.worker-expected.txt:
* web-platform-tests/fetch/http-cache/cc-request-expected.txt:
Rebaseline tests now that we provide a more helpful error message when rejecting
the fetch() promise.

* web-platform-tests/fetch/api/request/request-keepalive-quota-expected.txt:
Rebaseline test for keepalive Fetch requests quota which is now passing.

Source/WebCore:

Implement quota limitation for keepalive Fetch requests as per:
- https://fetch.spec.whatwg.org/#http-network-or-cache-fetch (Step 9)

This partly works for Beacon as well, meaning that no Beacon with a body
over 64Kb can be sent. However, we don't keep track about wether or not
beacon loads are inflight or not.

Also update CachedResourceLoader::requestResource() so that the caller
can get a ResourceError when it returns null. This is useful for both
Fetch and Beacon to return better error messages.

Test: http/wpt/beacon/beacon-quota.html

* CMakeLists.txt:
* Modules/beacon/NavigatorBeacon.cpp:
(WebCore::NavigatorBeacon::sendBeacon):
* Modules/fetch/FetchBodyOwner.cpp:
(WebCore::FetchBodyOwner::BlobLoader::didReceiveResponse):
(WebCore::FetchBodyOwner::BlobLoader::didFail):
* Modules/fetch/FetchBodyOwner.h:
* Modules/fetch/FetchLoader.cpp:
(WebCore::FetchLoader::start):
(WebCore::FetchLoader::didFail):
* Modules/fetch/FetchLoaderClient.h:
* Modules/fetch/FetchResponse.cpp:
(WebCore::FetchResponse::BodyLoader::didFail):
* Modules/fetch/FetchResponse.h:
* WebCore.xcodeproj/project.pbxproj:
* loader/DocumentThreadableLoader.cpp:
(WebCore::DocumentThreadableLoader::loadRequest):
* loader/cache/CachedResource.cpp:
(WebCore::CachedResource::load):
* loader/cache/CachedResource.h:
(WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
* loader/cache/CachedResourceLoader.cpp:
(WebCore::createResource):
(WebCore::CachedResourceLoader::requestImage):
(WebCore::CachedResourceLoader::requestFont):
(WebCore::CachedResourceLoader::requestTextTrack):
(WebCore::CachedResourceLoader::requestCSSStyleSheet):
(WebCore::CachedResourceLoader::requestUserCSSStyleSheet):
(WebCore::CachedResourceLoader::requestScript):
(WebCore::CachedResourceLoader::requestXSLStyleSheet):
(WebCore::CachedResourceLoader::requestSVGDocument):
(WebCore::CachedResourceLoader::requestLinkResource):
(WebCore::CachedResourceLoader::requestMedia):
(WebCore::CachedResourceLoader::requestIcon):
(WebCore::CachedResourceLoader::requestRawResource):
(WebCore::CachedResourceLoader::requestBeaconResource):
(WebCore::CachedResourceLoader::requestMainResource):
(WebCore::CachedResourceLoader::requestResource):
(WebCore::CachedResourceLoader::preload):
* loader/cache/CachedResourceLoader.h:
* loader/cache/KeepaliveRequestTracker.cpp: Added.
(WebCore::KeepaliveRequestTracker::~KeepaliveRequestTracker):
(WebCore::KeepaliveRequestTracker::canLoadRequest):
(WebCore::KeepaliveRequestTracker::registerRequest):
(WebCore::KeepaliveRequestTracker::responseReceived):
(WebCore::KeepaliveRequestTracker::notifyFinished):
(WebCore::KeepaliveRequestTracker::unregisterRequest):
* loader/cache/KeepaliveRequestTracker.h: Added.
* platform/network/FormData.cpp:
(WebCore::FormDataElement::lengthInBytes const):
(WebCore::FormData::lengthInBytes const):
* platform/network/FormData.h:

LayoutTests:

* fast/xmlhttprequest/xmlhttprequest-nonexistent-file-expected.txt:
* http/tests/contentextensions/async-xhr-onerror-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-iframe-expected.txt:
* http/tests/security/contentSecurityPolicy/block-all-mixed-content/insecure-xhr-asynchronous-in-main-frame-expected.txt:
* http/tests/security/mixedContent/insecure-xhr-in-main-frame-expected.txt:
Rebaseline a few tests now that we provide a more helpful error message when an XHR is failing synchronously.

* http/wpt/beacon/beacon-quota-expected.txt: Added.
* http/wpt/beacon/beacon-quota.html: Added.
Add layout test coverage for keepalive Fetch requests quota in the context of sendBeacon().
The second part of the test is still failing because WebCore does not currently know when
ping loads (e.g. beacon loads) complete. This will be addressed via Bug 175443.

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

2 years ago[WTF] Move ValueToString into WTF
don.olmstead@sony.com [Sat, 12 Aug 2017 01:13:47 +0000 (01:13 +0000)]
[WTF] Move ValueToString into WTF
https://bugs.webkit.org/show_bug.cgi?id=175469

Reviewed by Sam Weinig.

Source/WebCore:

No new tests. No change in behavior.

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.h:
(WTF::ValueToString<WebCore::TextTrackCue::string):
(WebCore::ValueToString<TextTrackCue::string): Deleted.
(WebCore::ValueToString<MediaTime>::string): Deleted.
* platform/LayoutUnit.h:
(WTF::ValueToString<WebCore::LayoutUnit>::string):
(WebCore::ValueToString<LayoutUnit>::string): Deleted.
* platform/PODInterval.h:
* platform/PODIntervalTree.h:
* platform/PODRedBlackTree.h:
* platform/graphics/FloatPolygon.h:
(WTF::ValueToString<WebCore::FloatPolygonEdge::string):
(WebCore::ValueToString<FloatPolygonEdge::string): Deleted.
* rendering/FloatingObjects.h:
(WTF::ValueToString<WebCore::FloatingObject::string):
(WebCore::ValueToString<FloatingObject::string): Deleted.
* rendering/RenderFlowThread.h:
(WTF::ValueToString<WebCore::RenderRegion::string):
(WebCore::ValueToString<RenderRegion::string): Deleted.

Source/WTF:

* WTF.xcodeproj/project.pbxproj:
* wtf/CMakeLists.txt:
* wtf/text/ValueToString.h: Renamed from Source/WebCore/platform/ValueToString.h.

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

2 years ago[Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
commit-queue@webkit.org [Sat, 12 Aug 2017 00:32:03 +0000 (00:32 +0000)]
[Bindings] Simplify DOMPromiseProxy now that WTF::Function can return references
https://bugs.webkit.org/show_bug.cgi?id=175394

Patch by Sam Weinig <sam@webkit.org> on 2017-08-11
Reviewed by Chris Dumez.

* bindings/IDLTypes.h:
(WebCore::IDLWrapper::convertToParameterType): Deleted.

    Remove no longer used convertToParameterType.

* bindings/js/DOMPromiseProxy.h:

    - Replace Variant<Value, Exception> with ExceptionOr<Value> / ExceptionOr<void>.
    - Update ResolveCallback to have a return type of IDLType::ParameterType, rather than
      IDLType::ImplementationType, now that WTF::Function supports references as the
      return type. This is needed, since the IDLType::ParameterType for an interface T
      is T&.

* css/FontFace.cpp:
* css/FontFace.h:
* css/FontFaceSet.cpp:
* css/FontFaceSet.h:

    Update resolve callbacks to return a reference rather than a RefPtr, matching
    the new signature requirement.

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

2 years ago[WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
commit-queue@webkit.org [Sat, 12 Aug 2017 00:07:00 +0000 (00:07 +0000)]
[WebIDL] Replace JSCryptoKeyCustom and JSCryptoAlgorithmBuilder with generated code
https://bugs.webkit.org/show_bug.cgi?id=175457

Patch by Sam Weinig <sam@webkit.org> on 2017-08-11
Reviewed by Chris Dumez.

* CMakeLists.txt:
* DerivedSources.make:
* WebCore.xcodeproj/project.pbxproj:
* bindings/js/JSCryptoAlgorithmBuilder.cpp: Removed.
* bindings/js/JSCryptoAlgorithmBuilder.h: Removed.
* bindings/js/JSCryptoKeyCustom.cpp: Removed.

    Remove JSCryptoAlgorithmBuilder and JSCryptoKeyCustom, add KeyAlgorithm
    IDLs and headers.

* crypto/CryptoKey.cpp:
* crypto/CryptoKey.h:
* crypto/CryptoKey.idl:

    Replace custom algorithm attribute with a union of the supported key algorithms.

* crypto/keys/CryptoAesKeyAlgorithm.h: Added.
* crypto/keys/CryptoAesKeyAlgorithm.idl: Added.
* crypto/keys/CryptoEcKeyAlgorithm.h: Added.
* crypto/keys/CryptoEcKeyAlgorithm.idl: Added.
* crypto/keys/CryptoHmacKeyAlgorithm.h: Added.
* crypto/keys/CryptoHmacKeyAlgorithm.idl: Added.
* crypto/keys/CryptoKeyAlgorithm.h: Added.
* crypto/keys/CryptoKeyAlgorithm.idl: Added.
* crypto/keys/CryptoRsaHashedKeyAlgorithm.h: Added.
* crypto/keys/CryptoRsaHashedKeyAlgorithm.idl: Added.
* crypto/keys/CryptoRsaKeyAlgorithm.h: Added.
* crypto/keys/CryptoRsaKeyAlgorithm.idl: Added.

    Add IDLs and headers fo the supported key algorithms.

* crypto/keys/CryptoKeyAES.h:
* crypto/keys/CryptoKeyEC.h:
* crypto/keys/CryptoKeyHMAC.h:
* crypto/keys/CryptoKeyRSA.h:
* crypto/keys/CryptoKeyRaw.h:

    Give each of the existing KeyAlgorithm subclasses a dictionary() function
    that returns the populated corresponding spec'd dictionary.

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

2 years agoJSLexicalEnvironment needs to be in the JSValue gigacage
fpizlo@apple.com [Fri, 11 Aug 2017 23:18:18 +0000 (23:18 +0000)]
JSLexicalEnvironment needs to be in the JSValue gigacage
https://bugs.webkit.org/show_bug.cgi?id=174922

Reviewed by Michael Saboff.

We can sorta random access the JSLexicalEnvironment. So, we put it in the JSValue gigacage and make
the only random accesses use pointer caging.

We don't need to do anything to normal lexical environment accesses.

* dfg/DFGSpeculativeJIT.cpp:
(JSC::DFG::SpeculativeJIT::compileGetByValOnScopedArguments):
* ftl/FTLLowerDFGToB3.cpp:
(JSC::FTL::DFG::LowerDFGToB3::compileGetByVal):
* runtime/JSEnvironmentRecord.h:
(JSC::JSEnvironmentRecord::subspaceFor):
(JSC::JSEnvironmentRecord::variables):

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

2 years agoUpdate TestExpectations for failing media/video-controls tests.
ryanhaddad@apple.com [Fri, 11 Aug 2017 23:12:52 +0000 (23:12 +0000)]
Update TestExpectations for failing media/video-controls tests.
https://bugs.webkit.org/show_bug.cgi?id=173978

Unreviewed test gardening.

* platform/mac/TestExpectations:

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