ChangeLog   [plain text]


2018-09-28  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r236615. rdar://problem/44883290

    [Apple Pay] Remove the "in-store" button type
    https://bugs.webkit.org/show_bug.cgi?id=190079
    
    Reviewed by Tim Horton.
    
    Source/WebCore:
    
    According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
    this button is meant only for certain kinds of native apps. It shouldn't be available on the web.
    
    Updated http/tests/ssl/applepay/ApplePayButton.html.
    
    * css/CSSPrimitiveValueMappings.h:
    (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
    (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
    * css/CSSValueKeywords.in:
    * css/parser/CSSParserFastPaths.cpp:
    (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
    * rendering/RenderThemeCocoa.mm:
    (WebCore::toPKPaymentButtonType):
    * rendering/style/RenderStyleConstants.h:
    
    Source/WebInspectorUI:
    
    * UserInterface/Models/CSSKeywordCompletions.js:
    
    LayoutTests:
    
    * http/tests/ssl/applepay/ApplePayButton.html:
    * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png:
    * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236615 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-09-28  Andy Estes  <aestes@apple.com>

            [Apple Pay] Remove the "in-store" button type
            https://bugs.webkit.org/show_bug.cgi?id=190079

            Reviewed by Tim Horton.

            According to <https://developer.apple.com/design/human-interface-guidelines/apple-pay/buttons-and-marks/buttons/>,
            this button is meant only for certain kinds of native apps. It shouldn't be available on the web.

            Updated http/tests/ssl/applepay/ApplePayButton.html.

            * css/CSSPrimitiveValueMappings.h:
            (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
            (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
            * css/CSSValueKeywords.in:
            * css/parser/CSSParserFastPaths.cpp:
            (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
            * rendering/RenderThemeCocoa.mm:
            (WebCore::toPKPaymentButtonType):
            * rendering/style/RenderStyleConstants.h:

2018-09-21  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r236306. rdar://problem/44682841

    Restrict the total combined size of backdrop filters
    https://bugs.webkit.org/show_bug.cgi?id=189812
    <rdar://problem/44532782>
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    If the total area of all backdrop filters on the page gets
    too large, the universe collapses in on itself and we enter
    the Quantum Realm (i.e. crash horribly).
    
    Put a hard limit on the total coverage, and ignore any backdrop
    filters after the limit. This might break some content, but
    such content is likely not doing things in the most optimal manner.
    There isn't any reason to have a backdrop larger than the size of
    the screen, because you'd be better off applying a foreground
    filter to the main content and showing something above it.
    
    Tests: css3/filters/backdrop/resource-use-add-more-layers.html
           css3/filters/backdrop/resource-use-excessive.html
           css3/filters/backdrop/resource-use-ok.html
           css3/filters/backdrop/resource-use-remove-some-layers.html
    
    * platform/graphics/ca/GraphicsLayerCA.cpp: Pick a fairly small maximum size. We
    can consider increasing this if necessary, and as devices with less RAM are
    upgraded.
    (WebCore::GraphicsLayerCA::recursiveCommitChanges): Gather the accumulated size
    of backdrop filters into the commit state as we are recursing through the tree.
    (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Force any layer
    with backdrop filters, or any that is removing backdrop filters, into an update.
    (WebCore::GraphicsLayerCA::updateBackdropFilters): Update the logic to first
    check if this backdrop layer causes us to exceed the total allowed size, and if
    it does, forbid it from getting the GraphicsLayer that composits the backdrop.
    
    * platform/graphics/ca/GraphicsLayerCA.h: Remove const from some parameters so
    that we can use the CommitState to hold the accumulated size.
    
    LayoutTests:
    
    Tests that have an acceptable number of backdrops, an excessive
    number of backdrops, and then some that add and remove backdrops
    at various points in the tree to confirm we do recursive checks
    correctly.
    
    * css3/filters/backdrop/layer-tree-as-text.js: Added.
    * css3/filters/backdrop/resource-use-add-more-layers-expected.txt: Added.
    * css3/filters/backdrop/resource-use-add-more-layers.html: Added.
    * css3/filters/backdrop/resource-use-excessive-expected.txt: Added.
    * css3/filters/backdrop/resource-use-excessive.html: Added.
    * css3/filters/backdrop/resource-use-ok-expected.txt: Added.
    * css3/filters/backdrop/resource-use-ok.html: Added.
    * css3/filters/backdrop/resource-use-remove-some-layers-expected.txt: Added.
    * css3/filters/backdrop/resource-use-remove-some-layers.html: Added.
    * css3/filters/backdrop/resource-use.css: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236306 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-09-20  Dean Jackson  <dino@apple.com>

            Restrict the total combined size of backdrop filters
            https://bugs.webkit.org/show_bug.cgi?id=189812
            <rdar://problem/44532782>

            Reviewed by Simon Fraser.

            If the total area of all backdrop filters on the page gets
            too large, the universe collapses in on itself and we enter
            the Quantum Realm (i.e. crash horribly).

            Put a hard limit on the total coverage, and ignore any backdrop
            filters after the limit. This might break some content, but
            such content is likely not doing things in the most optimal manner.
            There isn't any reason to have a backdrop larger than the size of
            the screen, because you'd be better off applying a foreground
            filter to the main content and showing something above it.

            Tests: css3/filters/backdrop/resource-use-add-more-layers.html
                   css3/filters/backdrop/resource-use-excessive.html
                   css3/filters/backdrop/resource-use-ok.html
                   css3/filters/backdrop/resource-use-remove-some-layers.html

            * platform/graphics/ca/GraphicsLayerCA.cpp: Pick a fairly small maximum size. We
            can consider increasing this if necessary, and as devices with less RAM are
            upgraded.
            (WebCore::GraphicsLayerCA::recursiveCommitChanges): Gather the accumulated size
            of backdrop filters into the commit state as we are recursing through the tree.
            (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): Force any layer
            with backdrop filters, or any that is removing backdrop filters, into an update.
            (WebCore::GraphicsLayerCA::updateBackdropFilters): Update the logic to first
            check if this backdrop layer causes us to exceed the total allowed size, and if
            it does, forbid it from getting the GraphicsLayer that composits the backdrop.

            * platform/graphics/ca/GraphicsLayerCA.h: Remove const from some parameters so
            that we can use the CommitState to hold the accumulated size.

2018-09-19  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r235752. rdar://problem/44576797

    Don't pause playback when locking screen if video is being displayed on second screen.
    https://bugs.webkit.org/show_bug.cgi?id=189321
    
    Reviewed by Eric Carlson.
    
    Source/WebCore:
    
    Expand the existing behavior when AirPlaying to an external device to playing to a local
    external screen. Don't pause when the screen locks, and don't stop buffering in that mode either.
    
    Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass
    that observed value on to the media element.
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
    (WebCore::HTMLMediaElement::setPlayingOnSecondScreen):
    (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
    (WebCore::HTMLMediaElement::processingUserGestureForMedia const):
    (WebCore::HTMLMediaElement::mediaState const):
    (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
    (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const):
    (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
    (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted.
    (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted.
    * html/HTMLMediaElement.h:
    (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
    (WebCore::HTMLMediaElement::isPlayingToExternalTarget const):
    * html/MediaElementSession.cpp:
    (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted.
    * html/MediaElementSession.h:
    * platform/audio/PlatformMediaSession.h:
    (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
    (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const):
    (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted.
    (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted.
    * platform/cocoa/PlaybackSessionModel.h:
    * platform/cocoa/PlaybackSessionModelMediaElement.h:
    * platform/cocoa/PlaybackSessionModelMediaElement.mm:
    (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen):
    * platform/ios/WebAVPlayerController.mm:
    (-[WebAVPlayerController init]):
    (-[WebAVPlayerController dealloc]):
    (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::setPlayingOnSecondScreen):
    
    Source/WebKit:
    
    Pass the "isPlayingOnSecondScreen" value across the process boundary.
    
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.mm:
    (WebKit::PlaybackSessionModelContext::setPlayingOnSecondScreen):
    (WebKit::PlaybackSessionManagerProxy::setPlayingOnSecondScreen):
    * WebProcess/cocoa/PlaybackSessionManager.h:
    * WebProcess/cocoa/PlaybackSessionManager.messages.in:
    * WebProcess/cocoa/PlaybackSessionManager.mm:
    (WebKit::PlaybackSessionManager::setPlayingOnSecondScreen):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235752 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-09-06  Jer Noble  <jer.noble@apple.com>

            Don't pause playback when locking screen if video is being displayed on second screen.
            https://bugs.webkit.org/show_bug.cgi?id=189321

            Reviewed by Eric Carlson.

            Expand the existing behavior when AirPlaying to an external device to playing to a local
            external screen. Don't pause when the screen locks, and don't stop buffering in that mode either.

            Add a KVO-observer to the WebAVPlayerController's playingOnSecondScreen property, and pass
            that observed value on to the media element.

            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget):
            (WebCore::HTMLMediaElement::setPlayingOnSecondScreen):
            (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction const):
            (WebCore::HTMLMediaElement::processingUserGestureForMedia const):
            (WebCore::HTMLMediaElement::mediaState const):
            (WebCore::HTMLMediaElement::purgeBufferedDataIfPossible):
            (WebCore::HTMLMediaElement::shouldOverrideBackgroundLoadingRestriction const):
            (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const): Deleted.
            (WebCore::HTMLMediaElement::canPlayToWirelessPlaybackTarget const): Deleted.
            (WebCore::HTMLMediaElement::isPlayingToWirelessPlaybackTarget const): Deleted.
            * html/HTMLMediaElement.h:
            (WebCore::HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless const):
            (WebCore::HTMLMediaElement::isPlayingToExternalTarget const):
            * html/MediaElementSession.cpp:
            (WebCore::MediaElementSession::canPlayToWirelessPlaybackTarget const): Deleted.
            * html/MediaElementSession.h:
            * platform/audio/PlatformMediaSession.h:
            (WebCore::PlatformMediaSessionClient::setWirelessPlaybackTarget):
            (WebCore::PlatformMediaSessionClient::isPlayingOnSecondScreen const):
            (WebCore::PlatformMediaSession::canPlayToWirelessPlaybackTarget const): Deleted.
            (WebCore::PlatformMediaSessionClient::canPlayToWirelessPlaybackTarget const): Deleted.
            * platform/cocoa/PlaybackSessionModel.h:
            * platform/cocoa/PlaybackSessionModelMediaElement.h:
            * platform/cocoa/PlaybackSessionModelMediaElement.mm:
            (WebCore::PlaybackSessionModelMediaElement::setPlayingOnSecondScreen):
            * platform/ios/WebAVPlayerController.mm:
            (-[WebAVPlayerController init]):
            (-[WebAVPlayerController dealloc]):
            (-[WebAVPlayerController observeValueForKeyPath:ofObject:change:context:]):
            * platform/ios/WebVideoFullscreenControllerAVKit.mm:
            (VideoFullscreenControllerContext::setPlayingOnSecondScreen):

2018-09-19  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r235956. rdar://problem/44576825

    imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
    https://bugs.webkit.org/show_bug.cgi?id=189493
    
    Reviewed by Alex Christensen.
    
    Source/WebCore:
    
    The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
    by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
    When a form (or any other) element has more than one ref inside removeDetachedChildren,
    addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.
    
    However, when a form associated element of this form element appears later in the tree order,
    FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.
    
    Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
    operations happening in this function so this should be safe.
    
    Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html
    
    * html/FormAssociatedElement.cpp:
    (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.
    
    LayoutTests:
    
    Unskip the test now that it doesn't hit a debug assertion.
    
    * TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235956 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-09-11  Ryosuke Niwa  <rniwa@webkit.org>

            imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html hits assertion
            https://bugs.webkit.org/show_bug.cgi?id=189493

            Reviewed by Alex Christensen.

            The debug assertion was caused by RefPtr in FormAssociatedElement::formOwnerRemovedFromTree introduced
            by r224390 and r223644 ref'ing ShadowRoot while calling removeDetachedChildren inside ~ShadowRoot.
            When a form (or any other) element has more than one ref inside removeDetachedChildren,
            addChildNodesToDeletionQueue calls notifyChildNodeRemoved in the tree oreder.

            However, when a form associated element of this form element appears later in the tree order,
            FormAssociatedElement::formOwnerRemovedFromTree can traverse up ancestors including the ShadowRoot.

            Fixed the bug by using raw pointers instead. Luckily, there is no DOM mutations or other non-trivial
            operations happening in this function so this should be safe.

            Test: imported/w3c/web-platform-tests/shadow-dom/form-control-form-attribute.html

            * html/FormAssociatedElement.cpp:
            (WebCore::FormAssociatedElement::formOwnerRemovedFromTree): Fixed the bug.

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235754. rdar://problem/44210305

    [Apple Pay] Rename the -apple-pay-button-type value "checkout" to "check-out"
    https://bugs.webkit.org/show_bug.cgi?id=189366
    <rdar://problem/44193218>
    
    Reviewed by Sam Weinig.
    
    Source/WebCore:
    
    The button title is "Check out with Apple Pay", so we should use the verb phrase "check out"
    rather than the noun "checkout" for naming this value.
    
    Updated http/tests/ssl/applepay/ApplePayButtonV4.html.
    
    * css/CSSPrimitiveValueMappings.h:
    (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
    (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
    * css/CSSValueKeywords.in:
    * css/parser/CSSParserFastPaths.cpp:
    (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
    * rendering/RenderThemeCocoa.mm:
    (WebCore::toPKPaymentButtonType):
    * rendering/style/RenderStyleConstants.h:
    
    Source/WebInspectorUI:
    
    * UserInterface/Models/CSSKeywordCompletions.js:
    
    LayoutTests:
    
    * http/tests/ssl/applepay/ApplePayButtonV4.html:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235754 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-09-06  Andy Estes  <aestes@apple.com>

            [Apple Pay] Rename the -apple-pay-button-type value "checkout" to "check-out"
            https://bugs.webkit.org/show_bug.cgi?id=189366
            <rdar://problem/44193218>

            Reviewed by Sam Weinig.

            The button title is "Check out with Apple Pay", so we should use the verb phrase "check out"
            rather than the noun "checkout" for naming this value.

            Updated http/tests/ssl/applepay/ApplePayButtonV4.html.

            * css/CSSPrimitiveValueMappings.h:
            (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
            (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
            * css/CSSValueKeywords.in:
            * css/parser/CSSParserFastPaths.cpp:
            (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
            * rendering/RenderThemeCocoa.mm:
            (WebCore::toPKPaymentButtonType):
            * rendering/style/RenderStyleConstants.h:

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235349. rdar://problem/44209834

    [Apple Pay] Introduce new values for -apple-pay-button-type
    https://bugs.webkit.org/show_bug.cgi?id=188949
    <rdar://problem/39992228>
    
    Reviewed by Anders Carlsson.
    
    Source/WebCore:
    
    Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type,
    and mapped those values to their equivalent PKPaymentButtonTypes.
    
    Tests: http/tests/ssl/applepay/ApplePayButton.html
           http/tests/ssl/applepay/ApplePayButtonV4.html
    
    * css/CSSPrimitiveValueMappings.h:
    (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
    (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
    * css/CSSValueKeywords.in:
    * css/parser/CSSParserFastPaths.cpp:
    (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
    * rendering/RenderThemeCocoa.mm:
    (WebCore::toPKPaymentButtonType):
    * rendering/style/RenderStyleConstants.h:
    
    Source/WebCore/PAL:
    
    * pal/spi/cocoa/PassKitSPI.h:
    
    LayoutTests:
    
    * http/tests/ssl/applepay/ApplePayButton.html: Added.
    * http/tests/ssl/applepay/ApplePayButtonV4.html: Added.
    * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.png:
    * platform/mac-highsierra/http/tests/ssl/applepay/ApplePayButton-expected.txt:
    * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.png: Added.
    * platform/mac/http/tests/ssl/applepay/ApplePayButton-expected.txt: Added.
    * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.png: Added.
    * platform/mac/http/tests/ssl/applepay/ApplePayButtonV4-expected.txt: Added.
    * platform/mac-wk2/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235349 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-26  Andy Estes  <aestes@apple.com>

            [Apple Pay] Introduce new values for -apple-pay-button-type
            https://bugs.webkit.org/show_bug.cgi?id=188949
            <rdar://problem/39992228>

            Reviewed by Anders Carlsson.

            Added "in-store", "checkout", "book", and "subscribe" keywords for -apple-pay-button-type,
            and mapped those values to their equivalent PKPaymentButtonTypes.

            Tests: http/tests/ssl/applepay/ApplePayButton.html
                   http/tests/ssl/applepay/ApplePayButtonV4.html

            * css/CSSPrimitiveValueMappings.h:
            (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
            (WebCore::CSSPrimitiveValue::operator ApplePayButtonType const):
            * css/CSSValueKeywords.in:
            * css/parser/CSSParserFastPaths.cpp:
            (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
            * rendering/RenderThemeCocoa.mm:
            (WebCore::toPKPaymentButtonType):
            * rendering/style/RenderStyleConstants.h:

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235569. rdar://problem/44169479

    Storage Access API: Maintain access through same-site navigations
    https://bugs.webkit.org/show_bug.cgi?id=188564
    <rdar://problem/43445160>
    
    Reviewed by Alex Christensen.
    
    Source/WebCore:
    
    Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
           http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html
    
    * dom/Document.h:
        Removed unused member variable m_hasFrameSpecificStorageAccess.
    * loader/DocumentLoader.cpp:
    (WebCore::DocumentLoader::willSendRequest):
    * loader/FrameLoaderClient.h:
    
    Source/WebKit:
    
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::dispatchWillChangeDocument):
        Now takes the current URL and the new URL as parameters
        and only clears out storage access if the navigation is
        cross-site, i.e. with differing eTLD+1s.
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.h:
    
    LayoutTests:
    
    * http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame-expected.txt:
    * http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html:
        Added both a same-site and a cross-site navigation to the sub frame to test maintained and cleared access.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access-expected.txt: Copied from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html: Copied from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access-expected.txt: Renamed from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access-expected.txt.
    * http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html: Renamed from LayoutTests/http/tests/storageAccess/request-and-grant-access-then-navigate-should-not-have-access.html.
    * http/tests/storageAccess/resources/get-cookies.php:
        Support for the new test scenarios.
    * http/tests/storageAccess/resources/self-navigating-frame-after-granted-access.html:
        Support for the new test scenarios.
    * platform/mac-wk2/TestExpectations:
        Marked the new and the renamed tests as [ Pass ].
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235569 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-31  John Wilander  <wilander@apple.com>

            Storage Access API: Maintain access through same-site navigations
            https://bugs.webkit.org/show_bug.cgi?id=188564
            <rdar://problem/43445160>

            Reviewed by Alex Christensen.

            Tests: http/tests/storageAccess/request-and-grant-access-then-navigate-cross-site-should-not-have-access.html
                   http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html

            * dom/Document.h:
                Removed unused member variable m_hasFrameSpecificStorageAccess.
            * loader/DocumentLoader.cpp:
            (WebCore::DocumentLoader::willSendRequest):
            * loader/FrameLoaderClient.h:

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235318. rdar://problem/44209848

    [Apple Pay] Allow $0 totals
    https://bugs.webkit.org/show_bug.cgi?id=185150
    <rdar://problem/39212331>
    
    Reviewed by Dan Bernstein.
    
    Source/WebCore:
    
    Relaxed payment request validation to allow $0 totals. This matches PassKit behavior.
    
    Updated test cases in http/tests/ssl/applepay/.
    
    * Modules/applepay/PaymentRequestValidator.mm:
    (WebCore::PaymentRequestValidator::validateTotal):
    
    LayoutTests:
    
    * 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:
    * http/tests/ssl/applepay/ApplePaySessionV4-expected.txt:
    * http/tests/ssl/applepay/ApplePaySessionV4.html:
    * http/tests/ssl/applepay/PaymentRequest.https-expected.txt:
    * http/tests/ssl/applepay/PaymentRequest.https.html:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235318 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-24  Andy Estes  <aestes@apple.com>

            [Apple Pay] Allow $0 totals
            https://bugs.webkit.org/show_bug.cgi?id=185150
            <rdar://problem/39212331>

            Reviewed by Dan Bernstein.

            Relaxed payment request validation to allow $0 totals. This matches PassKit behavior.

            Updated test cases in http/tests/ssl/applepay/.

            * Modules/applepay/PaymentRequestValidator.mm:
            (WebCore::PaymentRequestValidator::validateTotal):

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235251. rdar://problem/44209840

    [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
    https://bugs.webkit.org/show_bug.cgi?id=188829
    
    Reviewed by Tim Horton.
    
    Source/JavaScriptCore:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore:
    
    Test: http/tests/ssl/applepay/ApplePaySessionV4.html
    
    * Configurations/FeatureDefines.xcconfig:
    * testing/MockPaymentCoordinator.cpp:
    (WebCore::MockPaymentCoordinator::supportsVersion):
    
    Source/WebCore/PAL:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKit:
    
    * Configurations/FeatureDefines.xcconfig:
    * WebProcess/ApplePay/WebPaymentCoordinator.cpp:
    (WebKit::WebPaymentCoordinator::supportsVersion):
    
    Source/WebKitLegacy/mac:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Tools:
    
    * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
    
    LayoutTests:
    
    * 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:
    * http/tests/ssl/applepay/ApplePaySessionV4-expected.txt: Added.
    * http/tests/ssl/applepay/ApplePaySessionV4.html: Added.
    * platform/mac-wk2/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235251 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-23  Andy Estes  <aestes@apple.com>

            [Apple Pay] Introduce Apple Pay JS v4 on iOS 12 and macOS Mojave
            https://bugs.webkit.org/show_bug.cgi?id=188829

            Reviewed by Tim Horton.

            Test: http/tests/ssl/applepay/ApplePaySessionV4.html

            * Configurations/FeatureDefines.xcconfig:
            * testing/MockPaymentCoordinator.cpp:
            (WebCore::MockPaymentCoordinator::supportsVersion):

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235721. rdar://problem/44212406

    Source/WebCore:
    The width of an empty or nullptr TextRun should be zero
    https://bugs.webkit.org/show_bug.cgi?id=189154
    <rdar://problem/43685926>
    
    Reviewed by Zalan Bujtas.
    
    If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.
    
    This patch recognizes that an empty TextRun should always produce a zero width, rather than
    attempt to compute this value from font data. It also prevents ListBox from attempting to
    paint a null string.
    
    Test: fast/text/null-string-textrun.html
    
    * platform/graphics/FontCascade.cpp:
    (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
    (WebCore::FontCascade::width const): Ditto.
    * platform/graphics/TextRun.h:
    (WebCore::TextRun::TextRun): ASSERT that the supplied String is non-null.
    (WebCore::TextRun::setText): Ditto.
    * rendering/RenderListBox.cpp:
    (WebCore::RenderListBox::paintItemForeground): Don't attempt to paint a null string.
    
    Source/WTF:
    The width of an empty or nullptr TextRun should be zero
    https://bugs.webkit.org/show_bug.cgi?id=189154
    <rdar://problem/43685926>
    
    Reviewed by Zalan Bujtas.
    
    Most accessors in WTFString.cpp, such as isAllASCII(), hash(), etc., perform a nullptr check
    before using m_impl, but is8Bit() does not.
    
    This patch adds a check in the is8Bit() implementation to be consistent with other methods,
    and to address a small number of crashes observed in testing.
    
    * wtf/text/WTFString.h:
    (WTF::String::is8Bit const):
    
    LayoutTests:
    The width of a nullptr TextRun should be zero
    https://bugs.webkit.org/show_bug.cgi?id=189154
    <rdar://problem/43685926>
    
    Reviewed by Zalan Bujtas.
    
    * fast/text/null-string-textrun-expected.txt: Added.
    * fast/text/null-string-textrun.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235721 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-09-05  Brent Fulgham  <bfulgham@apple.com>

            The width of an empty or nullptr TextRun should be zero
            https://bugs.webkit.org/show_bug.cgi?id=189154
            <rdar://problem/43685926>

            Reviewed by Zalan Bujtas.

            If a page has an empty TextRun and attempts to paint it we can crash with a nullptr.

            This patch recognizes that an empty TextRun should always produce a zero width, rather than
            attempt to compute this value from font data. It also prevents ListBox from attempting to
            paint a null string.

            Test: fast/text/null-string-textrun.html

            * platform/graphics/FontCascade.cpp:
            (WebCore::FontCascade::widthOfTextRange const): An empty TextRun has zero width.
            (WebCore::FontCascade::width const): Ditto.
            * platform/graphics/TextRun.h:
            (WebCore::TextRun::TextRun): ASSERT that the supplied String is non-null.
            (WebCore::TextRun::setText): Ditto.
            * rendering/RenderListBox.cpp:
            (WebCore::RenderListBox::paintItemForeground): Don't attempt to paint a null string.

2018-09-06  Mark Lam  <mark.lam@apple.com>

        Cherry-pick r235254, r235419, r235666. rdar://problem/44169332

    2018-08-23  Mark Lam  <mark.lam@apple.com>

            Move vmEntryGlobalObject() to VM from CallFrame.
            https://bugs.webkit.org/show_bug.cgi?id=188900
            <rdar://problem/43655753>

            Reviewed by Michael Saboff.

            No new tests needed because this patch does not introduce new functionality.

            * bindings/js/JSCustomXPathNSResolver.cpp:
            (WebCore::JSCustomXPathNSResolver::create):
            * bindings/js/JSDOMGlobalObject.cpp:
            (WebCore::callerGlobalObject):
            (WebCore::toJSDOMGlobalObject): Deleted.
            * bindings/js/JSDOMWindowBase.cpp:
            (WebCore::firstDOMWindow):
            * bridge/c/c_utility.cpp:
            (JSC::Bindings::convertValueToNPVariant):
            * bridge/objc/WebScriptObject.mm:
            (WebCore::addExceptionToConsole):
            * bridge/objc/objc_instance.mm:
            (ObjcInstance::moveGlobalExceptionToExecState):
            * bridge/objc/objc_runtime.mm:
            (JSC::Bindings::convertValueToObjcObject):
            * bridge/objc/objc_utility.mm:
            (JSC::Bindings::convertValueToObjcValue):
            * testing/Internals.cpp:
            (WebCore::Internals::cloneArrayBuffer):

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r235537. rdar://problem/44169516

    CounterMaps should hold a unique_ptr of CounterMap.
    https://bugs.webkit.org/show_bug.cgi?id=189174
    <rdar://problem/43686458>
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object.
    
    Test: fast/css/counters/crash-when-cloning-body.html
    
    * rendering/RenderCounter.cpp:
    (WebCore::makeCounterNode):
    (WebCore::destroyCounterNodeWithoutMapRemoval):
    (WebCore::RenderCounter::destroyCounterNodes):
    (WebCore::RenderCounter::destroyCounterNode):
    (WebCore::updateCounters):
    (showCounterRendererTree):
    
    LayoutTests:
    
    * fast/css/counters/crash-when-cloning-body-expected.txt: Added.
    * fast/css/counters/crash-when-cloning-body.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@235537 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-30  Zalan Bujtas  <zalan@apple.com>

            CounterMaps should hold a unique_ptr of CounterMap.
            https://bugs.webkit.org/show_bug.cgi?id=189174
            <rdar://problem/43686458>

            Reviewed by Ryosuke Niwa.

            In certain cases calls to CounterMaps might lead to unexpected deletion of the CounterMap object.

            Test: fast/css/counters/crash-when-cloning-body.html

            * rendering/RenderCounter.cpp:
            (WebCore::makeCounterNode):
            (WebCore::destroyCounterNodeWithoutMapRemoval):
            (WebCore::RenderCounter::destroyCounterNodes):
            (WebCore::RenderCounter::destroyCounterNode):
            (WebCore::updateCounters):
            (showCounterRendererTree):

2018-09-06  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233898. rdar://problem/44168991

    [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
    https://bugs.webkit.org/show_bug.cgi?id=187501
    <rdar://problem/41438160>
    
    Reviewed by Youenn Fablet.
    
    Source/WebCore:
    
    This patch aims at making all captured variables in all crypto lambdas that need to be passed
    to a worker thread thread safe, which includes:
    1) changing ref counted objects to thread safe ref counted object.
    2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().
    
    In addition to above changes, this patch also does the following things:
    1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
    to make it clear that lambdas will be passed to a secondary thread.
    2) make CryptoAlgorithmParameters as const parameters for all methods.
    3) add null checks on BufferSource.length() and .data().
    
    Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
           http/wpt/crypto/aes-cbc-crash.any.html
           http/wpt/crypto/aes-cbc-crash.any.worker.html
           http/wpt/crypto/aes-ctr-crash.any.html
           http/wpt/crypto/aes-ctr-crash.any.worker.html
           http/wpt/crypto/aes-gcm-crash.any.html
           http/wpt/crypto/aes-gcm-crash.any.worker.html
           http/wpt/crypto/derive-hmac-key-crash.any.html
           http/wpt/crypto/derive-hmac-key-crash.any.worker.html
           http/wpt/crypto/ecdsa-crash.any.html
           http/wpt/crypto/ecdsa-crash.any.worker.html
           http/wpt/crypto/hkdf-crash.any.html
           http/wpt/crypto/hkdf-crash.any.worker.html
           http/wpt/crypto/pbkdf2-crash.any.html
           http/wpt/crypto/pbkdf2-crash.any.worker.html
           http/wpt/crypto/rsa-oaep-crash.any.html
           http/wpt/crypto/rsa-oaep-crash.any.worker.html
           http/wpt/crypto/rsa-pss-crash.any.html
           http/wpt/crypto/rsa-pss-crash.any.worker.html
           http/wpt/crypto/unwrap-ec-key-crash.any.html
           http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
           http/wpt/crypto/unwrap-rsa-key-crash.any.html
           http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html
    
    * bindings/js/BufferSource.h:
    (WebCore::BufferSource::data const):
    (WebCore::BufferSource::length const):
    * crypto/CryptoAlgorithm.cpp:
    (WebCore::CryptoAlgorithm::encrypt):
    (WebCore::CryptoAlgorithm::decrypt):
    (WebCore::CryptoAlgorithm::sign):
    (WebCore::CryptoAlgorithm::verify):
    (WebCore::CryptoAlgorithm::deriveBits):
    (WebCore::CryptoAlgorithm::importKey):
    (WebCore::dispatchAlgorithmOperation):
    (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
    (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
    * crypto/CryptoAlgorithm.h:
    * crypto/SubtleCrypto.cpp:
    (WebCore::crossThreadCopyImportParams):
    (WebCore::SubtleCrypto::encrypt):
    (WebCore::SubtleCrypto::decrypt):
    (WebCore::SubtleCrypto::sign):
    (WebCore::SubtleCrypto::verify):
    (WebCore::SubtleCrypto::deriveKey):
    (WebCore::SubtleCrypto::deriveBits):
    (WebCore::SubtleCrypto::importKey):
    (WebCore::SubtleCrypto::wrapKey):
    (WebCore::SubtleCrypto::unwrapKey):
    * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
    (WebCore::CryptoAlgorithmAES_CBC::encrypt):
    (WebCore::CryptoAlgorithmAES_CBC::decrypt):
    (WebCore::CryptoAlgorithmAES_CBC::importKey):
    * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
    * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
    (WebCore::CryptoAlgorithmAES_CFB::encrypt):
    (WebCore::CryptoAlgorithmAES_CFB::decrypt):
    (WebCore::CryptoAlgorithmAES_CFB::importKey):
    * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
    * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
    (WebCore::parametersAreValid):
    (WebCore::CryptoAlgorithmAES_CTR::encrypt):
    (WebCore::CryptoAlgorithmAES_CTR::decrypt):
    (WebCore::CryptoAlgorithmAES_CTR::importKey):
    * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
    * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
    (WebCore::CryptoAlgorithmAES_GCM::encrypt):
    (WebCore::CryptoAlgorithmAES_GCM::decrypt):
    (WebCore::CryptoAlgorithmAES_GCM::importKey):
    * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
    * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
    (WebCore::CryptoAlgorithmAES_KW::importKey):
    * crypto/algorithms/CryptoAlgorithmAES_KW.h:
    * crypto/algorithms/CryptoAlgorithmECDH.cpp:
    (WebCore::CryptoAlgorithmECDH::deriveBits):
    (WebCore::CryptoAlgorithmECDH::importKey):
    * crypto/algorithms/CryptoAlgorithmECDH.h:
    * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
    (WebCore::CryptoAlgorithmECDSA::sign):
    (WebCore::CryptoAlgorithmECDSA::verify):
    (WebCore::CryptoAlgorithmECDSA::importKey):
    * crypto/algorithms/CryptoAlgorithmECDSA.h:
    * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
    (WebCore::CryptoAlgorithmHKDF::deriveBits):
    (WebCore::CryptoAlgorithmHKDF::importKey):
    * crypto/algorithms/CryptoAlgorithmHKDF.h:
    * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
    (WebCore::CryptoAlgorithmHMAC::sign):
    (WebCore::CryptoAlgorithmHMAC::verify):
    (WebCore::CryptoAlgorithmHMAC::importKey):
    * crypto/algorithms/CryptoAlgorithmHMAC.h:
    * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
    (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
    (WebCore::CryptoAlgorithmPBKDF2::importKey):
    * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
    * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
    (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
    (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
    (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
    * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
    * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
    (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
    (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
    (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
    * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
    * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
    (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
    (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
    (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
    * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
    * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
    (WebCore::CryptoAlgorithmRSA_PSS::sign):
    (WebCore::CryptoAlgorithmRSA_PSS::verify):
    (WebCore::CryptoAlgorithmRSA_PSS::importKey):
    * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
    * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
    (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
    * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
    (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
    * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
    (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
    * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
    (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
    * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
    (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
    * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
    (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
    * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
    (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
    (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
    * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
    (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
    (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
    * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
    (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
    * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
    (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
    * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
    (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
    * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
    (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
    (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
    * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
    (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
    * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
    (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
    * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
    (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
    (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
    * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
    (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
    (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
    * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
    * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
    * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
    * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
    * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
    * crypto/parameters/CryptoAlgorithmHkdfParams.h:
    * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
    * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
    * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
    * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
    * crypto/parameters/CryptoAlgorithmRsaPssParams.h:
    
    LayoutTests:
    
    crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html is an exception of this series of tests as
    it only aims to test the correct behavoir of suggested algorithms. This patch aslo does some test
    gardening.
    
    * TestExpectations:
    * crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key-expected.txt: Added.
    * crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html: Added.
    * http/wpt/crypto/aes-cbc-crash.any-expected.txt: Added.
    * http/wpt/crypto/aes-cbc-crash.any.html: Added.
    * http/wpt/crypto/aes-cbc-crash.any.js: Added.
    * http/wpt/crypto/aes-cbc-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/aes-cbc-crash.any.worker.html: Added.
    * http/wpt/crypto/aes-ctr-crash.any-expected.txt: Added.
    * http/wpt/crypto/aes-ctr-crash.any.html: Added.
    * http/wpt/crypto/aes-ctr-crash.any.js: Added.
    * http/wpt/crypto/aes-ctr-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/aes-ctr-crash.any.worker.html: Added.
    * http/wpt/crypto/aes-gcm-crash.any-expected.txt: Added.
    * http/wpt/crypto/aes-gcm-crash.any.html: Added.
    * http/wpt/crypto/aes-gcm-crash.any.js: Added.
    * http/wpt/crypto/aes-gcm-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/aes-gcm-crash.any.worker.html: Added.
    * http/wpt/crypto/derive-hmac-key-crash.any-expected.txt: Added.
    * http/wpt/crypto/derive-hmac-key-crash.any.html: Added.
    * http/wpt/crypto/derive-hmac-key-crash.any.js: Added.
    * http/wpt/crypto/derive-hmac-key-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/derive-hmac-key-crash.any.worker.html: Added.
    * http/wpt/crypto/ecdsa-crash.any-expected.txt: Added.
    * http/wpt/crypto/ecdsa-crash.any.html: Added.
    * http/wpt/crypto/ecdsa-crash.any.js: Added.
    * http/wpt/crypto/ecdsa-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/ecdsa-crash.any.worker.html: Added.
    * http/wpt/crypto/hkdf-crash.any-expected.txt: Added.
    * http/wpt/crypto/hkdf-crash.any.html: Added.
    * http/wpt/crypto/hkdf-crash.any.js: Added.
    * http/wpt/crypto/hkdf-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/hkdf-crash.any.worker.html: Added.
    * http/wpt/crypto/pbkdf2-crash.any-expected.txt: Added.
    * http/wpt/crypto/pbkdf2-crash.any.html: Added.
    * http/wpt/crypto/pbkdf2-crash.any.js: Added.
    * http/wpt/crypto/pbkdf2-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/pbkdf2-crash.any.worker.html: Added.
    * http/wpt/crypto/resources/common.js: Added.
    * http/wpt/crypto/rsa-oaep-crash.any-expected.txt: Added.
    * http/wpt/crypto/rsa-oaep-crash.any.html: Added.
    * http/wpt/crypto/rsa-oaep-crash.any.js: Added.
    * http/wpt/crypto/rsa-oaep-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/rsa-oaep-crash.any.worker.html: Added.
    * http/wpt/crypto/rsa-pss-crash.any-expected.txt: Added.
    * http/wpt/crypto/rsa-pss-crash.any.html: Added.
    * http/wpt/crypto/rsa-pss-crash.any.js: Added.
    * http/wpt/crypto/rsa-pss-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/rsa-pss-crash.any.worker.html: Added.
    * http/wpt/crypto/unwrap-ec-key-crash.any-expected.txt: Added.
    * http/wpt/crypto/unwrap-ec-key-crash.any.html: Added.
    * http/wpt/crypto/unwrap-ec-key-crash.any.js: Added.
    * http/wpt/crypto/unwrap-ec-key-crash.any.worker-expected.txt: Added.
    * http/wpt/crypto/unwrap-ec-key-crash.any.worker.html: Added.
    * http/wpt/crypto/unwrap-rsa-key-crash.any-expected.txt: Added.
    * http/wpt/crypto/unwrap-rsa-key-crash.any.html: Added.
    * http/wpt/crypto/unwrap-rsa-key-crash.any.js: Added.
    * http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html: Added.
    * http/wpt/crypto/unwrap-rsa-key-crash.any.worker-expected.txt: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233898 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-15  Jiewen Tan  <jiewen_tan@apple.com>

            [WebCrypto] Crypto operations should copy their parameters before hoping to another thread
            https://bugs.webkit.org/show_bug.cgi?id=187501
            <rdar://problem/41438160>

            Reviewed by Youenn Fablet.

            This patch aims at making all captured variables in all crypto lambdas that need to be passed
            to a worker thread thread safe, which includes:
            1) changing ref counted objects to thread safe ref counted object.
            2) adding isolatedCopy methods to non ref counted classes, so they can be called by CrossThreadCopy().

            In addition to above changes, this patch also does the following things:
            1) change the name CryptoAlgorithm::dispatchOperation => CryptoAlgorithm::dispatchOperationInWorkQueue
            to make it clear that lambdas will be passed to a secondary thread.
            2) make CryptoAlgorithmParameters as const parameters for all methods.
            3) add null checks on BufferSource.length() and .data().

            Tests: crypto/subtle/aes-gcm-import-key-unwrap-ec-raw-key.html
                   http/wpt/crypto/aes-cbc-crash.any.html
                   http/wpt/crypto/aes-cbc-crash.any.worker.html
                   http/wpt/crypto/aes-ctr-crash.any.html
                   http/wpt/crypto/aes-ctr-crash.any.worker.html
                   http/wpt/crypto/aes-gcm-crash.any.html
                   http/wpt/crypto/aes-gcm-crash.any.worker.html
                   http/wpt/crypto/derive-hmac-key-crash.any.html
                   http/wpt/crypto/derive-hmac-key-crash.any.worker.html
                   http/wpt/crypto/ecdsa-crash.any.html
                   http/wpt/crypto/ecdsa-crash.any.worker.html
                   http/wpt/crypto/hkdf-crash.any.html
                   http/wpt/crypto/hkdf-crash.any.worker.html
                   http/wpt/crypto/pbkdf2-crash.any.html
                   http/wpt/crypto/pbkdf2-crash.any.worker.html
                   http/wpt/crypto/rsa-oaep-crash.any.html
                   http/wpt/crypto/rsa-oaep-crash.any.worker.html
                   http/wpt/crypto/rsa-pss-crash.any.html
                   http/wpt/crypto/rsa-pss-crash.any.worker.html
                   http/wpt/crypto/unwrap-ec-key-crash.any.html
                   http/wpt/crypto/unwrap-ec-key-crash.any.worker.html
                   http/wpt/crypto/unwrap-rsa-key-crash.any.html
                   http/wpt/crypto/unwrap-rsa-key-crash.any.worker.html

            * bindings/js/BufferSource.h:
            (WebCore::BufferSource::data const):
            (WebCore::BufferSource::length const):
            * crypto/CryptoAlgorithm.cpp:
            (WebCore::CryptoAlgorithm::encrypt):
            (WebCore::CryptoAlgorithm::decrypt):
            (WebCore::CryptoAlgorithm::sign):
            (WebCore::CryptoAlgorithm::verify):
            (WebCore::CryptoAlgorithm::deriveBits):
            (WebCore::CryptoAlgorithm::importKey):
            (WebCore::dispatchAlgorithmOperation):
            (WebCore::CryptoAlgorithm::dispatchOperationInWorkQueue):
            (WebCore::CryptoAlgorithm::dispatchOperation): Deleted.
            * crypto/CryptoAlgorithm.h:
            * crypto/SubtleCrypto.cpp:
            (WebCore::crossThreadCopyImportParams):
            (WebCore::SubtleCrypto::encrypt):
            (WebCore::SubtleCrypto::decrypt):
            (WebCore::SubtleCrypto::sign):
            (WebCore::SubtleCrypto::verify):
            (WebCore::SubtleCrypto::deriveKey):
            (WebCore::SubtleCrypto::deriveBits):
            (WebCore::SubtleCrypto::importKey):
            (WebCore::SubtleCrypto::wrapKey):
            (WebCore::SubtleCrypto::unwrapKey):
            * crypto/algorithms/CryptoAlgorithmAES_CBC.cpp:
            (WebCore::CryptoAlgorithmAES_CBC::encrypt):
            (WebCore::CryptoAlgorithmAES_CBC::decrypt):
            (WebCore::CryptoAlgorithmAES_CBC::importKey):
            * crypto/algorithms/CryptoAlgorithmAES_CBC.h:
            * crypto/algorithms/CryptoAlgorithmAES_CFB.cpp:
            (WebCore::CryptoAlgorithmAES_CFB::encrypt):
            (WebCore::CryptoAlgorithmAES_CFB::decrypt):
            (WebCore::CryptoAlgorithmAES_CFB::importKey):
            * crypto/algorithms/CryptoAlgorithmAES_CFB.h:
            * crypto/algorithms/CryptoAlgorithmAES_CTR.cpp:
            (WebCore::parametersAreValid):
            (WebCore::CryptoAlgorithmAES_CTR::encrypt):
            (WebCore::CryptoAlgorithmAES_CTR::decrypt):
            (WebCore::CryptoAlgorithmAES_CTR::importKey):
            * crypto/algorithms/CryptoAlgorithmAES_CTR.h:
            * crypto/algorithms/CryptoAlgorithmAES_GCM.cpp:
            (WebCore::CryptoAlgorithmAES_GCM::encrypt):
            (WebCore::CryptoAlgorithmAES_GCM::decrypt):
            (WebCore::CryptoAlgorithmAES_GCM::importKey):
            * crypto/algorithms/CryptoAlgorithmAES_GCM.h:
            * crypto/algorithms/CryptoAlgorithmAES_KW.cpp:
            (WebCore::CryptoAlgorithmAES_KW::importKey):
            * crypto/algorithms/CryptoAlgorithmAES_KW.h:
            * crypto/algorithms/CryptoAlgorithmECDH.cpp:
            (WebCore::CryptoAlgorithmECDH::deriveBits):
            (WebCore::CryptoAlgorithmECDH::importKey):
            * crypto/algorithms/CryptoAlgorithmECDH.h:
            * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
            (WebCore::CryptoAlgorithmECDSA::sign):
            (WebCore::CryptoAlgorithmECDSA::verify):
            (WebCore::CryptoAlgorithmECDSA::importKey):
            * crypto/algorithms/CryptoAlgorithmECDSA.h:
            * crypto/algorithms/CryptoAlgorithmHKDF.cpp:
            (WebCore::CryptoAlgorithmHKDF::deriveBits):
            (WebCore::CryptoAlgorithmHKDF::importKey):
            * crypto/algorithms/CryptoAlgorithmHKDF.h:
            * crypto/algorithms/CryptoAlgorithmHMAC.cpp:
            (WebCore::CryptoAlgorithmHMAC::sign):
            (WebCore::CryptoAlgorithmHMAC::verify):
            (WebCore::CryptoAlgorithmHMAC::importKey):
            * crypto/algorithms/CryptoAlgorithmHMAC.h:
            * crypto/algorithms/CryptoAlgorithmPBKDF2.cpp:
            (WebCore::CryptoAlgorithmPBKDF2::deriveBits):
            (WebCore::CryptoAlgorithmPBKDF2::importKey):
            * crypto/algorithms/CryptoAlgorithmPBKDF2.h:
            * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp:
            (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt):
            (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt):
            (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::importKey):
            * crypto/algorithms/CryptoAlgorithmRSAES_PKCS1_v1_5.h:
            * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp:
            (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::sign):
            (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::verify):
            (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey):
            * crypto/algorithms/CryptoAlgorithmRSASSA_PKCS1_v1_5.h:
            * crypto/algorithms/CryptoAlgorithmRSA_OAEP.cpp:
            (WebCore::CryptoAlgorithmRSA_OAEP::encrypt):
            (WebCore::CryptoAlgorithmRSA_OAEP::decrypt):
            (WebCore::CryptoAlgorithmRSA_OAEP::importKey):
            * crypto/algorithms/CryptoAlgorithmRSA_OAEP.h:
            * crypto/algorithms/CryptoAlgorithmRSA_PSS.cpp:
            (WebCore::CryptoAlgorithmRSA_PSS::sign):
            (WebCore::CryptoAlgorithmRSA_PSS::verify):
            (WebCore::CryptoAlgorithmRSA_PSS::importKey):
            * crypto/algorithms/CryptoAlgorithmRSA_PSS.h:
            * crypto/gcrypt/CryptoAlgorithmAES_CBCGCrypt.cpp:
            (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
            * crypto/gcrypt/CryptoAlgorithmAES_CFBGCrypt.cpp:
            (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
            * crypto/gcrypt/CryptoAlgorithmAES_CTRGCrypt.cpp:
            (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
            * crypto/gcrypt/CryptoAlgorithmAES_GCMGCrypt.cpp:
            (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
            * crypto/gcrypt/CryptoAlgorithmHKDFGCrypt.cpp:
            (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
            * crypto/gcrypt/CryptoAlgorithmPBKDF2GCrypt.cpp:
            (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
            * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
            (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
            (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
            * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
            (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
            (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
            * crypto/mac/CryptoAlgorithmAES_CBCMac.cpp:
            (WebCore::CryptoAlgorithmAES_CBC::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_CBC::platformDecrypt):
            * crypto/mac/CryptoAlgorithmAES_CFBMac.cpp:
            (WebCore::CryptoAlgorithmAES_CFB::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_CFB::platformDecrypt):
            * crypto/mac/CryptoAlgorithmAES_CTRMac.cpp:
            (WebCore::CryptoAlgorithmAES_CTR::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_CTR::platformDecrypt):
            * crypto/mac/CryptoAlgorithmAES_GCMMac.cpp:
            (WebCore::CryptoAlgorithmAES_GCM::platformEncrypt):
            (WebCore::CryptoAlgorithmAES_GCM::platformDecrypt):
            * crypto/mac/CryptoAlgorithmHKDFMac.cpp:
            (WebCore::CryptoAlgorithmHKDF::platformDeriveBits):
            * crypto/mac/CryptoAlgorithmPBKDF2Mac.cpp:
            (WebCore::CryptoAlgorithmPBKDF2::platformDeriveBits):
            * crypto/mac/CryptoAlgorithmRSA_OAEPMac.cpp:
            (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
            (WebCore::CryptoAlgorithmRSA_OAEP::platformDecrypt):
            * crypto/mac/CryptoAlgorithmRSA_PSSMac.cpp:
            (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
            (WebCore::CryptoAlgorithmRSA_PSS::platformVerify):
            * crypto/parameters/CryptoAlgorithmAesCbcCfbParams.h:
            * crypto/parameters/CryptoAlgorithmAesCtrParams.h:
            * crypto/parameters/CryptoAlgorithmAesGcmParams.h:
            * crypto/parameters/CryptoAlgorithmEcKeyParams.h:
            * crypto/parameters/CryptoAlgorithmEcdsaParams.h:
            * crypto/parameters/CryptoAlgorithmHkdfParams.h:
            * crypto/parameters/CryptoAlgorithmHmacKeyParams.h:
            * crypto/parameters/CryptoAlgorithmPbkdf2Params.h:
            * crypto/parameters/CryptoAlgorithmRsaHashedImportParams.h:
            * crypto/parameters/CryptoAlgorithmRsaOaepParams.h:
            * crypto/parameters/CryptoAlgorithmRsaPssParams.h:

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234905. rdar://problem/44144059

    Can't share an app on AppStore to WeChat due to a release assert
    https://bugs.webkit.org/show_bug.cgi?id=188621
    <rdar://problem/43343976>
    
    Reviewed by Geoffrey Garen.
    
    Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
    is getting hit by third party applications on iOS in UI process.
    
    Source/WebCore:
    
    * platform/Timer.cpp:
    (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.
    
    Source/WebKit:
    
    * UIProcess/Cocoa/VersionChecks.h:
    (WebKit::SDKVersion::FirstWithMainThreadReleaseAssertionInWebPageProxy): Added. It's iOS 12 or macOS 10.14 Mojave.
    * UIProcess/WebProcessProxy.cpp:
    (WebKit::isMainThreadOrCheckDisabled): Added. Returns true whether when we're in the main thread or if the app
    is not linked on or after iOS 12 or macOS 10.14 Mojave.
    (WebKit::globalPageMap):
    (WebKit::m_isInPrewarmedPool):
    (WebKit::WebProcessProxy::~WebProcessProxy):
    (WebKit::WebProcessProxy::shutDown):
    (WebKit::WebProcessProxy::deleteWebsiteDataForTopPrivatelyControlledDomainsInAllPersistentDataStores):
    (WebKit::WebProcessProxy::topPrivatelyControlledDomainsWithWebsiteData):
    (WebKit::WebProcessProxy::didFinishLaunching):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234905 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-15  Ryosuke Niwa  <rniwa@webkit.org>

            Can't share an app on AppStore to WeChat due to a release assert
            https://bugs.webkit.org/show_bug.cgi?id=188621
            <rdar://problem/43343976>

            Reviewed by Geoffrey Garen.

            Disable the thread safety check when the app is not linked on or after iOS 12 since this release assert
            is getting hit by third party applications on iOS in UI process.

            * platform/Timer.cpp:
            (WebCore::shouldSuppressThreadSafetyCheck): Added a SDK check.

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234890. rdar://problem/44144063

    Remove failing assertion introduced in r234873
    https://bugs.webkit.org/show_bug.cgi?id=188581
    
    * contentextensions/ContentExtensionCompiler.cpp:
    (WebCore::ContentExtensions::compileRuleList):
    The assertion is correct but failing because VectorTraits<String> is incorrect.
    I'll re-add it and fix VectorTraits<String> in a separate patch.
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234890 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-15  Alex Christensen  <achristensen@webkit.org>

            Remove failing assertion introduced in r234873
            https://bugs.webkit.org/show_bug.cgi?id=188581

            * contentextensions/ContentExtensionCompiler.cpp:
            (WebCore::ContentExtensions::compileRuleList):
            The assertion is correct but failing because VectorTraits<String> is incorrect.
            I'll re-add it and fix VectorTraits<String> in a separate patch.

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234873. rdar://problem/44144063

    isValidCSSSelector is unsafe to be called from a non-main thread
    https://bugs.webkit.org/show_bug.cgi?id=188581
    <rdar://problem/40517358>
    
    Reviewed by Sam Weinig.
    
    Source/WebCore:
    
    Parsing and determining whether the css selectors are valid is fast enough to do before
    hopping to the background thread for the slow NFA/DFA operations and writing to disk.
    Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings.
    
    * contentextensions/ContentExtensionCompiler.cpp:
    (WebCore::ContentExtensions::compileRuleList):
    * contentextensions/ContentExtensionCompiler.h:
    * contentextensions/ContentExtensionParser.cpp:
    (WebCore::ContentExtensions::isValidCSSSelector):
    (WebCore::ContentExtensions::loadEncodedRules):
    (WebCore::ContentExtensions::parseRuleList):
    * contentextensions/ContentExtensionParser.h:
    * contentextensions/ContentExtensionRule.cpp:
    (WebCore::ContentExtensions::Trigger::isolatedCopy const):
    (WebCore::ContentExtensions::Action::isolatedCopy const):
    * contentextensions/ContentExtensionRule.h:
    (WebCore::ContentExtensions::Trigger::isEmpty const):
    (WebCore::ContentExtensions::Trigger::operator== const):
    (WebCore::ContentExtensions::Action::Action):
    (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
    (WebCore::ContentExtensions::ContentExtensionRule::operator== const):
    (WebCore::ContentExtensions::vectorIsolatedCopy):
    
    Source/WebKit:
    
    * UIProcess/API/APIContentRuleListStore.cpp:
    (API::compiledToFile):
    (API::ContentRuleListStore::lookupContentRuleList):
    (API::ContentRuleListStore::getAvailableContentRuleListIdentifiers):
    (API::ContentRuleListStore::compileContentRuleList):
    (API::ContentRuleListStore::removeContentRuleList):
    (API::ContentRuleListStore::getContentRuleListSource):
    * UIProcess/API/APIContentRuleListStore.h:
    * UIProcess/API/Cocoa/WKContentRuleListStore.mm:
    
    Source/WTF:
    
    * wtf/Vector.h:
    (WTF::minCapacity>::isolatedCopy):
    
    Tools:
    
    * TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp:
    (TestWebKitAPI::InMemoryCompiledContentExtension::create):
    (TestWebKitAPI::checkCompilerError):
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234873 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-14  Alex Christensen  <achristensen@webkit.org>

            isValidCSSSelector is unsafe to be called from a non-main thread
            https://bugs.webkit.org/show_bug.cgi?id=188581
            <rdar://problem/40517358>

            Reviewed by Sam Weinig.

            Parsing and determining whether the css selectors are valid is fast enough to do before
            hopping to the background thread for the slow NFA/DFA operations and writing to disk.
            Doing it on the main thread avoids the thread safety issues in the CSSParser's use of strings.

            * contentextensions/ContentExtensionCompiler.cpp:
            (WebCore::ContentExtensions::compileRuleList):
            * contentextensions/ContentExtensionCompiler.h:
            * contentextensions/ContentExtensionParser.cpp:
            (WebCore::ContentExtensions::isValidCSSSelector):
            (WebCore::ContentExtensions::loadEncodedRules):
            (WebCore::ContentExtensions::parseRuleList):
            * contentextensions/ContentExtensionParser.h:
            * contentextensions/ContentExtensionRule.cpp:
            (WebCore::ContentExtensions::Trigger::isolatedCopy const):
            (WebCore::ContentExtensions::Action::isolatedCopy const):
            * contentextensions/ContentExtensionRule.h:
            (WebCore::ContentExtensions::Trigger::isEmpty const):
            (WebCore::ContentExtensions::Trigger::operator== const):
            (WebCore::ContentExtensions::Action::Action):
            (WebCore::ContentExtensions::ContentExtensionRule::isolatedCopy const):
            (WebCore::ContentExtensions::ContentExtensionRule::operator== const):
            (WebCore::ContentExtensions::vectorIsolatedCopy):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234778. rdar://problem/44144053

    [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
    https://bugs.webkit.org/show_bug.cgi?id=188480
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).
    
    In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
    or WebKit2 APIs in non-main threads.
    
    * platform/Timer.cpp:
    (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
    (WebCore::TimerBase::~TimerBase):
    (WebCore::TimerBase::setNextFireTime):
    
    Source/WTF:
    
    Added the SDK version for macOS Mojave.
    
    * wtf/spi/darwin/dyldSPI.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234778 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-10  Ryosuke Niwa  <rniwa@webkit.org>

            [macOS] Multiple third party apps crash due to the thread safety check in TimerBase::setNextFireTime
            https://bugs.webkit.org/show_bug.cgi?id=188480

            Reviewed by Simon Fraser.

            Suppress the release assert in WebKit1 on macOS (isInWebProcess is always true in non-Cocoa platforms).

            In the future, we should consider throwing Objective-C exceptions when third party apps call WebKit1
            or WebKit2 APIs in non-main threads.

            * platform/Timer.cpp:
            (WebCore::shouldSuppressThreadSafetyCheck): Extracted out of ~TimerBase and setNextFireTime.
            (WebCore::TimerBase::~TimerBase):
            (WebCore::TimerBase::setNextFireTime):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234766. rdar://problem/44144088

    CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
    https://bugs.webkit.org/show_bug.cgi?id=188461
    <rdar://problem/33555052>
    
    Reviewed by Chris Dumez.
    
    When we try to schedule shutdown for database, we should cancel the timer so no
    scheduleShutdownForClose will be running after this.
    
    * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
    (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234766 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-10  Sihui Liu  <sihui_liu@apple.com>

            CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose
            https://bugs.webkit.org/show_bug.cgi?id=188461
            <rdar://problem/33555052>

            Reviewed by Chris Dumez.

            When we try to schedule shutdown for database, we should cancel the timer so no
            scheduleShutdownForClose will be running after this.

            * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
            (WebCore::IDBServer::UniqueIDBDatabase::scheduleShutdownForClose):

2018-09-05  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234718. rdar://problem/44144071

    REGRESSION (r228260): Events handled by input method invoke default event handler
    https://bugs.webkit.org/show_bug.cgi?id=188370
    
    Reviewed by Wenson Hsieh.
    
    Source/WebCore:
    
    The bug was caused by the default event handler being invoked for the "virtual" keydown events
    generated for input methods. Namely, when Japanese or Chinese input methods swallows TAB key,
    WebKit should not invoke the default event handler and move the focus during input composition.
    
    Fixed the bug by adding a new boolean on Event indicating whether the default event handler
    should be invoked, and restoring the behavior prior to r228260 for these virtual keydown events.
    
    Test: editing/input/press-tab-during-ime-composition.html
    
    * dom/Event.h:
    (WebCore::Event::isDefaultEventHandlerIgnored const): Added.
    (WebCore::Event::setIsDefaultEventHandlerIgnored): Added.
    * dom/EventDispatcher.cpp:
    (WebCore::EventDispatcher::dispatchEvent): Don't invoke the default event handler if
    isDefaultEventHandlerIgnored is set.
    * page/EventHandler.cpp:
    (WebCore::EventHandler::internalKeyEvent): Set isDefaultEventHandlerIgnored. This restores WebKit's
    behavior prior to r228260.
    
    LayoutTests:
    
    Added a regression test. Due to the lack of adequate support of textInputController in WebKitTestRunner,
    the test is only enabled in WebKit1. The WTR fix is tracked by https://webkit.org/b/188428.
    
    * editing/input/press-tab-during-ime-composition-expected.txt: Added.
    * editing/input/press-tab-during-ime-composition.html: Added.
    * platform/ios/TestExpectations:
    * platform/wk2/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234718 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-08  Ryosuke Niwa  <rniwa@webkit.org>

            REGRESSION (r228260): Events handled by input method invoke default event handler
            https://bugs.webkit.org/show_bug.cgi?id=188370

            Reviewed by Wenson Hsieh.

            The bug was caused by the default event handler being invoked for the "virtual" keydown events
            generated for input methods. Namely, when Japanese or Chinese input methods swallows TAB key,
            WebKit should not invoke the default event handler and move the focus during input composition.

            Fixed the bug by adding a new boolean on Event indicating whether the default event handler
            should be invoked, and restoring the behavior prior to r228260 for these virtual keydown events.

            Test: editing/input/press-tab-during-ime-composition.html

            * dom/Event.h:
            (WebCore::Event::isDefaultEventHandlerIgnored const): Added.
            (WebCore::Event::setIsDefaultEventHandlerIgnored): Added.
            * dom/EventDispatcher.cpp:
            (WebCore::EventDispatcher::dispatchEvent): Don't invoke the default event handler if
            isDefaultEventHandlerIgnored is set.
            * page/EventHandler.cpp:
            (WebCore::EventHandler::internalKeyEvent): Set isDefaultEventHandlerIgnored. This restores WebKit's
            behavior prior to r228260.

2018-08-03  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234534. rdar://problem/42902608

    Control center controls disappear when pausing, locking device.
    https://bugs.webkit.org/show_bug.cgi?id=188282
    <rdar://problem/42497809>
    
    Reviewed by Eric Carlson.
    
    Source/WebCore:
    
    Test: platform/mac/media/audio-session-category-video-paused.html
    
    MediaRemote will set any app whose audio session category changes from MediaPlayback to
    Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of
    events, we never moved from MediaPlayback to Ambient when pausing <video>, even though that
    was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote.
    
    To solve the new issue, make our audio session category policy more explicit: once we are in
    MediaPlayback category, we will remain so as long as the media element in queston stays
    loaded, has played, and is never interrupted by the system.
    
    Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make
    MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new
    m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes
    to Playing, and cleared during an interruption. Check this flag when deciding what audio
    sessino category to set in MediaSessionManagerCocoa.
    
    * WebCore.xcodeproj/project.pbxproj:
    * platform/audio/PlatformMediaSession.cpp:
    (WebCore::PlatformMediaSession::setState):
    * platform/audio/PlatformMediaSession.h:
    (WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const):
    (WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption):
    * platform/audio/PlatformMediaSessionManager.cpp:
    (WebCore::PlatformMediaSessionManager::updateSessionState): Deleted.
    * platform/audio/PlatformMediaSessionManager.h:
    (WebCore::PlatformMediaSessionManager::audioHardwareListener):
    (WebCore::PlatformMediaSessionManager::updateSessionState):
    * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
    (MediaSessionManagerCocoa::updateSessionState):
    (MediaSessionManagerCocoa::beginInterruption):
    (PlatformMediaSessionManager::updateSessionState): Deleted.
    * platform/audio/cocoa/MediaSessionManagerCocoa.h: Added.
    * platform/audio/ios/MediaSessionManagerIOS.h:
    * platform/audio/ios/MediaSessionManagerIOS.mm:
    (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
    * platform/audio/mac/MediaSessionManagerMac.h:
    * platform/audio/mac/MediaSessionManagerMac.mm:
    (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
    
    LayoutTests:
    
    * platform/mac/media/audio-session-category-video-paused-expected.txt: Added.
    * platform/mac/media/audio-session-category-video-paused.html: Added.
    * platform/ios/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234534 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-02  Jer Noble  <jer.noble@apple.com>

            Control center controls disappear when pausing, locking device.
            https://bugs.webkit.org/show_bug.cgi?id=188282
            <rdar://problem/42497809>

            Reviewed by Eric Carlson.

            Test: platform/mac/media/audio-session-category-video-paused.html

            MediaRemote will set any app whose audio session category changes from MediaPlayback to
            Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of
            events, we never moved from MediaPlayback to Ambient when pausing <video>, even though that
            was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote.

            To solve the new issue, make our audio session category policy more explicit: once we are in
            MediaPlayback category, we will remain so as long as the media element in queston stays
            loaded, has played, and is never interrupted by the system.

            Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make
            MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new
            m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes
            to Playing, and cleared during an interruption. Check this flag when deciding what audio
            sessino category to set in MediaSessionManagerCocoa.

            * WebCore.xcodeproj/project.pbxproj:
            * platform/audio/PlatformMediaSession.cpp:
            (WebCore::PlatformMediaSession::setState):
            * platform/audio/PlatformMediaSession.h:
            (WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const):
            (WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption):
            * platform/audio/PlatformMediaSessionManager.cpp:
            (WebCore::PlatformMediaSessionManager::updateSessionState): Deleted.
            * platform/audio/PlatformMediaSessionManager.h:
            (WebCore::PlatformMediaSessionManager::audioHardwareListener):
            (WebCore::PlatformMediaSessionManager::updateSessionState):
            * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
            (MediaSessionManagerCocoa::updateSessionState):
            (MediaSessionManagerCocoa::beginInterruption):
            (PlatformMediaSessionManager::updateSessionState): Deleted.
            * platform/audio/cocoa/MediaSessionManagerCocoa.h: Added.
            * platform/audio/ios/MediaSessionManagerIOS.h:
            * platform/audio/ios/MediaSessionManagerIOS.mm:
            (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
            * platform/audio/mac/MediaSessionManagerMac.h:
            * platform/audio/mac/MediaSessionManagerMac.mm:
            (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):

2018-08-03  Babak Shafiei  <bshafiei@apple.com>

        Revert r234534. rdar://problem/42902608

2018-08-03  Kocsen Chung  <kocsen_chung@apple.com>

        Cherry-pick r234534. rdar://problem/42902608

    Control center controls disappear when pausing, locking device.
    https://bugs.webkit.org/show_bug.cgi?id=188282
    <rdar://problem/42497809>
    
    Reviewed by Eric Carlson.
    
    Source/WebCore:
    
    Test: platform/mac/media/audio-session-category-video-paused.html
    
    MediaRemote will set any app whose audio session category changes from MediaPlayback to
    Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of
    events, we never moved from MediaPlayback to Ambient when pausing <video>, even though that
    was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote.
    
    To solve the new issue, make our audio session category policy more explicit: once we are in
    MediaPlayback category, we will remain so as long as the media element in queston stays
    loaded, has played, and is never interrupted by the system.
    
    Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make
    MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new
    m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes
    to Playing, and cleared during an interruption. Check this flag when deciding what audio
    sessino category to set in MediaSessionManagerCocoa.
    
    * WebCore.xcodeproj/project.pbxproj:
    * platform/audio/PlatformMediaSession.cpp:
    (WebCore::PlatformMediaSession::setState):
    * platform/audio/PlatformMediaSession.h:
    (WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const):
    (WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption):
    * platform/audio/PlatformMediaSessionManager.cpp:
    (WebCore::PlatformMediaSessionManager::updateSessionState): Deleted.
    * platform/audio/PlatformMediaSessionManager.h:
    (WebCore::PlatformMediaSessionManager::audioHardwareListener):
    (WebCore::PlatformMediaSessionManager::updateSessionState):
    * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
    (MediaSessionManagerCocoa::updateSessionState):
    (MediaSessionManagerCocoa::beginInterruption):
    (PlatformMediaSessionManager::updateSessionState): Deleted.
    * platform/audio/cocoa/MediaSessionManagerCocoa.h: Added.
    * platform/audio/ios/MediaSessionManagerIOS.h:
    * platform/audio/ios/MediaSessionManagerIOS.mm:
    (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
    * platform/audio/mac/MediaSessionManagerMac.h:
    * platform/audio/mac/MediaSessionManagerMac.mm:
    (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):
    
    LayoutTests:
    
    * platform/mac/media/audio-session-category-video-paused-expected.txt: Added.
    * platform/mac/media/audio-session-category-video-paused.html: Added.
    * platform/ios/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234534 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-02  Jer Noble  <jer.noble@apple.com>

            Control center controls disappear when pausing, locking device.
            https://bugs.webkit.org/show_bug.cgi?id=188282
            <rdar://problem/42497809>

            Reviewed by Eric Carlson.

            Test: platform/mac/media/audio-session-category-video-paused.html

            MediaRemote will set any app whose audio session category changes from MediaPlayback to
            Ambient as not eligable for being the "now playing" app. Previously, due to the ordering of
            events, we never moved from MediaPlayback to Ambient when pausing <video>, even though that
            was the intention. Now that that bug is fixed, it exposed this new issue with MediaRemote.

            To solve the new issue, make our audio session category policy more explicit: once we are in
            MediaPlayback category, we will remain so as long as the media element in queston stays
            loaded, has played, and is never interrupted by the system.

            Make MediaSessionManagerCocoa a proper subclass of PlatformMediaSessionManager, and make
            MediaSessionManageriOS and -Mac subclasses of the -Cocoa class. Add a new
            m_hasPlayedSinceLastInterruption ivar to PlatformMediaSession, set when the state() changes
            to Playing, and cleared during an interruption. Check this flag when deciding what audio
            sessino category to set in MediaSessionManagerCocoa.

            * WebCore.xcodeproj/project.pbxproj:
            * platform/audio/PlatformMediaSession.cpp:
            (WebCore::PlatformMediaSession::setState):
            * platform/audio/PlatformMediaSession.h:
            (WebCore::PlatformMediaSession::hasPlayedSinceLastInterruption const):
            (WebCore::PlatformMediaSession::clearHasPlayedSinceLastInterruption):
            * platform/audio/PlatformMediaSessionManager.cpp:
            (WebCore::PlatformMediaSessionManager::updateSessionState): Deleted.
            * platform/audio/PlatformMediaSessionManager.h:
            (WebCore::PlatformMediaSessionManager::audioHardwareListener):
            (WebCore::PlatformMediaSessionManager::updateSessionState):
            * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
            (MediaSessionManagerCocoa::updateSessionState):
            (MediaSessionManagerCocoa::beginInterruption):
            (PlatformMediaSessionManager::updateSessionState): Deleted.
            * platform/audio/cocoa/MediaSessionManagerCocoa.h: Added.
            * platform/audio/ios/MediaSessionManagerIOS.h:
            * platform/audio/ios/MediaSessionManagerIOS.mm:
            (WebCore::MediaSessionManageriOS::MediaSessionManageriOS):
            * platform/audio/mac/MediaSessionManagerMac.h:
            * platform/audio/mac/MediaSessionManagerMac.mm:
            (WebCore::MediaSessionManagerMac::MediaSessionManagerMac):

2018-08-02  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234512. rdar://problem/42882298

    Text selection color is hard to see in dark mode web views.
    https://bugs.webkit.org/show_bug.cgi?id=188260
    rdar://problem/42721294
    
    Reviewed by Simon Fraser.
    
    Stop using blendWithWhite() to transform the AppKit selection color in dark mode.
    Using an alpha of 80% gives good contrast, and still works good for selections over images.
    
    * platform/graphics/Color.cpp:
    (WebCore::Color::blendWithWhite const): Mark new colors as semantic if the original is.
    (WebCore::Color::colorWithAlpha const): Ditto.
    * rendering/RenderElement.cpp:
    (WebCore::RenderElement::selectionBackgroundColor const): Use transformSelectionBackgroundColor.
    * rendering/RenderTheme.cpp:
    (WebCore::RenderTheme::activeSelectionBackgroundColor const): Use transformSelectionBackgroundColor.
    (WebCore::RenderTheme::inactiveSelectionBackgroundColor const): Ditto.
    (WebCore::RenderTheme::transformSelectionBackgroundColor const): Added. Just blend with white.
    * rendering/RenderTheme.h:
    * rendering/RenderThemeMac.h:
    * rendering/RenderThemeMac.mm:
    (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Added. Use an alpha with the color
    in dark mode, otherwise fallback to RenderTheme.
    (WebCore::RenderThemeMac::systemColor const): Use activeListBoxSelectionBackgroundColor()
    and activeSelectionBackgroundColor() instead of caching the colors again. Update hardcoded color.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234512 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-02  Timothy Hatcher  <timothy@apple.com>

            Text selection color is hard to see in dark mode web views.
            https://bugs.webkit.org/show_bug.cgi?id=188260
            rdar://problem/42721294

            Reviewed by Simon Fraser.

            Stop using blendWithWhite() to transform the AppKit selection color in dark mode.
            Using an alpha of 80% gives good contrast, and still works good for selections over images.

            * platform/graphics/Color.cpp:
            (WebCore::Color::blendWithWhite const): Mark new colors as semantic if the original is.
            (WebCore::Color::colorWithAlpha const): Ditto.
            * rendering/RenderElement.cpp:
            (WebCore::RenderElement::selectionBackgroundColor const): Use transformSelectionBackgroundColor.
            * rendering/RenderTheme.cpp:
            (WebCore::RenderTheme::activeSelectionBackgroundColor const): Use transformSelectionBackgroundColor.
            (WebCore::RenderTheme::inactiveSelectionBackgroundColor const): Ditto.
            (WebCore::RenderTheme::transformSelectionBackgroundColor const): Added. Just blend with white.
            * rendering/RenderTheme.h:
            * rendering/RenderThemeMac.h:
            * rendering/RenderThemeMac.mm:
            (WebCore::RenderThemeMac::transformSelectionBackgroundColor const): Added. Use an alpha with the color
            in dark mode, otherwise fallback to RenderTheme.
            (WebCore::RenderThemeMac::systemColor const): Use activeListBoxSelectionBackgroundColor()
            and activeSelectionBackgroundColor() instead of caching the colors again. Update hardcoded color.

2018-08-02  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234469. rdar://problem/42882308

    Always use MediaPlayback audio category when playing to AppleTV
    https://bugs.webkit.org/show_bug.cgi?id=188230
    <rdar://problem/42497809>
    
    Reviewed by Jer Noble.
    
    * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
    (PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234469 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-01  Eric Carlson  <eric.carlson@apple.com>

            Always use MediaPlayback audio category when playing to AppleTV
            https://bugs.webkit.org/show_bug.cgi?id=188230
            <rdar://problem/42497809>

            Reviewed by Jer Noble.

            * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
            (PlatformMediaSessionManager::updateSessionState): Check session.isPlayingToWirelessPlaybackTarget().

2018-08-02  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234463. rdar://problem/42882308

    [iOS] Remove the delay before setting audio session category added in r233535
    https://bugs.webkit.org/show_bug.cgi?id=188225
    
    Reviewed by Jer Noble.
    
    * platform/audio/PlatformMediaSessionManager.cpp:
    (WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
    (WebCore::PlatformMediaSessionManager::addSession): Ditto.
    (WebCore::PlatformMediaSessionManager::removeSession): Ditto.
    (WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
    (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
    (WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
    (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
    (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
    * platform/audio/PlatformMediaSessionManager.h:
    
    * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
    (PlatformMediaSessionManager::updateSessionState):
    (PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::updateClipRects):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234463 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-01  Eric Carlson  <eric.carlson@apple.com>

            [iOS] Remove the delay before setting audio session category added in r233535
            https://bugs.webkit.org/show_bug.cgi?id=188225

            Reviewed by Jer Noble.

            * platform/audio/PlatformMediaSessionManager.cpp:
            (WebCore::PlatformMediaSessionManager::beginInterruption): scheduleUpdateSessionState -> updateSessionState.
            (WebCore::PlatformMediaSessionManager::addSession): Ditto.
            (WebCore::PlatformMediaSessionManager::removeSession): Ditto.
            (WebCore::PlatformMediaSessionManager::sessionStateChanged): Ditto.
            (WebCore::PlatformMediaSessionManager::sessionCanProduceAudioChanged): Ditto.
            (WebCore::PlatformMediaSessionManager::updateSessionState): Ditto.
            (WebCore::PlatformMediaSessionManager::audioOutputDeviceChanged): Ditto.
            (WebCore::PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
            * platform/audio/PlatformMediaSessionManager.h:

            * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
            (PlatformMediaSessionManager::updateSessionState):
            (PlatformMediaSessionManager::scheduleUpdateSessionState): Deleted.
            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::updateClipRects):

2018-08-01  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234466. rdar://problem/42843690

    Hardcode some system colors to avoid fingerprinting exposure.
    https://bugs.webkit.org/show_bug.cgi?id=188203
    rdar://problem/42781630
    
    Reviewed by Tim Horton.
    
    Source/WebCore:
    
    Passes existing tests with the hardcoded blue system appearance.
    
    * rendering/RenderTheme.h:
    * rendering/RenderThemeMac.mm:
    (WebCore::RenderThemeMac::systemColor const):
    Adds special handling for some system colors. Fixes -apple-system-selected-text-background
    to match the real selection color by using blendWithWhite().
    
    LayoutTests:
    
    * fast/css/apple-system-control-colors-expected.txt: Updated.
    * fast/css/test-setting-canvas-color.html: Fixed for colors with alpha.
    * platform/mac-highsierra/fast/css/apple-system-control-colors-expected.txt:
    * platform/mac-sierra/fast/css/apple-system-control-colors-expected.txt: Updated.
    * platform/mac/TestExpectations: Removed fast/css/test-setting-canvas-color.html.
    * platform/mac/fast/css/apple-system-control-colors-expected.txt: Updated.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234466 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-08-01  Timothy Hatcher  <timothy@apple.com>

            Hardcode some system colors to avoid fingerprinting exposure.
            https://bugs.webkit.org/show_bug.cgi?id=188203
            rdar://problem/42781630

            Reviewed by Tim Horton.

            Passes existing tests with the hardcoded blue system appearance.

            * rendering/RenderTheme.h:
            * rendering/RenderThemeMac.mm:
            (WebCore::RenderThemeMac::systemColor const):
            Adds special handling for some system colors. Fixes -apple-system-selected-text-background
            to match the real selection color by using blendWithWhite().

2018-07-31  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234447. rdar://problem/42802126

    REGRESSION (r231107): MoviStar+ launches to a blank black screen
    https://bugs.webkit.org/show_bug.cgi?id=188139
    
    Reviewed by Brent Fulgham.
    
    Source/WebCore:
    
    For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
    r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
    targeted fix that will fix the affected app until they update.  
    
    I manually verified this fixes the app.
    
    * loader/DocumentThreadableLoader.cpp:
    (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::applicationSDKVersionOverride):
    (WebCore::setApplicationSDKVersion):
    (WebCore::applicationSDKVersion):
    (WebCore::IOSApplication::isMoviStarPlus):
    
    Source/WebKit:
    
    Add infrastructure to check UIProcess SDK from the WebProcess and NetworkProcess for linked-on-or-after checks.
    
    * NetworkProcess/NetworkProcessCreationParameters.cpp:
    (WebKit::NetworkProcessCreationParameters::encode const):
    (WebKit::NetworkProcessCreationParameters::decode):
    * NetworkProcess/NetworkProcessCreationParameters.h:
    * NetworkProcess/cocoa/NetworkProcessCocoa.mm:
    (WebKit::NetworkProcess::platformInitializeNetworkProcessCocoa):
    * Shared/WebProcessCreationParameters.cpp:
    (WebKit::WebProcessCreationParameters::encode const):
    (WebKit::WebProcessCreationParameters::decode):
    * Shared/WebProcessCreationParameters.h:
    * UIProcess/Cocoa/WebProcessPoolCocoa.mm:
    (WebKit::WebProcessPool::platformInitializeWebProcess):
    (WebKit::WebProcessPool::platformInitializeNetworkProcess):
    * WebProcess/cocoa/WebProcessCocoa.mm:
    (WebKit::WebProcess::platformInitializeWebProcess):
    
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234447 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-31  Alex Christensen  <achristensen@webkit.org>

            REGRESSION (r231107): MoviStar+ launches to a blank black screen
            https://bugs.webkit.org/show_bug.cgi?id=188139

            Reviewed by Brent Fulgham.

            For this app, revert behavior to how it was before r231107 with a linked-on-or-before check.
            r231107 increased our fetch spec conformance, which we intend to keep.  This makes a low-risk
            targeted fix that will fix the affected app until they update.

            I manually verified this fixes the app.

            * loader/DocumentThreadableLoader.cpp:
            (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
            * platform/RuntimeApplicationChecks.h:
            * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
            (WebCore::applicationSDKVersionOverride):
            (WebCore::setApplicationSDKVersion):
            (WebCore::applicationSDKVersion):
            (WebCore::IOSApplication::isMoviStarPlus):

2018-07-31  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234432. rdar://problem/42802123

    Don't call RenderTheme::platformColorsDidChange() during printing.
    https://bugs.webkit.org/show_bug.cgi?id=188181
    rdar://problem/42360070
    
    Reviewed by Tim Horton.
    
    * inspector/agents/InspectorPageAgent.cpp:
    (WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
    instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
    * page/FrameView.cpp:
    (WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234432 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-31  Timothy Hatcher  <timothy@apple.com>

            Don't call RenderTheme::platformColorsDidChange() during printing.
            https://bugs.webkit.org/show_bug.cgi?id=188181
            rdar://problem/42360070

            Reviewed by Tim Horton.

            * inspector/agents/InspectorPageAgent.cpp:
            (WebCore::InspectorPageAgent::setEmulatedMedia): Call m_page.updateStyleAfterChangeInEnvironment()
            instead of going to styleStope() and remove call to RenderTheme::platformColorsDidChange().
            * page/FrameView.cpp:
            (WebCore::FrameView::adjustMediaTypeForPrinting): Remove call RenderTheme::platformColorsDidChange().

2018-07-31  Ryosuke Niwa  <rniwa@webkit.org>

        <rdar://problem/40844658> Crash in WebCore::EventTarget::dispatchEvent

        Reviewed by Chris Dumez.

        Like https://trac.webkit.org/r233496.

        The null pointer crash was caused by some GenericEventQueue dispatching an event in a stopped document,
        which does not have a valid script execution context because some uses of GenericEventQueue in media code
        was not closing the queue upon stopping of all active DOM objects.

        Fixed close GenericEventQueue when the script execution context is destoryed in WebKitMediaKeySession,
        SourceBuffer, SourceBufferList, and TrackListBase.

        No new tests since r233496 relied on a debug assertion for testing but we can't add the same assertion here
        since we'll continue to enqueue events after the document had stopped but not yet destroyed.

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::stop):
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::stop):
        * Modules/mediasource/SourceBufferList.cpp:
        (WebCore::SourceBufferList::contextDestroyed):
        * Modules/mediasource/SourceBufferList.h:
        * html/track/TrackListBase.cpp:
        (TrackListBase::contextDestroyed):
        * html/track/TrackListBase.h:

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Revert r233926. rdar://problem/42354941

2018-07-30  Kocsen Chung  <kocsen_chung@apple.com>

        Revert r233930. rdar://problem/42354941

2018-07-30  Kocsen Chung  <kocsen_chung@apple.com>

        Revert r234044. rdar://problem/42433225

2018-07-30  Kocsen Chung  <kocsen_chung@apple.com>

        Revert r234051. rdar://problem/42451584

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Revert r234078. rdar://problem/42490088

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Revert r234264. rdar://problem/42650373

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Revert r234298. rdar://problem/42354941

2018-07-30  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234339. rdar://problem/42736275

    [iOS] Don't deactivate audio session
    https://bugs.webkit.org/show_bug.cgi?id=188127
    <rdar://problem/42544143>
    
    Reviewed by Jon Lee.
    
    r233435 includes a change that deactivates the shared audio session when there are no more
    active media sessions. This is a good in WK2 because it allows other applications to resume
    playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
    app may also be playing audio.
    
    * platform/audio/PlatformMediaSessionManager.cpp:
    (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234339 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-27  Eric Carlson  <eric.carlson@apple.com>

            [iOS] Don't deactivate audio session
            https://bugs.webkit.org/show_bug.cgi?id=188127
            <rdar://problem/42544143>

            Reviewed by Jon Lee.

            r233435 includes a change that deactivates the shared audio session when there are no more
            active media sessions. This is a good in WK2 because it allows other applications to resume
            playing audio when WebKit stops playing, but it is potentially bad in WK1 where the host
            app may also be playing audio.

            * platform/audio/PlatformMediaSessionManager.cpp:
            (WebCore::PlatformMediaSessionManager::removeSession): Don't deactivate the audio session.

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234345. rdar://problem/42721217

    Reset CompositingPolicyOverride between tests
    https://bugs.webkit.org/show_bug.cgi?id=188138
    
    Reviewed by Zalan Bujtas.
    
    WK1 tests were failing after r234330 because the compositing policy override optional
    was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having
    Internals::resetToConsistentState clear this state.
    
    * testing/Internals.cpp:
    (WebCore::Internals::resetToConsistentState):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234345 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-28  Simon Fraser  <simon.fraser@apple.com>

            Reset CompositingPolicyOverride between tests
            https://bugs.webkit.org/show_bug.cgi?id=188138

            Reviewed by Zalan Bujtas.

            WK1 tests were failing after r234330 because the compositing policy override optional
            was left set on the Page (WK1 has injected bundle SPI to clear it). Fix by having
            Internals::resetToConsistentState clear this state.

            * testing/Internals.cpp:
            (WebCore::Internals::resetToConsistentState):

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234340. rdar://problem/42721208

    Adjust the color matrix for the inverse apple-invert-lightness() transformation
    https://bugs.webkit.org/show_bug.cgi?id=188131
    rdar://problem/42673070
    
    Reviewed by Zalan Bujtas.
    
    Source/WebCore:
    
    Use the correct inverse matrix values.
    
    Test: editing/style/inverse-color-filter.html
    
    * platform/graphics/filters/FilterOperation.cpp:
    (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
    
    LayoutTests:
    
    Rebaseline tests that use the filter inversion. Add a new test that does inversion
    for a whole range of colors, to get good coverage of the inversion matrix.
    
    * editing/style/inverse-color-filter-expected.txt: Added.
    * editing/style/inverse-color-filter.html: Added.
    * editing/style/set-backColor-with-color-filter-expected.txt:
    * editing/style/set-foreColor-with-color-filter-expected.txt:
    * platform/win/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234340 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-27  Simon Fraser  <simon.fraser@apple.com>

            Adjust the color matrix for the inverse apple-invert-lightness() transformation
            https://bugs.webkit.org/show_bug.cgi?id=188131
            rdar://problem/42673070

            Reviewed by Zalan Bujtas.

            Use the correct inverse matrix values.

            Test: editing/style/inverse-color-filter.html

            * platform/graphics/filters/FilterOperation.cpp:
            (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234330. rdar://problem/42721217

    Be more conservative with compositing layer creation when memory is low
    https://bugs.webkit.org/show_bug.cgi?id=187866
    rdar://problem/42366345
    
    Reviewed by Zalan Bujtas.
    
    Source/WebCore:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    Test: compositing/layer-creation/compositing-policy.html
    
    * page/Page.h:
    (WebCore::Page::compositingPolicyOverride const):
    (WebCore::Page::setCompositingPolicyOverride):
    * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
    (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
    * platform/graphics/transforms/Matrix3DTransformOperation.h:
    * platform/graphics/transforms/PerspectiveTransformOperation.h:
    * platform/graphics/transforms/RotateTransformOperation.h:
    * platform/graphics/transforms/ScaleTransformOperation.h:
    * platform/graphics/transforms/TransformOperation.h:
    (WebCore::TransformOperation::isRepresentableIn2D const):
    * platform/graphics/transforms/TransformOperations.h:
    (WebCore::TransformOperations::has3DOperation const):
    (WebCore::TransformOperations::isRepresentableIn2D const):
    * platform/graphics/transforms/TranslateTransformOperation.h:
    * rendering/RenderLayerBacking.cpp:
    (WebCore::RenderLayerBacking::updateGeometry):
    * rendering/RenderLayerCompositor.cpp:
    (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
    (WebCore::RenderLayerCompositor::updateCompositingPolicy):
    (WebCore::RenderLayerCompositor::updateCompositingLayers):
    (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
    (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
    (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
    (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
    (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
    (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
    (WebCore::operator<<):
    * rendering/RenderLayerCompositor.h:
    * testing/Internals.cpp:
    (WebCore::Internals::setCompositingPolicyOverride):
    (WebCore::Internals::compositingPolicyOverride const):
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
    (WKBundlePageSetCompositingPolicyOverride):
    * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
    
    Source/WTF:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    * wtf/MemoryPressureHandler.cpp:
    (WTF::thresholdForPolicy):
    (WTF::MemoryPressureHandler::currentMemoryUsagePolicy):
    * wtf/MemoryPressureHandler.h:
    
    Tools:
    
    When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
    compositing layers. We avoid compositing for these situations:
    1. Layers with 3D transforms which are affine (like translateZ(0)).
    2. Layers with will-change
    3. Layers for canvases (other than WebGL/WebGPU)
    
    We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
    falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
    Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.
    
    Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
    flakily falling into a different mode, and so that we can impose the conservative
    mode for testing.
    
    * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
    (WTR::InjectedBundlePage::prepare):
    
    LayoutTests:
    
    * compositing/layer-creation/compositing-policy-expected.txt: Added.
    * compositing/layer-creation/compositing-policy.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234330 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-27  Simon Fraser  <simon.fraser@apple.com>

            Be more conservative with compositing layer creation when memory is low
            https://bugs.webkit.org/show_bug.cgi?id=187866
            rdar://problem/42366345

            Reviewed by Zalan Bujtas.

            When process physical footprint is above a fraction of the jetsam limit, be more conservative in making
            compositing layers. We avoid compositing for these situations:
            1. Layers with 3D transforms which are affine (like translateZ(0)).
            2. Layers with will-change
            3. Layers for canvases (other than WebGL/WebGPU)

            We reuse some macOS code in MemoryPressureHandler() but choose different thresholds for iOS,
            falling into "conservative mode" at 50% of jetsam limit, and "strict mode" at 65%.
            Compositing chooses to be more conservative in either "conservative" or "strict" memory modes.

            Plumb through a "compositingPolicyOverride" both so that on-device testing isn't
            flakily falling into a different mode, and so that we can impose the conservative
            mode for testing.

            Test: compositing/layer-creation/compositing-policy.html

            * page/Page.h:
            (WebCore::Page::compositingPolicyOverride const):
            (WebCore::Page::setCompositingPolicyOverride):
            * platform/graphics/transforms/Matrix3DTransformOperation.cpp:
            (WebCore::Matrix3DTransformOperation::isRepresentableIn2D const):
            * platform/graphics/transforms/Matrix3DTransformOperation.h:
            * platform/graphics/transforms/PerspectiveTransformOperation.h:
            * platform/graphics/transforms/RotateTransformOperation.h:
            * platform/graphics/transforms/ScaleTransformOperation.h:
            * platform/graphics/transforms/TransformOperation.h:
            (WebCore::TransformOperation::isRepresentableIn2D const):
            * platform/graphics/transforms/TransformOperations.h:
            (WebCore::TransformOperations::has3DOperation const):
            (WebCore::TransformOperations::isRepresentableIn2D const):
            * platform/graphics/transforms/TranslateTransformOperation.h:
            * rendering/RenderLayerBacking.cpp:
            (WebCore::RenderLayerBacking::updateGeometry):
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::RenderLayerCompositor::cacheAcceleratedCompositingFlags):
            (WebCore::RenderLayerCompositor::updateCompositingPolicy):
            (WebCore::RenderLayerCompositor::updateCompositingLayers):
            (WebCore::RenderLayerCompositor::requiresCompositingForTransform const):
            (WebCore::RenderLayerCompositor::requiresCompositingForVideo const):
            (WebCore::RenderLayerCompositor::requiresCompositingForCanvas const):
            (WebCore::RenderLayerCompositor::requiresCompositingForPlugin const):
            (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
            (WebCore::RenderLayerCompositor::needsFixedRootBackgroundLayer const):
            (WebCore::operator<<):
            * rendering/RenderLayerCompositor.h:
            * testing/Internals.cpp:
            (WebCore::Internals::setCompositingPolicyOverride):
            (WebCore::Internals::compositingPolicyOverride const):
            * testing/Internals.h:
            * testing/Internals.idl:

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234329. rdar://problem/42721126

    [WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
    https://bugs.webkit.org/show_bug.cgi?id=188122
    <rdar://problem/42584790>
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
    visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
    Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
    Skip assertion for now on WK1 (see webkit.org/b/188121)
    
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
    
    LayoutTests:
    
    * platform/mac-wk1/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234329 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-27  Zalan Bujtas  <zalan@apple.com>

            [WK1] ASSERTION FAILED: renderer().repaintLayoutRects().m_repaintRect == renderer().clippedOverflowRectForRepaint(renderer().containerForRepaint()) in WebCore::RenderLayer::updateLayerPositionsAfterScroll
            https://bugs.webkit.org/show_bug.cgi?id=188122
            <rdar://problem/42584790>

            Reviewed by Simon Fraser.

            When ScrollView's m_paintsEntireContents flag flips due to layer backing changes, the repaint area transitions from
            visual to layout overflow. When this happens the cached repaint rects become invalid and they need to be recomputed.
            Currently there's no mechanism to trigger repaint cache invalidation from ScrollView.
            Skip assertion for now on WK1 (see webkit.org/b/188121)

            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::updateLayerPositionsAfterScroll):

2018-07-29  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234125. rdar://problem/42721214

    CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
    https://bugs.webkit.org/show_bug.cgi?id=187927
    LayoutTests/imported/w3c:
    
    <rdar://problem/42516426>
    
    Reviewed by Chris Dumez.
    
    * web-platform-tests/IndexedDB/key-conversion-exceptions-expected.txt:
    
    Source/WebCore:
    
    Reviewed by Chris Dumez.
    
    IDBKeyData is valid only when each key of it is valid.
    
    Test: LayoutTests/storage/indexeddb/index-multientry.html
    
    * Modules/indexeddb/IDBKeyData.cpp:
    (WebCore::IDBKeyData::isValid const):
    * Modules/indexeddb/IDBKeyData.h:
    (WebCore::IDBKeyData::isValid const): Deleted.
    
    LayoutTests:
    
    <rdar://problem/42516426>
    
    Reviewed by Chris Dumez.
    
    Add a new test case in existing test file to cover the crash case and update the expecation accordingly.
    
    * storage/indexeddb/index-multientry-expected.txt:
    * storage/indexeddb/index-multientry-private-expected.txt:
    * storage/indexeddb/resources/index-multientry.js:
    (addData):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234125 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-23  Sihui Liu  <sihui_liu@apple.com>

            CrashTracer: com.apple.WebKit.Storage at WebCore: WebCore::encodeKey
            https://bugs.webkit.org/show_bug.cgi?id=187927

            Reviewed by Chris Dumez.

            IDBKeyData is valid only when each key of it is valid.

            Test: LayoutTests/storage/indexeddb/index-multientry.html

            * Modules/indexeddb/IDBKeyData.cpp:
            (WebCore::IDBKeyData::isValid const):
            * Modules/indexeddb/IDBKeyData.h:
            (WebCore::IDBKeyData::isValid const): Deleted.

2018-07-27  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234318. rdar://problem/42467016

    [WIN] Crash when trying to access store pages
    https://bugs.webkit.org/show_bug.cgi?id=188032
    <rdar://problem/42467016>
    
    Reviewed by Brent Fulgham.
    
    The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
    an additional offset to the position to paint each glyph. It also has two add() functions, one
    which appends to this vector, and one which doesn't. The one that doesn't append to the vector
    should never be called on Windows (because Windows requires this vector to be full).
    
    There were two situations where it was getting called:
    1) Inside ComplexTextController
    2) Inside display list playback
    
    Windows shouldn't be using ComplexTextController because the Windows implementation of this
    class isn't ready yet; instead it should be using UniscribeController. The display list playback
    code should be used on Windows.
    
    Rather than fix the function to append an offset, we actually don't need the m_offsets vector
    in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
    bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
    to distinguish between layout advances and paint advances, so we can bake them together and
    just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
    performance and memory improvement.
    
    * platform/graphics/ComplexTextController.cpp:
    (WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
    isn't used on Windows.
    * platform/graphics/FontCascade.cpp:
    (WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
    UniscribeController on Windows.
    (WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
    no reason to consult it when drawing.
    * platform/graphics/GlyphBuffer.h: Remove m_offsets
    (WebCore::GlyphBuffer::clear):
    (WebCore::GlyphBuffer::advanceAt const):
    (WebCore::GlyphBuffer::add):
    (WebCore::GlyphBuffer::expandLastAdvance):
    (WebCore::GlyphBuffer::shrink):
    (WebCore::GlyphBuffer::swap):
    (WebCore::GlyphBuffer::offsetAt const): Deleted.
    * platform/graphics/win/FontCGWin.cpp:
    (WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
    to consult it when drawing.
    * platform/graphics/win/FontCascadeDirect2D.cpp:
    (WebCore::FontCascade::drawGlyphs): Ditto.
    * platform/graphics/win/UniscribeController.cpp:
    (WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234318 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-27  Myles C. Maxfield  <mmaxfield@apple.com>

            [WIN] Crash when trying to access store pages
            https://bugs.webkit.org/show_bug.cgi?id=188032
            <rdar://problem/42467016>

            Reviewed by Brent Fulgham.

            The Windows implementation of GlyphBuffer has an additional member, m_offsets, which represents
            an additional offset to the position to paint each glyph. It also has two add() functions, one
            which appends to this vector, and one which doesn't. The one that doesn't append to the vector
            should never be called on Windows (because Windows requires this vector to be full).

            There were two situations where it was getting called:
            1) Inside ComplexTextController
            2) Inside display list playback

            Windows shouldn't be using ComplexTextController because the Windows implementation of this
            class isn't ready yet; instead it should be using UniscribeController. The display list playback
            code should be used on Windows.

            Rather than fix the function to append an offset, we actually don't need the m_offsets vector
            in the first place. Instead, we can do it the same way that the Cocoa ports do it, which is to
            bake the offsets into the glyph advances. This is possible because the GlyphBuffer doesn't need
            to distinguish between layout advances and paint advances, so we can bake them together and
            just put paint advances in the GlyphBuffer. This should be a small (probably within-the-noise)
            performance and memory improvement.

            * platform/graphics/ComplexTextController.cpp:
            (WebCore::ComplexTextController::ComplexTextController): Make sure that ComplexTextController
            isn't used on Windows.
            * platform/graphics/FontCascade.cpp:
            (WebCore::FontCascade::widthOfTextRange const): Switch from ComplexTextController to
            UniscribeController on Windows.
            (WebCore::FontCascade::drawGlyphBuffer const): After deleting the m_offsets vector, there's
            no reason to consult it when drawing.
            * platform/graphics/GlyphBuffer.h: Remove m_offsets
            (WebCore::GlyphBuffer::clear):
            (WebCore::GlyphBuffer::advanceAt const):
            (WebCore::GlyphBuffer::add):
            (WebCore::GlyphBuffer::expandLastAdvance):
            (WebCore::GlyphBuffer::shrink):
            (WebCore::GlyphBuffer::swap):
            (WebCore::GlyphBuffer::offsetAt const): Deleted.
            * platform/graphics/win/FontCGWin.cpp:
            (WebCore::FontCascade::drawGlyphs): After deleting the m_offsets vector, there's no reason
            to consult it when drawing.
            * platform/graphics/win/FontCascadeDirect2D.cpp:
            (WebCore::FontCascade::drawGlyphs): Ditto.
            * platform/graphics/win/UniscribeController.cpp:
            (WebCore::UniscribeController::shapeAndPlaceItem): Bake in the offsets into the glyph advances.

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234291. rdar://problem/42650439

    [Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
    https://bugs.webkit.org/show_bug.cgi?id=188087
    <rdar://problem/42632124>
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    Sibling composited layers prevent battery lifetime optimizations when in fullscreen.
    
    Test: compositing/no-compositing-when-fulll-screen-is-present.html
    
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::isDescendantOf const):
    * rendering/RenderLayer.h:
    * rendering/RenderLayerCompositor.cpp:
    (WebCore::isDescendantOfFullScreenLayer):
    (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
    (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):
    
    LayoutTests:
    
    * compositing/no-compositing-when-fulll-screen-is-present-expected.txt: Added.
    * compositing/no-compositing-when-fulll-screen-is-present.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234291 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-26  Zalan Bujtas  <zalan@apple.com>

            [Fullscreen] Do not create composited layers for renderers unless they are part of the fullscreen subtree.
            https://bugs.webkit.org/show_bug.cgi?id=188087
            <rdar://problem/42632124>

            Reviewed by Simon Fraser.

            Sibling composited layers prevent battery lifetime optimizations when in fullscreen.

            Test: compositing/no-compositing-when-fulll-screen-is-present.html

            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::isDescendantOf const):
            * rendering/RenderLayer.h:
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::isDescendantOfFullScreenLayer):
            (WebCore::RenderLayerCompositor::requiresCompositingForWillChange const):
            (WebCore::RenderLayerCompositor::requiresCompositingForPosition const):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234275. rdar://problem/42650440

    AX: nothing returned for various previous text marker APIs from one div/p node to another
    https://bugs.webkit.org/show_bug.cgi?id=188071
    
    Reviewed by Chris Fleizach.
    
    Source/WebCore:
    
    TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
    corresponding text node in the DOM tree, so we are not able to handle that for
    text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to
    the previous child text node.
    
    Test: accessibility/mac/text-marker-p-tags.html
    
    * accessibility/AXObjectCache.cpp:
    (WebCore::AXObjectCache::traverseToOffsetInRange):
    
    LayoutTests:
    
    * accessibility/mac/text-marker-p-tags-expected.txt: Added.
    * accessibility/mac/text-marker-p-tags.html: Added.
    * accessibility/mac/text-marker-string-for-document-range-expected.txt:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234275 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-26  Nan Wang  <n_wang@apple.com>

            AX: nothing returned for various previous text marker APIs from one div/p node to another
            https://bugs.webkit.org/show_bug.cgi?id=188071

            Reviewed by Chris Fleizach.

            TextIterator is emitting an extra '\n' at the end of the <p> node and there's no
            corresponding text node in the DOM tree, so we are not able to handle that for
            text markers. Fixed it by ignoring the extra '\n' and anchor the text marker to
            the previous child text node.

            Test: accessibility/mac/text-marker-p-tags.html

            * accessibility/AXObjectCache.cpp:
            (WebCore::AXObjectCache::traverseToOffsetInRange):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234264. rdar://problem/42650373

    Switching tabs should not close PiP window
    https://bugs.webkit.org/show_bug.cgi?id=188054
    <rdar://problem/41212379>
    
    Reviewed by Jon Lee.
    
    No new tests, fixes an existing test.
    
    Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
    In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
    selectors to close the PiP window. requestHideAndExitFullscreen is also called from
    WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
    tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
    a new method that is only used by the delegate to exit PiP.
    
    * platform/mac/VideoFullscreenInterfaceMac.h:
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
    do-nothing method.
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
    (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234264 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-26  Eric Carlson  <eric.carlson@apple.com>

            Switching tabs should not close PiP window
            https://bugs.webkit.org/show_bug.cgi?id=188054
            <rdar://problem/41212379>

            Reviewed by Jon Lee.

            No new tests, fixes an existing test.

            Prior to r233926, calling VideoFullscreenInterfaceMac::requestHideAndExitFullscreen was a noop.
            In r233926 it was updated to close the PiP window and was called from the PIPViewControllerDelegate
            selectors to close the PiP window. requestHideAndExitFullscreen is also called from
            WebPageProxy::viewDidLeaveWindow when the web view is removed from it window, so switching
            tabs also closed the PiP window. Revert the changes to requestHideAndExitFullscreen, and add
            a new method that is only used by the delegate to exit PiP.

            * platform/mac/VideoFullscreenInterfaceMac.h:
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Make this an empty,
            do-nothing method.
            * platform/mac/VideoFullscreenInterfaceMac.mm:
            (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]): Call requestHideAndExitPiP.
            (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]): Ditto.
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitPiP): Renamed from requestHideAndExitFullscreen.
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234078. rdar://problem/42490088

    REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
    https://bugs.webkit.org/show_bug.cgi?id=187873
    
    Reviewed by Jon Lee.
    
    When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
    not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the
    necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
    action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).
    
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234078 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Jer Noble  <jer.noble@apple.com>

            REGRESSION (r233974): Cannot close pip'd video; pops back into PiP.
            https://bugs.webkit.org/show_bug.cgi?id=187873

            Reviewed by Jon Lee.

            When the PIP machinery on Mac wants to close the PIP window (due to the close button being clicked), it does
            not consult our -shouldClosePiP handler; it just tells us that we're going to close. So we never setup the
            necessary state on the WebProcess side and still think that our "targetIsFullscreen". When we get the "stop"
            action, just request exit fullscreen, but set up the _pipState to think we're already exiting (because we are).

            * platform/mac/VideoFullscreenInterfaceMac.mm:
            (-[WebVideoFullscreenInterfaceMacObjC pipActionStop:]):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234051. rdar://problem/42451584

    First Auto-PiP from Fullscreen too small & animation blocks
    https://bugs.webkit.org/show_bug.cgi?id=187745
    <rdar://problem/42316583>
    
    Reviewed by Jon Lee.
    
    1) When Auto-PiPing, we don't have the luxury of setting up the fullscreen state
    ahead of time; we get notified that PiP has already started. The area of the code
    which does this just-in-time setup needs to set the video layer's frame so that the
    transform within the PiP window is correct.
    
    2) We generate a placeholder image when going into fullscreen, but we need to do
    so synchronously. Create the AVPlayerItemVideoOutput up front at AVPlayerItem creation
    time wherever AVPIVO is available.
    
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (VideoFullscreenInterfaceAVKit::doSetup):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234051 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Jer Noble  <jer.noble@apple.com>

            First Auto-PiP from Fullscreen too small & animation blocks
            https://bugs.webkit.org/show_bug.cgi?id=187745
            <rdar://problem/42316583>

            Reviewed by Jon Lee.

            1) When Auto-PiPing, we don't have the luxury of setting up the fullscreen state
            ahead of time; we get notified that PiP has already started. The area of the code
            which does this just-in-time setup needs to set the video layer's frame so that the
            transform within the PiP window is correct.

            2) We generate a placeholder image when going into fullscreen, but we need to do
            so synchronously. Create the AVPlayerItemVideoOutput up front at AVPlayerItem creation
            time wherever AVPIVO is available.

            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
            (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayerItem):
            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (VideoFullscreenInterfaceAVKit::doSetup):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234044. rdar://problem/42433225

    REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
    https://bugs.webkit.org/show_bug.cgi?id=187814
    <rdar://problem/42391869>
    
    Reviewed by Eric Carlson.
    
    After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
    VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
    assertion no longer holds true.
    
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (-[WebAVPlayerLayer layoutSublayers]):
    (-[WebAVPlayerLayer resolveBounds]):
    (-[WebAVPlayerLayer setVideoGravity:]):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Jer Noble  <jer.noble@apple.com>

            REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
            https://bugs.webkit.org/show_bug.cgi?id=187814
            <rdar://problem/42391869>

            Reviewed by Eric Carlson.

            After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
            VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
            assertion no longer holds true.

            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (-[WebAVPlayerLayer layoutSublayers]):
            (-[WebAVPlayerLayer resolveBounds]):
            (-[WebAVPlayerLayer setVideoGravity:]):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233936. rdar://problem/42354941

    Unreviewed API Test fix; restored a line inadventantly removed in r233926.
    
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233936 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Unreviewed API Test fix; restored a line inadventantly removed in r233926.

            * platform/mac/VideoFullscreenInterfaceMac.mm:
            (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233930. rdar://problem/42354941

    Unreviewed build fix after r233926; BOOL !== bool.
    
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233930 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Unreviewed build fix after r233926; BOOL !== bool.

            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233926. rdar://problem/42354941

    PiP from Element Fullscreen should match AVKit's behavior
    https://bugs.webkit.org/show_bug.cgi?id=187623
    Source/WebCore:
    
    Reviewed by Jon Lee.
    
    PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    
    Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
    
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
    
    Add VideoFullscreenModelClient virutal methods for PiP change notifications:
    
    * platform/cocoa/VideoFullscreenModel.h:
    (WebCore::VideoFullscreenModelClient::hasVideoChanged):
    (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
    (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
    * platform/cocoa/VideoFullscreenModelVideoElement.h:
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::willExitPictureInPicture):
    (VideoFullscreenModelVideoElement::didExitPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
    * platform/ios/VideoFullscreenInterfaceAVKit.h:
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (-[WebAVPlayerLayer layoutSublayers]):
    (-[WebAVPlayerLayer resolveBounds]):
    (-[WebAVPlayerLayer setVideoGravity:]):
    (VideoFullscreenInterfaceAVKit::setupFullscreen):
    (VideoFullscreenInterfaceAVKit::presentingViewController):
    (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
    (VideoFullscreenInterfaceAVKit::doSetup):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::willEnterPictureInPicture):
    (VideoFullscreenControllerContext::didEnterPictureInPicture):
    (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
    (VideoFullscreenControllerContext::willExitPictureInPicture):
    (VideoFullscreenControllerContext::didExitPictureInPicture):
    (VideoFullscreenControllerContext::failedToExitPictureInPicture):
    * platform/mac/VideoFullscreenInterfaceMac.h:
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
    (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
    
    Source/WebCore/PAL:
    
    Reviewed by Jon Lee.
    
    * pal/spi/mac/PIPSPI.h:
    
    Source/WebKit:
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
    (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
    (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
    (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
    (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenViewController initWithWebView:]):
    (-[WKFullScreenViewController dealloc]):
    (-[WKFullScreenViewController videoControlsManagerDidChange]):
    (-[WKFullScreenViewController ensurePiPAnimator]):
    (-[WKFullScreenViewController willEnterPictureInPicture]):
    (-[WKFullScreenViewController didEnterPictureInPicture]):
    (-[WKFullScreenViewController failedToEnterPictureInPicture]):
    (-[WKFullScreenViewController loadView]):
    (-[WKFullScreenViewController viewWillAppear:]):
    * UIProcess/Cocoa/WebViewImpl.mm:
    (WebKit::WebViewImpl::videoControlsManagerDidChange):
    * UIProcess/mac/WKFullScreenWindowController.h:
    * UIProcess/mac/WKFullScreenWindowController.mm:
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenWindowController initWithWindow:webView:page:]):
    (-[WKFullScreenWindowController dealloc]):
    (-[WKFullScreenWindowController videoControlsManagerDidChange]):
    (-[WKFullScreenWindowController willEnterPictureInPicture]):
    
    Tools:
    
    <rdar://problem/41212379>
    
    Reviewed by Jon Lee.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm: Added.
    (-[ExitFullscreenOnEnterPiPUIDelegate _webView:hasVideoInPictureInPictureDidChange:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidEnterFullscreen:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidExitFullscreen:]):
    (TestWebKitAPI::TEST):
    
    LayoutTests:
    
    Reviewed by Jon Lee.
    
    * TestExpectations:
    * media/fullscreen-video-going-into-pip-expected.txt: Removed.
    * media/fullscreen-video-going-into-pip.html: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip-expected.txt: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip.html: Removed.
    * platform/mac-wk2/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            PiP from Element Fullscreen should match AVKit's behavior
            https://bugs.webkit.org/show_bug.cgi?id=187623

            Reviewed by Jon Lee.

            PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:

            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::enterFullscreen):

            Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():

            * platform/cocoa/VideoFullscreenModelVideoElement.mm:
            (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):

            Add VideoFullscreenModelClient virutal methods for PiP change notifications:

            * platform/cocoa/VideoFullscreenModel.h:
            (WebCore::VideoFullscreenModelClient::hasVideoChanged):
            (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
            (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
            (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
            (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
            (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
            (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
            (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
            * platform/cocoa/VideoFullscreenModelVideoElement.h:
            * platform/cocoa/VideoFullscreenModelVideoElement.mm:
            (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
            (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
            (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
            (VideoFullscreenModelVideoElement::willExitPictureInPicture):
            (VideoFullscreenModelVideoElement::didExitPictureInPicture):
            (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
            * platform/ios/VideoFullscreenInterfaceAVKit.h:
            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (-[WebAVPlayerLayer layoutSublayers]):
            (-[WebAVPlayerLayer resolveBounds]):
            (-[WebAVPlayerLayer setVideoGravity:]):
            (VideoFullscreenInterfaceAVKit::setupFullscreen):
            (VideoFullscreenInterfaceAVKit::presentingViewController):
            (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
            (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
            (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
            (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
            (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
            (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
            (VideoFullscreenInterfaceAVKit::doSetup):
            * platform/ios/WebVideoFullscreenControllerAVKit.mm:
            (VideoFullscreenControllerContext::willEnterPictureInPicture):
            (VideoFullscreenControllerContext::didEnterPictureInPicture):
            (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
            (VideoFullscreenControllerContext::willExitPictureInPicture):
            (VideoFullscreenControllerContext::didExitPictureInPicture):
            (VideoFullscreenControllerContext::failedToExitPictureInPicture):
            * platform/mac/VideoFullscreenInterfaceMac.h:
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
            * platform/mac/VideoFullscreenInterfaceMac.mm:
            (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
            (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
            (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
            (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
            (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
            (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
            (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
            (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):

2018-07-26  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234272. rdar://problem/42645434

    Unreviewed, rolling out r234181 and r234189.
    https://bugs.webkit.org/show_bug.cgi?id=188075
    
    These are not needed right now (Requested by thorton on
    #webkit).
    
    Reverted changesets:
    
    "Enable Web Content Filtering on watchOS"
    https://bugs.webkit.org/show_bug.cgi?id=187979
    https://trac.webkit.org/changeset/234181
    
    "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
    https://bugs.webkit.org/show_bug.cgi?id=187985
    https://trac.webkit.org/changeset/234189
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234272 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-26  Commit Queue  <commit-queue@webkit.org>

            Unreviewed, rolling out r234181 and r234189.
            https://bugs.webkit.org/show_bug.cgi?id=188075

            These are not needed right now (Requested by thorton on
            #webkit).

            Reverted changesets:

            "Enable Web Content Filtering on watchOS"
            https://bugs.webkit.org/show_bug.cgi?id=187979
            https://trac.webkit.org/changeset/234181

            "HAVE(PARENTAL_CONTROLS) should be true on watchOS"
            https://bugs.webkit.org/show_bug.cgi?id=187985
            https://trac.webkit.org/changeset/234189

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234222. rdar://problem/42612113

    Build fix after r234215. Unreviewed.
    
    * rendering/RenderTheme.cpp:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234222 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-25  Zalan Bujtas  <zalan@apple.com>

            Build fix after r234215. Unreviewed.

            * rendering/RenderTheme.cpp:

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234215. rdar://problem/42604541

    REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
    https://bugs.webkit.org/show_bug.cgi?id=188018
    <rdar://problem/42517520>
    
    Reviewed by Dean Jackson.
    
    Source/WebCore:
    
    Manual rollout of r227577.
    
    Test: fast/overflow/line-clamp-with-text-shadow.html
    
    * Sources.txt:
    * WebCore.xcodeproj/project.pbxproj:
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
    * css/CSSProperties.json:
    * css/StyleBuilderCustom.h:
    (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
    * css/parser/CSSParserContext.cpp:
    (WebCore::CSSParserContext::CSSParserContext):
    * css/parser/CSSParserContext.h:
    (WebCore::CSSParserContextHash::hash):
    * css/parser/CSSPropertyParser.cpp:
    (WebCore::CSSPropertyParser::parseSingleValue):
    (WebCore::consumeLinesClamp): Deleted.
    * page/Settings.yaml:
    * rendering/RenderBlockFlow.cpp:
    (WebCore::RenderBlockFlow::willCreateColumns const):
    (WebCore::getHeightForLineCount):
    (WebCore::RenderBlockFlow::heightForLineCount):
    (WebCore::RenderBlockFlow::layoutExcludedChildren):
    (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
    (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
    * rendering/RenderBlockFlow.h:
    * rendering/RenderDeprecatedFlexibleBox.cpp:
    (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
    * rendering/RenderFragmentContainer.cpp:
    (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
    * rendering/RenderFragmentContainer.h:
    * rendering/RenderFragmentedFlow.cpp:
    (WebCore::RenderFragmentedFlow::validateFragments):
    (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
    (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
    * rendering/RenderFragmentedFlow.h:
    * rendering/RenderLinesClampFlow.cpp: Removed.
    * rendering/RenderLinesClampFlow.h: Removed.
    * rendering/RenderLinesClampSet.cpp: Removed.
    * rendering/RenderLinesClampSet.h: Removed.
    * rendering/RenderMultiColumnFlow.cpp:
    (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
    (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
    * rendering/RenderMultiColumnFlow.h:
    (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
    (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
    (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
    (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
    (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
    (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
    (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
    (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
    (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
    (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
    (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
    (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
    (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
    (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
    (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
    (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
    (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
    (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
    * rendering/RenderMultiColumnSet.cpp:
    (WebCore::RenderMultiColumnSet::collectLayerFragments):
    (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
    * rendering/RenderMultiColumnSet.h:
    (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
    (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
    (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
    (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
    (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
    (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
    (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
    (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
    (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
    (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
    (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
    (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
    (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
    * rendering/RenderObject.h:
    (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
    (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
    * rendering/style/LineClampValue.h:
    (WebCore::LinesClampValue::LinesClampValue): Deleted.
    (WebCore::LinesClampValue::isNone const): Deleted.
    (WebCore::LinesClampValue::operator== const): Deleted.
    (WebCore::LinesClampValue::operator!= const): Deleted.
    (WebCore::LinesClampValue::start const): Deleted.
    (WebCore::LinesClampValue::end const): Deleted.
    (WebCore::LinesClampValue::center const): Deleted.
    * rendering/style/RenderStyle.h:
    (WebCore::RenderStyle::lineClamp const):
    (WebCore::RenderStyle::setLineClamp):
    (WebCore::RenderStyle::initialLineClamp):
    (WebCore::RenderStyle::hasInlineColumnAxis const):
    (WebCore::RenderStyle::linesClamp const): Deleted.
    (WebCore::RenderStyle::hasLinesClamp const): Deleted.
    (WebCore::RenderStyle::setLinesClamp): Deleted.
    (WebCore::RenderStyle::initialLinesClamp): Deleted.
    * rendering/style/StyleRareNonInheritedData.cpp:
    (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
    (WebCore::StyleRareNonInheritedData::operator== const):
    * rendering/style/StyleRareNonInheritedData.h:
    * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
    (WebCore::isValidColumnSpanner):
    (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
    (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):
    
    Source/WebKit:
    
    * WebProcess/WebPage/WebPage.cpp:
    (WebKit::m_credentialsMessenger):
    
    LayoutTests:
    
    * fast/block/lines-clamp-advanced-expected.html: Removed.
    * fast/block/lines-clamp-advanced-rl-expected.html: Removed.
    * fast/block/lines-clamp-advanced-rl.html: Removed.
    * fast/block/lines-clamp-advanced.html: Removed.
    * fast/block/lines-clamp-basic-expected.html: Removed.
    * fast/block/lines-clamp-basic-rl-expected.html: Removed.
    * fast/block/lines-clamp-basic-rl.html: Removed.
    * fast/block/lines-clamp-basic.html: Removed.
    * fast/css/lines-clamp-parsing-expected.txt: Removed.
    * fast/css/lines-clamp-parsing.html: Removed.
    * fast/overflow/line-clamp-with-text-shadow-expected.html: Added.
    * fast/overflow/line-clamp-with-text-shadow.html: Added.
    * platform/ios-simulator-wk2/fast/overflow/line-clamp-expected.txt: Removed.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234215 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-25  Zalan Bujtas  <zalan@apple.com>

            REGRESSION(r227577) Text on TV & Movies page doesn't wrap properly in iTunes
            https://bugs.webkit.org/show_bug.cgi?id=188018
            <rdar://problem/42517520>

            Reviewed by Dean Jackson.

            Manual rollout of r227577.

            Test: fast/overflow/line-clamp-with-text-shadow.html

            * Sources.txt:
            * WebCore.xcodeproj/project.pbxproj:
            * css/CSSComputedStyleDeclaration.cpp:
            (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
            * css/CSSProperties.json:
            * css/StyleBuilderCustom.h:
            (WebCore::StyleBuilderCustom::applyValueWebkitLinesClamp): Deleted.
            * css/parser/CSSParserContext.cpp:
            (WebCore::CSSParserContext::CSSParserContext):
            * css/parser/CSSParserContext.h:
            (WebCore::CSSParserContextHash::hash):
            * css/parser/CSSPropertyParser.cpp:
            (WebCore::CSSPropertyParser::parseSingleValue):
            (WebCore::consumeLinesClamp): Deleted.
            * page/Settings.yaml:
            * rendering/RenderBlockFlow.cpp:
            (WebCore::RenderBlockFlow::willCreateColumns const):
            (WebCore::getHeightForLineCount):
            (WebCore::RenderBlockFlow::heightForLineCount):
            (WebCore::RenderBlockFlow::layoutExcludedChildren):
            (WebCore::RenderBlockFlow::logicalHeightForLineCount): Deleted.
            (WebCore::RenderBlockFlow::logicalHeightExcludingLineCount): Deleted.
            * rendering/RenderBlockFlow.h:
            * rendering/RenderDeprecatedFlexibleBox.cpp:
            (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
            * rendering/RenderFragmentContainer.cpp:
            (WebCore::RenderFragmentContainer::pageLogicalHeightForOffset const): Deleted.
            * rendering/RenderFragmentContainer.h:
            * rendering/RenderFragmentedFlow.cpp:
            (WebCore::RenderFragmentedFlow::validateFragments):
            (WebCore::RenderFragmentedFlow::pageLogicalHeightForOffset const):
            (WebCore::RenderFragmentedFlow::pageRemainingLogicalHeightForOffset const):
            * rendering/RenderFragmentedFlow.h:
            * rendering/RenderLinesClampFlow.cpp: Removed.
            * rendering/RenderLinesClampFlow.h: Removed.
            * rendering/RenderLinesClampSet.cpp: Removed.
            * rendering/RenderLinesClampSet.h: Removed.
            * rendering/RenderMultiColumnFlow.cpp:
            (WebCore::RenderMultiColumnFlow::isColumnSpanningDescendant const): Deleted.
            (WebCore::RenderMultiColumnFlow::createMultiColumnSet): Deleted.
            * rendering/RenderMultiColumnFlow.h:
            (WebCore::RenderMultiColumnFlow::multiColumnBlockFlow const): Deleted.
            (WebCore::RenderMultiColumnFlow::hasColumnSpanner const): Deleted.
            (WebCore::RenderMultiColumnFlow::findColumnSpannerPlaceholder const): Deleted.
            (WebCore::RenderMultiColumnFlow::columnCount const): Deleted.
            (WebCore::RenderMultiColumnFlow::columnWidth const): Deleted.
            (WebCore::RenderMultiColumnFlow::columnHeightAvailable const): Deleted.
            (WebCore::RenderMultiColumnFlow::setColumnHeightAvailable): Deleted.
            (WebCore::RenderMultiColumnFlow::inBalancingPass const): Deleted.
            (WebCore::RenderMultiColumnFlow::setInBalancingPass): Deleted.
            (WebCore::RenderMultiColumnFlow::needsHeightsRecalculation const): Deleted.
            (WebCore::RenderMultiColumnFlow::setNeedsHeightsRecalculation): Deleted.
            (WebCore::RenderMultiColumnFlow::shouldRelayoutForPagination const): Deleted.
            (WebCore::RenderMultiColumnFlow::setColumnCountAndWidth): Deleted.
            (WebCore::RenderMultiColumnFlow::progressionIsInline const): Deleted.
            (WebCore::RenderMultiColumnFlow::setProgressionIsInline): Deleted.
            (WebCore::RenderMultiColumnFlow::progressionIsReversed const): Deleted.
            (WebCore::RenderMultiColumnFlow::setProgressionIsReversed): Deleted.
            (WebCore::RenderMultiColumnFlow::spannerMap): Deleted.
            * rendering/RenderMultiColumnSet.cpp:
            (WebCore::RenderMultiColumnSet::collectLayerFragments):
            (WebCore::RenderMultiColumnSet::columnTranslationForOffset const):
            * rendering/RenderMultiColumnSet.h:
            (WebCore::RenderMultiColumnSet::multiColumnBlockFlow const): Deleted.
            (WebCore::RenderMultiColumnSet::multiColumnFlow const): Deleted.
            (WebCore::RenderMultiColumnSet::logicalTopInFragmentedFlow const): Deleted.
            (WebCore::RenderMultiColumnSet::logicalBottomInFragmentedFlow const): Deleted.
            (WebCore::RenderMultiColumnSet::logicalHeightInFragmentedFlow const): Deleted.
            (WebCore::RenderMultiColumnSet::computedColumnCount const): Deleted.
            (WebCore::RenderMultiColumnSet::computedColumnWidth const): Deleted.
            (WebCore::RenderMultiColumnSet::computedColumnHeight const): Deleted.
            (WebCore::RenderMultiColumnSet::columnHeightComputed const): Deleted.
            (WebCore::RenderMultiColumnSet::setComputedColumnWidthAndCount): Deleted.
            (WebCore::RenderMultiColumnSet::updateMinimumColumnHeight): Deleted.
            (WebCore::RenderMultiColumnSet::minimumColumnHeight const): Deleted.
            (WebCore::RenderMultiColumnSet::forcedBreaksCount const): Deleted.
            (WebCore::RenderMultiColumnSet::hasBeenFlowed const): Deleted.
            (WebCore::RenderMultiColumnSet::skipLayerFragmentCollectionForColumn const): Deleted.
            (WebCore::RenderMultiColumnSet::customBlockProgressionAdjustmentForColumn const): Deleted.
            (WebCore::RenderMultiColumnSet::ContentRun::ContentRun): Deleted.
            (WebCore::RenderMultiColumnSet::ContentRun::assumedImplicitBreaks const): Deleted.
            (WebCore::RenderMultiColumnSet::ContentRun::assumeAnotherImplicitBreak): Deleted.
            (WebCore::RenderMultiColumnSet::ContentRun::breakOffset const): Deleted.
            (WebCore::RenderMultiColumnSet::ContentRun::columnLogicalHeight const): Deleted.
            * rendering/RenderObject.h:
            (WebCore::RenderObject::isRenderLinesClampFlow const): Deleted.
            (WebCore::RenderObject::isRenderLinesClampSet const): Deleted.
            * rendering/style/LineClampValue.h:
            (WebCore::LinesClampValue::LinesClampValue): Deleted.
            (WebCore::LinesClampValue::isNone const): Deleted.
            (WebCore::LinesClampValue::operator== const): Deleted.
            (WebCore::LinesClampValue::operator!= const): Deleted.
            (WebCore::LinesClampValue::start const): Deleted.
            (WebCore::LinesClampValue::end const): Deleted.
            (WebCore::LinesClampValue::center const): Deleted.
            * rendering/style/RenderStyle.h:
            (WebCore::RenderStyle::lineClamp const):
            (WebCore::RenderStyle::setLineClamp):
            (WebCore::RenderStyle::initialLineClamp):
            (WebCore::RenderStyle::hasInlineColumnAxis const):
            (WebCore::RenderStyle::linesClamp const): Deleted.
            (WebCore::RenderStyle::hasLinesClamp const): Deleted.
            (WebCore::RenderStyle::setLinesClamp): Deleted.
            (WebCore::RenderStyle::initialLinesClamp): Deleted.
            * rendering/style/StyleRareNonInheritedData.cpp:
            (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
            (WebCore::StyleRareNonInheritedData::operator== const):
            * rendering/style/StyleRareNonInheritedData.h:
            * rendering/updating/RenderTreeBuilderMultiColumn.cpp:
            (WebCore::isValidColumnSpanner):
            (WebCore::RenderTreeBuilder::MultiColumn::createFragmentedFlow):
            (WebCore::RenderTreeBuilder::MultiColumn::processPossibleSpannerDescendant):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234181. rdar://problem/42604524

    Enable Web Content Filtering on watchOS
    https://bugs.webkit.org/show_bug.cgi?id=187979
    <rdar://problem/42559346>
    
    Reviewed by Wenson Hsieh.
    
    Source/JavaScriptCore:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebCore/PAL:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKit:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Source/WebKitLegacy/mac:
    
    * Configurations/FeatureDefines.xcconfig:
    
    Tools:
    
    * TestWebKitAPI/Configurations/FeatureDefines.xcconfig:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234181 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-24  Tim Horton  <timothy_horton@apple.com>

            Enable Web Content Filtering on watchOS
            https://bugs.webkit.org/show_bug.cgi?id=187979
            <rdar://problem/42559346>

            Reviewed by Wenson Hsieh.

            * Configurations/FeatureDefines.xcconfig:

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234149. rdar://problem/42604679

    Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
    appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
    https://bugs.webkit.org/show_bug.cgi?id=187870
    <rdar://problem/41190880>
    
    Reviewed by Dean Jackson.
    
    Source/WebCore:
    
    Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.
    
    Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
    same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
    disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
    we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
    from the opener.
    
    Developers that want to block plugin content from being loaded in a same-origin child window must now
    serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
    described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
    (Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
    behavior of Chrome and Firefox.
    
    Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
           http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
           http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html
    
    * dom/Document.cpp:
    (WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
    to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
    to inherit all directives from the owner frame as we do now.
    * page/csp/ContentSecurityPolicy.cpp:
    (WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
    inheriting only the plugin-types and report-uri directives.
    * page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
    loaded in a child window.
    * page/csp/ContentSecurityPolicyDirectiveList.cpp:
    (WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
    recognize the plugin-types and report-uri directives when parsing the policy.
    
    LayoutTests:
    
    Add new tests and fix up the existing test http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window.html
    so that still tests a scenario where a same-origin plugin document loaded in a child window is blocked from
    loading its plugin now that that "object-src: 'none'" is no longer inherited by the plugin document.
    
    * http/tests/plugins/resources/plugin-document-alert-and-notify-done.pl:
    * http/tests/security/contentSecurityPolicy/resources/checkDidSameOriginChildWindowLoad.js: Added.
    (checkDidSameOriginChildWindowLoadAndNotifyDone):
    (checkDidLoad):
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window-expected.txt: Added.
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html: Added.
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-expected.txt:
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report-expected.txt: Added.
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php: Added.
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window.html:
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window-expected.txt: Added.
    * http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html: Added.
    * platform/ios/TestExpectations: Skip the included tests as we do not support plugins on iOS.
    * platform/win/TestExpectations: Skip the included tests as plugins do not seem to work on Windows. We currently skip many
    (if not all) plugin tests on Windows despite <rdar://problem/5074411> being marked as Closed (why?).
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234149 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-24  Daniel Bates  <dabates@apple.com>

            Cannot view PDF's on my.gov.au: "Refused to load https://my.gov.au/attachment/viewAttachment because it
            appears in neither the object-src directive nor the default-src directive of the Content Security Policy"
            https://bugs.webkit.org/show_bug.cgi?id=187870
            <rdar://problem/41190880>

            Reviewed by Dean Jackson.

            Fixes an issue where opening attachments on my.gov.au would show a "Blocked Plug-in" message.

            Opening an attachment on my.gov.au opens a same-origin plugin document in a child window. Currently
            same-origin plugin documents inherit their CSP policy from their opener. If the opener's CSP policy
            disallows embedding plugins then the plugin document would be blocked from loading a plugin. For now
            we relax the inheritance model such that we only inherit the plugin-types and report-uri directives
            from the opener.

            Developers that want to block plugin content from being loaded in a same-origin child window must now
            serve such plugin content with a CSP policy that includes "object-src 'none'". This matches the behavior
            described in the second Note in section object-src of the CSP 3 spec: <https://w3c.github.io/webappsec-csp/#directive-object-src>
            (Editor's Draft, 10 July 2018). It also makes the behavior in WebKit more closely aligned with the
            behavior of Chrome and Firefox.

            Tests: http/tests/security/contentSecurityPolicy/same-origin-plugin-document-allowed-in-child-window.html
                   http/tests/security/contentSecurityPolicy/same-origin-plugin-document-blocked-in-child-window-report.php
                   http/tests/security/contentSecurityPolicy/same-origin-plugin-document-with-csp-blocked-in-child-window.html

            * dom/Document.cpp:
            (WebCore::Document::initContentSecurityPolicy): For plugin documents that have an opener call ContentSecurityPolicy::createPolicyForPluginDocumentFrom()
            to only inherit the plugin-types and report-uri directives from its opener's CSP policy. Otherwise, call ContentSecurityPolicy::copyStateFrom()
            to inherit all directives from the owner frame as we do now.
            * page/csp/ContentSecurityPolicy.cpp:
            (WebCore::ContentSecurityPolicy::createPolicyForPluginDocumentFrom): Create a new policy from the specified policy
            inheriting only the plugin-types and report-uri directives.
            * page/csp/ContentSecurityPolicy.h: Define a new PolicyFrom enumerator, InheritedForPluginDocument, for plugin documents
            loaded in a child window.
            * page/csp/ContentSecurityPolicyDirectiveList.cpp:
            (WebCore::ContentSecurityPolicyDirectiveList::parse): When policyFrom is InheritedForPluginDocument then only
            recognize the plugin-types and report-uri directives when parsing the policy.

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234140. rdar://problem/42606763

    REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
    https://bugs.webkit.org/show_bug.cgi?id=187944
    
    Reviewed by Carlos Garcia Campos.
    
    The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
    return false when the URL protocol is `data:`, and should return true
    when the given SecurityOrigin cannot access the media URL.
    
    This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
    which the new method falls back to when the MediaPlayerPrivate
    implementation doesn't or can't determine the would-taint result.
    
    This fixes a bunch of failing and timing-out WebGL test cases on ports
    using GStreamer (on which the MediaPlayerPrivate derivate doesn't
    implement the wouldTaintOrigin() method).
    
    * platform/graphics/MediaPlayer.cpp:
    (WebCore::MediaPlayer::wouldTaintOrigin const):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234140 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-24  Zan Dobersek  <zdobersek@igalia.com>

            REGRESSION(r234055): inverted return values in MediaPlayer::wouldTaintOrigin()
            https://bugs.webkit.org/show_bug.cgi?id=187944

            Reviewed by Carlos Garcia Campos.

            The MediaPlayer::wouldTaintOrigin(), as introduced in r234055, should
            return false when the URL protocol is `data:`, and should return true
            when the given SecurityOrigin cannot access the media URL.

            This matches behavior of CanvasRenderingContext::wouldTaintOrigin()
            which the new method falls back to when the MediaPlayerPrivate
            implementation doesn't or can't determine the would-taint result.

            This fixes a bunch of failing and timing-out WebGL test cases on ports
            using GStreamer (on which the MediaPlayerPrivate derivate doesn't
            implement the wouldTaintOrigin() method).

            * platform/graphics/MediaPlayer.cpp:
            (WebCore::MediaPlayer::wouldTaintOrigin const):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234113. rdar://problem/42604546

    WebCore::primaryScreenDisplayID() always return 0
    https://bugs.webkit.org/show_bug.cgi?id=187922
    <rdar://problem/42286933>
    
    Reviewed by Geoffrey Garen.
    
    This function should return a valid display ID.
    
    No new tests. Testing this requires a dual monitor setup.
    
    * platform/mac/PlatformScreenMac.mm:
    (WebCore::primaryScreenDisplayID):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234113 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-23  Per Arne Vollan  <pvollan@apple.com>

            WebCore::primaryScreenDisplayID() always return 0
            https://bugs.webkit.org/show_bug.cgi?id=187922
            <rdar://problem/42286933>

            Reviewed by Geoffrey Garen.

            This function should return a valid display ID.

            No new tests. Testing this requires a dual monitor setup.

            * platform/mac/PlatformScreenMac.mm:
            (WebCore::primaryScreenDisplayID):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234112. rdar://problem/42604514

    AX: Press tab to highlight items on a webpage is not working with voiceover enabled
    https://bugs.webkit.org/show_bug.cgi?id=187824
    
    Reviewed by Zalan Bujtas.
    
    Source/WebCore:
    
    We are deferring posting focused element change notification when the document needs a
    style recalculation. However, we only perform the cache update after a layout is completed.
    Added a timer to perform the cache update in the next runloop when non-layout type of mutation
    happens.
            
    Test: accessibility/mac/tab-focus-post-notification.html
    
    * accessibility/AXObjectCache.cpp:
    (WebCore::AXObjectCache::AXObjectCache):
    (WebCore::AXObjectCache::~AXObjectCache):
    (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
    (WebCore::AXObjectCache::performCacheUpdateTimerFired):
    * accessibility/AXObjectCache.h:
    (WebCore::AXObjectCache::AXObjectCache):
    (WebCore::AXObjectCache::performCacheUpdateTimerFired):
    
    LayoutTests:
    
    * accessibility/mac/tab-focus-post-notification-expected.txt: Added.
    * accessibility/mac/tab-focus-post-notification.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-23  Nan Wang  <n_wang@apple.com>

            AX: Press tab to highlight items on a webpage is not working with voiceover enabled
            https://bugs.webkit.org/show_bug.cgi?id=187824

            Reviewed by Zalan Bujtas.

            We are deferring posting focused element change notification when the document needs a
            style recalculation. However, we only perform the cache update after a layout is completed.
            Added a timer to perform the cache update in the next runloop when non-layout type of mutation
            happens.

            Test: accessibility/mac/tab-focus-post-notification.html

            * accessibility/AXObjectCache.cpp:
            (WebCore::AXObjectCache::AXObjectCache):
            (WebCore::AXObjectCache::~AXObjectCache):
            (WebCore::AXObjectCache::deferFocusedUIElementChangeIfNeeded):
            (WebCore::AXObjectCache::performCacheUpdateTimerFired):
            * accessibility/AXObjectCache.h:
            (WebCore::AXObjectCache::AXObjectCache):
            (WebCore::AXObjectCache::performCacheUpdateTimerFired):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234111. rdar://problem/42604691

    WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
    https://bugs.webkit.org/show_bug.cgi?id=187910
    <rdar://problem/42356526>
    
    Reviewed by Brent Fulgham.
    
    Source/WebCore:
    
    Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
    for the 5 second delay.
    
    * testing/Internals.cpp:
    (WebCore::Internals::notifyResourceLoadObserver):
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    
    The WebResourceLoadStatisticsStore was only removing itself as a MessageReceiver from the WebProcessProxy
    and that WebProcessProxy's connection was getting closed. However, it is possible for the
    WebResourceLoadStatisticsStore to get destroyed before this happens. This would lead to crashes such as
    the one in <rdar://problem/42356526>.
    
    To address the issue, we let the WebsiteDataStore take care of registering / unregistering the
    WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy. This is more reliable since
    the WebsiteDataStore is the one that subclasses WebProcessLifetimeObserver. Make sure the
    WebResourceLoadStatisticsStore is removed as a MessageReceiver whenever the WebsiteDataStore is destroyed
    or WebsiteDataStore::m_resourceLoadStatistics gets cleared.
    
    * UIProcess/WebResourceLoadStatisticsStore.cpp:
    * UIProcess/WebResourceLoadStatisticsStore.h:
    Drop logic to add / remove the WebResourceLoadStatisticsStore as a receiver now that the
    WebsiteDataStore takes care of it.
    
    * UIProcess/WebsiteData/WebsiteDataStore.cpp:
    (WebKit::WebsiteDataStore::~WebsiteDataStore):
    Make sure the WebResourceLoadStatisticsStore gets unregistered as a MessageReceiver from all associated
    WebProcessProxy objects when the WebsiteDataStore gets destroyed.
    
    (WebKit::WebsiteDataStore::webProcessWillOpenConnection):
    (WebKit::WebsiteDataStore::webProcessDidCloseConnection):
    Register / Unregister the WebResourceLoadStatisticsStore as a MessageReceiver with the WebProcessProxy.
    
    (WebKit::WebsiteDataStore::setResourceLoadStatisticsEnabled):
    Make sure we unregister the WebResourceLoadStatisticsStore as a MessageReceiver with all associated
    WebProcessProxy objects before we clear m_resourceLoadStatistics as this will causes the
    WebResourceLoadStatisticsStore to get destroyed.
    
    (WebKit::WebsiteDataStore::unregisterWebResourceLoadStatisticsStoreAsMessageReceiver):
    (WebKit::WebsiteDataStore::registerWebResourceLoadStatisticsStoreAsMessageReceiver):
    Add utility functions to register / unregister WebResourceLoadStatisticsStore as a MessageReceiver with
    all associated WebProcessProxy objects.
    
    (WebKit::WebsiteDataStore::enableResourceLoadStatisticsAndSetTestingCallback):
    Register the new WebResourceLoadStatisticsStore as a MessageReceiver with all associated WebProcessProxy
    objects in case setResourceLoadStatisticsEnabled(true) gets called *after* we've already started
    WebProcesses.
    
    * UIProcess/WebsiteData/WebsiteDataStore.h:
    
    Tools:
    
    Add API test coverage.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ResourceLoadStatistics.mm:
    (-[DisableITPDuringNavigationDelegate webView:didCommitNavigation:]):
    (-[DisableITPDuringNavigationDelegate webView:didFinishNavigation:]):
    (TEST):
    * TestWebKitAPI/Tests/WebKitCocoa/notify-resourceLoadObserver.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234111 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-23  Chris Dumez  <cdumez@apple.com>

            WebResourceLoadStatisticsStore fails to unregister itself as a MessageReceiver in its destructor
            https://bugs.webkit.org/show_bug.cgi?id=187910
            <rdar://problem/42356526>

            Reviewed by Brent Fulgham.

            Add internals API that causes the ResourceLoadObserver to notify its observer, and avoid waiting
            for the 5 second delay.

            * testing/Internals.cpp:
            (WebCore::Internals::notifyResourceLoadObserver):
            * testing/Internals.h:
            * testing/Internals.idl:

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234098. rdar://problem/42507862

    fullscreen env() variables should have initial values
    https://bugs.webkit.org/show_bug.cgi?id=187897
    <rdar://problem/42485682>
    
    Reviewed by Sam Weinig.
    
    Source/WebCore:
    
    The env() values for fullscreen properties need to be
    initialized, rather than wait for values to be set from WebKit.
    Without this, feature detection doesn't work, and properties
    won't parse correctly.
    
    Test: fullscreen/fullscreen-env-initial.html
    
    * dom/ConstantPropertyMap.cpp:
    (WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
    (WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
    also updates the duration value.
    (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
    (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
    * dom/ConstantPropertyMap.h:
    * page/Page.cpp:
    (WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
    * page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
    (WebCore::Page::fullscreenAutoHideDuration const):
    
    LayoutTests:
    
    * fullscreen/fullscreen-env-initial-expected.html: Added.
    * fullscreen/fullscreen-env-initial.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234098 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-22  Dean Jackson  <dino@apple.com>

            fullscreen env() variables should have initial values
            https://bugs.webkit.org/show_bug.cgi?id=187897
            <rdar://problem/42485682>

            Reviewed by Sam Weinig.

            The env() values for fullscreen properties need to be
            initialized, rather than wait for values to be set from WebKit.
            Without this, feature detection doesn't work, and properties
            won't parse correctly.

            Test: fullscreen/fullscreen-env-initial.html

            * dom/ConstantPropertyMap.cpp:
            (WebCore::ConstantPropertyMap::buildValues): Initialize the fullscreen values.
            (WebCore::ConstantPropertyMap::updateConstantsForFullscreen): Renamed function, because it
            also updates the duration value.
            (WebCore::ConstantPropertyMap::didChangeFullscreenInsets): Call new name.
            (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets): Deleted.
            * dom/ConstantPropertyMap.h:
            * page/Page.cpp:
            (WebCore::Page::setFullscreenAutoHideDuration): Don't change the value if it doesn't need it.
            * page/Page.h: Add accessor for fullscreenAutoHideDuration. Also add a member variable.
            (WebCore::Page::fullscreenAutoHideDuration const):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234064. rdar://problem/42451634

    Picking a color from the color panel for typing attributes needs to inverse transform through color-filter
    https://bugs.webkit.org/show_bug.cgi?id=187846
    
    Patch by Ryosuke Niwa <rniwa@apple.com> on 2018-07-20
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    This patch refines the color inversion for editing introduced in r234005 so that font panels and WebKit embedders
    can get and set inverted colors using attributed strings for a selected text in an editable region.
    
    More specifically, when font panels or WebKit embedders set a font color or a background color via WebView's
    _applyStyleToSelection and _applyEditingStyleToSelection, WebKit would automatically invert the color before inserting
    into DOM so that the color visible to the user matches that's given to WebKit. Conversely,
    [WebView attributedSubstringFromRange:nsRange] now return the color visible to the user, i.e. the color after
    the color filter had been applied, so that some WebKit embedders can present the visually identical color to the user.
    
    Because DOM never sees the color filter's effect in the computed style, etc... this patch reverts the change made to
    StyleChange in r234005 to avoid inverting the color passed to execCommand. This makes editing apps which is unaware
    of the dark mode or -apple-color-filter continue to function (because the color picker implemented in DOM will be
    applied of the same color filter before being presented to the user).
    
    Finally, this patch introduces a testing hook in applyCommandToFrame so that executing foreColor or backColor with
    the soruce of CommandFromMenuOrKeyBinding would trigger the same code path as the one taken by Objective-C
    
    Tests: editing/execCommand/set-backColor-with-color-filter-from-scripts.html
           editing/execCommand/set-foreColor-with-color-filter-from-scripts.html
           editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
           editing/style/set-backColor-with-color-filter.html
           editing/style/set-foreColor-with-color-filter.html
    
    * editing/EditingStyle.cpp:
    (WebCore::EditingStyle::inverseTransformColorIfNeeded): Added.
    (WebCore::StyleChange::StyleChange): Revert the change made in r234005 since this code is also used by execCommand
    which is not desirable, and won't work for background color.
    (WebCore::StyleChange::extractTextStyles): Ditto.
    * editing/EditingStyle.h:
    * editing/Editor.cpp:
    (WebCore::Editor::applyStyle):
    (WebCore::Editor::applyStyleToSelection): Call EditingStyle::inverseTransformColorIfNeeded when ColorFilterMode is
    set to InvertColor.
    * editing/Editor.h:
    * editing/EditorCommand.cpp:
    (WebCore::applyCommandToFrame): Added the aforementioned testing hook.
    * editing/cocoa/HTMLConverter.mm:
    (WebCore::editingAttributedStringFromRange): Take the color filtr into account. Some WebKit embedders use this
    function to compute the font color in the selected text. Note that this function is mostly used for input methods
    so the color doesn't really matter, and its implementation is distinct from that of HTMLConverter.
    
    Source/WebKitLegacy/mac:
    
    Invert the filtered font and background colors when using font panels, font pasteboard, and other Objective-C APIs.
    
    * WebView/WebHTMLView.mm:
    (-[WebHTMLView _applyStyleToSelection:withUndoAction:]): Share code with _applyEditingStyleToSelection.
    (-[WebHTMLView _applyEditingStyleToSelection:withUndoAction:]):
    
    Tools:
    
    Fixed the bug that testRunner.execCommand was using the second argument as the value.
    
    The second argument, aShowDefaultUI, should always be ignored in testRunner.execCommand,
    and the third argument should be used as the value. DumpRenderTree's implementation does this already.
    
    * WebKitTestRunner/InjectedBundle/Bindings/TestRunner.idl:
    * WebKitTestRunner/InjectedBundle/TestRunner.cpp:
    (WTR::TestRunner::execCommand):
    * WebKitTestRunner/InjectedBundle/TestRunner.h:
    
    LayoutTests:
    
    Added tests to make sure foreground or background colors specified in execCommand don't get inverted.
    
    Fixed the test which was asserting that textInputController.attributedSubstringFromRange doesn't invert the color
    since that's exactly what WebKit embedders uses to compute the style for color pickers.
    
    Added new tests for copy & paste case using textInputController.legacyAttributedString.
    
    * editing/execCommand/set-backColor-with-color-filter-from-scripts-expected.txt: Added.
    * editing/execCommand/set-backColor-with-color-filter-from-scripts.html: Added.
    * editing/execCommand/set-foreColor-with-color-filter-from-scripts-expected.txt: Added.
    * editing/execCommand/set-foreColor-with-color-filter-from-scripts.html: Added.
    * editing/mac/attributed-string/attrib-string-range-with-color-filter-expected.txt:
    * editing/mac/attributed-string/attrib-string-range-with-color-filter.html: This test uses attributedSubstringFromRange,
    which implemented using editingAttributedStringFromRange in WebCore. Since this is exactly what WebKit embedders uses
    to compute the current style of the selected text, we need to invert the color here. This API's main clinet is input methods
    so this shouldn't affect other editing operations, in particular, copy and paste, which uses HTMLConverter.
    * editing/mac/attributed-string/attribute-string-for-copy-with-color-filter-expected.txt: Added.
    * editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html: Added. Make sure the attributed string
    generated for copy & paste does not invert foreground or background colors via textInputController.legacyAttributedString.
    This is testing HTMLConverter, not editingAttributedStringFromRange, used by WebKit embedders and input methods.
    * editing/mac/attributed-string/attributed-string-for-typing-with-color-filter-expected.txt:
    * editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html: Added background color in the test.
    * editing/style/set-backColor-with-color-filter-expected.txt: Added.
    * editing/style/set-backColor-with-color-filter.html: Added.
    * editing/style/set-foreColor-with-color-filter-expected.txt: Renamed from exec-command-foreColor-with-color-filter-expected.txt.
    * editing/style/set-foreColor-with-color-filter.html: Renamed from exec-command-foreColor-with-color-filter.html.
    Updated the test to use testRunner.execCommand which uses CommandFromMenuOrKeyBinding in applyCommandToFrame since we're
    trying to test the code path taken by WebKit embedders and font panel here.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234064 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Ryosuke Niwa  <rniwa@apple.com>

            Picking a color from the color panel for typing attributes needs to inverse transform through color-filter
            https://bugs.webkit.org/show_bug.cgi?id=187846

            Reviewed by Simon Fraser.

            This patch refines the color inversion for editing introduced in r234005 so that font panels and WebKit embedders
            can get and set inverted colors using attributed strings for a selected text in an editable region.

            More specifically, when font panels or WebKit embedders set a font color or a background color via WebView's
            _applyStyleToSelection and _applyEditingStyleToSelection, WebKit would automatically invert the color before inserting
            into DOM so that the color visible to the user matches that's given to WebKit. Conversely,
            [WebView attributedSubstringFromRange:nsRange] now return the color visible to the user, i.e. the color after
            the color filter had been applied, so that some WebKit embedders can present the visually identical color to the user.

            Because DOM never sees the color filter's effect in the computed style, etc... this patch reverts the change made to
            StyleChange in r234005 to avoid inverting the color passed to execCommand. This makes editing apps which is unaware
            of the dark mode or -apple-color-filter continue to function (because the color picker implemented in DOM will be
            applied of the same color filter before being presented to the user).

            Finally, this patch introduces a testing hook in applyCommandToFrame so that executing foreColor or backColor with
            the soruce of CommandFromMenuOrKeyBinding would trigger the same code path as the one taken by Objective-C

            Tests: editing/execCommand/set-backColor-with-color-filter-from-scripts.html
                   editing/execCommand/set-foreColor-with-color-filter-from-scripts.html
                   editing/mac/attributed-string/attribute-string-for-copy-with-color-filter.html
                   editing/style/set-backColor-with-color-filter.html
                   editing/style/set-foreColor-with-color-filter.html

            * editing/EditingStyle.cpp:
            (WebCore::EditingStyle::inverseTransformColorIfNeeded): Added.
            (WebCore::StyleChange::StyleChange): Revert the change made in r234005 since this code is also used by execCommand
            which is not desirable, and won't work for background color.
            (WebCore::StyleChange::extractTextStyles): Ditto.
            * editing/EditingStyle.h:
            * editing/Editor.cpp:
            (WebCore::Editor::applyStyle):
            (WebCore::Editor::applyStyleToSelection): Call EditingStyle::inverseTransformColorIfNeeded when ColorFilterMode is
            set to InvertColor.
            * editing/Editor.h:
            * editing/EditorCommand.cpp:
            (WebCore::applyCommandToFrame): Added the aforementioned testing hook.
            * editing/cocoa/HTMLConverter.mm:
            (WebCore::editingAttributedStringFromRange): Take the color filtr into account. Some WebKit embedders use this
            function to compute the font color in the selected text. Note that this function is mostly used for input methods
            so the color doesn't really matter, and its implementation is distinct from that of HTMLConverter.

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234055. rdar://problem/42451567

    HLS resources with remote subresources will not taint canvasses.
    https://bugs.webkit.org/show_bug.cgi?id=187731
    <rdar://problem/42290703>
    
    Reviewed by Brady Eidson.
    
    Source/WebCore:
    
    Test: http/tests/security/canvas-remote-read-remote-video-hls.html
    
    Most media sources are single-resource; they are accessed from a single origin. HLS manifests can contain many
    subresources from arbitrary origins, and canvases should be tainted when painted from media elements whose
    subresources were retrieved from tainting origins.
    
    Add a new method to HTMLMediaElement, wouldTaintOrigin(), taking a SecurityOrigin, and returning whether the
    media element would taint that origin. This gets piped all the way down to MediaPlayerPrivateAVFoundationObjC
    which uses WebCoreNSURLSession to track all the origins of all the responses which resulted from the media
    element's load.
    
    Drive-by fix: also fix this issue for media elements which render to an AudioContext.
    
    Drive-by fix #2: CanvasRenderingContext2DBase::createPattern() needs to check the return value of
    ImageBuffer::create() before using it.
    
    * Modules/webaudio/MediaElementAudioSourceNode.cpp:
    (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::didAttachRenderers):
    (WebCore::HTMLMediaElement::didDetachRenderers):
    (WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
    * html/HTMLMediaElement.h:
    (WebCore::HTMLMediaElement::wouldTaintOrigin const):
    * html/canvas/CanvasRenderingContext.cpp:
    (WebCore::CanvasRenderingContext::wouldTaintOrigin):
    * html/canvas/CanvasRenderingContext2DBase.cpp:
    (WebCore::CanvasRenderingContext2DBase::createPattern):
    * platform/graphics/MediaPlayer.cpp:
    (WebCore::MediaPlayer::wouldTaintOrigin const):
    * platform/graphics/MediaPlayer.h:
    * platform/graphics/MediaPlayerPrivate.h:
    (WebCore::MediaPlayerPrivateInterface::hasSingleSecurityOrigin const):
    (WebCore::MediaPlayerPrivateInterface::wouldTaintOrigin const):
    * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
    (WebCore::CDMSessionAVContentKeySession::update):
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
    * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
    (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
    * platform/network/cocoa/WebCoreNSURLSession.h:
    * platform/network/cocoa/WebCoreNSURLSession.mm:
    (-[WebCoreNSURLSession task:didReceiveResponseFromOrigin:]):
    (-[WebCoreNSURLSession wouldTaintOrigin:]):
    (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):
    
    LayoutTests:
    
    * http/tests/media/resources/hls/test-vod-localhost.m3u8: Added.
    * http/tests/security/canvas-remote-read-remote-video-hls-expected.txt: Added.
    * http/tests/security/canvas-remote-read-remote-video-hls.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234055 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Jer Noble  <jer.noble@apple.com>

            HLS resources with remote subresources will not taint canvasses.
            https://bugs.webkit.org/show_bug.cgi?id=187731
            <rdar://problem/42290703>

            Reviewed by Brady Eidson.

            Test: http/tests/security/canvas-remote-read-remote-video-hls.html

            Most media sources are single-resource; they are accessed from a single origin. HLS manifests can contain many
            subresources from arbitrary origins, and canvases should be tainted when painted from media elements whose
            subresources were retrieved from tainting origins.

            Add a new method to HTMLMediaElement, wouldTaintOrigin(), taking a SecurityOrigin, and returning whether the
            media element would taint that origin. This gets piped all the way down to MediaPlayerPrivateAVFoundationObjC
            which uses WebCoreNSURLSession to track all the origins of all the responses which resulted from the media
            element's load.

            Drive-by fix: also fix this issue for media elements which render to an AudioContext.

            Drive-by fix #2: CanvasRenderingContext2DBase::createPattern() needs to check the return value of
            ImageBuffer::create() before using it.

            * Modules/webaudio/MediaElementAudioSourceNode.cpp:
            (WebCore::MediaElementAudioSourceNode::wouldTaintOrigin):
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::didAttachRenderers):
            (WebCore::HTMLMediaElement::didDetachRenderers):
            (WebCore::HTMLMediaElement::scheduleUpdateShouldAutoplay):
            * html/HTMLMediaElement.h:
            (WebCore::HTMLMediaElement::wouldTaintOrigin const):
            * html/canvas/CanvasRenderingContext.cpp:
            (WebCore::CanvasRenderingContext::wouldTaintOrigin):
            * html/canvas/CanvasRenderingContext2DBase.cpp:
            (WebCore::CanvasRenderingContext2DBase::createPattern):
            * platform/graphics/MediaPlayer.cpp:
            (WebCore::MediaPlayer::wouldTaintOrigin const):
            * platform/graphics/MediaPlayer.h:
            * platform/graphics/MediaPlayerPrivate.h:
            (WebCore::MediaPlayerPrivateInterface::hasSingleSecurityOrigin const):
            (WebCore::MediaPlayerPrivateInterface::wouldTaintOrigin const):
            * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
            (WebCore::CDMSessionAVContentKeySession::update):
            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
            * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
            (WebCore::MediaPlayerPrivateAVFoundationObjC::wouldTaintOrigin const):
            * platform/network/cocoa/WebCoreNSURLSession.h:
            * platform/network/cocoa/WebCoreNSURLSession.mm:
            (-[WebCoreNSURLSession task:didReceiveResponseFromOrigin:]):
            (-[WebCoreNSURLSession wouldTaintOrigin:]):
            (-[WebCoreNSURLSessionDataTask resource:receivedResponse:]):

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234053. rdar://problem/42451651

    Update FrameView::paintContents to use release logging.
    https://bugs.webkit.org/show_bug.cgi?id=187854
    <rdar://problem/42432371>
    
    Reviewed by Simon Fraser.
    
    Adding release logging helps identifying blank content cases.
    
    * page/FrameView.cpp:
    (WebCore::FrameView::paintContents):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234053 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Zalan Bujtas  <zalan@apple.com>

            Update FrameView::paintContents to use release logging.
            https://bugs.webkit.org/show_bug.cgi?id=187854
            <rdar://problem/42432371>

            Reviewed by Simon Fraser.

            Adding release logging helps identifying blank content cases.

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

2018-07-25  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234177. rdar://problem/42586717

    Unreviewed, rolling out r233496 and r233571.
    
    Likely cause of <rdar://problem/42160890> and
    <rdar://problem/42329658> as ActiveDOMObjects can now be
    constructed / destroyed while we are iterating over them.
    
    Reverted changesets:
    
    "Nullptr crash accessing Document in
    GenericEventQueue::dispatchOneEvent()"
    https://bugs.webkit.org/show_bug.cgi?id=187284
    https://trac.webkit.org/changeset/233496
    
    "REGRESSION(r233496): macOS Sierra hits debug assertions in
    TrackListBase::suspend"
    https://bugs.webkit.org/show_bug.cgi?id=187378
    https://trac.webkit.org/changeset/233571
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234177 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-24  Chris Dumez  <cdumez@apple.com>

            Unreviewed, rolling out r233496 and r233571.

            Likely cause of <rdar://problem/42160890> and
            <rdar://problem/42329658> as ActiveDOMObjects can now be
            constructed / destroyed while we are iterating over them.

            Reverted changesets:

            "Nullptr crash accessing Document in
            GenericEventQueue::dispatchOneEvent()"
            https://bugs.webkit.org/show_bug.cgi?id=187284
            https://trac.webkit.org/changeset/233496

            "REGRESSION(r233496): macOS Sierra hits debug assertions in
            TrackListBase::suspend"
            https://bugs.webkit.org/show_bug.cgi?id=187378
            https://trac.webkit.org/changeset/233571

2018-07-24  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234158. rdar://problem/42551556

    [Cocoa] Stop crashing in lastResortFallbackFont()
    https://bugs.webkit.org/show_bug.cgi?id=187936
    
    Reviewed by Jon Lee.
    
    CoreText can get into a state where both Times and Lucida Grande are inaccessible.
    Instead of crashing, we should use the real LastResort, which is backed by a section
    in the .rodata of the CoreText dylib, and as such should always exist.
    
    * platform/graphics/FontCache.cpp:
    (WebCore::FontCache::fontForFamily):
    * platform/graphics/cocoa/FontCacheCoreText.cpp:
    (WebCore::FontCache::lastResortFallbackFont):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234158 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-24  Myles C. Maxfield  <mmaxfield@apple.com>

            [Cocoa] Stop crashing in lastResortFallbackFont()
            https://bugs.webkit.org/show_bug.cgi?id=187936

            Reviewed by Jon Lee.

            CoreText can get into a state where both Times and Lucida Grande are inaccessible.
            Instead of crashing, we should use the real LastResort, which is backed by a section
            in the .rodata of the CoreText dylib, and as such should always exist.

            * platform/graphics/FontCache.cpp:
            (WebCore::FontCache::fontForFamily):
            * platform/graphics/cocoa/FontCacheCoreText.cpp:
            (WebCore::FontCache::lastResortFallbackFont):

2018-07-23  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234073. rdar://problem/42451644

    Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
    https://bugs.webkit.org/show_bug.cgi?id=187844
    rdar://problem/40387294
    
    Reviewed by Dean Jackson.
    Source/WebCore:
    
    A keyframe animation which animates 3D transforms, and is fill-forwards, currently
    leaves the GraphicsLayer in a state where it has a "running" animation. However, the
    logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
    so for running or paused animations. GraphicsLayer then thinks that it has an active
    transform animation with unknown extent, and refuses to detach its backing store.
    
    This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).
    
    Fix by always removing animations from the GraphicsLayer when they finish, whether
    or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
    always call endAnimation().
    
    This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
    to fix the other code path.
    
    Also improve some logging that would have revealed this problem sooner.
    
    Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html
    
    * page/animation/AnimationBase.h:
    (WebCore::AnimationBase::endAnimation):
    * page/animation/ImplicitAnimation.cpp:
    (WebCore::ImplicitAnimation::endAnimation):
    * page/animation/ImplicitAnimation.h:
    * page/animation/KeyframeAnimation.cpp:
    (WebCore::KeyframeAnimation::endAnimation):
    (WebCore::KeyframeAnimation::onAnimationEnd):
    * page/animation/KeyframeAnimation.h:
    * platform/graphics/ca/GraphicsLayerCA.cpp:
    (WebCore::GraphicsLayerCA::addAnimation):
    (WebCore::GraphicsLayerCA::updateCoverage):
    
    LayoutTests:
    
    * compositing/backing/backing-store-attachment-fill-forwards-animation-expected.txt: Added.
    * compositing/backing/backing-store-attachment-fill-forwards-animation.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234073 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Simon Fraser  <simon.fraser@apple.com>

            Remove completed animations from GraphicsLayer, thus avoiding excessive backing store allocation
            https://bugs.webkit.org/show_bug.cgi?id=187844
            rdar://problem/40387294

            Reviewed by Dean Jackson.

            A keyframe animation which animates 3D transforms, and is fill-forwards, currently
            leaves the GraphicsLayer in a state where it has a "running" animation. However, the
            logic that computes animation extent in RenderLayerBacking::updateGeometry() only does
            so for running or paused animations. GraphicsLayer then thinks that it has an active
            transform animation with unknown extent, and refuses to detach its backing store.

            This triggers excessive layer creation on some sites (e.g. https://www.kqed.org).

            Fix by always removing animations from the GraphicsLayer when they finish, whether
            or not they fill forwards. This is done by having KeyframeAnimation::onAnimationEnd()
            always call endAnimation().

            This change only fixes the non-Web Animation code path. webkit.org/b/187845 exists
            to fix the other code path.

            Also improve some logging that would have revealed this problem sooner.

            Test: compositing/backing/backing-store-attachment-fill-forwards-animation.html

            * page/animation/AnimationBase.h:
            (WebCore::AnimationBase::endAnimation):
            * page/animation/ImplicitAnimation.cpp:
            (WebCore::ImplicitAnimation::endAnimation):
            * page/animation/ImplicitAnimation.h:
            * page/animation/KeyframeAnimation.cpp:
            (WebCore::KeyframeAnimation::endAnimation):
            (WebCore::KeyframeAnimation::onAnimationEnd):
            * page/animation/KeyframeAnimation.h:
            * platform/graphics/ca/GraphicsLayerCA.cpp:
            (WebCore::GraphicsLayerCA::addAnimation):
            (WebCore::GraphicsLayerCA::updateCoverage):

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Revert r233926. rdar://problem/42446531

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Revert r233930. rdar://problem/42446531

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Revert r233936. rdar://problem/42446531

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Revert r234044. rdar://problem/42433225

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234045. rdar://problem/42434024

    FetchResponse should close its stream when loading finishes
    https://bugs.webkit.org/show_bug.cgi?id=187790
    
    Reviewed by Chris Dumez.
    
    It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
    Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
    Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
    This is consistent to errors sent back through callbacks.
    
    Covered by existing tests.
    
    * Modules/fetch/FetchBodyOwner.cpp:
    (WebCore::FetchBodyOwner::~FetchBodyOwner):
    * Modules/fetch/FetchBodyOwner.h:
    * Modules/fetch/FetchBodySource.cpp:
    (WebCore::FetchBodySource::FetchBodySource):
    (WebCore::FetchBodySource::setActive):
    (WebCore::FetchBodySource::setInactive):
    (WebCore::FetchBodySource::doStart):
    (WebCore::FetchBodySource::doPull):
    (WebCore::FetchBodySource::doCancel):
    (WebCore::FetchBodySource::cleanBodyOwner):
    * Modules/fetch/FetchBodySource.h:
    * Modules/fetch/FetchResponse.cpp:
    (WebCore::FetchResponse::BodyLoader::didSucceed):
    (WebCore::FetchResponse::BodyLoader::didFail):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234045 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Youenn Fablet  <youenn@apple.com>

            FetchResponse should close its stream when loading finishes
            https://bugs.webkit.org/show_bug.cgi?id=187790

            Reviewed by Chris Dumez.

            It simplifies for a FetchResponse to push all its data into its stream if already created at end of load time.
            Did some refactoring in FetchBodyOwner to have a cleaner relationship with the stream source.
            Did a minor refactoring to expose the error description when loading fails as part of the rejected promise.
            This is consistent to errors sent back through callbacks.

            Covered by existing tests.

            * Modules/fetch/FetchBodyOwner.cpp:
            (WebCore::FetchBodyOwner::~FetchBodyOwner):
            * Modules/fetch/FetchBodyOwner.h:
            * Modules/fetch/FetchBodySource.cpp:
            (WebCore::FetchBodySource::FetchBodySource):
            (WebCore::FetchBodySource::setActive):
            (WebCore::FetchBodySource::setInactive):
            (WebCore::FetchBodySource::doStart):
            (WebCore::FetchBodySource::doPull):
            (WebCore::FetchBodySource::doCancel):
            (WebCore::FetchBodySource::cleanBodyOwner):
            * Modules/fetch/FetchBodySource.h:
            * Modules/fetch/FetchResponse.cpp:
            (WebCore::FetchResponse::BodyLoader::didSucceed):
            (WebCore::FetchResponse::BodyLoader::didFail):

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234044. rdar://problem/42433225

    REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
    https://bugs.webkit.org/show_bug.cgi?id=187814
    <rdar://problem/42391869>
    
    Reviewed by Eric Carlson.
    
    After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
    VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
    assertion no longer holds true.
    
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (-[WebAVPlayerLayer layoutSublayers]):
    (-[WebAVPlayerLayer resolveBounds]):
    (-[WebAVPlayerLayer setVideoGravity:]):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234044 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-20  Jer Noble  <jer.noble@apple.com>

            REGRESSION(r233969): ASSERT in -[WebAVPlayerLayer setVideoGravity:]
            https://bugs.webkit.org/show_bug.cgi?id=187814
            <rdar://problem/42391869>

            Reviewed by Eric Carlson.

            After r233969 caused models to disassociate themselves from interfaces, it is now possible that an
            VideoFullscreenInterfaceAVKit can have a nil model. We should null-check, not ASSERT, now that the
            assertion no longer holds true.

            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (-[WebAVPlayerLayer layoutSublayers]):
            (-[WebAVPlayerLayer resolveBounds]):
            (-[WebAVPlayerLayer setVideoGravity:]):

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234002. rdar://problem/42432954

    REGRESSION(r233926): media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html is a TIMEOUT failure
    https://bugs.webkit.org/show_bug.cgi?id=187813
    
    Reviewed by Jon Lee.
    
    In r233926, we changed the behavior of entering PiP to exit fullscreen only after entering PiP completes. The
    test in question will immediately request "inline" presentation mode once the PiP animation begins, and thus
    it's asking to "exit fullscreen" when both in standard fullscreen and also in PiP. The fix is not to bail out
    early if we're in standard (element) fullscreen, but to allow the remaining steps to complete and exit PiP as
    well.
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::exitFullscreen):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234002 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Jer Noble  <jer.noble@apple.com>

            REGRESSION(r233926): media/modern-media-controls/media-controller/media-controller-inline-to-fullscreen-to-pip-to-inline.html is a TIMEOUT failure
            https://bugs.webkit.org/show_bug.cgi?id=187813

            Reviewed by Jon Lee.

            In r233926, we changed the behavior of entering PiP to exit fullscreen only after entering PiP completes. The
            test in question will immediately request "inline" presentation mode once the PiP animation begins, and thus
            it's asking to "exit fullscreen" when both in standard fullscreen and also in PiP. The fix is not to bail out
            early if we're in standard (element) fullscreen, but to allow the remaining steps to complete and exit PiP as
            well.

            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::exitFullscreen):

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234013. rdar://problem/42417130

    Crash under WebCore::DocumentWriter::addData()
    https://bugs.webkit.org/show_bug.cgi?id=187819
    <rdar://problem/41328743>
    
    Reviewed by Brady Eidson.
    
    When AppCache is used a DocumentLoader may start a NetworkLoad even though it has substitute data.
    In DocumentLoader::continueAfterContentPolicy(), if we have substitute data we commit this data
    and call finishLoad(). However, if the case where there was a NetworkLoad started, we'll send the
    ContinueDidReceiveResponse IPC back to the network process and it will start sending us data for
    the load. This could lead to crashes such as <rdar://problem/41328743> since the DocumentLoader
    has already committed data and finished loading when it gets the data from the network process.
    
    To address the issue, we now call clearMainResource() in continueAfterContentPolicy(), after we've
    decided to commit the substitute data. This effectively removes the DocumentLoader as a client of
    the CachedResource so that its will not be notified of following load progress. We do not cancel
    the load as other CachedResourceClients may be interested in the load (ApplicationCacheResourceLoader
    in particular, in order to update its cached data).
    
    * loader/DocumentLoader.cpp:
    (WebCore::DocumentLoader::continueAfterContentPolicy):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234013 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Chris Dumez  <cdumez@apple.com>

            Crash under WebCore::DocumentWriter::addData()
            https://bugs.webkit.org/show_bug.cgi?id=187819
            <rdar://problem/41328743>

            Reviewed by Brady Eidson.

            When AppCache is used a DocumentLoader may start a NetworkLoad even though it has substitute data.
            In DocumentLoader::continueAfterContentPolicy(), if we have substitute data we commit this data
            and call finishLoad(). However, if the case where there was a NetworkLoad started, we'll send the
            ContinueDidReceiveResponse IPC back to the network process and it will start sending us data for
            the load. This could lead to crashes such as <rdar://problem/41328743> since the DocumentLoader
            has already committed data and finished loading when it gets the data from the network process.

            To address the issue, we now call clearMainResource() in continueAfterContentPolicy(), after we've
            decided to commit the substitute data. This effectively removes the DocumentLoader as a client of
            the CachedResource so that its will not be notified of following load progress. We do not cancel
            the load as other CachedResourceClients may be interested in the load (ApplicationCacheResourceLoader
            in particular, in order to update its cached data).

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

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234007. rdar://problem/42417134

    Ensure DocumentTimeline is kept alive until the VM::whenIdle callback is called
    https://bugs.webkit.org/show_bug.cgi?id=187692
    
    Reviewed by Ryosuke Niwa.
    
    Ensure we keep the DocumentTimeline alive until the VM::whenIdle callback is called.
    
    * animation/DocumentTimeline.cpp:
    (WebCore::DocumentTimeline::currentTime):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234007 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Antoine Quint  <graouts@apple.com>

            Ensure DocumentTimeline is kept alive until the VM::whenIdle callback is called
            https://bugs.webkit.org/show_bug.cgi?id=187692

            Reviewed by Ryosuke Niwa.

            Ensure we keep the DocumentTimeline alive until the VM::whenIdle callback is called.

            * animation/DocumentTimeline.cpp:
            (WebCore::DocumentTimeline::currentTime):

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r234005. rdar://problem/42417113

    Setting foreground color when editing should take color-filter into account, and report the correct foreground color for collapsed selections
    https://bugs.webkit.org/show_bug.cgi?id=187778
    
    Reviewed by Ryosuke Niwa.
    Source/WebCore:
    
    Fix two aspects of editing with color-filter:
    
    1. When setting foreground color, inverse-transform the color through -apple-color-filter so that the user gets the color
       they chose when in Dark Mode. Tested by editing/style/exec-command-foreColor-with-color-filter.html.
    
    2. When retrieving the style of the collapsed selection, take color filter into account so that color picker
       reflects the color the users sees, instead of the content color. Tested by editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
    
    Add two additional tests that ensure that -apple-color-filter does not impact the NSAttributedString code
    path, since -apple-color-filter should not affect the behavior of Copy.
    
    Tests: editing/mac/attributed-string/attrib-string-colors-with-color-filter.html
           editing/mac/attributed-string/attrib-string-range-with-color-filter.html
           editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
           editing/style/exec-command-foreColor-with-color-filter.html
    
    * editing/EditingStyle.cpp:
    (WebCore::StyleChange::StyleChange):
    (WebCore::StyleChange::extractTextStyles):
    * editing/EditingStyle.h:
    * editing/cocoa/EditorCocoa.mm:
    (WebCore::Editor::fontAttributesForSelectionStart const):
    * platform/graphics/filters/FilterOperation.cpp:
    (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
    * platform/graphics/filters/FilterOperation.h:
    (WebCore::FilterOperation::inverseTransformColor const):
    * platform/graphics/filters/FilterOperations.cpp:
    (WebCore::FilterOperations::transformColor const):
    (WebCore::FilterOperations::inverseTransformColor const):
    * platform/graphics/filters/FilterOperations.h:
    
    LayoutTests:
    
    * editing/mac/attributed-string/attrib-string-colors-with-color-filter-expected.txt: Added.
    * editing/mac/attributed-string/attrib-string-colors-with-color-filter.html: Added.
    * editing/mac/attributed-string/attrib-string-range-with-color-filter-expected.txt: Added.
    * editing/mac/attributed-string/attrib-string-range-with-color-filter.html: Added.
    * editing/mac/attributed-string/attributed-string-for-typing-with-color-filter-expected.txt: Added.
    * editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html: Added.
    * editing/style/exec-command-foreColor-with-color-filter-expected.txt: Added.
    * editing/style/exec-command-foreColor-with-color-filter.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234005 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Simon Fraser  <simon.fraser@apple.com>

            Setting foreground color when editing should take color-filter into account, and report the correct foreground color for collapsed selections
            https://bugs.webkit.org/show_bug.cgi?id=187778

            Reviewed by Ryosuke Niwa.

            Fix two aspects of editing with color-filter:

            1. When setting foreground color, inverse-transform the color through -apple-color-filter so that the user gets the color
               they chose when in Dark Mode. Tested by editing/style/exec-command-foreColor-with-color-filter.html.

            2. When retrieving the style of the collapsed selection, take color filter into account so that color picker
               reflects the color the users sees, instead of the content color. Tested by editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html

            Add two additional tests that ensure that -apple-color-filter does not impact the NSAttributedString code
            path, since -apple-color-filter should not affect the behavior of Copy.

            Tests: editing/mac/attributed-string/attrib-string-colors-with-color-filter.html
                   editing/mac/attributed-string/attrib-string-range-with-color-filter.html
                   editing/mac/attributed-string/attributed-string-for-typing-with-color-filter.html
                   editing/style/exec-command-foreColor-with-color-filter.html

            * editing/EditingStyle.cpp:
            (WebCore::StyleChange::StyleChange):
            (WebCore::StyleChange::extractTextStyles):
            * editing/EditingStyle.h:
            * editing/cocoa/EditorCocoa.mm:
            (WebCore::Editor::fontAttributesForSelectionStart const):
            * platform/graphics/filters/FilterOperation.cpp:
            (WebCore::InvertLightnessFilterOperation::inverseTransformColor const):
            * platform/graphics/filters/FilterOperation.h:
            (WebCore::FilterOperation::inverseTransformColor const):
            * platform/graphics/filters/FilterOperations.cpp:
            (WebCore::FilterOperations::transformColor const):
            (WebCore::FilterOperations::inverseTransformColor const):
            * platform/graphics/filters/FilterOperations.h:

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233992. rdar://problem/42417109

    Update iOS fullscreen alert text again
    https://bugs.webkit.org/show_bug.cgi?id=187797
    rdar://problem/42373783
    
    Reviewed by Jer Noble.
    
    Source/WebCore:
    
    * English.lproj/Localizable.strings:
    
    Source/WebKit:
    
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (-[WKFullScreenViewController _showPhishingAlert]):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233992 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Jon Lee  <jonlee@apple.com>

            Update iOS fullscreen alert text again
            https://bugs.webkit.org/show_bug.cgi?id=187797
            rdar://problem/42373783

            Reviewed by Jer Noble.

            * English.lproj/Localizable.strings:

2018-07-20  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233982. rdar://problem/42389208

    Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
    https://bugs.webkit.org/show_bug.cgi?id=187793
    <rdar://problem/42308469>
    
    Patch by Antoine Quint <graouts@apple.com> on 2018-07-19
    Reviewed by Chris Dumez.
    
    Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::~HTMLMediaElement):
    (WebCore::HTMLMediaElement::contextDestroyed):
    (WebCore::HTMLMediaElement::stop):
    (WebCore::HTMLMediaElement::suspend):
    (WebCore::HTMLMediaElement::resume):
    * html/HTMLMediaElement.h:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233982 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Antoine Quint  <graouts@apple.com>

            Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
            https://bugs.webkit.org/show_bug.cgi?id=187793
            <rdar://problem/42308469>

            Reviewed by Chris Dumez.

            Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().

            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::~HTMLMediaElement):
            (WebCore::HTMLMediaElement::contextDestroyed):
            (WebCore::HTMLMediaElement::stop):
            (WebCore::HTMLMediaElement::suspend):
            (WebCore::HTMLMediaElement::resume):
            * html/HTMLMediaElement.h:

2018-07-19  Babak Shafiei  <bshafiei@apple.com>

        Revert r233982. rdar://problem/42389208

2018-07-19  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233982. rdar://problem/42389208

    Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
    https://bugs.webkit.org/show_bug.cgi?id=187793
    <rdar://problem/42308469>
    
    Patch by Antoine Quint <graouts@apple.com> on 2018-07-19
    Reviewed by Chris Dumez.
    
    Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::~HTMLMediaElement):
    (WebCore::HTMLMediaElement::contextDestroyed):
    (WebCore::HTMLMediaElement::stop):
    (WebCore::HTMLMediaElement::suspend):
    (WebCore::HTMLMediaElement::resume):
    * html/HTMLMediaElement.h:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233982 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-19  Antoine Quint  <graouts@apple.com>

            Hitting RELEASE_ASSERT(!m_activeDOMObjectAdditionForbidden) under HTMLMediaElement::resume()
            https://bugs.webkit.org/show_bug.cgi?id=187793
            <rdar://problem/42308469>

            Reviewed by Chris Dumez.

            Ensure we do not call JS under resume(), which would happen as a result of calling configureMediaControls() in prepareForLoad().

            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::~HTMLMediaElement):
            (WebCore::HTMLMediaElement::contextDestroyed):
            (WebCore::HTMLMediaElement::stop):
            (WebCore::HTMLMediaElement::suspend):
            (WebCore::HTMLMediaElement::resume):
            * html/HTMLMediaElement.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233915. rdar://problem/42345407

    Add SPI to defer running async script until after document load
    https://bugs.webkit.org/show_bug.cgi?id=187748
    <rdar://problem/42317378>
    
    Reviewed by Ryosuke Niwa and Tim Horton.
    
    Source/WebCore:
    
    On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
    the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
    until after document load (i.e. the same timing as DOMContentLoaded).
    
    This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
    until after document load; this, in combination with the parser yielding token introduced in r233891, allows
    Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
    most article-like pages. See below for more details.
    
    Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument
    
    * dom/Document.cpp:
    (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
    (WebCore::Document::finishedParsing):
    
    Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.
    
    * dom/Document.h:
    * dom/ScriptRunner.cpp:
    (WebCore::ScriptRunner::documentFinishedParsing):
    
    When the document is finished parsing, kick off the script execution timer if needed to run any async script
    that has been deferred.
    
    (WebCore::ScriptRunner::notifyFinished):
    (WebCore::ScriptRunner::timerFired):
    
    Instead of always taking from the list of async scripts to execute, check our document to see whether we should
    defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.
    
    * dom/ScriptRunner.h:
    * page/Settings.yaml:
    
    Add a WebCore setting for this behavior.
    
    Source/WebKit:
    
    Add plumbing for a new ShouldDeferAsynchronousScriptsUntilAfterDocumentLoad configuration that determines
    whether async script execution should be deferred until document load (i.e. DOMContentLoaded). This
    configuration defaults to NO on all platforms. See WebCore ChangeLog for more detail.
    
    * Shared/WebPreferences.yaml:
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _initializeWithConfiguration:]):
    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
    (-[WKWebViewConfiguration init]):
    (-[WKWebViewConfiguration copyWithZone:]):
    (-[WKWebViewConfiguration _shouldDeferAsynchronousScriptsUntilAfterDocumentLoad]):
    (-[WKWebViewConfiguration _setShouldDeferAsynchronousScriptsUntilAfterDocumentLoad:]):
    * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
    
    Tools:
    
    Add an API test to verify that when the deferred async script configuration is set, async scripts will be
    executed after the DOMContentLoaded event.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/RunScriptAfterDocumentLoad.mm: Added.
    (TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233915 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Wenson Hsieh  <wenson_hsieh@apple.com>

            Add SPI to defer running async script until after document load
            https://bugs.webkit.org/show_bug.cgi?id=187748
            <rdar://problem/42317378>

            Reviewed by Ryosuke Niwa and Tim Horton.

            On watchOS, we currently observe that time-consuming async scripts can block the first paint of Reader, leaving
            the user with a blank screen for tens of seconds. One way to mitigate this is to defer async script execution
            until after document load (i.e. the same timing as DOMContentLoaded).

            This patch introduces an SPI configuration allowing internal clients to defer execution of asynchronous script
            until after document load; this, in combination with the parser yielding token introduced in r233891, allows
            Safari on watchOS to avoid being blocked on slow script execution before the first paint of the Reader page on
            most article-like pages. See below for more details.

            Test: RunScriptAfterDocumentLoad.ExecutionOrderOfScriptsInDocument

            * dom/Document.cpp:
            (WebCore::Document::shouldDeferAsynchronousScriptsUntilParsingFinishes const):
            (WebCore::Document::finishedParsing):

            Notify ScriptRunner when the Document has finished parsing, and is about to fire DOMContentLoaded.

            * dom/Document.h:
            * dom/ScriptRunner.cpp:
            (WebCore::ScriptRunner::documentFinishedParsing):

            When the document is finished parsing, kick off the script execution timer if needed to run any async script
            that has been deferred.

            (WebCore::ScriptRunner::notifyFinished):
            (WebCore::ScriptRunner::timerFired):

            Instead of always taking from the list of async scripts to execute, check our document to see whether we should
            defer this until after document load. If so, ignore `m_scriptsToExecuteSoon`.

            * dom/ScriptRunner.h:
            * page/Settings.yaml:

            Add a WebCore setting for this behavior.

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233891. rdar://problem/42345327

    Add an SPI hook to allow clients to yield document parsing and script execution
    https://bugs.webkit.org/show_bug.cgi?id=187682
    <rdar://problem/42207453>
    
    Reviewed by Ryosuke Niwa.
    
    Source/WebCore:
    
    Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
    including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
    again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
    and we don't eat the additional cost of a web process launch if prewarming fails.
    
    However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
    original page may contend with work being done to load and render the Reader page. This is especially bad when
    the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
    the page is available, but before it has finished loading the Reader page. The result is that script on the
    original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
    apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).
    
    To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
    a document. This capability is surfaced in the form of an opaque token which clients may request from a
    WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
    scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
    active tokens on the document causes it to stop yielding and resume execution of scripts if needed.
    
    Tests:  ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
            ParserYieldTokenTests.TakeMultipleParserYieldTokens
            ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
            ParserYieldTokenTests.AsyncScriptRunsWhenFetched
    
    * dom/Document.cpp:
    (WebCore::Document::implicitOpen):
    
    If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
    start yielding immediately after creation.
    
    (WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
    (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
    * dom/Document.h:
    
    Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
    have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
    parser yield count (respectively).
    
    (WebCore::Document::createParserYieldToken):
    (WebCore::Document::hasActiveParserYieldToken const):
    * dom/DocumentParser.h:
    (WebCore::DocumentParser::didBeginYieldingParser):
    (WebCore::DocumentParser::didEndYieldingParser):
    
    Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
    parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
    script.
    
    * dom/ScriptRunner.cpp:
    (WebCore::ScriptRunner::resume):
    (WebCore::ScriptRunner::notifyFinished):
    * dom/ScriptRunner.h:
    (WebCore::ScriptRunner::didBeginYieldingParser):
    (WebCore::ScriptRunner::didEndYieldingParser):
    
    Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
    and resume.
    
    * html/parser/HTMLDocumentParser.cpp:
    (WebCore::HTMLDocumentParser::didBeginYieldingParser):
    (WebCore::HTMLDocumentParser::didEndYieldingParser):
    
    Plumb to didBegin/didEnd calls to the HTMLParserScheduler.
    
    * html/parser/HTMLDocumentParser.h:
    * html/parser/HTMLParserScheduler.cpp:
    (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
    * html/parser/HTMLParserScheduler.h:
    (WebCore::HTMLParserScheduler::shouldYieldBeforeToken):
    
    Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
    parser yield token.
    
    (WebCore::HTMLParserScheduler::isScheduledForResume const):
    
    Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
    incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
    parser is no longer scheduled to pump its tokenizer.
    
    (WebCore::HTMLParserScheduler::didBeginYieldingParser):
    (WebCore::HTMLParserScheduler::didEndYieldingParser):
    
    When the Document begins yielding due to the documet having active tokens or ends yielding after the document
    loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
    reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
    to resume, we'll never get the document load or load events after relinquishing the yield token.
    
    Source/WebKit:
    
    Add hooks to WKDOMDocument to create and return an internal WKDOMDocumentParserYieldToken object, whose lifetime
    is tied to a document parser yield token. See WebCore ChangeLog for more detail.
    
    * WebProcess/InjectedBundle/API/mac/WKDOMDocument.h:
    * WebProcess/InjectedBundle/API/mac/WKDOMDocument.mm:
    (-[WKDOMDocumentParserYieldToken initWithDocument:]):
    (-[WKDOMDocument parserYieldToken]):
    
    Tools:
    
    Add a few tests to exercise the new document yield token SPI, verifying that clients can use the SPI to defer
    document load, and that doing so doesn't cause deferred `script` to execute in the wrong order (i.e. before
    synchronous script, or after "DOMContentLoaded").
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenPlugIn.mm: Added.
    (-[ParserYieldTokenPlugIn takeDocumentParserTokenAfterCommittingLoad]):
    (-[ParserYieldTokenPlugIn releaseDocumentParserToken]):
    (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didCommitLoadForFrame:]):
    (-[ParserYieldTokenPlugIn webProcessPlugIn:didCreateBrowserContextController:]):
    (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didFinishDocumentLoadForFrame:]):
    (-[ParserYieldTokenPlugIn webProcessPlugInBrowserContextController:didFinishLoadForFrame:]):
    
    Add an injected bundle object that knows how to take and release multiple document parser yield tokens.
    
    * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.h: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/ParserYieldTokenTests.mm: Added.
    (+[ParserYieldTokenTestWebView webView]):
    (-[ParserYieldTokenTestWebView bundle]):
    (-[ParserYieldTokenTestWebView schemeHandler]):
    (-[ParserYieldTokenTestWebView didFinishDocumentLoad]):
    (-[ParserYieldTokenTestWebView didFinishLoad]):
    (waitForDelay):
    (TEST):
    * TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.h: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/TestURLSchemeHandler.mm: Added.
    (-[TestURLSchemeHandler webView:startURLSchemeTask:]):
    (-[TestURLSchemeHandler webView:stopURLSchemeTask:]):
    (-[TestURLSchemeHandler setStartURLSchemeTaskHandler:]):
    (-[TestURLSchemeHandler startURLSchemeTaskHandler]):
    (-[TestURLSchemeHandler setStopURLSchemeTaskHandler:]):
    (-[TestURLSchemeHandler stopURLSchemeTaskHandler]):
    
    Add a new test helper class to handle custom schemes via a block-based API.
    
    * TestWebKitAPI/Tests/WebKitCocoa/text-with-async-script.html: Added.
    
    New test HTML page that contains a deferred script element, a synchronous script element, another deferred
    script element, and then some text, images, and links.
    
    * TestWebKitAPI/Tests/WebKitCocoa/text-with-deferred-script.html: Added.
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233891 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-17  Wenson Hsieh  <wenson_hsieh@apple.com>

            Add an SPI hook to allow clients to yield document parsing and script execution
            https://bugs.webkit.org/show_bug.cgi?id=187682
            <rdar://problem/42207453>

            Reviewed by Ryosuke Niwa.

            Using a single web process for both the Reader page and original web page on watchOS has multiple benefits,
            including: (1) allowing the user to bail out of Reader and view the original web page without having to load it
            again, and (2) improving the bringup time of the Reader page, since subresources are already cached in process
            and we don't eat the additional cost of a web process launch if prewarming fails.

            However, this has some drawbacks as well, one of which is that main thread work being done on behalf of the
            original page may contend with work being done to load and render the Reader page. This is especially bad when
            the page is in the middle of executing heavy script after Safari has already detected that the Reader version of
            the page is available, but before it has finished loading the Reader page. The result is that script on the
            original page may block the first paint of the Reader page (on New York Times articles, this often leads to an
            apparent page load time of 25-35 seconds before the user sees anything besides a blank screen).

            To mitigate this, we introduce a way for injected bundle clients to yield parsing and async script execution on
            a document. This capability is surfaced in the form of an opaque token which clients may request from a
            WKDOMDocument. Construction of the token causes the document to begin yielding and defer execution of previously
            scheduled scripts, only if there were no active tokens on the document already. Similarly, destruction of all
            active tokens on the document causes it to stop yielding and resume execution of scripts if needed.

            Tests:  ParserYieldTokenTests.PreventDocumentLoadByTakingParserYieldToken
                    ParserYieldTokenTests.TakeMultipleParserYieldTokens
                    ParserYieldTokenTests.DeferredScriptExecutesBeforeDocumentLoadWhenTakingParserYieldToken
                    ParserYieldTokenTests.AsyncScriptRunsWhenFetched

            * dom/Document.cpp:
            (WebCore::Document::implicitOpen):

            If the parser yield token was taken before the document's parser was created, tell the parser's scheduler to
            start yielding immediately after creation.

            (WebCore::DocumentParserYieldToken::DocumentParserYieldToken):
            (WebCore::DocumentParserYieldToken::~DocumentParserYieldToken):
            * dom/Document.h:

            Introduce a parser yield count to Document; as long as this count is greater than 0, we consider the Document to
            have active yield tokens. When constructing or destroying a ParserYieldToken, we increment and decrement the
            parser yield count (respectively).

            (WebCore::Document::createParserYieldToken):
            (WebCore::Document::hasActiveParserYieldToken const):
            * dom/DocumentParser.h:
            (WebCore::DocumentParser::didBeginYieldingParser):
            (WebCore::DocumentParser::didEndYieldingParser):

            Hooks for Document to tell its parser that we've started or finished yielding. This updates a flag on the
            parser's scheduler which is consulted when we determine whether to yield before a pumping token or executing
            script.

            * dom/ScriptRunner.cpp:
            (WebCore::ScriptRunner::resume):
            (WebCore::ScriptRunner::notifyFinished):
            * dom/ScriptRunner.h:
            (WebCore::ScriptRunner::didBeginYieldingParser):
            (WebCore::ScriptRunner::didEndYieldingParser):

            Hooks for Document to tell its ScriptRunner that we've started or finished yielding. These wrap calls to suspend
            and resume.

            * html/parser/HTMLDocumentParser.cpp:
            (WebCore::HTMLDocumentParser::didBeginYieldingParser):
            (WebCore::HTMLDocumentParser::didEndYieldingParser):

            Plumb to didBegin/didEnd calls to the HTMLParserScheduler.

            * html/parser/HTMLDocumentParser.h:
            * html/parser/HTMLParserScheduler.cpp:
            (WebCore::HTMLParserScheduler::shouldYieldBeforeExecutingScript):
            * html/parser/HTMLParserScheduler.h:
            (WebCore::HTMLParserScheduler::shouldYieldBeforeToken):

            Consult a flag when determining whether to yield. This flag is set to true only while the document has an active
            parser yield token.

            (WebCore::HTMLParserScheduler::isScheduledForResume const):

            Consider the parser scheduler to be scheduled for resume if there are active tokens. Without this change, we
            incorrectly consider the document to be finished loading when we have yield tokens, since it appears that the
            parser is no longer scheduled to pump its tokenizer.

            (WebCore::HTMLParserScheduler::didBeginYieldingParser):
            (WebCore::HTMLParserScheduler::didEndYieldingParser):

            When the Document begins yielding due to the documet having active tokens or ends yielding after the document
            loses all of its yield tokens, update a flag on the parser scheduler. After we finish yielding, additionally
            reschedule the parser if needed to ensure that we continue parsing the document; without this additional change
            to resume, we'll never get the document load or load events after relinquishing the yield token.

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233936. rdar://problem/42354941

    Unreviewed API Test fix; restored a line inadventantly removed in r233926.
    
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233936 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Unreviewed API Test fix; restored a line inadventantly removed in r233926.

            * platform/mac/VideoFullscreenInterfaceMac.mm:
            (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233930. rdar://problem/42354941

    Unreviewed build fix after r233926; BOOL !== bool.
    
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233930 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            Unreviewed build fix after r233926; BOOL !== bool.

            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233926. rdar://problem/42354941

    PiP from Element Fullscreen should match AVKit's behavior
    https://bugs.webkit.org/show_bug.cgi?id=187623
    Source/WebCore:
    
    Reviewed by Jon Lee.
    
    PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:
    
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    
    Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():
    
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):
    
    Add VideoFullscreenModelClient virutal methods for PiP change notifications:
    
    * platform/cocoa/VideoFullscreenModel.h:
    (WebCore::VideoFullscreenModelClient::hasVideoChanged):
    (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
    (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
    (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
    (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
    * platform/cocoa/VideoFullscreenModelVideoElement.h:
    * platform/cocoa/VideoFullscreenModelVideoElement.mm:
    (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
    (VideoFullscreenModelVideoElement::willExitPictureInPicture):
    (VideoFullscreenModelVideoElement::didExitPictureInPicture):
    (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
    * platform/ios/VideoFullscreenInterfaceAVKit.h:
    * platform/ios/VideoFullscreenInterfaceAVKit.mm:
    (-[WebAVPlayerLayer layoutSublayers]):
    (-[WebAVPlayerLayer resolveBounds]):
    (-[WebAVPlayerLayer setVideoGravity:]):
    (VideoFullscreenInterfaceAVKit::setupFullscreen):
    (VideoFullscreenInterfaceAVKit::presentingViewController):
    (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
    (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
    (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
    (VideoFullscreenInterfaceAVKit::doSetup):
    * platform/ios/WebVideoFullscreenControllerAVKit.mm:
    (VideoFullscreenControllerContext::willEnterPictureInPicture):
    (VideoFullscreenControllerContext::didEnterPictureInPicture):
    (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
    (VideoFullscreenControllerContext::willExitPictureInPicture):
    (VideoFullscreenControllerContext::didExitPictureInPicture):
    (VideoFullscreenControllerContext::failedToExitPictureInPicture):
    * platform/mac/VideoFullscreenInterfaceMac.h:
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
    * platform/mac/VideoFullscreenInterfaceMac.mm:
    (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
    (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
    (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
    (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
    (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
    (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
    
    Source/WebCore/PAL:
    
    Reviewed by Jon Lee.
    
    * pal/spi/mac/PIPSPI.h:
    
    Source/WebKit:
    
    Reviewed by Jon Lee.
    
    * UIProcess/Cocoa/PlaybackSessionManagerProxy.h:
    (WebKit::PlaybackSessionManagerProxy::controlsManagerContextId const):
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.h:
    * UIProcess/Cocoa/VideoFullscreenManagerProxy.mm:
    (WebKit::VideoFullscreenModelContext::willEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToEnterPictureInPicture):
    (WebKit::VideoFullscreenModelContext::willExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::didExitPictureInPicture):
    (WebKit::VideoFullscreenModelContext::failedToExitPictureInPicture):
    (WebKit::VideoFullscreenManagerProxy::controlsManagerInterface):
    * UIProcess/ios/fullscreen/WKFullScreenViewController.mm:
    (WKFullScreenViewControllerVideoFullscreenModelClient::setParent):
    (WKFullScreenViewControllerVideoFullscreenModelClient::setInterface):
    (WKFullScreenViewControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenViewController initWithWebView:]):
    (-[WKFullScreenViewController dealloc]):
    (-[WKFullScreenViewController videoControlsManagerDidChange]):
    (-[WKFullScreenViewController ensurePiPAnimator]):
    (-[WKFullScreenViewController willEnterPictureInPicture]):
    (-[WKFullScreenViewController didEnterPictureInPicture]):
    (-[WKFullScreenViewController failedToEnterPictureInPicture]):
    (-[WKFullScreenViewController loadView]):
    (-[WKFullScreenViewController viewWillAppear:]):
    * UIProcess/Cocoa/WebViewImpl.mm:
    (WebKit::WebViewImpl::videoControlsManagerDidChange):
    * UIProcess/mac/WKFullScreenWindowController.h:
    * UIProcess/mac/WKFullScreenWindowController.mm:
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setParent):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::setInterface):
    (WebKit::WKFullScreenWindowControllerVideoFullscreenModelClient::interface const):
    (-[WKFullScreenWindowController initWithWindow:webView:page:]):
    (-[WKFullScreenWindowController dealloc]):
    (-[WKFullScreenWindowController videoControlsManagerDidChange]):
    (-[WKFullScreenWindowController willEnterPictureInPicture]):
    
    Tools:
    
    <rdar://problem/41212379>
    
    Reviewed by Jon Lee.
    
    * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj:
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.html: Added.
    * TestWebKitAPI/Tests/WebKitCocoa/ExitFullscreenOnEnterPiP.mm: Added.
    (-[ExitFullscreenOnEnterPiPUIDelegate _webView:hasVideoInPictureInPictureDidChange:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidEnterFullscreen:]):
    (-[ExitFullscreenOnEnterPiPUIDelegate _webViewDidExitFullscreen:]):
    (TestWebKitAPI::TEST):
    
    LayoutTests:
    
    Reviewed by Jon Lee.
    
    * TestExpectations:
    * media/fullscreen-video-going-into-pip-expected.txt: Removed.
    * media/fullscreen-video-going-into-pip.html: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip-expected.txt: Removed.
    * media/video-contained-in-fullscreen-element-going-into-pip.html: Removed.
    * platform/mac-wk2/TestExpectations:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233926 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-18  Jer Noble  <jer.noble@apple.com>

            PiP from Element Fullscreen should match AVKit's behavior
            https://bugs.webkit.org/show_bug.cgi?id=187623

            Reviewed by Jon Lee.

            PiP behavior should be defined at the WebKit2 level, and not in HTMLMediaElement:

            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::enterFullscreen):

            Add an accessor for pictureInPictureWasStartedWhenEnteringBackground():

            * platform/cocoa/VideoFullscreenModelVideoElement.mm:
            (VideoFullscreenInterfaceAVKit::pictureInPictureWasStartedWhenEnteringBackground const):

            Add VideoFullscreenModelClient virutal methods for PiP change notifications:

            * platform/cocoa/VideoFullscreenModel.h:
            (WebCore::VideoFullscreenModelClient::hasVideoChanged):
            (WebCore::VideoFullscreenModelClient::videoDimensionsChanged):
            (WebCore::VideoFullscreenModelClient::willEnterPictureInPicture):
            (WebCore::VideoFullscreenModelClient::didEnterPictureInPicture):
            (WebCore::VideoFullscreenModelClient::failedToEnterPictureInPicture):
            (WebCore::VideoFullscreenModelClient::willExitPictureInPicture):
            (WebCore::VideoFullscreenModelClient::didExitPictureInPicture):
            (WebCore::VideoFullscreenModelClient::failedToExitPictureInPicture):
            * platform/cocoa/VideoFullscreenModelVideoElement.h:
            * platform/cocoa/VideoFullscreenModelVideoElement.mm:
            (VideoFullscreenModelVideoElement::willEnterPictureInPicture):
            (VideoFullscreenModelVideoElement::didEnterPictureInPicture):
            (VideoFullscreenModelVideoElement::failedToEnterPictureInPicture):
            (VideoFullscreenModelVideoElement::willExitPictureInPicture):
            (VideoFullscreenModelVideoElement::didExitPictureInPicture):
            (VideoFullscreenModelVideoElement::failedToExitPictureInPicture):
            * platform/ios/VideoFullscreenInterfaceAVKit.h:
            * platform/ios/VideoFullscreenInterfaceAVKit.mm:
            (-[WebAVPlayerLayer layoutSublayers]):
            (-[WebAVPlayerLayer resolveBounds]):
            (-[WebAVPlayerLayer setVideoGravity:]):
            (VideoFullscreenInterfaceAVKit::setupFullscreen):
            (VideoFullscreenInterfaceAVKit::presentingViewController):
            (VideoFullscreenInterfaceAVKit::willStartPictureInPicture):
            (VideoFullscreenInterfaceAVKit::didStartPictureInPicture):
            (VideoFullscreenInterfaceAVKit::failedToStartPictureInPicture):
            (VideoFullscreenInterfaceAVKit::willStopPictureInPicture):
            (VideoFullscreenInterfaceAVKit::didStopPictureInPicture):
            (VideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason):
            (VideoFullscreenInterfaceAVKit::doSetup):
            * platform/ios/WebVideoFullscreenControllerAVKit.mm:
            (VideoFullscreenControllerContext::willEnterPictureInPicture):
            (VideoFullscreenControllerContext::didEnterPictureInPicture):
            (VideoFullscreenControllerContext::failedToEnterPictureInPicture):
            (VideoFullscreenControllerContext::willExitPictureInPicture):
            (VideoFullscreenControllerContext::didExitPictureInPicture):
            (VideoFullscreenControllerContext::failedToExitPictureInPicture):
            * platform/mac/VideoFullscreenInterfaceMac.h:
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen): Deleted.
            * platform/mac/VideoFullscreenInterfaceMac.mm:
            (-[WebVideoFullscreenInterfaceMacObjC invalidateFullscreenState]):
            (-[WebVideoFullscreenInterfaceMacObjC exitPIP]):
            (-[WebVideoFullscreenInterfaceMacObjC exitPIPAnimatingToRect:inWindow:]):
            (-[WebVideoFullscreenInterfaceMacObjC pipShouldClose:]):
            (-[WebVideoFullscreenInterfaceMacObjC pipDidClose:]):
            (WebCore::VideoFullscreenInterfaceMac::enterFullscreen):
            (WebCore::VideoFullscreenInterfaceMac::exitFullscreen):
            (WebCore::VideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode):
            (WebCore::VideoFullscreenInterfaceMac::requestHideAndExitFullscreen):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233903. rdar://problem/42345392

    Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().
    https://bugs.webkit.org/show_bug.cgi?id=187637
    <rdar://problem/42157915>
    
    Reviewed by Dean Jackson.
    
    Source/WebCore:
    
    Test: webanimations/empty-keyframes-crash.html
    
    Unlike what we assumed, it is possible to have a non-declarative animation without any parsed keyframes.
    This can happen as a result of calling `Element.animate({}, …)`. In this case, we want to return a null
    value in timingFunctionForKeyframeAtIndex() so we update the call site in setAnimatedPropertiesInStyle()
    which is the only place where we didn't check for a null value and didn't know for sure that there would
    be parsed keyframes to rely on in the case of a WebAnimation instance.
    
    * animation/KeyframeEffectReadOnly.cpp:
    (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
    (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):
    
    LayoutTests:
    
    Add a new test that would crash prior to this change.
    
    * webanimations/empty-keyframes-crash-expected.txt: Added.
    * webanimations/empty-keyframes-crash.html: Added.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233903 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-17  Antoine Quint  <graouts@apple.com>

            Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().
            https://bugs.webkit.org/show_bug.cgi?id=187637
            <rdar://problem/42157915>

            Reviewed by Dean Jackson.

            Test: webanimations/empty-keyframes-crash.html

            Unlike what we assumed, it is possible to have a non-declarative animation without any parsed keyframes.
            This can happen as a result of calling `Element.animate({}, …)`. In this case, we want to return a null
            value in timingFunctionForKeyframeAtIndex() so we update the call site in setAnimatedPropertiesInStyle()
            which is the only place where we didn't check for a null value and didn't know for sure that there would
            be parsed keyframes to rely on in the case of a WebAnimation instance.

            * animation/KeyframeEffectReadOnly.cpp:
            (WebCore::KeyframeEffectReadOnly::setAnimatedPropertiesInStyle):
            (WebCore::KeyframeEffectReadOnly::timingFunctionForKeyframeAtIndex):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233883. rdar://problem/42345112

    Correctly adjust scroll offsets when a page is zoomed
    https://bugs.webkit.org/show_bug.cgi?id=187673
    <rdar://problem/41712829>
    
    Reviewed by Wenson Hsieh.
    
    Will add test later.
    
    Make sure that distance is scaled by the pageScaleFactor, to
    make sure that we scroll correctly when we are zoomed in.
    
    * page/ios/EventHandlerIOS.mm:
    (WebCore::autoscrollAdjustmentFactorForScreenBoundaries):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233883 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Megan Gardner  <megan_gardner@apple.com>

            Correctly adjust scroll offsets when a page is zoomed
            https://bugs.webkit.org/show_bug.cgi?id=187673
            <rdar://problem/41712829>

            Reviewed by Wenson Hsieh.

            Will add test later.

            Make sure that distance is scaled by the pageScaleFactor, to
            make sure that we scroll correctly when we are zoomed in.

            * page/ios/EventHandlerIOS.mm:
            (WebCore::autoscrollAdjustmentFactorForScreenBoundaries):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233879. rdar://problem/42345389

    Release assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
    https://bugs.webkit.org/show_bug.cgi?id=187713
    <rdar://problem/41759548>
    
    Reviewed by Simon Fraser.
    
    Turn this into a debug assertion in WebKit1 on iOS since JSC API doesn't grab the web thread lock,
    which means that Timer can get destroyed without the web thread lock in the main thread.
    
    * platform/Timer.cpp:
    (WebCore::TimerBase::~TimerBase):
    (WebCore::TimerBase::setNextFireTime):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233879 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Ryosuke Niwa  <rniwa@webkit.org>

            Release assert in ~TimerBase is getting hit in WK1 apps which uses JSC API directly
            https://bugs.webkit.org/show_bug.cgi?id=187713
            <rdar://problem/41759548>

            Reviewed by Simon Fraser.

            Turn this into a debug assertion in WebKit1 on iOS since JSC API doesn't grab the web thread lock,
            which means that Timer can get destroyed without the web thread lock in the main thread.

            * platform/Timer.cpp:
            (WebCore::TimerBase::~TimerBase):
            (WebCore::TimerBase::setNextFireTime):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233877. rdar://problem/42344047

    Add color filter for transforming colors in Dark Mode
    https://bugs.webkit.org/show_bug.cgi?id=187717
    Source/WebCore:
    
    rdar://problem/41146650
    
    Reviewed by Dean Jackson.
    
    Add a new filter function for use in -apple-color-filter for transforming colors
    when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
    It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
    of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().
    
    Test: css3/color-filters/color-filter-apple-invert-lightness.html
    
    * css/CSSComputedStyleDeclaration.cpp:
    (WebCore::ComputedStyleExtractor::valueForFilter):
    * css/CSSValueKeywords.in:
    * css/StyleResolver.cpp:
    (WebCore::filterOperationForType):
    (WebCore::StyleResolver::createFilterOperations):
    * css/parser/CSSPropertyParser.cpp:
    (WebCore::CSSPropertyParser::parseSingleValue):
    * css/parser/CSSPropertyParserHelpers.cpp:
    (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
    (WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
    (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
    (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
    (WebCore::CSSPropertyParserHelpers::consumeFilter):
    (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
    * css/parser/CSSPropertyParserHelpers.h:
    * page/FrameView.cpp:
    (WebCore::FrameView::paintContents):
    * platform/graphics/Color.cpp:
    * platform/graphics/ColorUtilities.cpp:
    (WebCore::sRGBToLinearComponents):
    (WebCore::linearToSRGBComponents):
    (WebCore::sRGBToLinearColorComponentForLuminance):
    (WebCore::luminance):
    (WebCore::sRGBToHSL):
    (WebCore::calcHue):
    (WebCore::HSLToSRGB):
    (WebCore::ColorMatrix::ColorMatrix):
    * platform/graphics/ColorUtilities.h:
    * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
    (PlatformCAFilters::filterValueForOperation):
    (PlatformCAFilters::colorMatrixValueForFilter):
    * platform/graphics/filters/FEColorMatrix.cpp:
    * platform/graphics/filters/FilterOperation.cpp:
    (WebCore::InvertLightnessFilterOperation::operator== const):
    (WebCore::InvertLightnessFilterOperation::blend):
    (WebCore::InvertLightnessFilterOperation::transformColor const):
    (WebCore::operator<<):
    * platform/graphics/filters/FilterOperation.h:
    * rendering/FilterEffectRenderer.cpp:
    (WebCore::FilterEffectRenderer::build):
    
    Source/WebKit:
    
    Reviewed by Dean Jackson.
    
    * Shared/WebCoreArgumentCoders.cpp:
    (IPC::ArgumentCoder<FilterOperation>::encode):
    (IPC::decodeFilterOperation):
    
    LayoutTests:
    
    rdar://problem/41146650
    
    Reviewed by Dean Jackson.
    
    * css3/color-filters/color-filter-apple-invert-lightness-expected.html: Added.
    * css3/color-filters/color-filter-apple-invert-lightness.html: Added.
    * css3/color-filters/color-filter-parsing-expected.txt:
    * css3/color-filters/color-filter-parsing.html:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233877 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Simon Fraser  <simon.fraser@apple.com>

            Add color filter for transforming colors in Dark Mode
            https://bugs.webkit.org/show_bug.cgi?id=187717
            rdar://problem/41146650

            Reviewed by Dean Jackson.

            Add a new filter function for use in -apple-color-filter for transforming colors
            when in Dark Mode. The filter is called apple-invert-lightness(), and takes no parameters.
            It's based on a lightness invert in HSL space, with some adjustments to improve the contrast
            of some colors on dark backgrounds, so does a much better job that using invert() with hue-rotate().

            Test: css3/color-filters/color-filter-apple-invert-lightness.html

            * css/CSSComputedStyleDeclaration.cpp:
            (WebCore::ComputedStyleExtractor::valueForFilter):
            * css/CSSValueKeywords.in:
            * css/StyleResolver.cpp:
            (WebCore::filterOperationForType):
            (WebCore::StyleResolver::createFilterOperations):
            * css/parser/CSSPropertyParser.cpp:
            (WebCore::CSSPropertyParser::parseSingleValue):
            * css/parser/CSSPropertyParserHelpers.cpp:
            (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
            (WebCore::CSSPropertyParserHelpers::isPixelFilterFunction):
            (WebCore::CSSPropertyParserHelpers::isColorFilterFunction):
            (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
            (WebCore::CSSPropertyParserHelpers::consumeFilter):
            (WebCore::CSSPropertyParserHelpers::isValidPrimitiveFilterFunction): Deleted.
            * css/parser/CSSPropertyParserHelpers.h:
            * page/FrameView.cpp:
            (WebCore::FrameView::paintContents):
            * platform/graphics/Color.cpp:
            * platform/graphics/ColorUtilities.cpp:
            (WebCore::sRGBToLinearComponents):
            (WebCore::linearToSRGBComponents):
            (WebCore::sRGBToLinearColorComponentForLuminance):
            (WebCore::luminance):
            (WebCore::sRGBToHSL):
            (WebCore::calcHue):
            (WebCore::HSLToSRGB):
            (WebCore::ColorMatrix::ColorMatrix):
            * platform/graphics/ColorUtilities.h:
            * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
            (PlatformCAFilters::filterValueForOperation):
            (PlatformCAFilters::colorMatrixValueForFilter):
            * platform/graphics/filters/FEColorMatrix.cpp:
            * platform/graphics/filters/FilterOperation.cpp:
            (WebCore::InvertLightnessFilterOperation::operator== const):
            (WebCore::InvertLightnessFilterOperation::blend):
            (WebCore::InvertLightnessFilterOperation::transformColor const):
            (WebCore::operator<<):
            * platform/graphics/filters/FilterOperation.h:
            * rendering/FilterEffectRenderer.cpp:
            (WebCore::FilterEffectRenderer::build):

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233872. rdar://problem/42345272

    Source/WebCore:
    [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
    https://bugs.webkit.org/show_bug.cgi?id=187375
    
    Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
    Reviewed by Simon Fraser.
    
    An immediate-paint transaction should force all the images which are pending
    decoding to be repainted.
    
    To do that, FrameView::paintControlTints() will be re-factored to a new
    generic function such that it takes PaintInvalidationReasons. The new function
    which is named 'traverseForPaintInvalidation' will traverse the render tree
    for a specific PaintInvalidationReasons.
    
    invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
    the underlying image and repaint all the clients which are waiting for the
    decoding to finish.
    
    * loader/cache/CachedImage.cpp:
    (WebCore::CachedImage::didRemoveClient):
    (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
    (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
    (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
    (WebCore::CachedImage::allClientsRemoved):
    (WebCore::CachedImage::clear):
    (WebCore::CachedImage::createImage):
    (WebCore::CachedImage::imageFrameAvailable):
    (WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
    * loader/cache/CachedImage.h:
    * page/FrameView.cpp:
    (WebCore::FrameView::paintScrollCorner):
    (WebCore::FrameView::updateControlTints):
    (WebCore::FrameView::traverseForPaintInvalidation):
    (WebCore::FrameView::adjustPageHeightDeprecated):
    (WebCore::FrameView::paintControlTints): Deleted.
    * page/FrameView.h:
    * platform/ScrollView.cpp:
    (WebCore::ScrollView::paint):
    * platform/Scrollbar.cpp:
    (WebCore::Scrollbar::paint):
    * platform/graphics/BitmapImage.h:
    * platform/graphics/GraphicsContext.cpp:
    (WebCore::GraphicsContext::GraphicsContext):
    * platform/graphics/GraphicsContext.h:
    (WebCore::GraphicsContext::performingPaintInvalidation const):
    (WebCore::GraphicsContext::invalidatingControlTints const):
    (WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
    (WebCore::GraphicsContext::updatingControlTints const): Deleted.
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintFillLayerExtended):
    * rendering/RenderImage.cpp:
    (WebCore::RenderImage::paintReplaced):
    (WebCore::RenderImage::paintAreaElementFocusRing):
    (WebCore::RenderImage::paintIntoRect):
    * rendering/RenderLayer.cpp:
    (WebCore::RenderLayer::paintScrollCorner):
    (WebCore::RenderLayer::paintResizer):
    (WebCore::RenderLayer::paintLayer):
    * rendering/RenderScrollbar.cpp:
    (WebCore::RenderScrollbar::paint):
    * rendering/RenderTheme.cpp:
    (WebCore::RenderTheme::paint):
    * testing/Internals.cpp:
    (WebCore::Internals::invalidateControlTints):
    (WebCore::Internals::paintControlTints): Deleted.
    * testing/Internals.h:
    * testing/Internals.idl:
    
    Source/WebKit:
    [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
    https://bugs.webkit.org/show_bug.cgi?id=187375
    
    Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
    Reviewed by Simon Fraser.
    
    For immediate-paint transaction, we should force all the images which are
    pending decoding to be repainted before building this transaction.
    
    * WebProcess/Plugins/PDF/PDFPlugin.mm:
    (WebKit::PDFPlugin::updateControlTints):
    * WebProcess/Plugins/PluginView.cpp:
    (WebKit::PluginView::paint):
    * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
    (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
    
    LayoutTests:
    [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the immediate-paint transaction
    https://bugs.webkit.org/show_bug.cgi?id=187375
    
    Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2018-07-16
    Reviewed by Simon Fraser.
    
    The Internals API paintControlTints() is now renamed to invalidateControlTints()
    to be consistent with the new enum values and with the new name of the
    C++ function.
    
    * fast/css/webkit-mask-crash-fieldset-legend.html:
    * fast/css/webkit-mask-crash-figure.html:
    * fast/css/webkit-mask-crash-table.html:
    * fast/css/webkit-mask-crash-td-2.html:
    * fast/css/webkit-mask-crash-td.html:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233872 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Said Abou-Hallawa  <sabouhallawa@apple.com>

            [iOS] When bringing MobileSafari to the foreground, images, which are pending decoding, won't be drawn into the flush immediate transaction
            https://bugs.webkit.org/show_bug.cgi?id=187375

            Reviewed by Simon Fraser.

            An immediate-paint transaction should force all the images which are pending
            decoding to be repainted.

            To do that, FrameView::paintControlTints() will be re-factored to a new
            generic function such that it takes PaintInvalidationReasons. The new function
            which is named 'traverseForPaintInvalidation' will traverse the render tree
            for a specific PaintInvalidationReasons.

            invalidateImagesWithAsyncDecodes() will stop the asynchronous decoding for
            the underlying image and repaint all the clients which are waiting for the
            decoding to finish.

            * loader/cache/CachedImage.cpp:
            (WebCore::CachedImage::didRemoveClient):
            (WebCore::CachedImage::isClientWaitingForAsyncDecoding const):
            (WebCore::CachedImage::addClientWaitingForAsyncDecoding):
            (WebCore::CachedImage::removeAllClientsWaitingForAsyncDecoding):
            (WebCore::CachedImage::allClientsRemoved):
            (WebCore::CachedImage::clear):
            (WebCore::CachedImage::createImage):
            (WebCore::CachedImage::imageFrameAvailable):
            (WebCore::CachedImage::addPendingImageDrawingClient): Deleted.
            * loader/cache/CachedImage.h:
            * page/FrameView.cpp:
            (WebCore::FrameView::paintScrollCorner):
            (WebCore::FrameView::updateControlTints):
            (WebCore::FrameView::traverseForPaintInvalidation):
            (WebCore::FrameView::adjustPageHeightDeprecated):
            (WebCore::FrameView::paintControlTints): Deleted.
            * page/FrameView.h:
            * platform/ScrollView.cpp:
            (WebCore::ScrollView::paint):
            * platform/Scrollbar.cpp:
            (WebCore::Scrollbar::paint):
            * platform/graphics/BitmapImage.h:
            * platform/graphics/GraphicsContext.cpp:
            (WebCore::GraphicsContext::GraphicsContext):
            * platform/graphics/GraphicsContext.h:
            (WebCore::GraphicsContext::performingPaintInvalidation const):
            (WebCore::GraphicsContext::invalidatingControlTints const):
            (WebCore::GraphicsContext::invalidatingImagesWithAsyncDecodes const):
            (WebCore::GraphicsContext::updatingControlTints const): Deleted.
            * rendering/RenderBoxModelObject.cpp:
            (WebCore::RenderBoxModelObject::paintFillLayerExtended):
            * rendering/RenderImage.cpp:
            (WebCore::RenderImage::paintReplaced):
            (WebCore::RenderImage::paintAreaElementFocusRing):
            (WebCore::RenderImage::paintIntoRect):
            * rendering/RenderLayer.cpp:
            (WebCore::RenderLayer::paintScrollCorner):
            (WebCore::RenderLayer::paintResizer):
            (WebCore::RenderLayer::paintLayer):
            * rendering/RenderScrollbar.cpp:
            (WebCore::RenderScrollbar::paint):
            * rendering/RenderTheme.cpp:
            (WebCore::RenderTheme::paint):
            * testing/Internals.cpp:
            (WebCore::Internals::invalidateControlTints):
            (WebCore::Internals::paintControlTints): Deleted.
            * testing/Internals.h:
            * testing/Internals.idl:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233870. rdar://problem/42344023

    Unreviewed attempt to fix the build.
    
    * rendering/RenderThemeMac.mm:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233870 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Ryan Haddad  <ryanhaddad@apple.com>

            Unreviewed attempt to fix the build.

            * rendering/RenderThemeMac.mm:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233869. rdar://problem/42344023

    Allow removal of white backgrounds
    https://bugs.webkit.org/show_bug.cgi?id=187574
    <rdar://problem/41146792>
    
    Reviewed by Simon Fraser.
    
    Source/WebCore:
    
    Add a drawing mode that turns white backgrounds into transparent
    regions, such that a hosting app can see through to its window.
    
    Test: css3/color-filters/punch-out-white-backgrounds.html
    
    * page/Settings.yaml: New Setting.
    
    * rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
    if the background is white and we are punching out backgrounds, which means
    that it will erase the destination.
    (WebCore::InlineFlowBox::paintBoxDecorations):
    * rendering/RenderBox.cpp:
    (WebCore::RenderBox::paintBackground): Ditto.
    * rendering/RenderTableCell.cpp:
    (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.
    
    * rendering/RenderBoxModelObject.cpp:
    (WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
    the composition mode if necessary.
    
    Source/WebKit:
    
    Add a new WebPreference for punching out white backgrounds.
    
    * Shared/WebPreferences.yaml:
    * UIProcess/API/C/WKPreferences.cpp:
    (WKPreferencesSetPunchOutWhiteBackgroundsInDarkMode):
    (WKPreferencesGetPunchOutWhiteBackgroundsInDarkMode):
    * UIProcess/API/C/WKPreferencesRefPrivate.h:
    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _initializeWithConfiguration:]):
    * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
    (-[WKWebViewConfiguration init]):
    (-[WKWebViewConfiguration copyWithZone:]):
    (-[WKWebViewConfiguration _punchOutWhiteBackgroundsInDarkMode]):
    (-[WKWebViewConfiguration _setPunchOutWhiteBackgroundsInDarkMode:]):
    * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
    
    Source/WebKitLegacy/mac:
    
    Add a new WebPreference for punching out white backgrounds.
    
    * WebView/WebPreferenceKeysPrivate.h:
    * WebView/WebPreferences.mm:
    (+[WebPreferences initialize]):
    (-[WebPreferences punchOutWhiteBackgroundsInDarkMode]):
    (-[WebPreferences setPunchOutWhiteBackgroundsInDarkMode:]):
    * WebView/WebPreferencesPrivate.h:
    * WebView/WebView.mm:
    (-[WebView _preferencesChanged:]):
    
    Tools:
    
    Add a new menu item for punching out white backgrounds in MiniBrowser.
    In WebKitTestRunner, expose the new setting and hook that up to
    drawing a background in the WebView.
    
    * MiniBrowser/mac/AppDelegate.m:
    (defaultConfiguration): Add _punchOutWhiteBackgroundsInDarkMode.
    
    * MiniBrowser/mac/SettingsController.h: Ditto.
    * MiniBrowser/mac/SettingsController.m:
    (-[SettingsController _populateMenu]):
    (-[SettingsController validateMenuItem:]):
    (-[SettingsController togglePunchOutWhiteBackgroundsInDarkMode:]):
    (-[SettingsController punchOutWhiteBackgroundsInDarkMode]):
    
    * MiniBrowser/mac/WK1BrowserWindowController.m:
    (-[WK1BrowserWindowController didChangeSettings]): Set the new preference.
    
    * WebKitTestRunner/PlatformWebView.h: Expose a drawsBackground property.
    * WebKitTestRunner/gtk/PlatformWebViewGtk.cpp: Null implementation.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    * WebKitTestRunner/wpe/PlatformWebViewWPE.cpp: Ditto.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    * WebKitTestRunner/ios/PlatformWebViewIOS.mm: Call into the WKWebView and
    set its SPI.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    * WebKitTestRunner/mac/PlatformWebViewMac.mm: Ditto.
    (WTR::PlatformWebView::drawsBackground const):
    (WTR::PlatformWebView::setDrawsBackground):
    
    * WebKitTestRunner/TestController.cpp: Reset and copy the new preference.
    (WTR::TestController::resetPreferencesToConsistentValues):
    (WTR::updateTestOptionsFromTestHeader):
    * WebKitTestRunner/TestOptions.h:
    (WTR::TestOptions::hasSameInitializationOptions const):
    
    * WebKitTestRunner/cocoa/TestControllerCocoa.mm:
    (WTR::TestController::platformCreateWebView): If the option for punching
    out the background was set, tell the WebView to not draw its background.
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233869 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-11  Dean Jackson  <dino@apple.com>

            Allow removal of white backgrounds
            https://bugs.webkit.org/show_bug.cgi?id=187574
            <rdar://problem/41146792>

            Reviewed by Simon Fraser.

            Add a drawing mode that turns white backgrounds into transparent
            regions, such that a hosting app can see through to its window.

            Test: css3/color-filters/punch-out-white-backgrounds.html

            * page/Settings.yaml: New Setting.

            * rendering/InlineFlowBox.cpp: Draw with a destination out blend mode
            if the background is white and we are punching out backgrounds, which means
            that it will erase the destination.
            (WebCore::InlineFlowBox::paintBoxDecorations):
            * rendering/RenderBox.cpp:
            (WebCore::RenderBox::paintBackground): Ditto.
            * rendering/RenderTableCell.cpp:
            (WebCore::RenderTableCell::paintBackgroundsBehindCell): Ditto.

            * rendering/RenderBoxModelObject.cpp:
            (WebCore::RenderBoxModelObject::paintFillLayerExtended): Save and restore
            the composition mode if necessary.

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233865. rdar://problem/42343023

    Fullscreen requires active document.
    https://bugs.webkit.org/show_bug.cgi?id=186226
    rdar://problem/36187413
    
    Patch by Jeremy Jones <jeremyj@apple.com> on 2018-07-16
    Reviewed by Jer Noble.
    
    Source/WebCore:
    
    Test: media/no-fullscreen-when-hidden.html
    
    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
    
    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.
    
    Document::hidden() can't be relied upon because it won't update while JavaScript spins.
    
    This change adds a sync call to the UI process to get the current UI visibility state.
    
    * dom/Document.cpp:
    (WebCore::Document::requestFullScreenForElement):
    * html/HTMLMediaElement.cpp:
    (WebCore::HTMLMediaElement::enterFullscreen):
    * page/ChromeClient.h:
    
    Source/WebKit:
    
    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
    
    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.
    
    Document::hidden() can't be relied upon because it won't update while JavaScript spins.
    
    This change adds a sync call to the UI process to get the current UI visibility state.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::getIsViewVisible):
    * UIProcess/WebPageProxy.h:
    * UIProcess/WebPageProxy.messages.in:
    * WebProcess/WebCoreSupport/WebChromeClient.cpp:
    (WebKit::WebChromeClient::isViewVisible):
    * WebProcess/WebCoreSupport/WebChromeClient.h:
    
    LayoutTests:
    
    This change guarantees the document to be visible for both element fullscreen and video fullscreen.
    
    User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
    because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
    be hidden.
    
    Document::hidden() can't be relied upon because it won't update while JavaScript spins.
    
    This change adds a sync call to the UI process to get the current UI visibility state.
    
    * media/no-fullscreen-when-hidden.html: Added.
    * media/video-test.js:
    (eventName.string_appeared_here.thunk):
    (runWithKeyDown):
    * platform/ios-wk1/TestExpectations:
    * platform/mac-wk1/TestExpectations:
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233865 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Jeremy Jones  <jeremyj@apple.com>

            Fullscreen requires active document.
            https://bugs.webkit.org/show_bug.cgi?id=186226
            rdar://problem/36187413

            Reviewed by Jer Noble.

            Test: media/no-fullscreen-when-hidden.html

            This change guarantees the document to be visible for both element fullscreen and video fullscreen.

            User gesture is not enough to guarantee that the document is visible when fullscreen is initiated
            because JavaScript can spin wait before initiating fullscreen. During that spin the page or window might
            be hidden.

            Document::hidden() can't be relied upon because it won't update while JavaScript spins.

            This change adds a sync call to the UI process to get the current UI visibility state.

            * dom/Document.cpp:
            (WebCore::Document::requestFullScreenForElement):
            * html/HTMLMediaElement.cpp:
            (WebCore::HTMLMediaElement::enterFullscreen):
            * page/ChromeClient.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233857. rdar://problem/42345036

    Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread
    https://bugs.webkit.org/show_bug.cgi?id=187702
    
    Reviewed by Youenn Fablet.
    
    Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since
    it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is
    ThreadSafeRefCounted and frequently passed to other threads.
    
    * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
    (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
    * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233857 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Chris Dumez  <cdumez@apple.com>

            Make sure LibWebRTCMediaEndpoint is always destroyed on the main thread
            https://bugs.webkit.org/show_bug.cgi?id=187702

            Reviewed by Youenn Fablet.

            Make sure LibWebRTCMediaEndpoint is always constructed and destructed on the main thread since
            it has a Timer data member and it would not be safe otherwise. LibWebRTCMediaEndpoint is
            ThreadSafeRefCounted and frequently passed to other threads.

            * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
            (WebCore::LibWebRTCMediaEndpoint::LibWebRTCMediaEndpoint):
            * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

2018-07-18  Babak Shafiei  <bshafiei@apple.com>

        Cherry-pick r233853. rdar://problem/42344991

    IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
    https://bugs.webkit.org/show_bug.cgi?id=187631
    <rdar://problem/42164227>
    
    Reviewed by Brady Eidson.
    
    Source/WebCore:
    
    When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin
    is that origin. Given that the origin may create IndexedDB from subframes, we should delete
    databases whose openingOrigin is that origin too.
    
    Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths.
    
    * Modules/indexeddb/server/IDBServer.cpp:
    (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):
    
    Source/WebKit:
    
    We need to return all origins, both openingOrigin and mainFrameOrigin, of IndexedDB so users
    could be better aware of which origins are using databases and decide what they want to
    remove.
    
    * StorageProcess/StorageProcess.cpp:
    (WebKit::StorageProcess::indexedDatabaseOrigins):
    * StorageProcess/StorageProcess.h:
    
    Tools:
    
    * TestWebKitAPI/Tests/WebKitCocoa/WebsiteDataStoreCustomPaths.mm:
    (TEST):
    
    
    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233853 268f45cc-cd09-0410-ab3c-d52691b4dbfc

    2018-07-16  Sihui Liu  <sihui_liu@apple.com>

            IndexedDB: closeAndDeleteDatabasesForOrigins should remove all databases for those origins
            https://bugs.webkit.org/show_bug.cgi?id=187631
            <rdar://problem/42164227>

            Reviewed by Brady Eidson.

            When asked to delete database for an origin, we deleted the databases whose mainFrameOrigin
            is that origin. Given that the origin may create IndexedDB from subframes, we should delete
            databases whose openingOrigin is that origin too.

            Covered by modified API test: WebKit.WebsiteDataStoreCustomPaths.

            * Modules/indexeddb/server/IDBServer.cpp:
            (WebCore::IDBServer::IDBServer::performCloseAndDeleteDatabasesForOrigins):

2018-07-16  Simon Fraser  <simon.fraser@apple.com>

        Shrink some font-related classes and enums
        https://bugs.webkit.org/show_bug.cgi?id=187686

        Reviewed by Myles Maxfield.
        
        Use enum class for enums in TextFlags.h and make them one byte big.

        Re-order members of Font to shrink it from 360 to 328 bytes.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator FontSmoothingMode const):
        (WebCore::CSSPrimitiveValue::operator FontSmallCaps const):
        (WebCore::CSSPrimitiveValue::operator TextRenderingMode const):
        * platform/graphics/Font.cpp:
        (WebCore::Font::Font):
        (WebCore::Font::verticalRightOrientationFont const):
        * platform/graphics/Font.h:
        * platform/graphics/FontCascade.cpp:
        (WebCore::offsetToMiddleOfGlyph):
        * platform/graphics/FontCascade.h:
        (WebCore::FontCascade::advancedTextRenderingMode const):
        * platform/graphics/FontCascadeFonts.cpp:
        (WebCore::FontCascadeFonts::glyphDataForSystemFallback):
        (WebCore::FontCascadeFonts::glyphDataForVariant):
        (WebCore::glyphPageFromFontRanges):
        * platform/graphics/FontDescription.cpp:
        (WebCore::FontCascadeDescription::FontCascadeDescription):
        * platform/graphics/FontDescription.h:
        (WebCore::FontDescription::setTextRenderingMode):
        (WebCore::FontDescription::setOrientation):
        (WebCore::FontDescription::setWidthVariant):
        (WebCore::FontCascadeDescription::setFontSmoothing):
        (WebCore::FontCascadeDescription::initialSmallCaps):
        (WebCore::FontCascadeDescription::initialFontSmoothing):
        (WebCore::FontCascadeDescription::initialTextRenderingMode):
        * platform/graphics/FontPlatformData.h:
        (WebCore::FontPlatformData::isForTextCombine const):
        * platform/graphics/cocoa/FontCacheCoreText.cpp:
        (WebCore::preparePlatformFont):
        * platform/graphics/cocoa/FontCascadeCocoa.mm:
        (WebCore::showLetterpressedGlyphsWithAdvances):
        (WebCore::showGlyphsWithAdvances):
        (WebCore::FontCascade::drawGlyphs):
        (WebCore::FontCascade::fontForCombiningCharacterSequence const):
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::platformInit):
        (WebCore::Font::platformBoundsForGlyph const):
        (WebCore::Font::platformWidthForGlyph const):
        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
        (WebCore::FontPlatformData::hash const):
        (WebCore::mapFontWidthVariantToCTFeatureSelector):
        (WebCore::FontPlatformData::ctFont const):
        (WebCore::FontPlatformData::description const):
        * platform/graphics/freetype/FontPlatformDataFreeType.cpp:
        (WebCore::FontPlatformData::buildScaledFont):
        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
        (WebCore::Font::platformInit):
        (WebCore::Font::platformWidthForGlyph const):
        * platform/graphics/harfbuzz/ComplexTextControllerHarfBuzz.cpp:
        (WebCore::fontFeatures):
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
        * platform/graphics/mac/SimpleFontDataCoreText.cpp:
        (WebCore::Font::getCFStringAttributes const):
        * platform/graphics/win/FontCGWin.cpp:
        (WebCore::FontCascade::drawGlyphs):
        * platform/graphics/win/FontCascadeDirect2D.cpp:
        (WebCore::FontCascade::drawGlyphs):
        * platform/graphics/win/GlyphPageTreeNodeDirect2D.cpp:
        (WebCore::GlyphPage::fill):
        * platform/graphics/win/SimpleFontDataDirect2D.cpp:
        (WebCore::Font::platformInit):
        (WebCore::Font::platformBoundsForGlyph const):
        (WebCore::Font::platformWidthForGlyph const):
        * platform/text/TextFlags.h:
        * rendering/RenderCombineText.cpp:
        (WebCore::RenderCombineText::combineTextIfNeeded):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/TextPainter.cpp:
        (WebCore::TextPainter::paintTextWithShadows):
        * rendering/TextPainter.h:
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::fontAndGlyphOrientation):
        * rendering/svg/RenderSVGInlineText.cpp:
        (WebCore::RenderSVGInlineText::computeNewScaledFontForStyle):

2018-07-16  Sergio Villar Senin  <svillar@igalia.com>

        [WebVR] Add support for connect/disconnect and mount/unmount device events
        https://bugs.webkit.org/show_bug.cgi?id=187343

        Reviewed by Žan Doberšek.

        WebVR specs define a series of events as part of the Window Interface Extension. We're
        adding support for the connect/disconnect and mount/unmount events both at the module level
        and the platform level using OpenVR.

        In order to do that we need to keep lists of VRPlatformDisplays at platform level and
        VRDisplays at bindings level. We then update those lists accordingly to detect potential
        additions/removals, and emit the corresponding signals. A new client interface
        VRPlatformDisplayClient was also defined so that VRPlatformDisplay implementations could
        notify their clients (typically a VRDisplay).

        Last but not least, NavigatorWebVR was updated so it supplements Navigator instead of
        supplementing Page.

        * Modules/webvr/NavigatorWebVR.cpp: Supplement Navigator not Page.
        (WebCore::NavigatorWebVR::getVRDisplays): Keep a list of VRDisplays and update them
        conveniently, also emitting the required events under certain conditions (like device
        disconnection).
        (WebCore::NavigatorWebVR::supplementName): New method.
        (WebCore::NavigatorWebVR::from): Ditto.
        * Modules/webvr/NavigatorWebVR.h: Supplement Navigator not Page.
        * Modules/webvr/VRDisplay.cpp:
        (WebCore::VRDisplay::create): Moved suspendIfNeeded() to constructor.
        (WebCore::VRDisplay::VRDisplay): Set itself as VRPlatformDisplay client.
        (WebCore::VRDisplay::~VRDisplay): Unset as  VRPlatformDisplay client.
        (WebCore::VRDisplay::VRPlatformDisplayConnected): Dispatch event on DOM window.
        (WebCore::VRDisplay::VRPlatformDisplayDisconnected): Ditto.
        (WebCore::VRDisplay::VRPlatformDisplayMounted): Ditto.
        (WebCore::VRDisplay::VRPlatformDisplayUnmounted): Ditto.
        * Modules/webvr/VRDisplay.h: Extend from VRPlatformDisplayClient.
        (WebCore::VRDisplay::document):
        * Modules/webvr/VRDisplayEvent.cpp: Updated Copyright.
        * Modules/webvr/VRDisplayEvent.h: Ditto.
        * Sources.txt: Added the two new files.
        * WebCore.xcodeproj/project.pbxproj: Ditto.
        * platform/vr/VRManager.cpp:
        (WebCore::VRManager::getVRDisplays): Keep a list of VRPlatformDisplays and update them conveniently,
        also emitting the required events under certain conditions (like device disconnection).
        * platform/vr/VRManager.h:
        * platform/vr/VRPlatformDisplay.cpp: New file with common implementations for VRPlatformDisplays.
        (WebCore::VRPlatformDisplay::setClient):
        (WebCore::VRPlatformDisplay::notifyVRPlatformDisplayEvent):
        * platform/vr/VRPlatformDisplay.h: Added a generic method to notify about different
        events. Added the client pointer.
        * platform/vr/VRPlatformDisplayClient.h: New file. VRPlatformDisplay implementations will
        call the client methods in the event of some circumstances happening.
        (WebCore::VRPlatformDisplayClient::VRPlatformDisplayConnected):
        (WebCore::VRPlatformDisplayClient::VRPlatformDisplayDisconnected):
        (WebCore::VRPlatformDisplayClient::VRPlatformDisplayMounted):
        (WebCore::VRPlatformDisplayClient::VRPlatformDisplayUnmounted):
        * platform/vr/openvr/VRPlatformDisplayOpenVR.cpp:
        (WebCore::VRPlatformDisplayOpenVR::updateDisplayInfo): Poll the device for new events to
        detect connection/disconnections or device activations/deactivations (HMD
        mounted/unmounted).
        * platform/vr/openvr/VRPlatformDisplayOpenVR.h:

2018-07-16  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add Nicosia::PlatformLayer, Nicosia::CompositionLayer classes
        https://bugs.webkit.org/show_bug.cgi?id=187693

        Reviewed by Carlos Garcia Campos.

        Add the Nicosia::PlatformLayer class. This will be the base platform
        layer class from which different derivatives will be created, addressing
        different use cases. The generic PlatformLayer type alias will point to
        this class in the future.

        First class deriving from Nicosia::PlatformLayer is
        Nicosia::CompositionLayer, purpose of which will be to mirror the state
        that's stored in the platform-specific GraphicsLayer derivative. It will
        also allow making thread-safe updates to that state.

        CoordinatedGraphicsLayer implementation now spawns a CompositionLayer
        object and tracks state changes in a separate
        CompositionLayer::LayerState::Delta object. During flushing, the changed
        state is applied to the layer's pending state before the delta is nulled
        out. The updated state isn't used anywhere yet, but future changes will
        implement committing this state into the rendering pipeline.

        There's bits of state not yet being managed by CompositionLayer, e.g.
        debug visuals, filters and animations. These will be addressed later.

        The m_solidColor member variable is added to CoordinatedGraphicsLayer in
        order to properly store the solid color value. Normally this would be
        contained by the parent GraphicsLayer class, but no such member variable
        exists there.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/NicosiaPlatformLayer.cpp: Added.
        (Nicosia::PlatformLayer::PlatformLayer):
        (Nicosia::CompositionLayer::CompositionLayer):
        * platform/graphics/nicosia/NicosiaPlatformLayer.h: Added.
        (Nicosia::PlatformLayer::isCompositionLayer const):
        (Nicosia::PlatformLayer::id const):
        (Nicosia::CompositionLayer::create):
        (Nicosia::CompositionLayer::LayerState::Flags::Flags):
        (Nicosia::CompositionLayer::updateState):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
        (WebCore::CoordinatedGraphicsLayer::setPosition):
        (WebCore::CoordinatedGraphicsLayer::setAnchorPoint):
        (WebCore::CoordinatedGraphicsLayer::setSize):
        (WebCore::CoordinatedGraphicsLayer::setTransform):
        (WebCore::CoordinatedGraphicsLayer::setChildrenTransform):
        (WebCore::CoordinatedGraphicsLayer::setPreserves3D):
        (WebCore::CoordinatedGraphicsLayer::setMasksToBounds):
        (WebCore::CoordinatedGraphicsLayer::setDrawsContent):
        (WebCore::CoordinatedGraphicsLayer::setContentsVisible):
        (WebCore::CoordinatedGraphicsLayer::setContentsOpaque):
        (WebCore::CoordinatedGraphicsLayer::setBackfaceVisibility):
        (WebCore::CoordinatedGraphicsLayer::setOpacity):
        (WebCore::CoordinatedGraphicsLayer::setContentsRect):
        (WebCore::CoordinatedGraphicsLayer::setContentsTileSize):
        (WebCore::CoordinatedGraphicsLayer::setContentsTilePhase):
        (WebCore::CoordinatedGraphicsLayer::setContentsToSolidColor):
        (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
        (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
        (WebCore::CoordinatedGraphicsLayer::syncChildren):
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2018-07-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS apps on macOS] Playing embedded Twitter videos in the News app crashes the web process
        https://bugs.webkit.org/show_bug.cgi?id=187690
        <rdar://problem/41869703>

        Reviewed by Tim Horton.

        Work around unexpected behavior when soft-linking AVFoundation. After using `dlopen_preflight` to check for the
        existence of a library prior to loading the library using `dlopen`, `dlsym` subsequently returns null for some
        symbols that would otherwise be available. This causes us to RELEASE_ASSERT later down the road when we try to
        load AVAudioSessionModeDefault in AudioSessionIOS.mm.

        To fix this for now, simply check for the library directly instead of using the more lightweight preflight
        check. See clone: <rdar://problem/42224780> for more detail.

        * platform/graphics/avfoundation/objc/AVFoundationMIMETypeCache.mm:
        (WebCore::AVFoundationMIMETypeCache::isAvailable const):

2018-07-14  Simon Fraser  <simon.fraser@apple.com>

        Shrink StyleFillData, StyleStrokeData and StyleMiscData
        https://bugs.webkit.org/show_bug.cgi?id=187681

        Reviewed by Anders Carlsson.

        Shrink these data structures by making more enum classes one byte in size, and
        re-ordering. StyleFillData goes from 56 to 48, StyleStrokeData from 80 to 72,
        StyleMiscData from 40 to 32 bytes.

        * rendering/style/SVGRenderStyleDefs.cpp:
        (WebCore::StyleFillData::StyleFillData):
        (WebCore::StyleFillData::operator== const):
        (WebCore::StyleStrokeData::StyleStrokeData):
        (WebCore::StyleStrokeData::operator== const):
        (WebCore::StyleStopData::operator== const):
        (WebCore::StyleMiscData::StyleMiscData):
        * rendering/style/SVGRenderStyleDefs.h:

2018-07-14  Simon Fraser  <simon.fraser@apple.com>

        Shrink CachedResource and subclasses
        https://bugs.webkit.org/show_bug.cgi?id=187546

        Reviewed by Daniel Bates.

        Shrink CachedResource down from 1384 to 1336 bytes, CachedImage from 1480 to
        1424 bytes, and CachedFont a little.
        
        This saves about 23KB on cnn.com.

        * loader/ResourceLoaderOptions.h:
        * loader/cache/CachedFont.h:
        * loader/cache/CachedImage.h:
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::CachedResource):
        * loader/cache/CachedResource.h:
        * platform/network/CacheValidation.h:
        (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
        * platform/network/NetworkLoadMetrics.h:
        * platform/network/ParsedContentRange.h:
        * platform/network/ResourceRequestBase.h:
        * platform/network/ResourceResponseBase.h:

2018-07-14  Simon Fraser  <simon.fraser@apple.com>

        Shrink some style-related classes and enums
        https://bugs.webkit.org/show_bug.cgi?id=187680

        Reviewed by Antti Koivisto.
        
        Make all the enum classes in RenderStyleConstants be one byte big (all have less
        than 256 values).
        
        Shrink DocumentRuleSet from 384 to 368 bytes by re-ordering, which also helps shrink
        StyleResolver from 1024 to 952 bytes.
        
        Shrink BorderValue by re-ordering (now that the layout of Color has changed) which
        shrinks BorderData from 168 to 136 bytes.
        
        Convert a couple of other enums to enum class so that they can have explicit size.

        * css/DocumentRuleSets.h:
        * css/MediaQueryMatcher.cpp:
        (WebCore::MediaQueryMatcher::documentElementUserAgentStyle const):
        * css/StyleMedia.cpp:
        (WebCore::StyleMedia::matchMedium const):
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::StyleResolver):
        (WebCore::StyleResolver::State::State):
        (WebCore::StyleResolver::styleForElement):
        (WebCore::StyleResolver::cascadedPropertiesForRollback):
        (WebCore::StyleResolver::applyProperty):
        (WebCore::cascadeLevelForIndex):
        * css/StyleResolver.h:
        * rendering/style/BorderValue.h:
        * rendering/style/RenderStyle.cpp:
        * rendering/style/RenderStyleConstants.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::styleForElement):
        * svg/SVGElementRareData.h:
        (WebCore::SVGElementRareData::overrideComputedStyle):

2018-07-14  Kocsen Chung  <kocsen_chung@apple.com>

        Ensure WebKit stack is ad-hoc signed
        https://bugs.webkit.org/show_bug.cgi?id=187667

        Reviewed by Alexey Proskuryakov.

        * Configurations/Base.xcconfig:

2018-07-14  Dirk Schulze  <krit@webkit.org>

        [css-masking] Fully support -webkit-clip-path on SVG elements
        https://bugs.webkit.org/show_bug.cgi?id=185829

        Reviewed by Simon Fraser.

        -webkit-clip-path contributes to SVG elements with boxes, shapes and now with
        element references to <clipPath> elements as well. Make sure that all types
        contribute to hit-testing of the SVG element as well as they should.

        Tests: svg/clip-path/webkit-clip-path-after-expected.svg
               svg/clip-path/webkit-clip-path-after.svg
               svg/clip-path/webkit-clip-path-before-expected.svg
               svg/clip-path/webkit-clip-path-before.svg
               svg/dynamic-updates/SVGClipPath-prefixed-influences-hitTesting.html
               svg/dynamic-updates/SVGClipPath-prefixed-path-influences-hitTesting.html
               svg/dynamic-updates/SVGClipPathElement-prefixed-css-transform-influences-hitTesting.html
               svg/dynamic-updates/SVGClipPathElement-prefixed-transform-influences-hitTesting.html

        * rendering/svg/SVGRenderSupport.cpp: Share code as much as possible.
        (WebCore::clipPathReferenceBox):
        (WebCore::isPointInCSSClippingArea): Take -webkit-clip-path into account.
        (WebCore::SVGRenderSupport::clipContextToCSSClippingArea):
        (WebCore::SVGRenderSupport::pointInClippingArea):
        * rendering/svg/SVGRenderSupport.h:
        * rendering/svg/SVGRenderingContext.cpp: Clip to -webkit-clip-path boxes, shapes and references.
        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
        * rendering/svg/SVGResources.cpp: Add -webkit-clip-path references to cached resources. Mimic SVG clip-path.
        (WebCore::SVGResources::buildCachedResources):

2018-07-13  Simon Fraser  <simon.fraser@apple.com>

        Avoid fetching visitedDependentColor() so many times in editing code
        https://bugs.webkit.org/show_bug.cgi?id=187676

        Reviewed by Zalan Bujtas.
        
        editingAttributedStringFromRange called style.visitedDependentColor() twice for each property,
        and fontAttributesForSelectionStart() called it two or three times. Use a local Color variable
        to avoid so many calls. Also replace a call to alpha() with isVisible() which makes the usage more clear.

        No behavior change.

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::fontAttributesForSelectionStart const):
        * editing/cocoa/HTMLConverter.mm:
        (WebCore::editingAttributedStringFromRange):

2018-07-13  Youenn Fablet  <youenn@apple.com>

        Support connecting a MediaStreamAudioDestinationNode to RTCPeerConnection
        https://bugs.webkit.org/show_bug.cgi?id=187627
        <rdar://problem/35334400>

        Reviewed by Jer Noble.

        When MediaStreamAudioSource is called to read new audio samples,
        convert these samples to a WebAudioBufferList and call RealtimeMediaSource::audioSamplesAvailable.
        This makes its observers to get the audio data.

        Test: webrtc/peer-connection-createMediaStreamDestination.html

        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::create): Minor refactoring.
        * Modules/webaudio/MediaStreamAudioDestinationNode.cpp:
        (WebCore::createMediaStream):
        (WebCore::MediaStreamAudioDestinationNode::MediaStreamAudioDestinationNode):
        (WebCore::MediaStreamAudioDestinationNode::process):
        * Modules/webaudio/MediaStreamAudioDestinationNode.h:
        * Modules/webaudio/MediaStreamAudioSource.cpp:
        (WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
        (WebCore::MediaStreamAudioSource::consumeAudio):
        * Modules/webaudio/MediaStreamAudioSource.h:
        * Modules/webaudio/MediaStreamAudioSourceCocoa.cpp: Added.
        (WebCore::streamDescription):
        (WebCore::MediaStreamAudioSource::consumeAudio):
        * WebCore.xcodeproj/project.pbxproj:
        * platform/audio/AudioDestinationConsumer.h: Removed.
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::create):
        * platform/mediastream/MediaStreamPrivate.h:

2018-07-13  Christopher Reid  <chris.reid@sony.com>

        [WinCairo] Enable WebGL when Accelerated Compositing is disabled
        https://bugs.webkit.org/show_bug.cgi?id=187664

        Reviewed by Fujii Hironori.

        AC was disabled for WinCairo in r233725 but it can still run WebGL without AC.

        * html/HTMLCanvasElement.cpp:

2018-07-13  Chris Dumez  <cdumez@apple.com>

        Crash under ApplicationCacheGroup::didFailLoadingEntry()
        https://bugs.webkit.org/show_bug.cgi?id=187661
        <rdar://problem/42179755>

        Reviewed by Youenn Fablet.

        If ApplicationCacheResourceLoader::create() fails synchronously with
        ApplicationCacheResourceLoader::Error::CannotCreateResource error, then
        m_entryLoader will be null when didFailLoadingEntry() is called. However,
        didFailLoadingEntry() fails to null check m_entryLoader before using it.

        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::didFailLoadingEntry):
        (WebCore::ApplicationCacheGroup::startLoadingEntry):
        * loader/appcache/ApplicationCacheGroup.h:

2018-07-13  Alex Christensen  <achristensen@webkit.org>

        Add release assertion to check thread in TimerBase::setNextFireTime
        https://bugs.webkit.org/show_bug.cgi?id=187666

        Reviewed by Ryosuke Niwa.

        This should give us insight into what is causing <rdar://problem/33352721>
        
        * platform/Timer.cpp:
        (WebCore::TimerBase::setNextFireTime):

2018-07-13  Ryosuke Niwa  <rniwa@webkit.org>

        [iOS] [WK1] Crash inside IOSurfacePool::platformGarbageCollectNow() in WebThread
        https://bugs.webkit.org/show_bug.cgi?id=187635
        <rdar://problem/34297065>

        Reviewed by Simon Fraser.

        r167717 added code to trigger a CA commit in the web process via platformGarbageCollectNow() in order to free IOSurface-related memory.
        However, that code is also running in the web thread in apps using WebKit1, causing unwanted UIView layout on the web thread.

        Fix by not triggering this CA commit if it's called on the web thread.

        * platform/graphics/cocoa/IOSurfacePoolCocoa.mm:
        (WebCore::IOSurfacePool::platformGarbageCollectNow):

2018-07-13  Antoine Quint  <graouts@apple.com>

        Dark Mode: document markers are difficult to see
        https://bugs.webkit.org/show_bug.cgi?id=187632
        <rdar://problem/41099719>

        Reviewed by Simon Fraser.

        We update the way we draw the document markers for macOS and use more constrasting colors in dark mode.
        Paving the way for future improvements, we move the drawLineForDocumentMarker() method from GraphicsContext
        to RenderTheme and implement a first version in RenderThemeMac. The circles used for the underline are now
        drawn directly with Core Graphics and we no longer use an image resource. To allow both GraphicsContext
        and RenderTheme to have different versions of the drawLineForDocumentMarker() method, the DocumentMarkerLineStyle
        enum is now an "enum class".

        No new test due to webkit.org/b/105616, webkit.org/b/187655 was raised to track the creation of new tests
        when it becomes possible again.

        * platform/graphics/GraphicsContext.h:
        * platform/graphics/GraphicsContextImpl.h:
        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::drawLineForDocumentMarker):
        * platform/graphics/cairo/CairoOperations.h:
        * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
        (WebCore::GraphicsContextImplCairo::drawLineForDocumentMarker):
        * platform/graphics/cairo/GraphicsContextImplCairo.h:
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawLineForDocumentMarker):
        * platform/graphics/displaylists/DisplayListItems.h:
        (WebCore::DisplayList::DrawLineForDocumentMarker::create):
        (WebCore::DisplayList::DrawLineForDocumentMarker::DrawLineForDocumentMarker):
        * platform/graphics/displaylists/DisplayListRecorder.cpp:
        (WebCore::DisplayList::Recorder::drawLineForDocumentMarker):
        * platform/graphics/displaylists/DisplayListRecorder.h:
        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
        (Nicosia::CairoOperationRecorder::drawLineForDocumentMarker):
        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:
        * platform/graphics/win/GraphicsContextCGWin.cpp:
        (WebCore::GraphicsContext::drawLineForDocumentMarker):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintPlatformDocumentMarker): Call drawLineForDocumentMarker() on the RenderTheme on
        macOS and on GraphicsContext in all other cases.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::drawLineForDocumentMarker):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::colorForStyle): Provide different colors for light and dark modes.
        (WebCore::RenderThemeMac::drawLineForDocumentMarker): A new macOS-specific version of drawLineForDocumentMarker()
        where we paint circles using Core Graphics directly.

2018-07-13  Charlie Turner  <cturner@igalia.com>

        [GStreamer] Use smart pointers for GstByteReader
        https://bugs.webkit.org/show_bug.cgi?id=187638

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Add
        specialisation for GstByteReader.
        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
        Use the new smart pointer class to avoid needing to remember where
        to call gst_byte_reader_free.
        (webKitMediaClearKeyDecryptorDecrypt):

2018-07-13  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Move HTTP Setup logic from CurlRequest to CurlHandle for reuse.
        https://bugs.webkit.org/show_bug.cgi?id=187427

        Reviewed by Fujii Hironori.

        CurlContext will be used by Secure WebSocket client, but HTTP setup code is
        in CurlRequest, which is only for regular HTTP/HTTPS transaction. This patch
        allows wss client to setup CurlHandle for HTTPS communication, such as TLS,
        proxy or authentication.

        No new tests because there's no behavior change.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::CurlHandle):
        (WebCore::CurlHandle::enableSSLForHost):
        (WebCore::CurlHandle::willSetupSslCtx):
        (WebCore::CurlHandle::willSetupSslCtxCallback):
        (WebCore::CurlHandle::sslErrors const):
        (WebCore::CurlHandle::setUrl):
        (WebCore::CurlHandle::enableHttp):
        (WebCore::CurlHandle::enableConnectionOnly):
        (WebCore::CurlHandle::certificateInfo const):
        (WebCore::CurlHandle::enableStdErrIfUsed):
        (WebCore::CurlHandle::initialize): Deleted.
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlHandle::url const):
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupTransfer):
        (WebCore::CurlRequest::didReceiveHeader):
        (WebCore::CurlRequest::didCompleteTransfer):
        (WebCore::CurlRequest::finalizeTransfer):
        (WebCore::CurlRequest::willSetupSslCtx): Deleted.
        (WebCore::CurlRequest::willSetupSslCtxCallback): Deleted.
        * platform/network/curl/CurlRequest.h:
        * platform/network/curl/CurlSSLVerifier.cpp:
        (WebCore::CurlSSLVerifier::CurlSSLVerifier):
        (WebCore::CurlSSLVerifier::verify):
        * platform/network/curl/CurlSSLVerifier.h:

2018-07-13  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer][MSE] Add GstFlowCombiner to handle non-linked inactive branches
        https://bugs.webkit.org/show_bug.cgi?id=187636

        Reviewed by Carlos Garcia Campos.

        When we have more than one source buffer, only one will be
        rendered and the inactive branch will report linking errors that
        we have to deal with.

        * platform/graphics/gstreamer/GUniquePtrGStreamer.h: Added GstFlowCombiner.
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
        (webkitMediaSrcChain): Combine the flow in the flow combiner.
        (webkit_media_src_init): Initialize the flow combiner.
        (webKitMediaSrcLinkStreamToSrcPad): Add the proxypad to the
        combiner and set the chain function.
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:
        Declare the flow combiner.

2018-07-13  Charlie Turner  <cturner@igalia.com>

        [GStreamer] Add GstBufferMapped abstraction
        https://bugs.webkit.org/show_bug.cgi?id=187600

        Reviewed by Xabier Rodriguez-Calvar.

        There is a similar abstraction called `mapGstBuffer` and friends,
        which have a slightly different use-case: wanting a buffer that is
        mapped for a longer lifetime without have to keep track of the map
        infos separately. They could be subsumed by this abstraction, but
        everytime they need to write to the buffer, they'd have to remap
        the memory blocks.

        This abstraction is more for one-short reads and writes saving the user
        from remembering to unmap the buffer and having to manage to
        auxiliary GstMapInfo structures.

        * platform/graphics/gstreamer/GStreamerCommon.h:
        (WebCore::GstMappedBuffer::GstMappedBuffer):
        (WebCore::GstMappedBuffer::~GstMappedBuffer):
        (WebCore::GstMappedBuffer::data):
        (WebCore::GstMappedBuffer::size const):
        (WebCore::GstMappedBuffer::operator bool const):
        * platform/graphics/gstreamer/InbandTextTrackPrivateGStreamer.cpp:
        (WebCore::InbandTextTrackPrivateGStreamer::notifyTrackOfSample):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
        (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
        (webKitMediaClearKeyDecryptorSetupCipher):
        (webKitMediaClearKeyDecryptorDecrypt):

2018-07-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        Make it easier to hit the significant rendered text layout milestone on pages with main article elements
        https://bugs.webkit.org/show_bug.cgi?id=187578
        <rdar://problem/42104637>

        Reviewed by Ryosuke Niwa.

        Our current heuristics for triggering the significant rendered text layout milestone are very conservative, with
        the intention of avoiding false positives. In practice, we can relax some of these constraints when we've
        detected the presence of a main article element on the page. (e.g. in New York Times articles). See per-method
        changes below for more detail.

        Test: RenderingProgressTests.DidRenderSignificantAmountOfText

        * dom/Document.cpp:
        (WebCore::Document::registerArticleElement):
        (WebCore::Document::unregisterArticleElement):
        (WebCore::Document::updateMainArticleElementAfterLayout):

        As a post layout task, update the main article element by looping through the articles (up to a maximum limit of
        10) in search of an article element that is several times larger than the second largest article element.

        * dom/Document.h:

        Store a set containing the article elements in the document, as well as the current main article on the page.

        (WebCore::Document::hasMainArticleElement const):
        * html/Element.cpp:
        (WebCore::Element::insertedIntoAncestor):
        (WebCore::Element::removedFromAncestor):

        Keep track of the article elements that exist in the document whenever elements with the article tag are added
        to or removed from the document.

        * page/FrameView.cpp:

        Add new minimum thresholds for firing the significant rendered text milestone when there exists a main article.

        (WebCore::FrameView::performPostLayoutTasks):
        (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):

        Take the main article element into consideration when determining whether to fire the significant text
        layout milestone.

2018-07-12  Daniel Bates  <dabates@apple.com>

        JavaScript URL gives incorrect result when frame is navigated
        https://bugs.webkit.org/show_bug.cgi?id=187203
        <rdar://problem/41438443>

        Reviewed by David Kilzer.

        * loader/SubframeLoader.cpp:
        (WebCore::SubframeLoader::requestFrame):

2018-07-12  Alex Christensen  <achristensen@webkit.org>

        Reduce size of WebCore::URL
        https://bugs.webkit.org/show_bug.cgi?id=186820

        Reviewed by Yusuke Suzuki and Youenn Fablet.

        We were using 32 bits for the length of the port, which is always between 0 and 5 inclusive
        because port numbers are missing or between 0 and 65535.  Let's just use 3 bits here.
        We were using 32 bits for the length of the scheme, which is usually 3-5 characters and can be
        longer for some custom schemes, but I've never seen one more than 20 characters.  If we assume
        schemes are always less than 64MB, we can save 8 bytes per URL!

        No change in behavior, just less memory use!
        
        To restore the IPC encoding to how it was before r221165, I just encode the string and reparse it.

        * platform/URL.cpp:
        (WebCore::URL::invalidate):
        (WebCore::URL::lastPathComponent const):
        (WebCore::URL::port const):
        (WebCore::URL::protocolHostAndPort const):
        (WebCore::URL::path const):
        (WebCore::URL::removePort):
        (WebCore::URL::setPort):
        (WebCore::URL::setHostAndPort):
        (WebCore::URL::setPath):
        * platform/URL.h:
        (WebCore::URL::encode const):
        (WebCore::URL::decode):
        (WebCore::URL::hasPath const):
        (WebCore::URL::pathStart const):
        * platform/URLParser.cpp:
        (WebCore::URLParser::copyBaseWindowsDriveLetter):
        (WebCore::URLParser::urlLengthUntilPart):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::shouldPopPath):
        (WebCore::URLParser::popPath):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHostAndPort):
        (WebCore::URLParser::allValuesEqual):
        (WebCore::URLParser::internalValuesConsistent):
        * workers/service/server/RegistrationDatabase.cpp:
        Increment the service worker registration schema version because of the URL encoding change.

2018-07-12  Youenn Fablet  <youenn@apple.com>

        Add a FrameLoaderClient willInjectUserScriptForFrame callback
        https://bugs.webkit.org/show_bug.cgi?id=187565

        Reviewed by Alex Christensen.

        Test: http/tests/contentextensions/injected-script-callback.html.

        * loader/FrameLoaderClient.h:
        * page/Frame.cpp:
        (WebCore::Frame::injectUserScriptImmediately):
        Calling the new callback whenever being about to inject a new script.

2018-07-12  Megan Gardner  <megan_gardner@apple.com>

        Keep Selections within Shadow DOM boundaries
        https://bugs.webkit.org/show_bug.cgi?id=187556
        <rdar://problem/41664567>

        Reviewed by Ryosuke Niwa.

        Expose needed functionality to WebKit to help with determing editing and shadow dom boundries.

        Only exposing functionality to WebKit.

        * dom/TreeScope.h:
        * editing/Editing.h:
        * editing/VisibleSelection.cpp:
        (WebCore::VisibleSelection::adjustPositionForEnd const):
        (WebCore::VisibleSelection::adjustPositionForStart const):
        (WebCore::adjustPositionForEnd): Deleted.
        (WebCore::adjustPositionForStart): Deleted.
        * editing/VisibleSelection.h:
        
2018-07-12  Sihui Liu  <sihui_liu@apple.com>

        IndexedDB: database file of subframe cannot be removed
        https://bugs.webkit.org/show_bug.cgi?id=187564

        Reviewed by Youenn Fablet.

        For IndexedDB, if openingOrigin is different from mainFrameOrigin, there will be another 
        layer in the database file path. 
        IDBServer should delete database files recursively to make sure all files are removed.

        Covered by modified test: WebKit.WebsiteDataStoreCustomPaths.

        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::removeAllDatabasesForOriginPath):

2018-07-12  Per Arne Vollan  <pvollan@apple.com>

        Add compile guard for enabling NSRunLoop in the WebContent process.
        https://bugs.webkit.org/show_bug.cgi?id=187563

        Reviewed by Chris Dumez.

        No new tests, no change in behavior.

        * platform/mac/EventLoopMac.mm:
        (WebCore::EventLoop::cycle):

2018-07-12  Zalan Bujtas  <zalan@apple.com>

        Newly added float should trigger full layout on the block.
        https://bugs.webkit.org/show_bug.cgi?id=187251
        <rdar://problem/41726137>

        Reviewed by David Kilzer.

        RenderBlockFlow::determineStartPosition() is one of the places where we decide the extent of the line layout for the current block.
        In here we try to figure out the first line in the block that requires layout. In certain cases when floats are present,
        (due to their intrusive behavior) we just trigger a full layout on the entire block.
        One of the special cases is when a new float is added to the block. determineStartPosition() checks for such floats (floats inserted
        after the "last known float") and marks the block for full layout. However it missed the case when other, unrelated mutations happened
        in addition to this newly inserted float. This patch fixes this case by checking if the floats after the "last know float" actually need layout.

        Test: fast/inline/new-float-needs-layout-when-line-is-dirty.html

        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::determineStartPosition):

2018-07-12  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Add pads to the GstFlowCombiner in MediaStreamSrc
        https://bugs.webkit.org/show_bug.cgi?id=187552

        Reviewed by Alejandro G. Castro.

        This was overlooked and it is the way the API is supposed to be used.

        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
        (WebCore::webkitMediaStreamSrcAddPad):

2018-07-12  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Thread VM& to JSCell::methodTable(VM&)
        https://bugs.webkit.org/show_bug.cgi?id=187548

        Reviewed by Saam Barati.

        * bindings/js/JSDOMConstructorBase.h:
        (WebCore::JSDOMConstructorBase::className):
        * bindings/js/JSPluginElementFunctions.cpp:
        (WebCore::pluginElementCustomGetCallData):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GenerateImplementation):
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::JSInterfaceName::estimatedSize):
        * bindings/scripts/test/JS/JSInterfaceName.h:

2018-07-11  Youenn Fablet  <youenn@apple.com>

        MediaDevices should derive from EventTarget in its IDL
        https://bugs.webkit.org/show_bug.cgi?id=187575

        Reviewed by Chris Dumez.

        Test: fast/mediastream/MediaDevices-addEventListener.html

        * Modules/mediastream/MediaDevices.idl:

2018-07-11  Jon Lee  <jonlee@apple.com>

        Update iOS fullscreen alert text
        https://bugs.webkit.org/show_bug.cgi?id=187576
        rdar://problem/42052284

        Reviewed by Ryosuke Niwa.

        * English.lproj/Localizable.strings:

2018-07-11  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233742.
        https://bugs.webkit.org/show_bug.cgi?id=187577

        Binary incompatible change with respect to Service Worker
        registration map (Requested by dydz on #webkit).

        Reverted changeset:

        "Reduce size of WebCore::URL"
        https://bugs.webkit.org/show_bug.cgi?id=186820
        https://trac.webkit.org/changeset/233742

2018-07-11  Aditya Keerthi  <akeerthi@apple.com>

        REGRESSION (231276): Attempting to copy an image fails
        https://bugs.webkit.org/show_bug.cgi?id=187212
        <rdar://problem/41540074>

        Reviewed by Ryosuke Niwa.

        Renamed methods to make it clear that one URL and one title are being passed in.

        Test: editing/mac/pasteboard/can-copy-url-without-title.html

        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::setURL):
        * platform/mac/PasteboardMac.mm:
        (WebCore::writeURLForTypes):
        (WebCore::Pasteboard::writeTrustworthyWebURLsPboardType):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::setURL):

2018-07-11  Alex Christensen  <achristensen@webkit.org>

        Add SPI for immediate injection of user scripts
        https://bugs.webkit.org/show_bug.cgi?id=173342
        <rdar://problem/29202285>

        Reviewed by Brady Eidson, Youenn Fablet, and Geoff Garen.

        The new SPI is WKUserContentController._addUserScriptImmediately.
        It is covered by new API tests.
        Existing functionality remains unchanged unless the new SPI is adopted.

        * page/Frame.cpp:
        (WebCore::Frame::injectUserScripts):
        (WebCore::Frame::injectUserScriptImmediately):
        Move injection functionality to allow us to call it directly from the new SPI.
        * page/Frame.h:
        * page/Page.cpp:
        (WebCore::Page::forEachPage):
        * page/Page.h:

2018-07-11  Alex Christensen  <achristensen@webkit.org>

        Reduce size of WebCore::URL
        https://bugs.webkit.org/show_bug.cgi?id=186820

        Reviewed by Yusuke Suzuki.

        We were using 32 bits for the length of the port, which is always between 0 and 5 inclusive
        because port numbers are missing or between 0 and 65535.  Let's just use 3 bits here.
        We were using 32 bits for the length of the scheme, which is usually 3-5 characters and can be
        longer for some custom schemes, but I've never seen one more than 20 characters.  If we assume
        schemes are always less than 64MB, we can save 8 bytes per URL!

        No change in behavior, just less memory use!

        * platform/URL.cpp:
        (WebCore::URL::invalidate):
        (WebCore::URL::lastPathComponent const):
        (WebCore::URL::port const):
        (WebCore::URL::protocolHostAndPort const):
        (WebCore::URL::path const):
        (WebCore::URL::removePort):
        (WebCore::URL::setPort):
        (WebCore::URL::setHostAndPort):
        (WebCore::URL::setPath):
        * platform/URL.h:
        (WebCore::URL::encode const):
        (WebCore::URL::decode):
        (WebCore::URL::hasPath const):
        (WebCore::URL::pathStart const):
        * platform/URLParser.cpp:
        (WebCore::URLParser::copyBaseWindowsDriveLetter):
        (WebCore::URLParser::urlLengthUntilPart):
        (WebCore::URLParser::copyURLPartsUntil):
        (WebCore::URLParser::shouldPopPath):
        (WebCore::URLParser::popPath):
        (WebCore::URLParser::parse):
        (WebCore::URLParser::parsePort):
        (WebCore::URLParser::parseHostAndPort):
        (WebCore::URLParser::allValuesEqual):
        (WebCore::URLParser::internalValuesConsistent):

2018-07-11  Youenn Fablet  <youenn@apple.com>

        Fix remaining Cross-Origin-Resource-Policy failures, if any
        https://bugs.webkit.org/show_bug.cgi?id=186761
        <rdar://problem/41209829>

        Reviewed by Alex Christensen.

        Add case-sensitive check for CORP header value, as per fetch specification.
        Add HTTP->HTTPS check for same-site case, as per fetch specification.
        https://fetch.spec.whatwg.org/#cross-origin-resource-policy-check

        Test: imported/w3c/web-platform-tests/fetch/cross-origin-resource-policy/scheme-restriction.https.window.html

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::shouldCrossOriginResourcePolicyCancelLoad):
        * platform/network/HTTPParsers.cpp:
        (WebCore::parseCrossOriginResourcePolicyHeader):

2018-07-11  Ross Kirsling  <ross.kirsling@sony.com>

        [WinCairo] MIME type registry doesn't explicitly recognize *.xht
        https://bugs.webkit.org/show_bug.cgi?id=187555

        Reviewed by Konstantin Tokarev.

        Follow-up to r233715 -- WinCairo bots are failing on *.xht layout tests as they lack a registry key for this filetype.
        (Hopefully this is the last one to add.)

        * platform/win/MIMETypeRegistryWin.cpp:
        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
        Add *.xht to the list of recognized filetypes.

2018-07-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186501
        <rdar://problem/41000224>

        Unreviewed build fix after r233729 and r233730.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::processIterableKeyframes):

2018-07-11  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186501
        <rdar://problem/41000224>

        Unreviewed build fix after r233729.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::processIterableKeyframes):

2018-07-10  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-001.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186501
        <rdar://problem/41000224>

        Reviewed by Dean Jackson.

        There were two remaining assertions that we were failing in this WPT test file, both related to processing iterable keyframes.
        The first one was failing because didn't correctly propagate the TypeError exception in the forEachInIterable() callback. The
        second one was failing because we didn't use the "process a keyframe-like object" procedure when processing iterable keyframes
        and, as such, we didn't correctly sort property alphabetically before reading their values.

        To fix this second issue, we make processIterableKeyframes() use processKeyframeLikeObject(). To do so, we update processKeyframeLikeObject()
        to accept a new boolean flag to match the "allow lists" flag from the specification. We also ensure we sort the properties *before*
        reading from them which we didn't use to do previously.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::processKeyframeLikeObject):
        (WebCore::processIterableKeyframes):
        (WebCore::processPropertyIndexedKeyframes):
        * animation/KeyframeEffectReadOnly.h:
        * animation/KeyframeEffectReadOnly.idl:

2018-07-11  Zalan Bujtas  <zalan@apple.com>

        SimpleLineLayout::FlowContents wastes 54KB of Vector capacity on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=186709
        <rdar://problem/41173793>

        Reviewed by Simon Fraser.

        The size of the m_segments vector in SimpleLineLayoutFlowContents is alway pre-computed and don't change after the initial append.  

        Not testable.

        * rendering/SimpleLineLayoutFlowContents.h:

2018-07-10  Youenn Fablet  <youenn@apple.com>

        Make fetch() use "same-origin" credentials by default
        https://bugs.webkit.org/show_bug.cgi?id=176023

        Reviewed by Chris Dumez.

        Covered by updated tests.

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::initializeWith):
        Setting credentials mode to same-origin for FetchRequest by default.
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::redirectReceived):
        Handle correctly referrer in case we restart a load.
        * page/PerformanceResourceTiming.cpp:
        (WebCore::entryStartTime):
        (WebCore::entryEndTime):
        In case it is not allowed to disclose resource timing info, update as
        https://www.w3.org/TR/resource-timing-1/#performanceresourcetiming

2018-07-10  Chris Dumez  <cdumez@apple.com>

        "serviceworker.js" is fetched several times in a row
        https://bugs.webkit.org/show_bug.cgi?id=187435
        <rdar://problem/41940569>

        Reviewed by Youenn Fablet.

        Soft updates happen every time a fetch event is sent to a service worker for a main resource request.
        This can happen many times during a page load and will cause us to spam the HTTP server with update
        requests, especially considering that the default behavior is to bypass the HTTP cache. To address
        the issue, we now do soft updates on a 1 second delay and we keep rescheduling this timer was long as
        soft update requests keep coming. Based on my understanding of the Chromium code, this seems to be
        what they are doing so this should align our behavior with them.

        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::ServiceWorkerRegistration):
        (WebCore::ServiceWorkerRegistration::scheduleSoftUpdate):
        * workers/service/ServiceWorkerRegistration.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):

2018-07-10  Ross Kirsling  <ross.kirsling@sony.com>

        [WinCairo] MIME type registry doesn't explicitly recognize *.css
        https://bugs.webkit.org/show_bug.cgi?id=187538

        Reviewed by Yusuke Suzuki.

        MIMETypeRegistryWin doesn't explicitly recognize *.css; it instead falls back to the registry key "Content Type"
        under HKEY_CLASSES_ROOT\.css. This key doesn't exist on Windows Server unless an application actually registers
        it -- as a result, WinCairo bots are currently viewing it as an unrecognized filetype!

        * platform/win/MIMETypeRegistryWin.cpp:
        (WebCore::MIMETypeRegistry::getMIMETypeForExtension):
        Add *.css to the list of recognized filetypes.

2018-07-10  Timothy Hatcher  <timothy@apple.com>

        REGRESSION (r233552): Find highlight has white text on yellow background
        https://bugs.webkit.org/show_bug.cgi?id=187535
        rdar://problem/42043371

        Reviewed by Tim Horton.

        Fixes existing image tests:
        - fast/text/mark-matches-rendering.html
        - fast/text/mark-matches-broken-line-rendering.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::resolveStyleForMarkedText): Remove incorect UseDarkAppearance.

2018-07-10  Chris Fleizach  <cfleizach@apple.com>

        AX: Crash in accessing AXObjectCache in textMarkerDataForVisiblePosition
        https://bugs.webkit.org/show_bug.cgi?id=187528
        <rdar://problem/37231941>

        Reviewed by Joanmarie Diggs.

        Occasional crashes reported when running accessibility/mac/search-field-cancel-button.html.
        Looks like the cache object retrieved was not valid and we weren't checking for it.

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::visiblePositionForTextMarkerData):
        (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
        (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):

2018-07-10  Zalan Bujtas  <zalan@apple.com>

        FragmentInterval, FragmentIntervalTree and FragmentSearchAdapter should hold not hold raw pointers to renderers.
        https://bugs.webkit.org/show_bug.cgi?id=187249
        <rdar://problem/41725869>

        Reviewed by Simon Fraser.

        Test: fast/multicol/crash-in-vertical-writing-mode.html

        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
        * rendering/RenderFragmentedFlow.h:
        (WTF::ValueToString<WeakPtr<WebCore::RenderFragmentContainer>>::string):

2018-07-10  Ryosuke Niwa  <rniwa@webkit.org>

        Disable cross-origin-window-policy by default
        https://bugs.webkit.org/show_bug.cgi?id=187509

        Reviewed by Chris Dumez.

        Disabled the feature by default.

        * page/Settings.yaml:

2018-07-10  Alejandro G. Castro  <alex@igalia.com>

        [GTK][WPE] The LibWebRTCProvider object in RealtimeMediaSourceCenterLibWebRTC is not needed anymore
        https://bugs.webkit.org/show_bug.cgi?id=187513

        Reviewed by Youenn Fablet.

        We used the factory of the LibWebRTCProvider in
        RealtimeMediaSourceCenterLibWebRTC as a singleton to make sure the
        devices were correctly listed and used, we needed this when using
        libwebrtc media devices management. We are now using GStreamer to handle
        the media devices so this is not needed anymore.

        No new tests, this change removed unused code.

        * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
        (WebCore::RealtimeMediaSourceCenterLibWebRTC::RealtimeMediaSourceCenterLibWebRTC):
        * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.h:

2018-07-10  Zalan Bujtas  <zalan@apple.com>

        Rollout r233530: Candidate for Speedometer regression.
        https://bugs.webkit.org/show_bug.cgi?id=187518

        * rendering/SimpleLineLayoutFlowContents.h:

2018-07-09  Antoine Quint  <graouts@apple.com>

        [Web Animations] Correct handle repetition of composite and easing values
        https://bugs.webkit.org/show_bug.cgi?id=187498
        <rdar://problem/41999183>

        Reviewed by Dean Jackson.

        If there are fewer values for "easing" and "composite" than there are keyframes, we are supposed to
        fill in missing values by repeating the pattern of specified values. We were starting our iteration
        to fill those missing values on the second missing value rather than the first missing value.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::processPropertyIndexedKeyframes):

2018-07-09  Youenn Fablet  <youenn@apple.com>

        Add the possibility to run unsandboxed plug-ins
        https://bugs.webkit.org/show_bug.cgi?id=187310
        <rdar://problem/41798808>

        Reviewed by Alexey Proskuryakov.

        Add a runtime flag to enforce plugin sandboxing.
        Covered by manual testing.

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setSandboxPlugInEnabled):
        (WebCore::RuntimeEnabledFeatures::sandboxPlugInEnabled const):

2018-07-09  Dean Jackson  <dino@apple.com>

        Remove fullscreen-auto-hide-delay
        https://bugs.webkit.org/show_bug.cgi?id=187493
        <rdar://problem/41830852>

        Reviewed by Antoine Quint.

        Remove the env() value for fullscreen-auto-hide-delay.

        * dom/ConstantPropertyMap.cpp:
        (WebCore::ConstantPropertyMap::nameForProperty const):
        (WebCore::ConstantPropertyMap::setFullscreenAutoHideDelay): Deleted.
        * dom/ConstantPropertyMap.h:
        * page/Page.cpp:
        (WebCore::Page::setFullscreenAutoHideDelay): Deleted.
        * page/Page.h:
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState): No need to reset delay.
        (WebCore::Internals::setFullscreenAutoHideDelay): Deleted.
        * testing/Internals.h: Remove the delay setter/getter.
        * testing/Internals.idl:

2018-07-09  Timothy Hatcher  <timothy@apple.com>

        Semantic colors don't update when accessibility Increase Contrast mode is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=187425
        rdar://problem/39948240

        Reviewed by Tim Horton.

        Added a listener for the accessibility change notification to invalidate our color caches.

        Removed calls to RenderTheme::singleton().platformColorsDidChange() in Page, since that
        ended up calling Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment multiple times.
        Instead, changed the functions to use the new instance version instead.

        * page/Page.cpp:
        (WebCore::Page::updateStyleAfterChangeInEnvironment): Added. Gives Page a direct way to do this work
        per instance instead of on all pages (since appearance can be difference per view).
        (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Call updateStyleAfterChangeInEnvironment.
        (WebCore::Page::setUseSystemAppearance): Call updateStyleAfterChangeInEnvironment.
        (WebCore::Page::setUseDarkAppearance): Added. Call updateStyleAfterChangeInEnvironment.
        * page/Page.h:
        (WebCore::Page::setUseDarkAppearance): Moved to the implementation file.
        * platform/mac/LocalDefaultSystemAppearance.mm:
        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Removed recursive check since it was interfering
        with the setting of m_usingDarkAppearance and causing the wrong color cache to be used.
        (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
        * rendering/RenderThemeMac.mm:
        (-[WebCoreRenderThemeNotificationObserver init]): Listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
        (-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]): Removed assert since multiple notifications are used now.
        (WebCore::RenderThemeMac::systemColor): Change how system link colors are cached. Don't store useSystemAppearance link colors in the
        ColorCache, since that special bool isn't considered in the cache after the first time.

2018-07-09  Simon Fraser  <simon.fraser@apple.com>

        Shrink various loading-related enums to shrink CachedResource
        https://bugs.webkit.org/show_bug.cgi?id=187443

        Reviewed by Chris Dumez.
        
        ResourceRequestBase, ResourceResponseBase, ResourceLoaderOptions, FetchOptions and
        CachedResource have a lot of enum members variables most of which took 4 bytes each.
        These can be packed much more efficiently if the enums are declared with an 8-bit size.
        This requires turning enums into enum classes in some cases.
        
        This reduces the size of CachedResource from 1464 to 1384 bytes, which saves about 49KB
        over the ~600 CachedResources on nytimes.com.

        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::startLoadingBlobURL):
        (WebCore::FetchLoader::start):
        * css/StyleRuleImport.cpp:
        (WebCore::StyleRuleImport::requestStyleSheet):
        * fileapi/FileReaderLoader.cpp:
        (WebCore::FileReaderLoader::start):
        * html/MediaDocument.cpp:
        (WebCore::MediaDocumentParser::createDocumentStructure):
        * html/PluginDocument.cpp:
        (WebCore::PluginDocumentParser::appendBytes):
        * html/parser/CSSPreloadScanner.cpp:
        (WebCore::CSSPreloadScanner::emitRule):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::StartTagScanner::resourceType const):
        * inspector/NetworkResourcesData.cpp:
        (WebCore::shouldBufferResourceData):
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::didReceiveResponse):
        (WebCore::InspectorNetworkAgent::loadResource):
        (WebCore::InspectorNetworkAgent::cachedResourceContent):
        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::sourceMapURLForResource):
        (WebCore::InspectorPageAgent::inspectorResourceType):
        * loader/ApplicationManifestLoader.cpp:
        (WebCore::ApplicationManifestLoader::startLoading):
        * loader/ContentFilter.cpp:
        (WebCore::ContentFilter::deliverResourceData):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::notifyFinished):
        (WebCore::DocumentLoader::willSendRequest):
        (WebCore::DocumentLoader::tryLoadingRedirectRequestFromApplicationCache):
        (WebCore::DocumentLoader::subresource const):
        (WebCore::DocumentLoader::loadMainResource):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        (WebCore::DocumentThreadableLoader::makeCrossOriginAccessRequest):
        (WebCore::DocumentThreadableLoader::makeSimpleCrossOriginAccessRequest):
        (WebCore::DocumentThreadableLoader::preflightSuccess):
        (WebCore::DocumentThreadableLoader::loadRequest):
        * loader/FetchOptions.h:
        (WebCore::FetchOptions::FetchOptions):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadFrameRequest):
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::reloadWithOverrideEncoding):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::defaultRequestCachingPolicy):
        (WebCore::FrameLoader::addExtraFieldsToRequest):
        (WebCore::FrameLoader::loadedResourceFromMemoryCache):
        (WebCore::FrameLoader::loadDifferentDocumentItem):
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::resourceTypeFromAsAttribute):
        (WebCore::createLinkPreloadResourceClient):
        (WebCore::LinkLoader::isSupportedType):
        (WebCore::LinkLoader::prefetchIfNeeded):
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::requestResource):
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::scheduleLocationChange):
        * loader/NetscapePlugInStreamLoader.cpp:
        (WebCore::NetscapePlugInStreamLoader::NetscapePlugInStreamLoader):
        * loader/ResourceLoadInfo.cpp:
        (WebCore::toResourceType):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::init):
        (WebCore::ResourceLoader::start):
        (WebCore::ResourceLoader::setDataBufferingPolicy):
        (WebCore::ResourceLoader::addDataOrBuffer):
        (WebCore::ResourceLoader::willSendRequestInternal):
        (WebCore::ResourceLoader::didReceiveResponse):
        (WebCore::ResourceLoader::didReceiveDataOrBuffer):
        (WebCore::ResourceLoader::didFinishLoadingOnePart):
        (WebCore::ResourceLoader::cleanupForError):
        * loader/ResourceLoader.h:
        (WebCore::ResourceLoader::shouldSendResourceLoadCallbacks const):
        (WebCore::ResourceLoader::shouldSniffContent const):
        (WebCore::ResourceLoader::shouldIncludeCertificateInfo const):
        * loader/ResourceLoaderOptions.h:
        * loader/ResourceTimingInformation.cpp:
        (WebCore::ResourceTimingInformation::addResourceTiming):
        (WebCore::ResourceTimingInformation::storeResourceTimingInitiatorInformation):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::SubresourceLoader):
        (WebCore::SubresourceLoader::willSendRequestInternal):
        (WebCore::SubresourceLoader::shouldCreatePreviewLoaderForResponse const):
        (WebCore::SubresourceLoader::didReceiveResponse):
        (WebCore::logResourceLoaded):
        (WebCore::SubresourceLoader::didFinishLoading):
        (WebCore::SubresourceLoader::didFail):
        (WebCore::SubresourceLoader::didCancel):
        * loader/cache/CachedApplicationManifest.cpp:
        (WebCore::CachedApplicationManifest::CachedApplicationManifest):
        * loader/cache/CachedApplicationManifest.h:
        * loader/cache/CachedCSSStyleSheet.cpp:
        (WebCore::CachedCSSStyleSheet::CachedCSSStyleSheet):
        * loader/cache/CachedCSSStyleSheet.h:
        * loader/cache/CachedFont.h:
        * loader/cache/CachedImage.cpp:
        (WebCore::CachedImage::CachedImage):
        (WebCore::CachedImage::updateBuffer):
        (WebCore::CachedImage::updateData):
        * loader/cache/CachedImage.h:
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::updateBuffer):
        (WebCore::CachedRawResource::updateData):
        (WebCore::CachedRawResource::finishLoading):
        (WebCore::CachedRawResource::canReuse const):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::defaultPriorityForResourceType):
        (WebCore::deadDecodedDataDeletionIntervalForResourceType):
        (WebCore::CachedResource::CachedResource):
        (WebCore::CachedResource::load):
        (WebCore::CachedResource::updateBuffer):
        (WebCore::CachedResource::updateData):
        (WebCore::CachedResource::isCORSSameOrigin const):
        (WebCore::CachedResource::freshnessLifetime const):
        (WebCore::CachedResource::setResponse):
        (WebCore::CachedResource::addClientToSet):
        (WebCore::CachedResource::areAllClientsXMLHttpRequests const):
        * loader/cache/CachedResource.h:
        (WebCore::CachedResource::isImage const):
        (WebCore::CachedResource::isMainOrMediaOrIconOrRawResource const):
        (WebCore::CachedResource::ignoreForRequestCount const):
        (WebCore::CachedResource::shouldSendResourceLoadCallbacks const):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::createResource):
        (WebCore::CachedResourceLoader::requestImage):
        (WebCore::CachedResourceLoader::requestFont):
        (WebCore::CachedResourceLoader::requestTextTrack):
        (WebCore::CachedResourceLoader::requestCSSStyleSheet):
        (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::requestApplicationManifest):
        (WebCore::contentTypeFromResourceType):
        (WebCore::CachedResourceLoader::checkInsecureContent const):
        (WebCore::CachedResourceLoader::allowedByContentSecurityPolicy const):
        (WebCore::CachedResourceLoader::canRequest):
        (WebCore::CachedResourceLoader::canRequestInContentDispositionAttachmentSandbox const):
        (WebCore::CachedResourceLoader::shouldUpdateCachedResourceWithCurrentRequest):
        (WebCore::isResourceSuitableForDirectReuse):
        (WebCore::destinationForType):
        (WebCore::CachedResourceLoader::loadResource):
        (WebCore::CachedResourceLoader::determineRevalidationPolicy const):
        (WebCore::CachedResourceLoader::cachePolicy const):
        (WebCore::CachedResourceLoader::preload):
        (WebCore::CachedResourceLoader::warnUnusedPreloads):
        (WebCore::CachedResourceLoader::clearPreloads):
        (WebCore::CachedResourceLoader::defaultCachedResourceOptions):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::updateAccordingCacheMode):
        * loader/cache/CachedResourceRequest.h:
        * loader/cache/CachedSVGDocument.cpp:
        (WebCore::CachedSVGDocument::CachedSVGDocument):
        * loader/cache/CachedSVGDocument.h:
        * loader/cache/CachedSVGFont.cpp:
        (WebCore::CachedSVGFont::CachedSVGFont):
        * loader/cache/CachedSVGFont.h:
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::CachedScript):
        * loader/cache/CachedScript.h:
        * loader/cache/CachedTextTrack.cpp:
        (WebCore::CachedTextTrack::CachedTextTrack):
        (WebCore::CachedTextTrack::doUpdateBuffer):
        * loader/cache/CachedTextTrack.h:
        * loader/cache/CachedXSLStyleSheet.cpp:
        (WebCore::CachedXSLStyleSheet::CachedXSLStyleSheet):
        * loader/cache/CachedXSLStyleSheet.h:
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::getStatistics):
        * loader/icon/IconLoader.cpp:
        (WebCore::IconLoader::startLoading):
        * loader/mac/ResourceLoaderMac.mm:
        (WebCore::ResourceLoader::willCacheResponseAsync):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):
        * page/EventSource.cpp:
        (WebCore::EventSource::connect):
        * platform/ReferrerPolicy.h:
        * platform/graphics/avfoundation/objc/WebCoreAVFResourceLoader.mm:
        (WebCore::WebCoreAVFResourceLoader::startLoading):
        * platform/ios/QuickLook.mm:
        (WebCore::registerQLPreviewConverterIfNeeded):
        * platform/network/CacheValidation.cpp:
        (WebCore::updateRedirectChainStatus):
        (WebCore::redirectChainAllowsReuse):
        * platform/network/CacheValidation.h:
        (WebCore::RedirectChainCacheStatus::RedirectChainCacheStatus):
        * platform/network/ResourceErrorBase.h:
        * platform/network/ResourceLoadPriority.h:
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::httpBody const):
        (WebCore::ResourceRequestBase::updatePlatformRequest const):
        (WebCore::ResourceRequestBase::updateResourceRequest const):
        * platform/network/ResourceRequestBase.h:
        * platform/network/ResourceResponseBase.h:
        * platform/network/StoredCredentialsPolicy.h:
        * platform/network/cf/ResourceRequest.h:
        (WebCore::ResourceRequest::ResourceRequest):
        * platform/network/cf/ResourceRequestCFNet.cpp:
        (WebCore::toPlatformRequestCachePolicy):
        (WebCore::fromPlatformRequestCachePolicy):
        (WebCore::ResourceRequest::doUpdateResourceRequest):
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        (WebCore::fromPlatformRequestCachePolicy):
        (WebCore::toPlatformRequestCachePolicy):
        (WebCore::ResourceRequest::doUpdateResourceRequest):
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSessionDataTask resource:receivedRedirect:request:completionHandler:]):
        * platform/network/ios/PreviewConverter.mm:
        (WebCore::PreviewConverter::safeRequest const):
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::createNSURLConnection):
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:willSendRequest:redirectResponse:]):
        (-[WebCoreResourceHandleAsOperationQueueDelegate connection:didReceiveResponse:]):
        * testing/Internals.cpp:
        (WebCore::toResourceRequestCachePolicy):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadSynchronously):
        (WebCore::WorkerScriptLoader::loadAsynchronously):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::createRequest):

2018-07-09  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/DocumentTimeline/constructor.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186498
        <rdar://problem/41000205>
        
        Reviewed by Dean Jackson.

        Add a Constructor to the DocumentTimeline IDL to match the spec and ensure we respect the provided
        origin time. To ensure all DocumentTimeline instances report matching current times, we read the
        current time from the "main" document timeline, the one created by the Document automatically.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::create):
        (WebCore::DocumentTimeline::DocumentTimeline):
        (WebCore::DocumentTimeline::currentTime):
        * animation/DocumentTimeline.h:
        * animation/DocumentTimeline.idl:
        * animation/DocumentTimelineOptions.h:
        * animation/DocumentTimelineOptions.idl:

2018-07-09  Antoine Quint  <graouts@apple.com>

        [Web Animations] Support overlapping keyframes
        https://bugs.webkit.org/show_bug.cgi?id=187481
        <rdar://problem/41988674>

        Reviewed by Dean Jackson.

        We now support parsing of multiple keyframes for the same offset.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::computeMissingKeyframeOffsets): Keyframes with a null offset that don't yet have a non-zero
        computed offset are keyframes with an offset that needs to be computed.
        (WebCore::KeyframeEffectReadOnly::processKeyframes): Only file an exception if an offset is found that
        is lower than a previously-parsed one, allowing offsets with the same value.
        * rendering/style/KeyframeList.cpp:
        (WebCore::KeyframeList::insert): Remove the assertion that prevented an offset to be found more than once.

2018-07-09  Youenn Fablet  <youenn@apple.com>

        StringView operator==(char*) should check the length of the string
        https://bugs.webkit.org/show_bug.cgi?id=187422

        Reviewed by Chris Dumez.

        Covered by existing tests.

        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename):

2018-07-09  Simon Fraser  <simon.fraser@apple.com>

        Shrink WebCore::Pair
        https://bugs.webkit.org/show_bug.cgi?id=187450

        Reviewed by Sam Weinig.

        Move m_encoding to pack in with m_refCount and remove the virtual destructor,
        shrinking the class from 40 to 24 bytes.
        Also make the enum take only a byte, in case it gets used elsewhere
        
        There are about 500 Pairs on nytimes.com, so this memory saving is non-trivial.

        * css/Pair.h:

2018-07-09  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WebCore] Annotate classes with WTF_MAKE_FAST_ALLOCATED as much as possible
        https://bugs.webkit.org/show_bug.cgi?id=187474

        Reviewed by Mark Lam.

        When opening cnn.com, debugger says that so many objects in WebCore are allocated
        from system allocator. This patch attempts to annotate these found classes with
        WTF_MAKE_FAST_ALLOCATED.

        We also annotate WebAudio classes with `final` to make WebAudio class hierarchy solid.

        No behavior change.

        * Modules/indexeddb/IDBIndex.h:
        * Modules/indexeddb/IDBObjectStore.h:
        * Modules/indexeddb/client/IDBConnectionProxy.h:
        * Modules/mediastream/UserMediaController.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/webaudio/AsyncAudioDecoder.h:
        * Modules/webaudio/AudioListener.h:
        (WebCore::AudioListener::create): Deleted.
        (WebCore::AudioListener::setPosition): Deleted.
        (WebCore::AudioListener::position const): Deleted.
        (WebCore::AudioListener::setOrientation): Deleted.
        (WebCore::AudioListener::orientation const): Deleted.
        (WebCore::AudioListener::setUpVector): Deleted.
        (WebCore::AudioListener::upVector const): Deleted.
        (WebCore::AudioListener::setVelocity): Deleted.
        (WebCore::AudioListener::velocity const): Deleted.
        (WebCore::AudioListener::setDopplerFactor): Deleted.
        (WebCore::AudioListener::dopplerFactor const): Deleted.
        (WebCore::AudioListener::setSpeedOfSound): Deleted.
        (WebCore::AudioListener::speedOfSound const): Deleted.
        * Modules/webaudio/AudioNode.h:
        * Modules/webaudio/AudioNodeInput.h:
        (WebCore::AudioNodeInput::node const): Deleted.
        * Modules/webaudio/AudioNodeOutput.h:
        * Modules/webaudio/AudioParam.h:
        (WebCore::AudioParam::create): Deleted.
        (WebCore::AudioParam::name const): Deleted.
        (WebCore::AudioParam::minValue const): Deleted.
        (WebCore::AudioParam::maxValue const): Deleted.
        (WebCore::AudioParam::defaultValue const): Deleted.
        (WebCore::AudioParam::units const): Deleted.
        (WebCore::AudioParam::resetSmoothedValue): Deleted.
        (WebCore::AudioParam::setSmoothingConstant): Deleted.
        (WebCore::AudioParam::setValueAtTime): Deleted.
        (WebCore::AudioParam::linearRampToValueAtTime): Deleted.
        (WebCore::AudioParam::exponentialRampToValueAtTime): Deleted.
        (WebCore::AudioParam::setTargetAtTime): Deleted.
        (WebCore::AudioParam::setValueCurveAtTime): Deleted.
        (WebCore::AudioParam::cancelScheduledValues): Deleted.
        (WebCore::AudioParam::hasSampleAccurateValues): Deleted.
        (WebCore::AudioParam::AudioParam): Deleted.
        * Modules/webaudio/AudioParamTimeline.h:
        * Modules/webaudio/AudioProcessingEvent.h:
        (WebCore::AudioProcessingEvent::create): Deleted.
        (WebCore::AudioProcessingEvent::createForBindings): Deleted.
        (WebCore::AudioProcessingEvent::inputBuffer): Deleted.
        (WebCore::AudioProcessingEvent::outputBuffer): Deleted.
        (WebCore::AudioProcessingEvent::playbackTime const): Deleted.
        * Modules/webaudio/BiquadDSPKernel.h:
        (WebCore::BiquadDSPKernel::BiquadDSPKernel): Deleted.
        (WebCore::BiquadDSPKernel::biquadProcessor): Deleted.
        * Modules/webaudio/BiquadFilterNode.h:
        (WebCore::BiquadFilterNode::create): Deleted.
        (WebCore::BiquadFilterNode::frequency): Deleted.
        (WebCore::BiquadFilterNode::q): Deleted.
        (WebCore::BiquadFilterNode::gain): Deleted.
        (WebCore::BiquadFilterNode::detune): Deleted.
        (WebCore::BiquadFilterNode::biquadProcessor): Deleted.
        * Modules/webaudio/BiquadProcessor.h:
        (WebCore::BiquadProcessor::filterCoefficientsDirty const): Deleted.
        (WebCore::BiquadProcessor::hasSampleAccurateValues const): Deleted.
        (WebCore::BiquadProcessor::parameter1): Deleted.
        (WebCore::BiquadProcessor::parameter2): Deleted.
        (WebCore::BiquadProcessor::parameter3): Deleted.
        (WebCore::BiquadProcessor::parameter4): Deleted.
        (WebCore::BiquadProcessor::type const): Deleted.
        * Modules/webaudio/ChannelMergerNode.h:
        * Modules/webaudio/ChannelSplitterNode.h:
        * Modules/webaudio/DelayDSPKernel.h:
        (WebCore::DelayDSPKernel::maxDelayTime const): Deleted.
        (WebCore::DelayDSPKernel::setDelayFrames): Deleted.
        (WebCore::DelayDSPKernel::delayProcessor): Deleted.
        * Modules/webaudio/DelayNode.h:
        * Modules/webaudio/DelayProcessor.h:
        (WebCore::DelayProcessor::delayTime const): Deleted.
        (WebCore::DelayProcessor::maxDelayTime): Deleted.
        * Modules/webaudio/DynamicsCompressorNode.h:
        (WebCore::DynamicsCompressorNode::create): Deleted.
        (WebCore::DynamicsCompressorNode::threshold): Deleted.
        (WebCore::DynamicsCompressorNode::knee): Deleted.
        (WebCore::DynamicsCompressorNode::ratio): Deleted.
        (WebCore::DynamicsCompressorNode::attack): Deleted.
        (WebCore::DynamicsCompressorNode::release): Deleted.
        (WebCore::DynamicsCompressorNode::reduction): Deleted.
        * Modules/webaudio/GainNode.h:
        (WebCore::GainNode::create): Deleted.
        (WebCore::GainNode::gain): Deleted.
        * Modules/webaudio/MediaElementAudioSourceNode.h:
        (WebCore::MediaElementAudioSourceNode::mediaElement): Deleted.
        * Modules/webaudio/MediaStreamAudioDestinationNode.h:
        (WebCore::MediaStreamAudioDestinationNode::stream): Deleted.
        * Modules/webaudio/MediaStreamAudioSourceNode.h:
        (WebCore::MediaStreamAudioSourceNode::mediaStream): Deleted.
        * Modules/webaudio/OfflineAudioCompletionEvent.h:
        (WebCore::OfflineAudioCompletionEvent::renderedBuffer): Deleted.
        * Modules/webaudio/OfflineAudioDestinationNode.h:
        (WebCore::OfflineAudioDestinationNode::create): Deleted.
        * Modules/webaudio/PannerNode.h:
        (WebCore::PannerNode::create): Deleted.
        (WebCore::PannerNode::panningModel const): Deleted.
        (WebCore::PannerNode::position const): Deleted.
        (WebCore::PannerNode::setPosition): Deleted.
        (WebCore::PannerNode::orientation const): Deleted.
        (WebCore::PannerNode::setOrientation): Deleted.
        (WebCore::PannerNode::velocity const): Deleted.
        (WebCore::PannerNode::setVelocity): Deleted.
        (WebCore::PannerNode::refDistance): Deleted.
        (WebCore::PannerNode::setRefDistance): Deleted.
        (WebCore::PannerNode::maxDistance): Deleted.
        (WebCore::PannerNode::setMaxDistance): Deleted.
        (WebCore::PannerNode::rolloffFactor): Deleted.
        (WebCore::PannerNode::setRolloffFactor): Deleted.
        (WebCore::PannerNode::coneInnerAngle const): Deleted.
        (WebCore::PannerNode::setConeInnerAngle): Deleted.
        (WebCore::PannerNode::coneOuterAngle const): Deleted.
        (WebCore::PannerNode::setConeOuterAngle): Deleted.
        (WebCore::PannerNode::coneOuterGain const): Deleted.
        (WebCore::PannerNode::setConeOuterGain): Deleted.
        (WebCore::PannerNode::distanceGain): Deleted.
        (WebCore::PannerNode::coneGain): Deleted.
        * Modules/webaudio/PeriodicWave.h:
        (WebCore::PeriodicWave::rateScale const): Deleted.
        (WebCore::PeriodicWave::periodicWaveSize const): Deleted.
        (WebCore::PeriodicWave::sampleRate const): Deleted.
        (WebCore::PeriodicWave::numberOfRanges const): Deleted.
        * Modules/webaudio/RealtimeAnalyser.h:
        * Modules/webaudio/ScriptProcessorNode.h:
        (WebCore::ScriptProcessorNode::bufferSize const): Deleted.
        (WebCore::ScriptProcessorNode::doubleBufferIndex const): Deleted.
        (WebCore::ScriptProcessorNode::swapBuffers): Deleted.
        * Modules/webaudio/WaveShaperDSPKernel.h:
        (WebCore::WaveShaperDSPKernel::waveShaperProcessor): Deleted.
        * Modules/webaudio/WaveShaperProcessor.h:
        (WebCore::WaveShaperProcessor::curve): Deleted.
        (WebCore::WaveShaperProcessor::oversample const): Deleted.
        * dom/MessagePort.h:
        * html/FormAssociatedElement.h:
        * loader/LinkPreloadResourceClients.h:
        * page/WheelEventDeltaFilter.h:
        * page/mac/WheelEventDeltaFilterMac.h:
        * platform/RemoteCommandListener.h:
        * platform/audio/AudioDSPKernel.h:
        * platform/audio/AudioProcessor.h:
        * platform/audio/PlatformMediaSession.h:
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.h:
        * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
        * platform/mediastream/libwebrtc/LibWebRTCProviderCocoa.h:
        * workers/service/ServiceWorkerContainer.h:

2018-07-09  Simon Fraser  <simon.fraser@apple.com>

        Shrink RenderSVGShape
        https://bugs.webkit.org/show_bug.cgi?id=187459

        Reviewed by Zalan Bujtas.

        Shrink RenderSVGShape from 328 to 320 bytes by moving the bits before the AffineTransform,
        which is 16-byte aligned. This saves 9.6KB on nytimes.com.

        * rendering/svg/RenderSVGShape.h:

2018-07-09  Simon Fraser  <simon.fraser@apple.com>

        Shrink CSSFontFace
        https://bugs.webkit.org/show_bug.cgi?id=187456

        Reviewed by Anders Carlsson.

        Shrink CSSFontFace by 56 bytes, from 288 to 256 bytes, mostly by defining enums as 8-bit,
        but also re-ordering the member variables. There are over 400 of these objects on nytimes.com,
        so this saves about 22KB.

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::CSSFontFace):
        * css/CSSFontFace.h:
        * platform/text/TextFlags.h:
        * rendering/style/RenderStyleConstants.h:

2018-07-09  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233612.
        https://bugs.webkit.org/show_bug.cgi?id=187475

        Revision caused the api test LinkColorWithSystemAppearance to
        fail on all systems. (Requested by Truitt on #webkit).

        Reverted changeset:

        "Semantic colors don't update when accessibility Increase
        Contrast mode is enabled."
        https://bugs.webkit.org/show_bug.cgi?id=187425
        https://trac.webkit.org/changeset/233612

2018-07-09  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] Remove useless workaround
        https://bugs.webkit.org/show_bug.cgi?id=186921

        Reviewed by Xabier Rodriguez-Calvar.

        In bug 67407 a workaround was added for GStreamer 0.10. With 1.x
        the media/video-reverse-play-duration.html test passes without any
        workaround needed. The other test mentioned in that bug was
        removed, it seems.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
        Removed early return, position queries shouldn't be avoided on EOS
        because the pipeline is in READY state, not NULL.
        (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):

2018-07-08  Simon Fraser  <simon.fraser@apple.com>

        Optimize packing of RenderSVGViewportContainer
        https://bugs.webkit.org/show_bug.cgi?id=187458

        Reviewed by Zalan Bujtas.

        Shrink RenderSVGViewportContainer from 296 bytes to 280 bytes, saving about 6KB on nytimes.com.

        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::RenderSVGContainer):
        * rendering/svg/RenderSVGContainer.h:
        * rendering/svg/RenderSVGViewportContainer.h:

2018-07-08  Simon Fraser  <simon.fraser@apple.com>

        Shrink RenderTableSection
        https://bugs.webkit.org/show_bug.cgi?id=187457

        Reviewed by Zalan Bujtas.

        Shrink RenderTableSection from 344 to 336 bytes, saving about 3.6KB on nytimes.com.

        * rendering/RenderTableSection.h:

2018-07-08  Simon Fraser  <simon.fraser@apple.com>

        Optimize packing of RootInlineBox
        https://bugs.webkit.org/show_bug.cgi?id=187430

        Reviewed by Zalan Bujtas.

        In InlineBox, move the m_logicalWidth float up next to the m_expansion float with m_topLeft next; this
        avoids padding of 4 bytes after this float.
        
        In InlineFlowBox, move the bitfields before the pointers so they can snug up into the
        4 bytes after m_expansion in the base class.
        
        The comment about m_lineBreakPos's padding in RootInlineBox is wrong; just move it to the end
        to avoid padding before the m_lineBreakObj pointer.
        
        Make m_logicalWidth private and have derived classes use the accessor.
        
        Make EllipsisBox 4 bytes smaller too.

        * rendering/EllipsisBox.cpp:
        (WebCore::EllipsisBox::EllipsisBox):
        (WebCore::EllipsisBox::paintMarkupBox):
        (WebCore::EllipsisBox::nodeAtPoint):
        * rendering/EllipsisBox.h:
        * rendering/InlineBox.h:
        (WebCore::InlineBox::InlineBox):
        * rendering/InlineFlowBox.cpp:
        * rendering/InlineFlowBox.h:
        (WebCore::InlineFlowBox::InlineFlowBox):
        (WebCore::InlineFlowBox::frameRectIncludingLineHeight const):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::localSelectionRect const):
        (WebCore::InlineTextBox::paint):
        (WebCore::InlineTextBox::paintPlatformDocumentMarker):
        (WebCore::InlineTextBox::paintMarkedTextBackground):
        (WebCore::InlineTextBox::paintCompositionUnderline const):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::RootInlineBox):
        * rendering/RootInlineBox.h:

2018-07-08  Antoine Quint  <graouts@apple.com>

        [Web Animations] A number of tests report an incorrect computed offset
        https://bugs.webkit.org/show_bug.cgi?id=187410
        <rdar://problem/41905790>

        Reviewed by Dean Jackson.

        While we would correctly avoid computing missing offsets when processing the first keyframe following the last
        keyframes with a specified offset, we were forgetting to update the index of the last keyframe with a specified
        offset which meant we would accidentally override a specified offset with an automically-computed one.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::computeMissingKeyframeOffsets):

2018-07-08  David Kilzer  <ddkilzer@apple.com>

        DOMMatrix.invertSelf() returns garbage values for a non-invertible matrix
        <https://webkit.org/b/187446>
        <rdar://problem/41853187>

        Reviewed by Daniel Bates.

        Test: http/wpt/css/geometry/DOMMatrix-invertSelf.html

        * css/DOMMatrix.cpp:
        (WebCore::DOMMatrix::invertSelf): Add missing `else`, and
        restructure to use positive logic.

2018-07-07  Wenson Hsieh  <wenson_hsieh@apple.com>

        Introduce a layout milestone to track when the document contains a large number of rendered characters
        https://bugs.webkit.org/show_bug.cgi?id=187412
        <rdar://problem/41744338>

        Reviewed by Ryosuke Niwa.

        Implements a new layout milestone: `DidRenderSignificantAmountOfText`. This is similar to the existing
        `DidFirstVisuallyNonEmptyLayout` milestone, but with a few important additional constraints:

        • The minimum threshold of rendered characters is much larger (3000 instead of 200).
        • The mean length of a text node must be large (at least 50).

        This is a (computationally) lightweight heuristic intended to estimate the likelihood that a page is capable of
        being presented in Reader mode. In many article-like pages, the average length of a text node is significantly
        longer than other types of pages; thus, on pages where the average length of a text node is very large *and*
        there is a large quantity of text, we can use this as a cue to opportunistically detect and enter Safari reader
        mode on watchOS.

        Test: RenderingProgressTests.DidRenderSignificantAmountOfText

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

        Clear out new state members that keep track of whether the significant rendered text milestone has been met.

        (WebCore::elementOverflowRectIsLargerThanThreshold):

        Factor out logic to grab the overflow height of an element into a separate helper function.

        (WebCore::FrameView::qualifiesAsVisuallyNonEmpty const):
        (WebCore::FrameView::updateSignificantRenderedTextMilestoneIfNeeded):

        Determines whether to fire this new milestone after the next layout pass is finished. The logic here is similar
        to the logic in qualifiesAsVisuallyNonEmpty, requiring that there are not still pending stylesheets in the head
        and that the document height is at least a minimum threshold. However, unlike the first visually non-empty
        layout, this milestone is never guaranteed to fire.

        (WebCore::FrameView::fireLayoutRelatedMilestonesIfNeeded):
        * page/FrameView.h:
        (WebCore::FrameView::incrementVisuallyNonEmptyCharacterCount):
        * page/LayoutMilestones.h:

2018-07-06  Timothy Hatcher  <timothy@apple.com>

        Semantic colors don't update when accessibility Increase Contrast mode is enabled.
        https://bugs.webkit.org/show_bug.cgi?id=187425
        rdar://problem/39948240

        Reviewed by Tim Horton.

        Added a listener for the accessibility change notification to invalidate our color caches.

        Removed calls to RenderTheme::singleton().platformColorsDidChange() in Page, since that
        ended up calling Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment multiple times.
        Instead, changed the functions to use the new instance version instead.

        * page/Page.cpp:
        (WebCore::Page::updateStyleAfterChangeInEnvironment): Added. Gives Page a direct way to do this work
        per instance instead of on all pages (since appearance can be difference per view).
        (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): Call updateStyleAfterChangeInEnvironment.
        (WebCore::Page::setUseSystemAppearance): Call updateStyleAfterChangeInEnvironment.
        (WebCore::Page::setUseDarkAppearance): Added. Call updateStyleAfterChangeInEnvironment.
        * page/Page.h:
        (WebCore::Page::setUseDarkAppearance): Moved to the implementation file.
        * platform/mac/LocalDefaultSystemAppearance.mm:
        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Removed recursive check since it was interfering
        with the setting of m_usingDarkAppearance and causing the wrong color cache to be used.
        (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
        * rendering/RenderThemeMac.mm:
        (-[WebCoreRenderThemeNotificationObserver init]): Listen for NSWorkspaceAccessibilityDisplayOptionsDidChangeNotification.
        (-[WebCoreRenderThemeNotificationObserver systemColorsDidChange:]): Removed assert since multiple notifications are used now.

2018-07-06  Ryosuke Niwa  <rniwa@webkit.org>

        Make ReasonForSuspension enum class
        https://bugs.webkit.org/show_bug.cgi?id=187405

        Reviewed by Zalan Bujtas.

        Made ReasonForSuspension an enum class instead of enum and moved out of ActiveDOMObject.

        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::suspend):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::suspend):
        * dom/ActiveDOMObject.h:
        * dom/Document.cpp:
        (WebCore::Document::didBecomeCurrentDocumentInFrame):
        (WebCore::Document::suspendActiveDOMObjects):
        (WebCore::Document::resumeActiveDOMObjects):
        (WebCore::Document::suspend):
        (WebCore::Document::resume):
        (WebCore::Document::suspendScheduledTasks):
        (WebCore::Document::resumeScheduledTasks):
        * dom/Document.h:
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
        (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
        * dom/ScriptExecutionContext.h:
        (WebCore::ScriptExecutionContext::reasonForSuspendingActiveDOMObjects const):
        * history/CachedFrame.cpp:
        (WebCore::CachedFrameBase::restore):
        (WebCore::CachedFrame::CachedFrame):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::suspend):
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::suspend):
        * inspector/PageScriptDebugServer.cpp:
        (WebCore::PageScriptDebugServer::setJavaScriptPaused):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::commitProvisionalLoad):
        * page/Frame.cpp:
        (WebCore::Frame::suspendActiveDOMObjectsAndAnimations):
        (WebCore::Frame::resumeActiveDOMObjectsAndAnimations):
        * page/PageGroupLoadDeferrer.cpp:
        (WebCore::PageGroupLoadDeferrer::PageGroupLoadDeferrer):
        (WebCore::PageGroupLoadDeferrer::~PageGroupLoadDeferrer):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::suspend):

2018-07-06  Nan Wang  <n_wang@apple.com>

        AX: add a subrole for meter elements on macOS
        https://bugs.webkit.org/show_bug.cgi?id=187409
        <rdar://problem/41905702>

        Reviewed by Chris Fleizach.

        Test: accessibility/mac/meter-subrole.html

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper subrole]):

2018-07-06  Jeremy Jones  <jeremyj@apple.com>

        For <video> element, use video fullscreen instead of element fullscreen.
        https://bugs.webkit.org/show_bug.cgi?id=186093
        rdar://problem/40144751

        Reviewed by Jer Noble.

        Some pages use webkitRequestFullscreen directly on the video element, without any custom controls.
        This will prevent native fullscreeen presentation mode conrols from being used.

        This change makes webkitRequestFullscreen on a video element call webKitSetPresentationMode.

        * dom/Element.h:
        * html/HTMLVideoElement.cpp:
        (WebCore::HTMLVideoElement::webkitRequestFullscreen):
        * html/HTMLVideoElement.h:

2018-07-06  Youenn Fablet  <youenn@apple.com>

        WebRTC MediaStreamTrack Enable / Disable causes video delay / lag
        https://bugs.webkit.org/show_bug.cgi?id=186889
        <rdar://problem/41370285>

        Reviewed by Eric Carlson.

        Libwebrtc expects a continuous flow of calls for audio data since the API
        does not provide any possiblity to give timestamps.

        We were optimizing previously when a source is muted so that we would not transmit audio data.
        This breaks synchronization between audio and video frames (which are timestamped).

        This patch reverts the optimization and instead makes sure to send zeros for silenced audio tracks.

        This requires MediaStreamTrackPrivate to send audio data even if disabled,
        so that RealtimeOutgoingAudioSource will continue sending zeros at the correct pace.
        This also requires WebAudioSourceProviderAVFObjC to exit early if its track is disabled.

        Covered by existing tests.
        Manual testing shows that synchronization is kept.

        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
        * platform/mediastream/RealtimeOutgoingAudioSource.cpp:
        (WebCore::RealtimeOutgoingAudioSource::RealtimeOutgoingAudioSource):
        (WebCore::RealtimeOutgoingAudioSource::initializeConverter):
        (WebCore::RealtimeOutgoingAudioSource::stop):
        (WebCore::RealtimeOutgoingAudioSource::sourceMutedChanged):
        (WebCore::RealtimeOutgoingAudioSource::sourceEnabledChanged):
        (WebCore::RealtimeOutgoingAudioSource::handleMutedIfNeeded): Deleted.
        * platform/mediastream/RealtimeOutgoingAudioSource.h:
        (WebCore::RealtimeOutgoingAudioSource::pullAudioData):
        (WebCore::RealtimeOutgoingAudioSource::isSilenced const):
        (WebCore::RealtimeOutgoingAudioSource::sendSilence): Deleted.
        * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
        (WebCore::RealtimeOutgoingAudioSourceCocoa::pullAudioData):
        (WebCore::RealtimeOutgoingAudioSourceCocoa::handleMutedIfNeeded): Deleted.
        (WebCore::RealtimeOutgoingAudioSourceCocoa::sendSilence): Deleted.
        * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.h:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:
        (WebCore::WebAudioSourceProviderAVFObjC::audioSamplesAvailable):

2018-07-06  Youenn Fablet  <youenn@apple.com>

        Make RealtimeOutgoingVideoSource use DestructionThread::Main
        https://bugs.webkit.org/show_bug.cgi?id=187402

        Reviewed by Chris Dumez.

        No change of behavior.

        * platform/mediastream/RealtimeOutgoingVideoSource.h:

2018-07-06  Ryosuke Niwa  <rniwa@webkit.org>

        Make HTMLMediaElement::remove*Track take a Ref<>&&
        https://bugs.webkit.org/show_bug.cgi?id=187407

        Reviewed by Zalan Bujtas.

        Make these functions take Ref<>&& since they can delete track objects.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::removeAudioTrack):
        (WebCore::HTMLMediaElement::removeTextTrack):
        (WebCore::HTMLMediaElement::removeVideoTrack):
        (WebCore::HTMLMediaElement::forgetResourceSpecificTracks):
        * html/HTMLMediaElement.h:

2018-07-06  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/KeyframeEffect/processing-a-keyframes-argument-002.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186502
        <rdar://problem/41000229>l

        Reviewed by Dean Jackson.

        Ensure we only attempt to convert defined objects or we risk to throw errors in valid situations.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::processKeyframeLikeObject):

2018-07-05  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/Animation/finish.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186496
        <rdar://problem/41000179>

        Reviewed by Dean Jackson.

        We used to only resolve animations that had a target element, but animations need not have a target and their
        current time should still advance so that their finished promise may resolve. We now maintain a list of animations
        without targets and we iterate through them as well as animations with targets in DocumentTimeline::updateAnimations().

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::addAnimation):
        (WebCore::AnimationTimeline::removeAnimation):
        (WebCore::AnimationTimeline::animationWasAddedToElement):
        (WebCore::AnimationTimeline::animationWasRemovedFromElement):
        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline:: const):
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::updateAnimations):
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::resolve):
        * animation/WebAnimation.h:

2018-07-05  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at interfaces/Animation/finished.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186497
        <rdar://problem/41000193>

        Reviewed by Dean Jackson.

        We need to ensure the finished state is updated as a result of any timing property changing.

        * animation/AnimationEffectReadOnly.cpp:
        (WebCore::AnimationEffectReadOnly::timingDidChange):
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::effectTimingPropertiesDidChange):
        * animation/WebAnimation.h:

2018-07-06  Antoine Quint  <graouts@apple.com>

        [Web Animations] Using a Web Animation leaks the Document
        https://bugs.webkit.org/show_bug.cgi?id=187088
        <rdar://problem/41392046>

        Reviewed by Darin Adler.

        Test: webanimations/leak-document-with-web-animation.html

        We need to ensure that any remaining animation is cleared when the DocumentTimeline is detached from its Document.
        We rename WebAnimation::prepareAnimationForRemoval() to WebAnimation::remove() since it really actively disassociates
        the animation from its timeline.

        An earlier version of this patch (r233349) was rolled out due to crashes caught in the ASan configuration. The following
        changes were made to make it safe:

        - We protect the DocumentAnimationScheduler instance in displayRefreshFired() against code that might run in a
        requestAnimationFrame() callback that would trigger the object to be deleted.

        - We protect the WebAnimation instance in remove() against setEffectInternal() or setTimelineInternal() potentially
        causing the object to be deleted. Similar protections were addede to setEffect() and setTimeline().

        - We changed ~DocumentTimeline() to a default implementation to ensure it calls ~DisplayRefreshMonitorClient()
        to avoid callbacks after the object has been marked for deletion.


        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::removeAnimationsForElement): We no longer need the call to removeAnimation()
        since the new WebAnimation::remove() method will also set the timeline to null which will eventually call
        removeAnimation() on the disassociated timeline.
        * animation/DeclarativeAnimation.cpp:
        (WebCore::DeclarativeAnimation::remove):
        (WebCore::DeclarativeAnimation::prepareAnimationForRemoval): Deleted.
        * animation/DeclarativeAnimation.h:
        * animation/DocumentAnimationScheduler.cpp:
        (WebCore::DocumentAnimationScheduler::displayRefreshFired):
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::detachFromDocument): Call remove() on all known animations.
        (WebCore::DocumentTimeline::~DocumentTimeline): Deleted.
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::remove): Set the timeline to null to fully disassociate this animation from its timeline.
        (WebCore::WebAnimation::setEffect):
        (WebCore::WebAnimation::setEffectInternal):
        (WebCore::WebAnimation::setTimeline): Factor the internal timeline-association code out of this JS API method so
        that we can call this code without any JS-facing implications.
        (WebCore::WebAnimation::setTimelineInternal):
        (WebCore::WebAnimation::prepareAnimationForRemoval): Deleted.
        * animation/WebAnimation.h:

2018-07-06  Daniel Bates  <dabates@apple.com>

        Remove Strong Confirmation Password button
        https://bugs.webkit.org/show_bug.cgi?id=187306
        <rdar://problem/41795185>

        Reviewed by Sam Weinig.

        Remove support for the Strong Confirmation Password button because we never made use of it.

        * English.lproj/Localizable.strings:
        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _accessibilityIsStrongPasswordField]):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
        * html/HTMLInputElement.h:
        (WebCore::HTMLInputElement::hasAutoFillStrongPasswordButton const):
        * html/HTMLTextFormControlElement.h:
        * html/TextFieldInputType.cpp:
        (WebCore::autoFillButtonTypeToAccessibilityLabel):
        (WebCore::autoFillButtonTypeToAutoFillButtonText):
        (WebCore::autoFillButtonTypeToAutoFillButtonPseudoClassName):
        (WebCore::isAutoFillButtonTypeChanged):
        * platform/LocalizedStrings.cpp:
        (WebCore::AXAutoFillStrongConfirmationPasswordLabel): Deleted.
        * platform/LocalizedStrings.h:
        * rendering/RenderTextControlSingleLine.cpp:
        (WebCore::RenderTextControlSingleLine::layout):
        * testing/Internals.cpp:
        (WebCore::toAutoFillButtonType):
        (WebCore::toInternalsAutoFillButtonType):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-07-06  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] REGRESSION(r233239): proxy settings not applied after r233239
        https://bugs.webkit.org/show_bug.cgi?id=187381

        Reviewed by Yusuke Suzuki.

        This is because the static variable for proxy settings was replaced by a NeverDestroyed, but the function is not
        returning a reference, but a copy. This is causing several unit tests to fail.

        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::proxySettings):

2018-07-06  Frederic Wang  <fwang@igalia.com>

        [Crash] Illegal use of uninitialized std::optional value in WebCore::AnimationBase::updateStateMachine
        https://bugs.webkit.org/show_bug.cgi?id=187382

        Reviewed by Carlos Garcia Campos.

        WebCore::AnimationBase::updateStateMachine has two potential places where the use of an
        uninitialized std:optional value is possible and one of them is hit when using Google drive.
        Since that old animation code is going to be removed soon, we just quickly patch this issue
        via value_or() so that we can restore the ASSERT added in bug 186536.

        No new tests, code is going to be removed soon.

        * page/animation/AnimationBase.cpp:
        (WebCore::AnimationBase::updateStateMachine): Use value_or(0) to avoid potential crashes.

2018-07-06  Frederic Wang  <fwang@igalia.com>

        Rename HTMLTreeBuilder::didCreateCustomOrCallbackElement
        https://bugs.webkit.org/show_bug.cgi?id=187317

        Reviewed by Ryosuke Niwa.

        This function is called with a new custom element or the fallback HTMLUnknownElement element
        so we rename it didCreateCustomOrFallbackElement.

        No new tests, behavior unchanged.

        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::didCreateCustomOrFallbackElement):
        (WebCore::HTMLTreeBuilder::didCreateCustomOrCallbackElement): Deleted.
        * html/parser/HTMLTreeBuilder.h:

2018-07-05  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r233496): macOS Sierra hits debug assertions in TrackListBase::suspend
        https://bugs.webkit.org/show_bug.cgi?id=187378
        <rdar://problem/41878885>

        Reviewed by Eric Carlson.

        These assertions were wrong since inline debugger, alert, etc... can suspend active DOM objects without
        calling canSuspendForDocumentSuspension. Fixed the bug by removing the assertion and instead suspending
        and resuming the generic event queue.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::suspend):
        (WebCore::MediaSource::resume):
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::suspend):
        (WebCore::SourceBuffer::resume):
        * Modules/mediasource/SourceBufferList.cpp:
        (WebCore::SourceBufferList::suspend):
        (WebCore::SourceBufferList::resume):
        * html/track/TrackListBase.cpp:
        (WebCore::TrackListBase::suspend):
        (WebCore::TrackListBase::resume):

2018-07-05  Youenn Fablet  <youenn@apple.com>

        REGRESSION (r230843): Flash doesn't work; Produces blue box on page
        https://bugs.webkit.org/show_bug.cgi?id=187346
        <rdar://problem/41773974>

        Reviewed by Ryosuke Niwa.

        Introduce clearPagesPluginData used by WebProcess when a plugin policy changes.
        Add a new internals API to get the plugin count as navigator.plugin is filtering plugins.

        Test: http/tests/plugins/plugin-allow-then-reload.html

        * plugins/PluginData.h:
        * plugins/PluginInfoProvider.cpp:
        (WebCore::PluginInfoProvider::clearPagesPluginData):
        * plugins/PluginInfoProvider.h:
        * testing/Internals.cpp:
        (WebCore::Internals::pluginCount):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-07-05  Brady Eidson  <beidson@apple.com>

        IndexedDB operations in a Page fail after a StorageProcess crash.
        <rdar://problem/41626526> and https://bugs.webkit.org/show_bug.cgi?id=187123

        Reviewed by Alex Christensen.

        Test: storage/indexeddb/modern/opendatabase-after-storage-crash.html

        When the connection to a StorageProcess goes away, explicitly tell all of the WebPages
        in the WebProcess about it.
        
        This puts Documents/Workers in an error mode where requests fail instead of timeout.
        It also clears the Page's connection so *new* Documents and Workers will get a fresh 
        new connection that works.
        
        * Modules/indexeddb/client/IDBConnectionToServer.cpp:
        (WebCore::IDBClient::IDBConnectionToServer::callResultFunctionLater):
        (WebCore::IDBClient::IDBConnectionToServer::deleteDatabase):
        (WebCore::IDBClient::IDBConnectionToServer::openDatabase):
        (WebCore::IDBClient::IDBConnectionToServer::createObjectStore):
        (WebCore::IDBClient::IDBConnectionToServer::deleteObjectStore):
        (WebCore::IDBClient::IDBConnectionToServer::renameObjectStore):
        (WebCore::IDBClient::IDBConnectionToServer::clearObjectStore):
        (WebCore::IDBClient::IDBConnectionToServer::createIndex):
        (WebCore::IDBClient::IDBConnectionToServer::deleteIndex):
        (WebCore::IDBClient::IDBConnectionToServer::renameIndex):
        (WebCore::IDBClient::IDBConnectionToServer::putOrAdd):
        (WebCore::IDBClient::IDBConnectionToServer::getRecord):
        (WebCore::IDBClient::IDBConnectionToServer::getAllRecords):
        (WebCore::IDBClient::IDBConnectionToServer::getCount):
        (WebCore::IDBClient::IDBConnectionToServer::deleteRecord):
        (WebCore::IDBClient::IDBConnectionToServer::openCursor):
        (WebCore::IDBClient::IDBConnectionToServer::iterateCursor):
        (WebCore::IDBClient::IDBConnectionToServer::establishTransaction):
        (WebCore::IDBClient::IDBConnectionToServer::commitTransaction):
        (WebCore::IDBClient::IDBConnectionToServer::didFinishHandlingVersionChangeTransaction):
        (WebCore::IDBClient::IDBConnectionToServer::abortTransaction):
        (WebCore::IDBClient::IDBConnectionToServer::didFireVersionChangeEvent):
        (WebCore::IDBClient::IDBConnectionToServer::confirmDidCloseFromServer):
        (WebCore::IDBClient::IDBConnectionToServer::connectionToServerLost):
        (WebCore::IDBClient::IDBConnectionToServer::openDBRequestCancelled):
        (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionPendingClose):
        (WebCore::IDBClient::IDBConnectionToServer::databaseConnectionClosed):
        (WebCore::IDBClient::IDBConnectionToServer::abortOpenAndUpgradeNeeded):
        (WebCore::IDBClient::IDBConnectionToServer::getAllDatabaseNames):
        * Modules/indexeddb/client/IDBConnectionToServer.h:

        * Modules/indexeddb/shared/IDBError.h:
        (WebCore::IDBError::serverConnectionLostError):

        * page/Page.cpp:
        (WebCore::Page::setSessionID):
        (WebCore::Page::idbConnection):
        (WebCore::Page::optionalIDBConnection):
        (WebCore::Page::clearIDBConnection):
        * page/Page.h:

2018-07-05  Ryosuke Niwa  <rniwa@webkit.org>

        Youtube video pages crash after a couple of minutes
        https://bugs.webkit.org/show_bug.cgi?id=187316

        Reviewed by Antti Koivisto.

        The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
        which traverses all media players across different documents including the one in the main frame while its iframe
        is getting removed (to update the Touch Bar's media control).

        Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
        this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
        a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.

        Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
        since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
        a timer via scheduleUpdateNowPlayingInfo instead.

        Test: media/remove-video-best-media-element-in-main-frame-crash.html

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
        moved to Page.
        (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
        a raw pointer while we're at it.
        (WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
        (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
        clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
        (WebCore::HTMLMediaElement::contextDestroyed):
        (WebCore::HTMLMediaElement::stop):
        (WebCore::HTMLMediaElement::schedulePlaybackControlsManagerUpdate): Renamed from scheduleUpdatePlaybackControlsManager.
        (WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::playbackControlsManagerUpdateTimerFired.
        * html/HTMLMediaElement.h:
        * page/Page.cpp:
        (WebCore::Page::Page):
        (WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
        (WebCore::Page::playbackControlsManagerUpdateTimerFired): Moved from HTMLMediaElement::updatePlaybackControlsManager.
        * page/Page.h:
        * testing/Internals.cpp:
        (WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
        * testing/Internals.h:

2018-07-05  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(r233496): Crash in WebCore::VideoTrack::clearClient()
        https://bugs.webkit.org/show_bug.cgi?id=187377

        Reviewed by Simon Fraser.

        Clear m_client of an audio track or a video track before removing it from the list
        since TrackListBase::m_inbandTracks may hold the last ref to the track.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::removeAudioTrack):
        (WebCore::HTMLMediaElement::removeVideoTrack):

2018-07-05  Fujii Hironori  <Hironori.Fujii@sony.com>

        REGRESSION(r233495) [cairo] drawGlyphsShadow should use the fast path for zero blur-radius
        https://bugs.webkit.org/show_bug.cgi?id=187336

        Reviewed by Carlos Garcia Campos.

        drawGlyphsShadow has a fast path to draw a shadow without a shadow
        layer. Since r233495, it is not used for zero blur-radius shadow.

        In Bug 187244, I changed ShadowState::isRequired not to check
        blur-radius is zero. This is not a right fix.

        This change reverts r233495.

        No new tests (Covered by existing tests).

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::ShadowState::isRequired const): Return false if
        'blur' is zero.
        (WebCore::Cairo::fillRectWithRoundedHole): Use
        ShadowState::isVisible instead of ShadowState::isRequired to check
        a shadow should be drawn.

2018-07-05  Timothy Hatcher  <timothy@apple.com>

        Rename and flip the meaning of defaultAppearance to be useDarkAppearance.
        https://bugs.webkit.org/show_bug.cgi?id=187369
        rdar://problem/41870420

        Reviewed by Tim Horton.

        * Modules/mediasession/WebMediaSessionManager.cpp:
        (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
        * css/MediaQueryEvaluator.cpp:
        (WebCore::prefersDarkInterfaceEvaluate):
        * css/StyleColor.h:
        * dom/Document.cpp:
        (WebCore::Document::useDarkAppearance const):
        (WebCore::Document::styleColorOptions const):
        (WebCore::Document::useDefaultAppearance const): Deleted.
        * dom/Document.h:
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::paint):
        * page/Page.cpp:
        (WebCore::Page::useDarkAppearance const):
        (WebCore::Page::defaultAppearance const): Deleted.
        * page/Page.h:
        (WebCore::Page::setUseDarkAppearance):
        (WebCore::Page::setDefaultAppearance): Deleted.
        * platform/Theme.h:
        * platform/graphics/MediaPlaybackTargetPicker.h:
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
        (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForLink):
        * platform/mac/LocalDefaultSystemAppearance.h:
        * platform/mac/LocalDefaultSystemAppearance.mm:
        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):
        * platform/mac/ThemeMac.h:
        * platform/mac/ThemeMac.mm:
        (WebCore::ThemeMac::paint):
        * platform/mock/MediaPlaybackTargetPickerMock.cpp:
        (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
        * platform/mock/MediaPlaybackTargetPickerMock.h:
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::resolveStyleForMarkedText):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::paintContents):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::paint):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::documentViewFor const):
        (WebCore::RenderThemeMac::platformActiveSelectionBackgroundColor const):
        (WebCore::RenderThemeMac::platformInactiveSelectionBackgroundColor const):
        (WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
        (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
        (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
        (WebCore::RenderThemeMac::platformActiveListBoxSelectionBackgroundColor const):
        (WebCore::RenderThemeMac::platformInactiveListBoxSelectionBackgroundColor const):
        (WebCore::RenderThemeMac::platformActiveListBoxSelectionForegroundColor const):
        (WebCore::RenderThemeMac::platformInactiveListBoxSelectionForegroundColor const):
        (WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const):
        (WebCore::RenderThemeMac::colorCache const):
        (WebCore::RenderThemeMac::systemColor const):
        (WebCore::RenderThemeMac::paintCellAndSetFocusedElementNeedsRepaintIfNecessary):
        (WebCore::RenderThemeMac::paintSliderThumb):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw):

2018-07-05  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233539.
        https://bugs.webkit.org/show_bug.cgi?id=187368

        Changes made for youtube crashes has caused 15 api failures
        (Requested by Truitt on #webkit).

        Reverted changeset:

        "Youtube video pages crash after a couple of minutes"
        https://bugs.webkit.org/show_bug.cgi?id=187316
        https://trac.webkit.org/changeset/233539

2018-07-05  Chris Dumez  <cdumez@apple.com>

        Update Element API to use qualifiedName instead of name/localName where applicable
        https://bugs.webkit.org/show_bug.cgi?id=187347

        Reviewed by Darin Adler.

        Update Element API to use qualifiedName instead of name/localName where applicable. Naming
        is now consistent with the IDL and the specification:
        - https://dom.spec.whatwg.org/#element

        Our implementation properly deals with qualified names already, even though the parameters
        were named localName.

        * dom/Element.cpp:
        (WebCore::Element::getAttribute const):
        (WebCore::Element::toggleAttribute):
        (WebCore::Element::setAttribute):
        (WebCore::Element::removeAttribute):
        (WebCore::Element::getAttributeNode):
        (WebCore::Element::hasAttribute const):
        * dom/Element.h:

2018-07-04  Ryosuke Niwa  <rniwa@webkit.org>

        Youtube video pages crash after a couple of minutes
        https://bugs.webkit.org/show_bug.cgi?id=187316

        Reviewed by Antti Koivisto.

        The crash was caused by HTMLMediaElement::stopWithoutDestroyingMediaPlayer invoking updatePlaybackControlsManager,
        which traverses all media players across different documents including the one in the main frame while its iframe
        is getting removed (to update the Touch Bar's media control).

        Fixed the bug by making this code async in both stopWithoutDestroyingMediaPlayer and ~HTMLMediaElement. To do this,
        this patch moves the timer to update the playback controls manager from HTMLMediaElement to Page since scheduling
        a timer owned by HTMLMediaElement in its destructor wouldn't work as the timer would get destructed immediately.

        Also replaced the call to clientWillPausePlayback by a call to stopSession in stopWithoutDestroyingMediaPlayer
        since the former also updates the layout synchronously via updateNowPlayingInfo; the latter function schedules
        a timer via scheduleUpdateNowPlayingInfo instead.

        Test: media/remove-video-best-media-element-in-main-frame-crash.html

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::~HTMLMediaElement): Call scheduleUpdatePlaybackControlsManager now that timer has been
        moved to Page.
        (WebCore::HTMLMediaElement::bestMediaElementForShowingPlaybackControlsManager): Made this return a RefPtr instead of
        a raw pointer while we're at it.
        (WebCore::HTMLMediaElement::clearMediaPlayer): Call scheduleUpdatePlaybackControlsManager.
        (WebCore::HTMLMediaElement::stopWithoutDestroyingMediaPlayer): Ditto. Also invoke stopSession instead of
        clientWillPausePlayback on MediaSession since clientWillPausePlayback will synchronously try to update the layout.
        (WebCore::HTMLMediaElement::contextDestroyed):
        (WebCore::HTMLMediaElement::stop):
        (WebCore::HTMLMediaElement::scheduleUpdatePlaybackControlsManager):
        (WebCore::HTMLMediaElement::updatePlaybackControlsManager): Moved to Page::schedulePlaybackControlsManagerUpdate.
        * html/HTMLMediaElement.h:
        * page/Page.cpp:
        (WebCore::Page::schedulePlaybackControlsManagerUpdate): Added.
        * page/Page.h:
        * testing/Internals.cpp:
        (WebCore::Internals::bestMediaElementForShowingPlaybackControlsManager):
        * testing/Internals.h:

2018-07-05  Zalan Bujtas  <zalan@apple.com>

        Do not assume that hypen's width can be computed using the simplified text measure codepath.
        https://bugs.webkit.org/show_bug.cgi?id=187352
        <rdar://problem/40821283>

        Reviewed by Simon Fraser.

        Just because the text content is qualified for simplified text measure, it does not necessarily mean the hyphen is simple enough as well.

        Test: fast/text/hyphen-is-complex-crash.html

        * rendering/SimpleLineLayoutTextFragmentIterator.cpp:
        (WebCore::SimpleLineLayout::TextFragmentIterator::Style::Style):
        (WebCore::SimpleLineLayout::TextFragmentIterator::TextFragmentIterator):
        * rendering/SimpleLineLayoutTextFragmentIterator.h:

2018-07-05  Eric Carlson  <eric.carlson@apple.com>

        Video sometimes flickers when playing to AppleTV
        https://bugs.webkit.org/show_bug.cgi?id=187193
        <rdar://problem/40153865>

        Unreviewed, fix a broken API test.

        * platform/audio/ios/AudioSessionIOS.mm:
        (WebCore::AudioSession::setCategory): None should set the category to AVAudioSessionCategoryAmbient, 
        because it signals that WebKit is not playing audio so we want allow other apps to play.

2018-07-05  Per Arne Vollan  <pvollan@apple.com>

        Use ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) in ScrollAnimatorMac.mm
        https://bugs.webkit.org/show_bug.cgi?id=187334

        Reviewed by Alex Christensen.

        Use ENABLE(WEBPROCESS_WINDOWSERVER_BLOCKING) instead of __MAC_OS_X_VERSION_MIN_REQUIRED when deciding
        to use NSTimer or NSAnimation for scrollbar animation.

        No new tests. No change in behavior.

        * platform/mac/ScrollAnimatorMac.mm:
        (-[WebScrollbarPartAnimation initWithScrollbar:featureToAnimate:animateFrom:animateTo:duration:]):
        (-[WebScrollbarPartAnimation startAnimation]):
        (-[WebScrollbarPartAnimation setCurrentProgress:setCurrentProgress:]):

2018-07-05  Timothy Hatcher  <timothy@apple.com>

        Don't invert text color for selections in light mode.
        https://bugs.webkit.org/show_bug.cgi?id=187349
        rdar://problem/41297946

        Reviewed by Tim Horton.

        Fix color caching in RenderTheme so we don't cache a dark mode color
        for a light appearance, or vise versa. Use the new color caching
        in RenderThemeMac, and clear the color caches in purgeCaches.

        Allow supportsSelectionForegroundColors to conditionalize on StyleColor::Options.
        Return true only in dark mode.

        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::activeSelectionBackgroundColor const):
        (WebCore::RenderTheme::inactiveSelectionBackgroundColor const):
        (WebCore::RenderTheme::activeSelectionForegroundColor const):
        (WebCore::RenderTheme::inactiveSelectionForegroundColor const):
        (WebCore::RenderTheme::activeListBoxSelectionBackgroundColor const):
        (WebCore::RenderTheme::inactiveListBoxSelectionBackgroundColor const):
        (WebCore::RenderTheme::activeListBoxSelectionForegroundColor const):
        (WebCore::RenderTheme::inactiveListBoxSelectionForegroundColor const):
        (WebCore::RenderTheme::purgeCaches):
        (WebCore::RenderTheme::platformColorsDidChange):
        (WebCore::RenderTheme::activeTextSearchHighlightColor const):
        (WebCore::RenderTheme::inactiveTextSearchHighlightColor const):
        * rendering/RenderTheme.h:
        (WebCore::RenderTheme::supportsSelectionForegroundColors const):
        (WebCore::RenderTheme::supportsListBoxSelectionForegroundColors const):
        (WebCore::RenderTheme::colorCache const):
        (WebCore::RenderTheme::purgeCaches): Deleted.
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::purgeCaches):
        (WebCore::RenderThemeMac::supportsSelectionForegroundColors const):
        (WebCore::RenderThemeMac::platformActiveSelectionForegroundColor const):
        (WebCore::RenderThemeMac::platformInactiveSelectionForegroundColor const):
        (WebCore::RenderThemeMac::platformColorsDidChange):
        (WebCore::RenderThemeMac::colorCache const):
        (WebCore::RenderThemeMac::systemColor const):

2018-07-05  Zalan Bujtas  <zalan@apple.com>

        SimpleLineLayout::FlowContents wastes 54KB of Vector capacity on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=186709
        <rdar://problem/41173793>

        Reviewed by Simon Fraser.

        The size of the m_segments vector in SimpleLineLayoutFlowContents is alway pre-computed and don't change after the initial append.  

        Not testable.

        * rendering/SimpleLineLayoutFlowContents.h:

2018-07-05  Nan Wang  <n_wang@apple.com>

        AX: setValue on text controls should send out key events
        https://bugs.webkit.org/show_bug.cgi?id=186690
        <rdar://problem/41169985>

        Reviewed by Chris Fleizach.

        Use Editor's insertText function when the text control element is being
        focused, so that the InputEvent will be dispatched properly.

        Test: accessibility/mac/set-value-editable-dispatch-events.html

        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::setValue):

2018-07-05  Chris Dumez  <cdumez@apple.com>

        ASSERT(m_dictionaryStack.size() == 1) assertion hit in ~KeyedDecoderCF() when decoding fails
        https://bugs.webkit.org/show_bug.cgi?id=187152

        Reviewed by Brent Fulgham.

        Whenever a call to KeyedDecoderCF::beginArrayElement() succeeds (returns true), it
        appends an item to m_dictionaryStack which is expected to get popped later on via
        a matching call to KeyedDecoderCF::endArrayElement(). The ASSERT(m_dictionaryStack.size() == 1)
        assertion in the destructor protects against a begin / end mismatch.

        However, there was a bug in KeyedDecoder::decodeObjects(), which would cause us to return early
        after a call to beginArrayElement() when the lambda function call returns false, causing us
        not to call the matching endArrayElement() in this case. This patch addresses the issue by
        calling endArrayElement() before returning early.

        This bug was uncovered by r233309 which slightly changed the ITP encoding / decoding format.
        Because empty HashCountedSets are now expected to be encoded as empty array, decoding of old
        data fails and we hit the buggy code path.

        * platform/KeyedCoding.h:
        (WebCore::KeyedDecoder::decodeObjects):

2018-07-05  Antti Koivisto  <antti@apple.com>

        Move CSSParserContext to a file of its own
        https://bugs.webkit.org/show_bug.cgi?id=187342

        Reviewed by Zalan Bujtas.

        Move it out from CSSParserMode.h and CSSParser.cpp.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * contentextensions/ContentExtensionParser.cpp:
        * css/PropertySetCSSStyleDeclaration.h:
        * css/StyleProperties.h:
        * css/StyleSheetContents.h:
        * css/parser/CSSDeferredParser.h:
        * css/parser/CSSParser.cpp:
        (WebCore::strictCSSParserContext): Deleted.
        (WebCore::CSSParserContext::CSSParserContext): Deleted.
        (WebCore::operator==): Deleted.
        * css/parser/CSSParser.h:
        * css/parser/CSSParserContext.cpp: Added.
        (WebCore::strictCSSParserContext):
        (WebCore::CSSParserContext::CSSParserContext):
        (WebCore::operator==):

        Also add the missing textAutosizingEnabled bit.

        * css/parser/CSSParserContext.h: Copied from Source/WebCore/css/parser/CSSParserMode.h.
        (WebCore::CSSParserContextHash::hash):

        Also add the missing bits to the hash function.
        
        (WebCore::isQuirksModeBehavior): Deleted.
        (WebCore::isUASheetBehavior): Deleted.
        (WebCore::isUnitLessValueParsingEnabledForMode): Deleted.
        (WebCore::isCSSViewportParsingEnabledForMode): Deleted.
        (WebCore::strictToCSSParserMode): Deleted.
        (WebCore::isStrictParserMode): Deleted.
        * css/parser/CSSParserIdioms.h:
        * css/parser/CSSParserImpl.h:
        * css/parser/CSSParserMode.h:
        (WebCore::CSSParserContext::completeURL const): Deleted.
        (WebCore::operator!=): Deleted.
        (WebCore::CSSParserContextHash::hash): Deleted.
        (WebCore::CSSParserContextHash::equal): Deleted.
        (WTF::HashTraits<WebCore::CSSParserContext>::constructDeletedValue): Deleted.
        (WTF::HashTraits<WebCore::CSSParserContext>::isDeletedValue): Deleted.
        (WTF::HashTraits<WebCore::CSSParserContext>::emptyValue): Deleted.
        * css/parser/CSSPropertyParserHelpers.h:
        * css/parser/CSSSelectorParser.cpp:
        * css/parser/CSSVariableParser.cpp:

2018-07-05  Antoine Quint  <graouts@apple.com>

        [Web Animations] The ready promise should initially be resolved
        https://bugs.webkit.org/show_bug.cgi?id=187341
        <rdar://problem/41844711>

        Reviewed by Dean Jackson.

        The Web Animations spec mandates that the ready promise is initially resolved.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::WebAnimation):

2018-07-05  Sergio Villar Senin  <svillar@igalia.com>

        [WebVR] Fix VRDisplayEvent implementation
        https://bugs.webkit.org/show_bug.cgi?id=187337

        Reviewed by Žan Doberšek.

        VRDisplayEvent implementation had two issues. First there were no attributes storing the
        VRDisplay the event refers to. Secondly the VRDisplayEventReason is not mandatory so it
        should be handled via an optional.

        * Modules/webvr/VRDisplayEvent.cpp:
        (WebCore::VRDisplayEvent::VRDisplayEvent):
        (WebCore::VRDisplayEvent::display const): Deleted.
        (WebCore::VRDisplayEvent::reason const): Deleted.
        * Modules/webvr/VRDisplayEvent.h:

2018-07-04  Carlos Garcia Campos  <cgarcia@igalia.com>

        REGRESSION(r233325): [GTK] Broke 40 animations tests
        https://bugs.webkit.org/show_bug.cgi?id=187264

        Reviewed by Žan Doberšek.

        This is because DocumentAnimationScheduler uses DisplayRefreshMonitor, that is only used by GTK port when
        accelerated compositing is enabled. Add a GTK display refresh monitor implementation to be used as the default.

        * PlatformGTK.cmake: Add new file to compilation.
        * platform/graphics/DisplayRefreshMonitor.cpp:
        (WebCore::DisplayRefreshMonitor::createDefaultDisplayRefreshMonitor): Create DisplayRefreshMonitorGtk in GTK.
        * platform/graphics/gtk/DisplayRefreshMonitorGtk.cpp: Added.
        (WebCore::DisplayRefreshMonitorGtk::DisplayRefreshMonitorGtk):
        (WebCore::DisplayRefreshMonitorGtk::~DisplayRefreshMonitorGtk):
        (WebCore::onFrameClockUpdate):
        (WebCore::DisplayRefreshMonitorGtk::requestRefreshCallback):
        (WebCore::DisplayRefreshMonitorGtk::displayLinkFired):
        * platform/graphics/gtk/DisplayRefreshMonitorGtk.h: Added.
        (WebCore::DisplayRefreshMonitorGtk::create):

2018-07-04  Antti Koivisto  <antti@apple.com>

        Reparse user stylesheets when _useSystemAppearance changes
        https://bugs.webkit.org/show_bug.cgi?id=187312
        <rdar://problem/38565834>

        Reviewed by Tim Horton.

        This setting may affect user stylesheet parsing. Reparse if it changes.

        Test: fast/media/use-system-appearance-user-stylesheet-parsing.html

        * page/Page.cpp:
        (WebCore::Page::setUseSystemAppearance):
        * page/Page.h:
        (WebCore::Page::setUseSystemAppearance): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::setUseSystemAppearance):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-07-04  Thibault Saunier  <tsaunier@igalia.com>

        RealtimeIncomingVideoSources: Call stop() directly in the destructor
        https://bugs.webkit.org/show_bug.cgi?id=187303

        Reviewed by Youenn Fablet.

        Avoiding to call stopProducingData when we are not actually producing data.

        This fixes tests that will run once the WPE/GTK PeerConnection implementation is merged.

        * platform/mediastream/RealtimeIncomingVideoSource.h:
        (WebCore::RealtimeIncomingVideoSource::~RealtimeIncomingVideoSource):

2018-07-04  Thibault Saunier  <tsaunier@igalia.com>

        [GTK][WPE] Stop pushing the StreamCollection as event in GStreamerMediaStreamSource
        https://bugs.webkit.org/show_bug.cgi?id=187304

        Reviewed by Philippe Normand.

        We let parsebin build the StreamCollection for us and pass extra metadata through the
        `TAG_EVENT` pushing the collection ourself is not bringing anything but adds extra work in the
        MediaPlayerGStreamer duplicating the STREAM_COLLECTION message for no good reason.

        MediaStream layout tests already test that code path.

        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
        (WebCore::webkitMediaStreamSrcPadProbeCb):

2018-07-04  Frederic Wang  <fwang@igalia.com>

        [WebIDL] Remove custom bindings for HTMLDocument
        https://bugs.webkit.org/show_bug.cgi?id=173444

        Unreviewed, add missing bugzilla link for FIXME comments.

        * dom/Document.cpp:
        (WebCore::Document::closeForBindings):
        (WebCore::Document::write):
        (WebCore::Document::writeln):

2018-07-04  Tim Horton  <timothy_horton@apple.com>

        Introduce PLATFORM(IOSMAC)
        https://bugs.webkit.org/show_bug.cgi?id=187315

        Reviewed by Dan Bernstein.

        * Configurations/Base.xcconfig:
        * Configurations/FeatureDefines.xcconfig:
        * Configurations/WebCore.xcconfig:
        * Modules/geolocation/ios/GeolocationPositionIOS.mm:
        (WebCore::GeolocationPosition::GeolocationPosition):
        * page/cocoa/MemoryReleaseCocoa.mm:
        (WebCore::platformReleaseMemory):
        * platform/audio/ios/AudioSessionIOS.mm:
        (WebCore::AudioSession::setCategory):
        (WebCore::AudioSession::routingContextUID const):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVPlayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldDisableSleep):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::registerItemToPasteboard):
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList itemProvider]):

2018-07-03  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at timing-model/timelines/timelines.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186508
        <rdar://problem/41000260>

        Reviewed by Dean Jackson.

        The remaining failing assertion in this test assumes that the ready promise for an animation is fired
        prior to requestAnimationFrame callbacks being fired in the current event loop such that registering
        the requestAnimationFrame() call within the ready promise has its callback fired with the same timeline
        time. To ensure that is true, we perform a microtask checkpoint as soon as we're done running pending
        tasks, which will resolve the ready promise for any play-pending animations.

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::updateAnimations):

2018-07-03  Ryosuke Niwa  <rniwa@webkit.org>

        Nullptr crash accessing Document in GenericEventQueue::dispatchOneEvent()
        https://bugs.webkit.org/show_bug.cgi?id=187284

        Reviewed by Eric Carlson.

        The null pointer crash was caused by some GenericEventQueue dispatching an event in a stopped document,
        which does not have a valid script execution context because some uses of GenericEventQueue in media code
        was not closing the queue upon stopping of all active DOM objects.

        Fixed all uses of GenericEventQueue which did not suspend or stop the queue with active DOM objects.
        Made SourceBufferList and TrackListBase (along with AudioTrackList, TextTrackList, and VideoTrackList)
        inherit from ActiveDOMObject instead of ContextDestructionObserver to do this.

        Also fixed a bug that media elements inside a template element (and other cases where the document doesn't
        have a browsing context) were scheduling events since this would hit the newly added debug assertion in
        GenericEventQueue::dispatchOneEvent.

        Test: media/track/video-track-addition-and-frame-removal.html

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::suspend): Assert that we never try to suspend when the document has
        this object alive since canSuspendForDocumentSuspension always returns false.
        (WebCore::WebKitMediaKeySession::resume): Ditto.
        (WebCore::WebKitMediaKeySession::stop): Stop the event queue to avoid the crash.
        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::removeSourceBuffer): Don't do any work to update tracks when the active DOM
        objects are stopped since this MediaSource and the related media objects are about to be destructed.
        (WebCore::MediaSource::suspend): Assert that m_asyncEventQueue is empty as canSuspendForDocumentSuspension
        returns false whenever the queue is not empty.
        (WebCore::MediaSource::resume): Ditto.
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::suspend): Ditto.
        (WebCore::SourceBuffer::resume): Ditto.
        (WebCore::SourceBuffer::stop): Stop the event queue to avoid the crash.
        * Modules/mediasource/SourceBuffer.h:
        * Modules/mediasource/SourceBufferList.cpp:
        (WebCore::SourceBufferList): Made this an active DOM object.
        (WebCore::SourceBufferList::SourceBufferList):
        (WebCore::SourceBufferList::canSuspendForDocumentSuspension const): Added. Return false when there are
        pending events to match other media code.
        (WebCore::SourceBufferList::suspend): Added. Assert that the event queue is empty here.
        (WebCore::SourceBufferList::resume): Ditto.
        (WebCore::SourceBufferList::stop): Added. Stop the event queue to avoid the crash.
        (WebCore::SourceBufferList::activeDOMObjectName const): Added.
        * Modules/mediasource/SourceBufferList.h:
        (WebCore::SourceBufferList): Made this an active DOM object.
        * Modules/mediasource/SourceBufferList.idl:
        * dom/Document.h:
        (WebCore::Document::hasBrowsingContext const): Added.
        * dom/GenericEventQueue.cpp:
        (WebCore::GenericEventQueue::dispatchOneEvent): Added an assertion to catch when an event is dispatched
        inside a stopped document, which is never correct and causes this crash down the line.
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::playInternal): Exit early when the document doesn't have a browsing context;
        e.g. when the media element is inside a template element.
        (WebCore::HTMLMediaElement::pauseInternal): Ditto.
        (WebCore::HTMLMediaElement::sourceWasAdded): Ditto.
        * html/track/AudioTrackList.cpp:
        (AudioTrackList::activeDOMObjectName const): Added.
        * html/track/AudioTrackList.h:
        * html/track/AudioTrackList.idl:
        * html/track/TextTrackList.cpp::
        (TextTrackList::activeDOMObjectName const): Added.
        * html/track/TextTrackList.h:
        * html/track/TextTrackList.idl:
        * html/track/TrackListBase.cpp:
        (WebCore::TrackListBase): Made this an active DOM object.
        (WebCore::TrackListBase::TrackListBase): 
        (WebCore::TrackListBase::canSuspendForDocumentSuspension const): Added. Return false when there are pending events
        to match other media code.
        (WebCore::TrackListBase::suspend): Added. Assert that the event queue is empty here.
        (WebCore::TrackListBase::resume): Ditto.
        (WebCore::TrackListBase::stop): Added. Stop the event queue to avoid the crash.
        * html/track/TrackListBase.h:
        * html/track/VideoTrackList.cpp:
        (VideoTrackList::activeDOMObjectName const): Added.
        * html/track/VideoTrackList.h:
        * html/track/VideoTrackList.idl:

2018-07-03  Fujii Hironori  <Hironori.Fujii@sony.com>

        [cairo] Doesn't paint box-shadow with zero blur-radius
        https://bugs.webkit.org/show_bug.cgi?id=187244

        Reviewed by Žan Doberšek.

        Cairo::ShadowState::isRequired() returned false if blur-radius is
        zero.

        No new tests (Covered by existing tests).

        * platform/graphics/cairo/CairoOperations.cpp:
        (WebCore::Cairo::ShadowState::isRequired const): Do not check blur
        is zero.

2018-07-03  Ryosuke Niwa  <rniwa@webkit.org>

        Add a release assert to diagnose infinite recursions in removeAllEventListeners()
        https://bugs.webkit.org/show_bug.cgi?id=187287

        Reviewed by Keith Miller.

        Assert that we never re-enter removeAllEventListeners per thread.

        * dom/EventTarget.cpp:
        (WebCore::EventTarget::removeAllEventListeners):
        * platform/ThreadGlobalData.h:
        (WebCore::ThreadGlobalData::ThreadGlobalData::isInRemoveAllEventListeners const):
        (WebCore::ThreadGlobalData::ThreadGlobalData::setIsInRemoveAllEventListeners):

2018-07-03  Chris Dumez  <cdumez@apple.com>

        performance-api/performance-observer-no-document-leak.html is flaky
        https://bugs.webkit.org/show_bug.cgi?id=186938
        <rdar://problem/41379336>

        Reviewed by Simon Fraser.

        Add internals API to get the identifier of a document and to ask if the document with
        a given identifier is still alive. This is helpful to write tests for document leaking
        fixes.

        * testing/Internals.cpp:
        (WebCore::Internals::documentIdentifier const):
        (WebCore::Internals::isDocumentAlive const):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-07-03  Chris Dumez  <cdumez@apple.com>

        Improve window.event compliance: Should not be set when target is in shadow tree
        https://bugs.webkit.org/show_bug.cgi?id=186266

        Reviewed by Ryosuke Niwa.

        Stop exposing window.event to Shadow DOM by not setting window.event if the event's target
        is a Node inside a shadow tree. This is as per the latest DOM specification:
        - https://github.com/whatwg/dom/pull/407

        This aligns our behavior with Blink as well:
        - https://bugs.chromium.org/p/chromium/issues/detail?id=779461

        Tests: imported/w3c/web-platform-tests/dom/events/event-global.html
               imported/w3c/web-platform-tests/dom/events/event-global.worker.html

        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::handleEvent):

2018-07-03  Chris Dumez  <cdumez@apple.com>

        [Cocoa] Disable vnode guard related simulated crashes for WKTR / DRT and WebSQL
        https://bugs.webkit.org/show_bug.cgi?id=187270
        <rdar://problem/40674034>

        Reviewed by Geoffrey Garen.

        Disable vnode guard related simulated crashes for WebSQL by setting the expected
        environment variable, if not already set by WKTR / DRT.

        * Modules/webdatabase/DatabaseManager.cpp:
        (WebCore::DatabaseManager::initialize):
        (WebCore::DatabaseManager::platformInitialize):
        * Modules/webdatabase/DatabaseManager.h:
        * Modules/webdatabase/cocoa/DatabaseManagerCocoa.mm: Added.
        (WebCore::DatabaseManager::paltformInitialize):
        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/FileSystem.h:
        * platform/posix/FileSystemPOSIX.cpp:
        (WebCore::FileSystem::realPath):
        * platform/win/FileSystemWin.cpp:
        (WebCore::FileSystem::realPath):

2018-07-03  Eric Carlson  <eric.carlson@apple.com>

        Don't allow autoplay when the element is suspended
        https://bugs.webkit.org/show_bug.cgi?id=187299
        <rdar://problem/41044691>

        Reviewed by Youenn Fablet.
        
        Block autoplay when a media element is suspended. Add more release logging to the methods
        that handle autoplay attempts to help diagnose future media playback problems.

        * html/HTMLMediaElement.cpp:
        (WebCore::convertEnumerationToString): Convert PlaybackWithoutUserGesture to a string.
        (WebCore::HTMLMediaElement::dispatchPlayPauseEventsIfNeedsQuirks): Add logging.
        (WebCore::HTMLMediaElement::hardwareMutedStateDidChange): Ditto.
        (WebCore::HTMLMediaElement::handleAutoplayEvent): Ditto.
        (WebCore::HTMLMediaElement::userDidInterfereWithAutoplay): Ditto.
        (WebCore::HTMLMediaElement::setPlaybackWithoutUserGesture): Ditto.
        * html/HTMLMediaElement.h:
        (WTF::LogArgument<WebCore::HTMLMediaElement::PlaybackWithoutUserGesture>::toString):

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::playbackPermitted const): Playback is not permitted when the
        element is suspended.
        * html/MediaElementSession.h:

2018-07-03  Zalan Bujtas  <zalan@apple.com>

        [LFC] Generate anonymous inline box for text content.
        https://bugs.webkit.org/show_bug.cgi?id=187301

        Reviewed by Antti Koivisto.

        Always have a inline container for text content (and no dedicated text renderer).

        * layout/layouttree/LayoutInlineBox.cpp:
        (WebCore::Layout::InlineBox::InlineBox):
        * layout/layouttree/LayoutInlineBox.h:
        (WebCore::Layout::InlineBox::setContent):
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::TreeBuilder::createSubTree):

2018-07-03  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Embed certificate information into ResourceResponse.
        https://bugs.webkit.org/show_bug.cgi?id=187102

        Reviewed by Youenn Fablet.

        No new tests but tested internally.

        Collect certificate information from the communication and put them into
        ResourceResponse for the sake of advanced security checking and information
        providing to the user.

        * platform/Curl.cmake:
        * platform/network/curl/CertificateInfo.cpp: Copied from Source/WebCore/platform/network/curl/CertificateInfo.h.
        (WebCore::CertificateInfo::CertificateInfo):
        (WebCore::CertificateInfo::isolatedCopy const):
        (WebCore::CertificateInfo::makeCertificate):
        * platform/network/curl/CertificateInfo.h:
        (WebCore::CertificateInfo::verificationError const):
        (WebCore::CertificateInfo::certificateChain const):
        (WebCore::operator==):
        (WebCore::CertificateInfo::CertificateInfo): Deleted.
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::didReceiveHeader):
        (WebCore::CurlRequest::didCompleteTransfer):
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::getCertificateInfo const):
        (WebCore::CurlRequest::getNetworkLoadMetrics const):
        (WebCore::CurlRequest::getNetworkLoadMetrics): Deleted.
        * platform/network/curl/CurlResourceHandleDelegate.cpp:
        (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):
        (WebCore::CurlResourceHandleDelegate::curlDidComplete):
        * platform/network/curl/CurlSSLHandle.cpp:
        (WebCore::CurlSSLHandle::setHostAllowsAnyHTTPSCertificate):
        (WebCore::CurlSSLHandle::canIgnoredHTTPSCertificate):
        * platform/network/curl/CurlSSLHandle.h:
        * platform/network/curl/CurlSSLVerifier.cpp:
        (WebCore::CurlSSLVerifier::CurlSSLVerifier):
        (WebCore::CurlSSLVerifier::verifyCallback):
        (WebCore::StackOfX509::StackOfX509): For RAII. Used in pemDataFromCtx().
        (WebCore::StackOfX509::~StackOfX509): Ditto.
        (WebCore::StackOfX509::count): Ditto.
        (WebCore::StackOfX509::item): Ditto.
        (WebCore::BIOHolder::BIOHolder): Ditto.
        (WebCore::BIOHolder::~BIOHolder): Ditto.
        (WebCore::BIOHolder::write): Ditto.
        (WebCore::BIOHolder::asCertificate): Ditto.
        (WebCore::pemDataFromCtx): Become simple static function.
        (WebCore::convertToSSLCertificateFlags): Ditto.
        (WebCore::CurlSSLVerifier::certVerifyCallback): Deleted.
        (WebCore::CurlSSLVerifier::getPemDataFromCtx): Deleted.
        (WebCore::CurlSSLVerifier::convertToSSLCertificateFlags): Deleted.
        * platform/network/curl/CurlSSLVerifier.h:
        (WebCore::CurlSSLVerifier::verificationError):
        (WebCore::CurlSSLVerifier::certificateChain const):
        * platform/network/curl/ResourceError.h:
        * platform/network/curl/ResourceErrorCurl.cpp:
        (WebCore::ResourceError::isSSLConnectError const):
        (WebCore::ResourceError::isSSLCertVerificationError const):
        (WebCore::ResourceError::hasSSLConnectError const): Deleted.
        * platform/network/curl/ResourceResponse.h:
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::setCertificateInfo):
        (WebCore::ResourceResponse::setDeprecatedNetworkLoadMetrics):

2018-07-02  Simon Fraser  <simon.fraser@apple.com>

        Clean up the layer volatility code and logging
        https://bugs.webkit.org/show_bug.cgi?id=187286

        Reviewed by Tim Horton.

        Export a function.

        * platform/graphics/cocoa/IOSurface.h:

2018-07-03  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233112.
        https://bugs.webkit.org/show_bug.cgi?id=187300

        this revision is causing crashes on iOS 11 simulator
        (Requested by Truitt on #webkit).

        Reverted changeset:

        "[Fullscreen] Restore ASSERT_NOT_REACHED() checks in exit
        fullscreen handler after r231924"
        https://bugs.webkit.org/show_bug.cgi?id=186945
        https://trac.webkit.org/changeset/233112

2018-07-03  Chris Dumez  <cdumez@apple.com>

        Implement support for Element.toggleAttribute
        https://bugs.webkit.org/show_bug.cgi?id=186883

        Reviewed by Sam Weinig.

        Implement support for Element.toggleAttribute as per:
        - https://github.com/whatwg/dom/issues/461
        - https://dom.spec.whatwg.org/#dom-element-toggleattribute

        This was already implemented in Blink:
        - https://bugs.chromium.org/p/chromium/issues/detail?id=854960

        Edge expressed public support:
        - https://github.com/whatwg/dom/issues/461#issuecomment-398206390

        Gecko is working on it:
        - https://bugzilla.mozilla.org/show_bug.cgi?id=1469592

        * dom/Element.cpp:
        (WebCore::Element::toggleAttribute):
        * dom/Element.h:
        * dom/Element.idl:

2018-07-03  Zalan Bujtas  <zalan@apple.com>

        [LFC] Implement minimum/maximum content width logic.
        https://bugs.webkit.org/show_bug.cgi?id=187241

        Reviewed by Antti Koivisto.

        Compute the minimum/maximum content width if needed and cache the values on the formatting state.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::shrinkToFitWidth):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
        (WebCore::Layout::shrinkToFitWidth): Deleted.
        * layout/FormattingState.cpp:
        (WebCore::Layout::FormattingState::FormattingState):
        * layout/FormattingState.h:
        (WebCore::Layout::FormattingState::setMinimumMaximumContentWidth):
        (WebCore::Layout::FormattingState::clearMinimumMaximumContentWidth):
        (WebCore::Layout::FormattingState::minimumMaximumContentWidth const):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::establishedFormattingState):
        * layout/LayoutContext.h:
        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::createFormattingState const):
        (WebCore::Layout::BlockFormattingContext::minimumMaximumContentWidth const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::minimumMaximumContentWidthNeedsChildrenWidth):
        (WebCore::Layout::BlockFormattingContext::Geometry::minimumMaximumContentWidth):
        * layout/blockformatting/BlockFormattingState.cpp:
        (WebCore::Layout::BlockFormattingState::BlockFormattingState):
        * layout/blockformatting/BlockFormattingState.h:
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::createFormattingState const):
        (WebCore::Layout::InlineFormattingContext::minimumMaximumContentWidth const):
        * layout/inlineformatting/InlineFormattingContext.h:
        * layout/inlineformatting/InlineFormattingState.cpp:
        (WebCore::Layout::InlineFormattingState::InlineFormattingState):
        * layout/inlineformatting/InlineFormattingState.h:
        * page/FrameViewLayoutContext.cpp:

2018-07-03  Jonathan Bedard  <jbedard@apple.com>

        Unreviewed, rolling out r233461.

        Assertions triggered during iOS 11 debug layout and API tests

        Reverted changeset:

        "[iOS] Add assert to catch improper use of WebCore::Timer in
        UI Process"
        https://bugs.webkit.org/show_bug.cgi?id=185330
        https://trac.webkit.org/changeset/233461

2018-07-03  Jer Noble  <jer.noble@apple.com>

        Update Fullscreen anti-phishing alert text
        https://bugs.webkit.org/show_bug.cgi?id=187199
        <rdar://problem/41162543>

        Reviewed by Brent Fulgham.

        * English.lproj/Localizable.strings:

2018-07-03  Frederic Wang  <fwang@igalia.com>

        REGRESSION (r232186): Hardware-accelerated CSS animations using steps() timing function no longer work
        https://bugs.webkit.org/show_bug.cgi?id=186129

        Reviewed by Antoine Quint.

        When the WebAnimationsCSSIntegration flag is enabled, animating the transform property with
        a steps() timing function no longer works. This is because the WebAnimation code wrongly
        assumes that the transform property can always be accelerated (for counterexamples, see
        GraphicsLayerCA::animationCanBeAccelerated). For consistency with AnimationBase, we make
        WebAnimation fallback to non-accelerated mode when RenderBoxModelObject::startAnimation
        fails. This addresses the regression previously mentioned.

        Test: http/wpt/css/css-animations/start-animation-001.html

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions): Fallback to
        non-accelerated mode if startAnimation failed.

2018-07-03  David Kilzer  <ddkilzer@apple.com>

        [iOS] Add assert to catch improper use of WebCore::Timer in UI Process
        <https://webkit.org/b/185330>
        <rdar://problem/32816079>

        Reviewed by Darin Adler.

        * platform/RuntimeApplicationChecks.cpp:
        (WebCore::s_webKitProcessType): Add. Global to track process
        type.
        (WebCore::setWebKitProcessType): Implement new function that is
        called when initializing Web, Network, and Storage processes.
        (WebCore::isInNetworkProcess): Add.
        (WebCore::isInStorageProcess): Add.
        (WebCore::isInWebProcess): Add.
        - Check value in s_webKitProcessType to determine which process
          is currently running.
        * platform/RuntimeApplicationChecks.h:
        (WebCore::isInNetworkProcess): Add.
        (WebCore::isInStorageProcess): Add.
        (WebCore::isInWebProcess):
        - Make available for all platforms.

        * platform/Timer.cpp:
        (WebCore::TimerBase::TimerBase): Add assert and os_log_fault.
        This catches the unwanted behavior on iOS using isAllowed().
        (WebCore::TimerBase::isAllowed): Add implementation.
        * platform/Timer.h:
        (WebCore::TimerBase::isAllowed): Add declaration.

        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::isInWebProcess): Delete.  Replace with method in
        RuntimeApplicationChecks.cpp.

2018-07-02  Antti Koivisto  <antti@apple.com>

        Tighter limit for canvas memory use on iOS
        https://bugs.webkit.org/show_bug.cgi?id=187279
        <rdar://problem/38420562>

        Reviewed by Simon Fraser.

        We allowed 448MB of canvas buffer memory. This is still too much in some cases. Painting a large
        canvas may also requires several other temporary canvas sized buffers getting us easily over
        the process size limit.

        * html/HTMLCanvasElement.cpp:
        (WebCore::maxActivePixelMemory):

        Drop to (ramSize() / 4) which computes to 224MB on 2GB devices.

2018-07-02  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Google Fonts doesn't work if the user has the requested font locally-installed
        https://bugs.webkit.org/show_bug.cgi?id=187228
        <rdar://problem/40967280>

        Reviewed by Brent Fulgham.

        This is due to the local() items in the src: descriptor in the @font-family blocks.

        This is because of a behavior difference between CSSFontFaceSource::load() and CSSFontFaceSource::font().
        load() is supposed to set the status() to Success iff the font can be used, and then CSSFontFaceSource::font()
        is supposed to return the font itself to use. load() works by constructing a dummy FontDescription and
        performing a system lookup (to see if the local font really exists). However, this dummy FontDescription
        doesn't set the ShouldAllowUserInstalledFonts flag. Then, in CSSFontFaceSource::font(), a similar lookup is
        performed, except this one has the original FontDescription (with the correct value of the
        ShouldAllowUserInstalledFonts flag set. Therefore, the two functions disagree about the state of the flag.

        When the CSSFontFaceSource's status gets set to Success, that means "this is the font face source that
        represents the @font-face block" but when CSSFontFaceSource::font() returns nullptr, that means "The font face
        source can't be used for some reason" so we then continue searching down the font-family list (and render the
        text in Helvetica or whatever comes next).

        The solution is simple - just set the ShouldAllowUserInstalledFonts flag correctly in the dummy
        FontDescription.

        Test: fast/text/user-installed-fonts/local.html

        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::allowUserInstalledFonts const):
        * css/CSSFontFace.h:
        * css/CSSFontFaceSet.cpp:
        (WebCore::CSSFontFaceSet::ensureLocalFontFacesForFamilyRegistered):
        * css/CSSFontFaceSource.cpp:
        (WebCore::CSSFontFaceSource::load):

2018-06-29  Ryosuke Niwa  <rniwa@webkit.org>

        Generate event and event target interface types directly instead of via macros
        https://bugs.webkit.org/show_bug.cgi?id=187215

        Reviewed by Chris Dumez.

        Made make_event_factory.pl directly generate EventInterface enum values and toJSNewlyCreated for Event,
        and EventTargetInterface enum values and toJS for EventTarget. Removed the code to generate EventFactory::create
        since it was never even compiled or used anywhere.

        This patch faithfully replicates what the macro used to generate but we should consider always generating either
        toJS or toJSNewlyCreated for both interfaces in the future.

        No new tests since there should be no observable behavioral changes.

        * DerivedSources.make: Generate EventTargetFactory.cpp, which is used to generate toJS function for EventTarget.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSEventCustom.cpp:
        (WebCore::toJSNewlyCreated): Deleted. Now generated directly in EventFactory.cpp.
        * bindings/js/JSEventTargetCustom.cpp:
        (WebCore::JSEventTarget::toWrapped): Removed the use of TRY_TO_UNWRAP_WITH_INTERFACE.
        (WebCore::toJS): Deleted. Now generated directly in EventFactory.cpp.
        * bindings/scripts/InFilesCompiler.pm:
        (generateInterfacesHeader): Use #pragma once. Generate enum values directly. Added the support for suffixing
        each type name with namespace for EventTarget.
        * dom/Event.h: Removed the declaration of EventInterface enum. It's now directly generated in EventInterfaces.h
        * dom/EventNames.in: Generate toJSNewlyCreated.
        * dom/EventTarget.h: Removed the declaration of EventTargetInterface as it's now done in EventTargetInterfaces.h.
        * dom/EventTargetFactory.in: Generate toJS.
        * dom/make_event_factory.pl:
        (defaultParameters): Added two new options. factoryFunction specifies whether toJS or toJSNewlyCreated is generated,
        and useNamespaceAsSuffix specifies whether each entry should be suffixed by the namespace (used by EventTarget).
        (generateCode): Added a missing semicolon.
        (generateImplementation): Removed the early exit for EventTarget since we now need to generate its toJS function.
        Replaced the code to generate EventFactory::create by the one to generate toJS / toJSNewlyCreated.

2018-07-02  Zalan Bujtas  <zalan@apple.com>

        HTML widget displays blank when playing on page
        https://bugs.webkit.org/show_bug.cgi?id=187272
        <rdar://problem/39317899>

        Reviewed by Simon Fraser.

        When a composited layer gains content (in this particular case, going from NoContentsLayer to ContentsLayerForMedia),
        we need to size the associated graphics layer accordingly (NoContentsLayer means zero sized graphics layer).  

        Not testable on iOS.

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateConfiguration):

2018-07-02  David Kilzer  <ddkilzer@apple.com>

        Refactor InlineTextBox::emphasisMarkExistsAndIsAbove()
        <https://webkit.org/b/187204>

        Reviewed by Darin Adler.

        No new tests since there is no change in behavior.

        Refactor emphasisMarkExistsAndIsAbove() to return a
        std::optional<bool> instead of returning a bool and taking a
        std::optional<bool> argument.  The state returned is now:
        - std::nullopt => emphasis mark doesn't exist or is suppressed.
        - false => emphasis mark exists and is not suppressed, but is not above.
        - true => emphasis mark exists and is not suppressed, and is above.

        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::placeBoxesInBlockDirection):
        (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
        (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
        (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
        - Update for refactored method.  Remove some redundant checks
          for TextEmphasisMark::None that already happen in
          emphasisMarkExistsAndIsAbove().
        * rendering/InlineTextBox.cpp:
        (WebCore::emphasisPositionHasNeitherLeftNorRight): Delete.
        - Replaced by an OptionSet<TextEmphasisPosition>.
        (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
        - Refactor as described above.
        (WebCore::InlineTextBox::paintMarkedTextForeground):
        - Update for refactored method.
        * rendering/InlineTextBox.h:
        (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
        - Update for new method signature.

2018-07-02  Megan Gardner  <megan_gardner@apple.com>

        Enable copy paste on iOS apps for Mac
        https://bugs.webkit.org/show_bug.cgi?id=187194
        <rdar://problem/41451148>

        Reviewed by Darin Adler.

        Difficult to test this platform.

        UIKit doesn't support itemProviders for iOS apps for Mac, so we need to revert to the
        older way of setting a dictionary of objects and keys for items. Not everything is
        availble in this form, and we haven't cleaned up our itemProvider code yet, so we 
        need to case some things out for now. Hopefully in the future, this will be implmented
        and can just work as expected, but for now, this is the best workaround.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::registerItemToPasteboard):
        (WebCore::PlatformPasteboard::write):
        (WebCore::PlatformPasteboard::readURL):
        * platform/ios/WebItemProviderPasteboard.h:
        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderRegistrationInfoList itemProvider]):

2018-07-02  Eric Carlson  <eric.carlson@apple.com>

        Video sometimes flickers when playing to AppleTV
        https://bugs.webkit.org/show_bug.cgi?id=187193
        <rdar://problem/40153865>

        Reviewed by Jer Noble and Youenn Fablet.
        
        No new tests, existing test updated.

        Delay 100ms before changing the iOS audio session category because it is an expensive and
        potentially disruptive operation, and changing an audio or video element configuration
        can result in several quick, ultimately unnecessary, category changes.

        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::clientWillBeginPlayback): Add logging.

        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager): Initialize timer.
        (WebCore::PlatformMediaSessionManager::removeSession): Deactivate audio session when there
        are no sessions.
        (WebCore::PlatformMediaSessionManager::updateSessionStateTimerFired): New, update session now.
        (WebCore::PlatformMediaSessionManager::updateSessionState): Add parameter.
        * platform/audio/PlatformMediaSessionManager.h:

        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (PlatformMediaSessionManager::updateSessionState): Defer update if it isn't supposed to happen
        immediately.

        * platform/audio/ios/AudioSessionIOS.mm:
        (WebCore::AudioSession::setCategory): Drive-by: setting the audio category to nil is a noop,
        so don't waste time doing it.
        (WebCore::AudioSession::tryToSetActive): Allow other apps to resume playback when we deactivate
        the audio session.

        * platform/Timer.h:
        (WebCore::DeferrableOneShotTimer): Add WTF_MAKE_FAST_ALLOCATED so it can be used in a unique_ptr.

2018-07-02  Wenson Hsieh  <wenson_hsieh@apple.com>

        Clean up some spellchecking code
        https://bugs.webkit.org/show_bug.cgi?id=187238

        Reviewed by Tim Horton.

        A few minor tweaks to modernize some spellchecking code. No change in behavior.

        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::timerFired):
        * editing/Editor.cpp:
        (WebCore::Editor::markMisspellingsAfterTypingToWord):

        Use move semantics when passing Ranges to markAllMisspellingsAndBadGrammarInRanges.

        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):

        Change this to take RefPtr<Range>&& instead of Range*.

        (WebCore::Editor::markMisspellingsAndBadGrammar):

        Remove an unnecessary call to `RefPtr::get()`.

        * editing/Editor.h:
        * editing/TextCheckingHelper.cpp:
        (WebCore::TextCheckingParagraph::invalidateParagraphRangeValues):
        (WebCore::TextCheckingParagraph::checkingStart const):
        (WebCore::TextCheckingParagraph::checkingEnd const):
        (WebCore::TextCheckingParagraph::checkingLength const):
        (WebCore::TextCheckingParagraph::automaticReplacementStart const):
        (WebCore::TextCheckingParagraph::automaticReplacementLength const):

        Currently, all of these cached range offsets are `int`s, and use a value of -1 to denote that their values are
        missing and must be recomputed. Instead, make these `std::optional`s and let `std::nullopt` represent the
        missing value.

        * editing/TextCheckingHelper.h:

2018-07-02  Antoine Quint  <graouts@apple.com>

        Crash in WebCore::WebAnimation::timeToNextRequiredTick when running imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html
        https://bugs.webkit.org/show_bug.cgi?id=187145

        Reviewed by Dean Jackson.

        Ensure we have a resolved time value before trying to use it.

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::timeToNextRequiredTick const):

2018-07-02  Antoine Quint  <graouts@apple.com>

        [Web Animations] Crash in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
        https://bugs.webkit.org/show_bug.cgi?id=187139

        Reviewed by Dean Jackson.

        Ensure we have a resolved time value before trying to use it.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

2018-07-02  Youenn Fablet  <youenn@apple.com>

        Reject getUserMedia promise if capture fails
        https://bugs.webkit.org/show_bug.cgi?id=187190

        Reviewed by Eric Carlson.

        In case PendingActivationMediaStream is notified of a change,
        Check whether any track failed to capture.
        If so, reject the promise.
        Add more release logging in error case.

        Covered by manual testing.

        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::PendingActivationMediaStream::~PendingActivationMediaStream):
        (WebCore::UserMediaRequest::PendingActivationMediaStream::characteristicsChanged):
        (WebCore::UserMediaRequest::mediaStreamIsReady):
        (WebCore::UserMediaRequest::mediaStreamDidFail):
        * Modules/mediastream/UserMediaRequest.h:
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::captureFailed):
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::setupCaptureSession):

2018-07-01  Fujii Hironori  <Hironori.Fujii@sony.com>

        [WK2] fast/parser/document-open-in-unload.html makes the following test crash
        https://bugs.webkit.org/show_bug.cgi?id=98345
        <rdar://problem/12474923>

        Reviewed by Ryosuke Niwa.

        m_documentLoader can become null in the middle of
        FrameLoader::commitProvisionalLoad by stopping the loading.

        No new tests (Covered by existing tests).

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::commitProvisionalLoad): Do null check of m_documentLoader.

2018-07-01  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] LastResort in the font family list causes emoji with joiners to be rendered as multiple .notdef characters
        https://bugs.webkit.org/show_bug.cgi?id=187209
        <rdar://problem/40920785>

        Reviewed by Darin Adler.

        Inside our complex text codepath, we perform our own font fallback, which
        includes a function that asks "can this font support this grapheme cluster?"
        Because of the mechanics of how fonts work, the implementation of this
        function is "Does the font's cmap table support every character of the
        cluster?" We were using Font::glyphForCharacter() to determine this; however,
        this function maps certain control characters to the zero width space
        character (with the intention that these control characters shouldn't be
        visible in the fast text codepath). That replacement, however, was causing
        us to get false negatives, because Apple Color Emoji doesn't support zero
        width space. Therefore, Apple Color Emoji was looking like it didn't support
        emoji combining sequences.

        The best solution to this would be to get Font::glyphForCharacter() to stop
        performing these replacements (see https://bugs.webkit.org/show_bug.cgi?id=187166).
        However, that is too risky of a change to be making right now. Instead,
        a more localized solution is to implement a version of "Does the font's cmap
        table support every character of the cluster" that doesn't perform the
        substitutions. This patch does exactly that, and uses a bit vector to cache
        the results. In order to not have a giant bit vector, we take the old code
        path if we know the substitutions won't affect us (and uses ASSERT()s to 
        validate this) so the bit vector only holds at maximum 3 words of storage.

        Test: fast/text/emoji-with-joiner.html

        * platform/graphics/Font.cpp:
        (WebCore::codePointSupportIndex):
        (WebCore::createAndFillGlyphPage):
        (WebCore::Font::platformSupportsCodePoint const):
        (WebCore::Font::supportsCodePoint const):
        (WebCore::Font::canRenderCombiningCharacterSequence const):
        * platform/graphics/Font.h:
        * platform/graphics/cocoa/FontCocoa.mm:
        (WebCore::Font::platformSupportsCodePoint const):

2018-07-01  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Text replacements that end with symbols are expanded immediately
        https://bugs.webkit.org/show_bug.cgi?id=187225
        <rdar://problem/41112433>

        Reviewed by Darin Adler.

        In shipping Safari, enabling grammar correction causes text shortcuts that end with symbols or punctuation marks
        to immediately trigger when typing; normally, when grammar correction is off, this is only triggered after the
        user has additionally inserted a punctuation mark or whitespace character after the replaced text.

        This bug happens because enabling grammar checking causes the spell checking range to expand to the range of the
        full sentence, so any text checking results that replace an existing range are triggered as long as they end
        anywhere in the sentence. In contrast, when grammar checking is disabled, the spell checking range is limited to
        the nearest adjacent word, which prevents text replacement from occurring elsewhere in the sentence.

        However, after r232530, we now always expand the spell checking range to the extent of the sentence when a word
        is typed regardless of whether grammar checking is enabled, which means that the issue described above now
        happens everywhere. To fix this recent regression and the existing bug, we:

        -   Augment our spellchecking codepaths to include a new automatic text replacement range, alongside
            spellchecking and paragraph ranges.
        -   Let this automatic text replacement range be the range of the adjacent word in the case where the user has
            finished typing a word.
        -   When marking and replacing text checking results, consult this new automatic text replacement instead of the
            spellchecking range.

        This keeps the behavior grammar and sentence retro correction results intact, while limiting the scope in which
        text replacement results are applied.

        Test: editing/spelling/text-replacement-after-typing-to-word.html

        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::timerFired):
        * editing/Editor.cpp:
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::markMisspellingsAfterTypingToWord):

        Pass in the adjacent word range for the `automaticReplacementRange`, instead of the spell checking range (which
        may be extended to the full range of the sentence).

        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):

        Add an `automaticReplacementRange` argument to markAllMisspellingsAndBadGrammarInRanges, and adjust call sites
        to pass in a range (generally the same as the spell checking range, but in the case where a word has been typed,
        this is a narrower range).

        (WebCore::correctSpellcheckingPreservingTextCheckingParagraph):
        (WebCore::Editor::markAndReplaceFor):

        When replacing text, only allow text replacement in the automatic replacement range rather than the spell
        checking range.

        (WebCore::Editor::markMisspellingsAndBadGrammar):
        * editing/Editor.h:
        * editing/SpellChecker.cpp:
        (WebCore::SpellCheckRequest::SpellCheckRequest):

        Add a new version of this constructor that takes a single Range representing both the spellchecking range and
        the automatic text replacement range, for convenience.

        (WebCore::SpellCheckRequest::create):
        * editing/SpellChecker.h:

        Add plumbing for the automatic replacement range.

        (WebCore::SpellCheckRequest::automaticReplacementRange const):
        * editing/TextCheckingHelper.cpp:

        Add plumbing for the automatic replacement range, and new helpers to locate the range as offsets within the
        text checking paragraph range.

        (WebCore::TextCheckingParagraph::TextCheckingParagraph):
        (WebCore::TextCheckingParagraph::invalidateParagraphRangeValues):
        (WebCore::TextCheckingParagraph::automaticReplacementStart const):
        (WebCore::TextCheckingParagraph::automaticReplacementLength const):
        * editing/TextCheckingHelper.h:

2018-06-30  David Kilzer  <ddkilzer@apple.com>

        Follow-up: Fix clang static analyzer warnings: Garbage return value
        <https://webkit.org/b/187224>

        Address review feedback from Eric Carlson.

        * platform/mediastream/MediaConstraints.h:
        (WebCore::NumericConstraint::valueForCapabilityRange const):
        - Use brace initialization for more local variables.

2018-06-30  Michael Catanzaro  <mcatanzaro@igalia.com>

        Asan false positive: stack use after scope under WebCore::ApplyPropertyBorderImageModifier in WebCore::Length::Length(WebCore::Length&&)
        https://bugs.webkit.org/show_bug.cgi?id=186980
        <rdar://problem/41409838>

        Reviewed by Oliver Hunt.

        We believe that we have found a bug in GCC's address sanitizer. It is blocking work on other
        issues, so work around it by changing a temporary into a local variable.

        * css/StyleBuilderCustom.h:
        (WebCore::ApplyPropertyBorderImageModifier::applyInitialValue):

2018-06-30  David Kilzer  <ddkilzer@apple.com>

        Fix clang static analyzer warnings: Garbage return value
        <https://webkit.org/b/187224>

        Reviewed by Eric Carlson.

        * platform/mediastream/MediaConstraints.h:
        (WebCore::NumericConstraint::valueForCapabilityRange const):
        - Use brace initialization for local variables.

2018-06-30  Zalan Bujtas  <zalan@apple.com>

        [LFC] Do not add the containing block's offset while computing the out-of-flow static position.
        https://bugs.webkit.org/show_bug.cgi?id=187202

        Reviewed by Antti Koivisto.

        The static position for an out-of-flow elements is
        1. the distance from the parent's border box.
        2. climbing up on the containing block chain and offset the containers until we reach the out-of-flow element's containing block.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
        (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):

2018-06-30  Zalan Bujtas  <zalan@apple.com>

        [LFC] If the top and bottom margins of a box are adjoining, then it is possible for margins to collapse through it.
        https://bugs.webkit.org/show_bug.cgi?id=187220

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginBottomCollapsedThrough):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):

2018-06-30  Zalan Bujtas  <zalan@apple.com>

        [LFC] Adjust final out-of-flow position with the computed margin value.
        https://bugs.webkit.org/show_bug.cgi?id=187219

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):

2018-06-29  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make WPT test at timing-model/timelines/document-timelines.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=186507
        <rdar://problem/41000257>

        Reviewed by Dean Jackson.

        The Web Animations spec, along with the HTML5 event loop spec, specify some assumptions on the time reported by
        document.timeline.currentTime:

        - it should only increase once per frame
        - it should have the same value as the timestamp passed to requestAnimationFrame() callbacks

        The WPT test at web-platform-tests/web-animations/timing-model/timelines/document-timelines.html relies on these
        assumptions to be true so that we check that the start time of a new animation is not the same as the timeline time
        when it was created, since it will be in the "play-pending" state for a frame.

        In order to support this, we add two new methods on DocumentAnimationScheduler. First, when a scheduled display update
        fires, we record the timestamp and expose it via lastTimestamp() such that DocumentTimeline and ScriptedAnimationController
        can use the same value when updating animations. Then, to know whether code is run as a result of a display update, we
        expose isFiring().

        Now, within DocumentTimeline::currentTime(), we can cache the current time this way:

        - if we're in the middle of a display update, use the value returned by lastTimestamp().
        - otherwise, compute what would have been the ideal number of frames (at 60fps or less if throttled) and add those to
        the lastTimestamp() value.

        Then, we remove this cached current time when both currently-running JavaScript has completed and all animation update
        code has completed by waiting on the invalidation task to run.

        * animation/DocumentAnimationScheduler.cpp:
        (WebCore::DocumentAnimationScheduler::displayRefreshFired):
        * animation/DocumentAnimationScheduler.h:
        (WebCore::DocumentAnimationScheduler::lastTimestamp):
        (WebCore::DocumentAnimationScheduler::isFiring const):
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::currentTime):
        (WebCore::DocumentTimeline::performInvalidationTask):
        (WebCore::DocumentTimeline::maybeClearCachedCurrentTime):
        * animation/DocumentTimeline.h:
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::serviceScriptedAnimations):
        (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):

2018-06-29  Nan Wang  <n_wang@apple.com>

        Crash under WebCore::AXObjectCache::handleMenuItemSelected
        https://bugs.webkit.org/show_bug.cgi?id=186918
        <rdar://problem/41365984>

        Reviewed by Chris Fleizach.

        When a node is being destroyed, we deregister it from the AX cache through the Node's destructor.
        But we did not remove the corresponding entry from the m_deferredFocusedNodeChange list. It would
        then lead to a crash if we try to access the deleted node from m_deferredFocusedNodeChange.
        Fixed it by removing the entry if the newly focused node is being destroyed.

        Test: accessibility/accessibility-crash-focused-element-change.html

        * accessibility/AXObjectCache.cpp:
        (WebCore::AXObjectCache::remove):

2018-06-29  Antti Koivisto  <antti@apple.com>

        REGRESSION (r232806): Facebook login fields have blue fill background instead of white
        https://bugs.webkit.org/show_bug.cgi?id=187207
        <rdar://problem/41606349>

        Reviewed by Tim Horton.

        This happens because a 'prefers-dark-interface' media query on UA sheet always evaluates to true in dark mode.

        Tests: fast/forms/input-background-ua-media-query.html

        * css/MediaQueryEvaluator.cpp:
        (WebCore::prefersDarkInterfaceEvaluate):

        Make prefers-dark-interface media query match only when using system appearance.

2018-06-29  Daniel Bates  <dabates@apple.com>

        REGRESSION (r230921): Cannot log in to forums.swift.org using GitHub account
        https://bugs.webkit.org/show_bug.cgi?id=187197
        <rdar://problem/40420821>

        Reviewed by Brent Fulgham.

        Fixes an issue where a Same-Site cookies are not sent with any child window load if the
        load is cross-origin with respect to the window's opener. One example where this issue
        manifest itself was in the GitHub sign in flow on forums.swift.org.

        Currently we always consider the origin of the window's opener (if we have one) when
        determining whether a frame load request is same-origin and hence should send Same-Site
        cookies when performing the request. So, when page A.com opens a child window to B.com and
        then a person clicks a hyperlink or submits a form to B.com/b2 then we do not send Same-
        Site cookies with the request to B.com/b2 (because its origin, B.com, is cross-origin
        with its opener, A.com). But we should send Same-Site cookies with the request to B.com/b2
        because it is same-origin with the page that initiated the request, B.com. Instead of
        always considering the origin the window's opener for every frame load we should only
        consider it for the first non-empty document load.

        Tests: http/tests/cookies/same-site/fetch-in-about-blank-popup.html
               http/tests/cookies/same-site/post-from-cross-site-popup.html

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

2018-06-29  Nan Wang  <n_wang@apple.com>

        AX: [iOS] VoiceOver scroll position is jumpy in frames
        https://bugs.webkit.org/show_bug.cgi?id=186956

        Reviewed by Simon Fraser.

        iOS is using delegate scrolling and we should not take into account
        the scroll offset when converting rects.

        Also fixed a issue where we want to scroll the element into view even
        if it's partially visible.

        Test: fast/scrolling/ios/iframe-scroll-into-view.html

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::scrollToMakeVisible const):
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::contentsToContainingViewContents const):

2018-06-29  Chris Dumez  <cdumez@apple.com>

        WebKitLegacy: Can trigger recursive loads triggering debug assertions
        https://bugs.webkit.org/show_bug.cgi?id=187121
        <rdar://problem/41259430>

        Reviewed by Brent Fulgham.

        In order to support asynchronous policy delegates, r229722 added a call to
        FrameLoader::clearProvisionalLoadForPolicyCheck() when starting a navigation
        policy decision in PolicyChecker::checkNavigationPolicy(). This calls
        stopLoading() on the current provisional loader if there is one, and potentially
        calls the didFailProvisionalLoadWithError cleint delegate. This delegate call
        is synchronous on WebKit1, so the client may start a new load from this delegate
        and re-enter Webcore. This happens in practive with Quickens 2017 / 2018 on Mac.

        Before r229722, this was not an issue because pending loads were canceled after
        the (asynchronous) navigation policy decision, via FrameLoader::stopAllLoaders().
        FrameLoader::stopAllLoaders() sets a m_inStopAllLoaders flag and we return early
        in FrameLoader::loadRequest() when this flag is set to prevent recursive loads.

        To maintain shipping behavior as much as possible, this patch introduces a similar
        inClearProvisionalLoadForPolicyCheck which gets set during
        FrameLoader::clearProvisionalLoadForPolicyCheck() and we prevent new loads while
        this flag is set.

        I have verified that Quickens 2017 / 2018 works again after this change and I added
        API test coverage for this behavior.

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::clearProvisionalLoadForPolicyCheck):
        * loader/FrameLoader.h:

2018-06-25  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Infinite loop if a <use> element references its ancestor and the DOMNodeInserted event handler of one its ancestor's descents updates the document style
        https://bugs.webkit.org/show_bug.cgi?id=186925

        Reviewed by Antti Koivisto.

        This patches fixes two issues:
        -- SVGTRefTargetEventListener should not assume it has to be attached to
        target when its handleEvent() is called.
        Because SVGTRefTargetEventListener::handleEvent() references the target
        element, we just return if the listener is detached.

        -- The <use> element should not clone its shadow tree if it references one
        of its ancestors. The DOMNodeInserted of any node in the target element
        tree may issue a document command. This document command will cause the 
        shadow tree to be re-cloned so this will cause infinite loop to happen.

        Test: svg/dom/svg-use-infinite-loop-cloning.html

        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefTargetEventListener::handleEvent):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::updateShadowTree):

2018-06-29  Manuel Rego Casasnovas  <rego@igalia.com>

        [WPE] Three CSS Grid Layout tests crash due to valueless std::optional access
        https://bugs.webkit.org/show_bug.cgi?id=186752

        Reviewed by Frédéric Wang.

        This is a simple fix for the crash we're getting on WPE
        in IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep().

        Covered by existent tests, just remove them from TestExpectations file.

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::IndefiniteSizeStrategy::freeSpaceForStretchAutoTracksStep const):
        Check if minSize is null before trying to access it's value.

2018-06-29  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r233349.

        caused 42 crashes on iOS GuardMalloc and iOS ASan tests

        Reverted changeset:

        "[Web Animations] Using a Web Animation leaks the Document"
        https://bugs.webkit.org/show_bug.cgi?id=187088
        https://trac.webkit.org/changeset/233349

2018-06-29  Jer Noble  <jer.noble@apple.com>

        Returning PiP'd video to fullscreen while playing leaves video muted.
        https://bugs.webkit.org/show_bug.cgi?id=187181
        <rdar://problem/41408335>

        Reviewed by Eric Carlson.

        Test: media/picture-in-picture-interruption.html

        Don't reset the media session's state at the end of an interruption if it wasn't changed an the beginning of one.

        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::endInterruption):
        * testing/Internals.cpp:
        (WebCore::Internals::mediaSessionState):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-06-29  Zalan Bujtas  <zalan@apple.com>

        [LFC] When the formatting root is also a containing block for out-of-flow elements.
        https://bugs.webkit.org/show_bug.cgi?id=187179

        Reviewed by Antti Koivisto.

        Out-of-flow descendants' layout requires their containing block height to be computed. This patch takes care of the case
        when the containing block is also a formatting context root (e.g. relative positioned with overflow other than visible).

        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):

2018-06-29  Zalan Bujtas  <zalan@apple.com>

        [LFC] Do not skip the next inflow sibling after finishing a formatting context root layout.
        https://bugs.webkit.org/show_bug.cgi?id=187178

        Reviewed by Antti Koivisto.

        Since the block formatting layout is based on pre-order traversal, after finishing a formatting
        context layout (which takes care of its entire subtre), we need to visit the next (in-flow)sibling. 

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):

2018-06-29  Zalan Bujtas  <zalan@apple.com>

        [LFC] The static position for an out-of-flow box should include the previous sibling's collapsed margin
        https://bugs.webkit.org/show_bug.cgi?id=187169

        Reviewed by Antti Koivisto.

        When computing the static position of an absolutely positioned box, we need to look at the previous sibling's bottom margin.
        If the previous sibling happens to collapse its bottom margin with the parent's bottom margin, we still need to account for it
        and compute the static vertical position as if the bottom margin was not collapsed.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::initializeRoot):
        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::nonCollapsedMarginBox const):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::setHasValidVerticalNonCollapsedMargin):
        (WebCore::Display::Box::setVerticalMargin):
        (WebCore::Display::Box::setVerticalNonCollapsedMargin):
        (WebCore::Display::Box::nonCollapsedMarginTop const):
        (WebCore::Display::Box::nonCollapsedMarginBottom const):

2018-06-27  Antoine Quint  <graouts@apple.com>

        [Web Animations] Using a Web Animation leaks the Document
        https://bugs.webkit.org/show_bug.cgi?id=187088
        <rdar://problem/41392046>

        Reviewed by Dean Jackson.

        Test: webanimations/leak-document-with-web-animation.html

        We need to ensure that any remaining animation is cleared when the DocumentTimeline is detached from its Document.
        We rename WebAnimation::prepareAnimationForRemoval() to WebAnimation::remove() since it really actively disassociates
        the animation from its timeline.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::removeAnimationsForElement): We no longer need the call to removeAnimation()
        since the new WebAnimation::remove() method will also set the timeline to null which will eventually call
        removeAnimation() on the disassociated timeline.
        * animation/DeclarativeAnimation.cpp:
        (WebCore::DeclarativeAnimation::remove):
        (WebCore::DeclarativeAnimation::prepareAnimationForRemoval): Deleted.
        * animation/DeclarativeAnimation.h:
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::detachFromDocument): Call remove() on all known animations.
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::remove): Set the timeline to null to fully disassociate this animation from its timeline.
        (WebCore::WebAnimation::setTimeline): Factor the internal timeline-association code out of this JS API method so
        that we can call this code without any JS-facing implications.
        (WebCore::WebAnimation::setTimelineInternal):
        (WebCore::WebAnimation::prepareAnimationForRemoval): Deleted.
        * animation/WebAnimation.h:

2018-06-28  Zalan Bujtas  <zalan@apple.com>

        [LFC] Out-of-flow positioned height does not necessarily equal to "bottom - top".
        https://bugs.webkit.org/show_bug.cgi?id=187168

        Reviewed by Antti Koivisto.

        According to the spec "For absolutely positioned elements, the used values of the vertical dimensions must satisfy this constraint:
        'top' + 'margin-top' + 'border-top-width' + 'padding-top' + 'height' + 'padding-bottom' + 'border-bottom-width' + 'margin-bottom' + 'bottom' = height of containing block"
        With a non-auto "height" value, the bottom - top does not necessarily compute to the height of the element.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):

2018-06-28  Olivia Barnett  <obarnett@apple.com>

        Find in page for typographic quotes does not find low (German) quotes
        https://bugs.webkit.org/show_bug.cgi?id=187164
        <rdar://problem/29612785>

        Reviewed by Tim Horton.

        Added additional quote test to LayoutTests/fast/text/find-quotes.html.

        Added functionality to replace German quotes when matching.

        * editing/TextIterator.cpp:
        (WebCore::foldQuoteMark):
        (WebCore::foldQuoteMarks):

2018-06-28  Antti Koivisto  <antti@apple.com>

        REGRESSION (233281): fast/dom/location-new-window-no-crash.html and some other tests are timing out
        https://bugs.webkit.org/show_bug.cgi?id=187156

        Reviewed by Zalan Bujtas.

        We need still need to re-enable memory cache client calls even when not doing other post-resolution callbacks.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::memoryCacheClientCallsResumeQueue):

        Add a separate queue for this.

        (WebCore::Style::suspendMemoryCacheClientCalls):
        (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):

2018-06-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] DataTransfer.getData always returns the empty string when dropping text
        https://bugs.webkit.org/show_bug.cgi?id=187130
        <rdar://problem/41014117>

        Reviewed by Ryosuke Niwa.

        Currently, DataTransfer.getData() always returns the empty string on drop. This is because all data on drop is
        backed by local files in the temporary directory, so the number of files is never 0; this, combined with the
        fact that WebKit will suppress access to the DataTransfer object if there is one or more file in the pasteboard,
        means that getData() never works for drag and drop on iOS at the moment. To fix this, we need to know whether a
        dropped item provider is a file.

        Ideally, we'd have a flag to tell us whether or not an NSItemProvider being dropped is a file, or instead just
        inline data - in fact, this flag already exists in the form of UIPreferredPresentationStyle. Unfortunately, not
        all apps that vend draggable files specify this, so we can't simply ask the item provider whether it's intended
        to be a file. As a workaround, we can use several heuristics to determine the "file content state" of the drag
        pasteboard on iOS (see below for more details).

        This patch adds some plumbing through the client layers to grab a list of item information describing each
        dropped item provider on iOS. Using this information, we tweak the logic in Pasteboard::fileContentState to make
        an educated guess at whether or not the pasteboard really contains files; if we determine that the pasteboard
        probably contains no files, we'll allow DataTransfer.getData() to retrieve information from the pasteboard.
        Otherwise, if the pasteboard may contain files, we'll fall back to our current behavior of including the "Files"
        type in DataTransfer.types and allowing the page to grab file data using DataTransfer.files or
        DataTransfer.items.

        Tests:  DataInteractionTests.DataTransferGetDataReadPlainAndRichText
                DataInteractionTests.DataTransferSuppressGetDataDueToPresenceOfTextFile

        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::filesFromPasteboardAndItemList const):

        Check Pasteboard::fileContentState() to ensure that we don't expose files when DataTransfer.types does not
        contain the "Files" type, and vice versa, and DataTranser.files is also empty in this case.

        * dom/DataTransferItemList.cpp:
        * platform/PasteboardItemInfo.h:

        Add a couple of additional members to PasteboardItemInfo: suggestedFileName and hasDeclaredNonTextType, a flag
        that indicates whether or not the pasteboard item has a type representation that is a declared type, but is not
        a text type (i.e. does not conform to "public.text", "public.url", or rich text format with attachment types).

        (WebCore::PasteboardItemInfo::encode const):
        (WebCore::PasteboardItemInfo::decode):
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::fileContentState):

        Instead of always considering a dropped item provider on iOS to represent a file, only do so if at least one of
        the following conditions are met:
        - The drop session contains multiple item providers (flocking text selections is a very rare use case).
        - The item provider was explicitly marked as an attachment.
        - The item provider has a suggested file name.
        - The item provider has any other content that is not text.

        In the case where none of the above conditions are met, the item provider (if it ends up being a file) is
        essentially indistinguishable from inline data. An example of this is dropping a plain text file that is
        unnamed, with no presentation style, and alongside no other items nor other known type representations. These
        are cases in which whether the item is treated as a file or as inline data is (hopefully) irrelevant.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::allPasteboardItemInfo):
        (WebCore::PlatformPasteboard::informationForItemAtIndex):

2018-06-28  Timothy Hatcher  <timothy@apple.com>

        Don't force black text when TextIndicator draws backgrounds or all content.
        https://bugs.webkit.org/show_bug.cgi?id=187161
        rdar://problem/40434644

        Reviewed by Tim Horton.

        * page/TextIndicator.cpp:
        (WebCore::snapshotOptionsForTextIndicatorOptions):
        Only set SnapshotOptionsForceBlackText when TextIndicatorOptionRespectTextColor and
        TextIndicatorOptionPaintBackgrounds are not set.

2018-06-28  Timothy Hatcher  <timothy@apple.com>

        Find on page selection color isn't adapted for dark mode.
        https://bugs.webkit.org/show_bug.cgi?id=187072

        Unreviewed, revert part of r233280.

        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Use pure yellow again.

2018-06-28  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-animations/test_animation-starttime.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183834
        <rdar://problem/40997932>

        Reviewed by Dean Jackson.

        We need to run pending tasks in the "update animations" procedure to ensure that the start time has been set
        to a different time than the timeline time at the time the animation was asked to play(). This ensure the
        timeline current time has progressed and can be queried to a different value in a requestAnimationFrame()
        callback.

        When invalidating events, we need to make sure we disregard instances when an animation has and is still pending
        so that we wait until we change the pending state to work out which events to enqueue.

        * animation/DeclarativeAnimation.cpp:
        (WebCore::DeclarativeAnimation::invalidateDOMEvents):
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::updateAnimations):
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::updatePendingTasks):
        (WebCore::WebAnimation::timeToNextRequiredTick const):
        (WebCore::WebAnimation::runPendingTasks):
        * animation/WebAnimation.h:

2018-06-28  Ryosuke Niwa  <rniwa@webkit.org>

        Release assert in ScriptController::canExecuteScripts via WebCore::SVGUseElement::insertedIntoAncestor
        https://bugs.webkit.org/show_bug.cgi?id=187137
        <rdar://problem/41081885>

        Reviewed by Zalan Bujtas.

        The bug was caused by SVGUseElement::notifyFinished firing a DOM event via SVGUseElement::updateExternalDocument
        inside SVGUseElement::insertedIntoAncestor. Ideally, we make every call to notifyFinished asynchronous
        but simply delay the call to updateExternalDocument() until didFinishInsertingNode() for now.

        No new tests since the failure is caught with the newly added assertion in notifyFinished by existing SVG tests
        such as svg/batik/filters/filterRegions.svg and svg/batik/text/smallFonts.svg. Unfortunately, I could not
        construct a test case which hits this release assertion since the real crash happens when the cached resource
        had an error but in the all cases I could find, the resource response with an error results in a reload or
        an asynchronous failure callback.

        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::didAddClient): Added a FIXME.
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::insertedIntoAncestor): Delay the call to updateExternalDocument.
        (WebCore::SVGUseElement::didFinishInsertingNode): Invoke updateExternalDocument.
        (WebCore::SVGUseElement::notifyFinished): Added an assertion.
        * svg/SVGUseElement.h:

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Unreviewed, rolling out r233309.

        Invalidates previous database model without versioning

        Reverted changeset:

        "Fix encoding / decoding issues in ResourceLoadStatistics"
        https://bugs.webkit.org/show_bug.cgi?id=186890
        https://trac.webkit.org/changeset/233309

2018-06-28  Timothy Hatcher  <timothy@apple.com>

        Focus ring color does not honor dark mode or system accent color.
        https://bugs.webkit.org/show_bug.cgi?id=187144
        rdar://problem/41105081

        Reviewed by Tim Horton.

        Pass the focus ring color through to the GraphicsContext methods that draw it.

        * platform/graphics/GraphicsContext.h:
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::drawFocusRingAtTime):
        (WebCore::drawFocusRing):
        (WebCore::drawFocusRingToContext):
        (WebCore::drawFocusRingToContextAtTime):
        (WebCore::GraphicsContext::drawFocusRing):
        (WebCore::GraphicsContext::focusRingColor): Deleted.
        * platform/mac/ThemeMac.mm:
        (WebCore::drawCellFocusRingWithFrameAtTime):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::paintFocusRing):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintAreaElementFocusRing):

2018-06-28  Aditya Keerthi  <akeerthi@apple.com>

        REGRESSION (r232040): Cursor jumping in Safari text fields
        https://bugs.webkit.org/show_bug.cgi?id=187142
        <rdar://problem/41397577>

        Reviewed by Tim Horton.

        r232040 enabled click events to fire on nodes that are already being edited in
        iOS. This resulted FrameSelection::setSelection being called twice. One call
        originated from the UIWKTextInteractionAssistant, which snaps the caret to word
        boundaries. The other call originates from handleMousePressEvent in EventHandler,
        and uses character boundaries. Consequently, we see the caret jumping around.

        To fix this issue, an early return was added in the handleMousePressEvent
        codepath, which prevents FrameSelection::setSelection from being called when
        clicking on a node that is already being edited. This ensures that the
        UIWKTextInteractionAssistant codepath is the only influence on the caret position.

        Test: fast/events/ios/click-selectionchange-once.html

        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleMousePressEventSingleClick):

2018-06-28  Chris Dumez  <cdumez@apple.com>

        Fix encoding / decoding issues in ResourceLoadStatistics
        https://bugs.webkit.org/show_bug.cgi?id=186890

        Reviewed by Brent Fulgham.

        * loader/ResourceLoadStatistics.cpp:
        (WebCore::encodeHashCountedSet):
        (WebCore::encodeHashSet):
        Do not return early if the container we're trying to encode is empty. Instead,
        have the encoder encode an empty array. This is important for encoding / decoding
        to be fully symmetric. Otherwise, when trying to decode one of these empty containers,
        the decoder would fail (silently since we were ignoring decoding errors). Worse, the
        decoder might succeed but actually be decoding the *next* container in the file, since
        we have several HashCountedSets / HashSets encoded one after another.

        (WebCore::decodeHashCountedSet):
        (WebCore::decodeHashSet):
        Return a boolean to indicate if the decoding suceeded or not.

        (WebCore::ResourceLoadStatistics::decode):
        Check for container decoding errors and return false when decoding fails.
        Otherwise, we would just silently keep going.

2018-06-28  Sihui Liu  <sihui_liu@apple.com>

        Cookie API: cookie creation time is wrong
        https://bugs.webkit.org/show_bug.cgi?id=187101

        Reviewed by Geoffrey Garen.

        Covered by API test: WebKit.WKHTTPCookieStoreCreationTime.

        * platform/network/cocoa/CookieCocoa.mm:
        (WebCore::Cookie::operator NSHTTPCookie * _Nullable  const):

2018-06-28  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add Display::Box::nonCollapsedMarginBox for verification purposes.
        https://bugs.webkit.org/show_bug.cgi?id=187140

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::nonCollapsedMarginBox const):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::setVerticalNonCollapsedMargin):

2018-06-28  Zalan Bujtas  <zalan@apple.com>

        [LFC] The margin bottom of the document element does not collapse with its last inflow child's bottom margin.
        https://bugs.webkit.org/show_bug.cgi?id=187135

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):

2018-06-28  Dirk Schulze  <krit@webkit.org>

        [css-masking] Update clip-path box mapping to unified box
        https://bugs.webkit.org/show_bug.cgi?id=185797

        Reviewed by Simon Fraser.

        The box mapping for fill-box, stroke-box, view-box on HTML elements
        and content-box, padding-box, margin-box, border-box for SVG elements
        was aligned with the transform-box CSS property.

        Furthermore, the keywords fill changed to fill-box and stroke changed
        to stroke-box.

        https://drafts.fxtf.org/css-masking-1/#typedef-geometry-box

        Update the -webkit-clip-path property.

        Tests: svg/clip-path/clip-path-shape-border-box-expected.svg
               svg/clip-path/clip-path-shape-border-box.svg
               svg/clip-path/clip-path-shape-content-box-expected.svg
               svg/clip-path/clip-path-shape-content-box.svg
               svg/clip-path/clip-path-shape-margin-box-expected.svg
               svg/clip-path/clip-path-shape-margin-box.svg
               svg/clip-path/clip-path-shape-padding-box-expected.svg
               svg/clip-path/clip-path-shape-padding-box.svg

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator CSSBoxType const):
        * css/CSSValueKeywords.in:
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertClipPath):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::consumeBasicShapeOrBox):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::nodeAtPoint):
        * rendering/RenderLayer.cpp:
        (WebCore::computeReferenceBox):
        * rendering/shapes/BoxShape.cpp:
        (WebCore::computeRoundedRectForBoxShape):
        * rendering/shapes/ShapeOutsideInfo.cpp:
        (WebCore::ShapeOutsideInfo::setReferenceBoxLogicalSize):
        (WebCore::ShapeOutsideInfo::logicalTopOffset const):
        (WebCore::ShapeOutsideInfo::logicalLeftOffset const):
        * rendering/style/RenderStyleConstants.h:
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):

2018-06-27  Timothy Hatcher  <timothy@apple.com>

        Don't expose new semantic -apple-system color keywords on iOS.
        https://bugs.webkit.org/show_bug.cgi?id=187080
        rdar://problem/41505699

        Reviewed by Tim Horton.

        * DerivedSources.make: Use gnu++14, since gnu++17 is giving errors on macOS 10.12.
        * css/CSSValueKeywords.in: Define new semantic colors only on macOS.

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Compute both the collapsed and the non-collapsed margin values.
        https://bugs.webkit.org/show_bug.cgi?id=187129

        Reviewed by Antti Koivisto.

        For validation purposes only at this point.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Align inFlowNonReplacedHeightAndMargin() style with the rest of the compute functions.
        https://bugs.webkit.org/show_bug.cgi?id=187126

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

2018-06-27  Yusuke Suzuki  <utatane.tea@gmail.com>

        [GTK][WPE] Use LazyNeverDestroyed<XErrorTrapper> to remove static initializers
        https://bugs.webkit.org/show_bug.cgi?id=187089

        Reviewed by Michael Catanzaro.

        Do not allow copying since XErrorTrapper's logic relies on the address of XErrorTrapper.

        * platform/graphics/x11/XErrorTrapper.h:

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Align inFlowNonReplacedWidthAndMargin() style with the rest of the compute functions.
        https://bugs.webkit.org/show_bug.cgi?id=187124

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):

2018-06-27  Dirk Schulze  <krit@webkit.org>

        -webkit-clip-path wrong offset for clipPath references
        https://bugs.webkit.org/show_bug.cgi?id=129246

        Reviewed by Simon Fraser.

        Compute the correct offset for reference clip-paths by reusing
        some of the logic from basic shapes.
        Makes reference based clip-path interoperable and follows the
        spec.

        Test: css3/masking/clip-path-reference-2.html

        * rendering/RenderLayer.cpp:
        (WebCore::computeReferenceBox):
        (WebCore::RenderLayer::computeClipPath const):
        (WebCore::RenderLayer::setupClipPath):

2018-06-27  Antti Koivisto  <antti@apple.com>

        Don't invoke post resolution callbacks when resolving computed style
        https://bugs.webkit.org/show_bug.cgi?id=187113
        <rdar://problem/41365766>

        Reviewed by Geoff Garen.

        Post-resolution callbacks should only be invoked when we resolve the full document style,
        not when resolving computed style for a single element.

        Tests: fast/dom/object-computed-style-event.html

        * dom/Document.cpp:
        (WebCore::Document::styleForElementIgnoringPendingStylesheets):
        * dom/Element.cpp:
        (WebCore::Element::resolveComputedStyle):

        Also ref the ancestor stack to be safe.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::PostResolutionCallbackDisabler::PostResolutionCallbackDisabler):
        (WebCore::Style::PostResolutionCallbackDisabler::~PostResolutionCallbackDisabler):

        Add an option to not drain the callback queue on destruction. In this mode we
        just block network loads.

        * style/StyleTreeResolver.h:

2018-06-27  Timothy Hatcher  <timothy@apple.com>

        Find on page selection color isn't adapted for dark mode.
        https://bugs.webkit.org/show_bug.cgi?id=187072
        rdar://problem/40354841

        Reviewed by Tim Horton.

        * page/mac/TextIndicatorWindow.mm:
        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Use [NSColor findHighlightColor].
        * platform/mac/LocalDefaultSystemAppearance.h:
        (WebCore::LocalDefaultSystemAppearance::usingDarkAppearance const): Added.
        * platform/mac/LocalDefaultSystemAppearance.mm:
        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Set m_usingDarkAppearance.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintPlatformDocumentMarkers): Use TextPaintPhase::Decoration since this
        matches step three of InlineTextBox::paint ("Paint fancy decorations"). This allows TextMatch to
        paint a forground and not end up painting during this "fancy decorations" phase.
        (WebCore::InlineTextBox::resolveStyleForMarkedText): Set the fillColor for TextMarker to force a
        dark text color which will draw over the yellow highlight.
        (WebCore::InlineTextBox::collectMarkedTextsForDocumentMarkers): Added support for TextPaintPhase::Decoration.
        Seperate DocumentMarker::TelephoneNumber and DocumentMarker::TextMatch. Have DocumentMarker::TextMatch
        support Forground and Background phases.
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::platformColorsDidChange):
        (WebCore::RenderTheme::activeTextSearchHighlightColor const): Added. Call the platfrom version.
        (WebCore::RenderTheme::inactiveTextSearchHighlightColor const): Added. Ditto.
        (WebCore::RenderTheme::platformActiveTextSearchHighlightColor const): Added StyleColor::Options.
        (WebCore::RenderTheme::platformInactiveTextSearchHighlightColor const): Ditto.
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::platformActiveTextSearchHighlightColor const): Added.
        (WebCore::RenderThemeMac::platformInactiveTextSearchHighlightColor const): Added.
        (WebCore::RenderThemeMac::platformColorsDidChange): Clear new color caches.
        (WebCore::RenderThemeMac::systemColor const): Cache system colors by light and dark mode.

2018-06-27  Chris Dumez  <cdumez@apple.com>

        Crash under SWServer::unregisterServiceWorkerClient()
        https://bugs.webkit.org/show_bug.cgi?id=187115
        <rdar://problem/41539197>

        Reviewed by Youenn Fablet.

        Connections are usually destroyed before their SWServer. However, as per crash traces, it is possible
        for SWServers to get destroyed while they still have connections. When this happens, the connections
        (which are owned by the SWServer) get destroyed with other SWServer data members. In turn, the
        connection destructor tries to unregister its clients from the server that is currently being destroyed.

        To address the issue, the SWServer destructor now destroys remaining connections early, before SWServer's
        other data members get destroyed.

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

2018-06-27  Youenn Fablet  <youenn@apple.com>

        NetworkLoadChecker should not need to hard ref NetworkConnectionToWebProcess
        https://bugs.webkit.org/show_bug.cgi?id=186551

        Reviewed by Daniel Bates.

        No change of behavior.
        Add a way to set the client receiving any CSP warning/error notification.

        * page/csp/ContentSecurityPolicy.h:
        (WebCore::ContentSecurityPolicy::setClient):

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Do not collapse margin with the parent when element has border/padding.
        https://bugs.webkit.org/show_bug.cgi?id=187114

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):

2018-06-27  Simon Fraser  <simon.fraser@apple.com>

        Fix Windows build after r233268.

        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
        (PlatformCALayerWin::hasContents const):
        * platform/graphics/ca/win/PlatformCALayerWin.h:

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Out-of-flow positioned element's height depends on its containing block's height.
        https://bugs.webkit.org/show_bug.cgi?id=187082

        Reviewed by Antti Koivisto.

        We can't really compute the final height of an out-of-flow element until after its containing block's height is computed.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/FormattingContext.h:
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::updateLayout):
        (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
        * layout/LayoutContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        * layout/layouttree/LayoutContainer.h:
        (WebCore::Layout::Container::outOfFlowDescendants const):
        (WebCore::Layout::Container::outOfFlowDescendants): Deleted.

2018-06-27  Youenn Fablet  <youenn@apple.com>

        Disable content blockers in NetworkLoadChecker except for ping loads
        https://bugs.webkit.org/show_bug.cgi?id=187083
        <rdar://problem/41440083>

        Reviewed by Chris Dumez.

        Add internals API to reload a frame without content extensions.

        Test: http/tests/contentextensions/reload-without-contentextensions.html

        * testing/Internals.cpp:
        (WebCore::Internals::reloadWithoutContentExtensions):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-06-27  Simon Fraser  <simon.fraser@apple.com>

        https://hackernoon.com/ uses lots of layer backing store
        https://bugs.webkit.org/show_bug.cgi?id=186909
        rdar://problem/40257540

        Reviewed by Tim Horton.
        
        The existing "backing store detached" logic, which was used to eliminate backing store
        for compositing layers outside the viewport, had a number of bugs that allowed layers
        to have backing store when they should not.
        
        Specifically, any code path that ended up in setNeedsDisplay{InRect}() in PlatformCALayer
        could trigger backing store creation on layers that should have never had any.
        
        Rather than monkeypatch all the GraphicsLayerCA call sites that call setNeedsDisplay{InRect}(),
        just bail early from the PlatformCALayer* methods that trigger repaints.
        
        Tests didn't catch this because they just dumped the state of the backingStoreAttached flag. To fix this,
        create backingStoreAttachedForTesting() which also tests whether the layer has contents.

        Test: compositing/backing/backing-store-attachment-outside-viewport.html

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::dumpProperties const):
        (showGraphicsLayerTree):
        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::backingStoreAttachedForTesting const):
        * platform/graphics/GraphicsLayerClient.h:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::backingStoreAttachedForTesting const):
        (WebCore::GraphicsLayerCA::setNeedsDisplay):
        * platform/graphics/ca/GraphicsLayerCA.h:
        * platform/graphics/ca/PlatformCALayer.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::setNeedsDisplay):
        (PlatformCALayerCocoa::setNeedsDisplayInRect):
        (PlatformCALayerCocoa::hasContents const):

2018-06-27  David Kilzer  <ddkilzer@apple.com>

        Fix clang static analyzer warnings: Branch condition evaluates to a garbage value
        <https://webkit.org/b/186968>

        Reviewed by Zalan Bujtas.

        This patch changes two stack-allocated `bool` variables into
        `std::optional<bool>` since the functions that set the variable
        may return early without setting it.  It also changes one
        stack-allocated pointer to be initialized to `nullptr`.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
        Update for change to CSSPropertyAnimation::getPropertyAtIndex()
        argument type.

        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::writeImageToPasteboard): Initialize
        `cachedImage` stack pointer to nullptr since getImage() has an
        early return that doesn't set `cachedImage`.
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::writeImageToPasteboard): Ditto.

        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::CSSPropertyAnimation::getPropertyAtIndex):
        * page/animation/CSSPropertyAnimation.h:
        (WebCore::CSSPropertyAnimation::getPropertyAtIndex):
        - Change method to take `std::optional<bool>` instead of `bool`
          as second argument since the method may return early without
          setting `isShorthand`.

        * page/animation/CompositeAnimation.cpp:
        (WebCore::CompositeAnimation::updateTransitions): Update for
        change to CSSPropertyAnimation::getPropertyAtIndex() argument
        type.

        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::placeBoxesInBlockDirection): Also
        rename local `emphasisMarkIsOver` to `emphasisMarkIsAbove` to
        match other call sites.
        (WebCore::InlineFlowBox::addTextBoxVisualOverflow):
        (WebCore::InlineFlowBox::computeOverAnnotationAdjustment const):
        (WebCore::InlineFlowBox::computeUnderAnnotationAdjustment const):
        - Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
          argument type.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
        - Change method to take `std::optional<bool>` instead of `bool`
          as second argument since the method may return early without
          setting `above`.
        (WebCore::InlineTextBox::paintMarkedTextForeground):
        - Update for change to InlineTextBox::emphasisMarkExistsAndIsAbove()
          argument type.
        * rendering/InlineTextBox.h:
        (WebCore::InlineTextBox::emphasisMarkExistsAndIsAbove const):
        - Change method to take `std::optional<bool>` instead of `bool`.

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Move formatting context root layout logic to a dedicated function.
        https://bugs.webkit.org/show_bug.cgi?id=187097

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        * layout/blockformatting/BlockFormattingContext.h:

2018-06-27  Zalan Bujtas  <zalan@apple.com>

        [LFC] Compute static position for out-of-flow elements only when required.
        https://bugs.webkit.org/show_bug.cgi?id=187096

        Reviewed by Antti Koivisto.

        Computing static position for out-of-flow elements could be somewhat expensive, so let's not do it unless we actually need it.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
        (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned): Deleted.

2018-06-27  Nan Wang  <n_wang@apple.com>

        AX: [iOS] Remove the ability to set keyboard focus when VoiceOver takes focus
        https://bugs.webkit.org/show_bug.cgi?id=187076

        Reviewed by Chris Fleizach.

        We shouldn't set keyboard focus when assistive technology takes focus since
        this is causing website incompatibility issues by causing focus to be lost.

        Test: accessibility/ios-simulator/accessibility-focus-do-not-set-focus.html

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityElementDidBecomeFocused]):

2018-06-21  Emilio Cobos Álvarez  <emilio@crisal.io>

        Move clearChildNeedsStyleRecalc into resetStyleForNonRenderedDescendants.
        https://bugs.webkit.org/show_bug.cgi?id=186881

        Reviewed by Antti Koivisto.

        Every caller does this already.

        No new tests, no change in behavior.

        * style/StyleTreeResolver.cpp:
        (WebCore::Style::resetStyleForNonRenderedDescendants):
        (WebCore::Style::TreeResolver::resolveComposedTree):

2018-06-27  Tomas Popela  <tpopela@redhat.com>

        [GStreamer] Coverity scan issues
        https://bugs.webkit.org/show_bug.cgi?id=187087

        Reviewed by Xabier Rodriguez-Calvar.

        Fix uninitialized members.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        * platform/graphics/gstreamer/VideoSinkGStreamer.cpp:
        * platform/graphics/gstreamer/mse/SourceBufferPrivateGStreamer.h:

2018-06-27  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Move definitions of GCryptUtilities helpers into a separate source file
        https://bugs.webkit.org/show_bug.cgi?id=187033

        Reviewed by Michael Catanzaro.

        Move the GCryptUtilities helpers that operate on libgcrypt values and
        constants into a separate source file. This limits a bit the amount of
        inlining the compiler might feel compelled to do, and the resulting
        shared library is 8kB smaller in size.

        * crypto/gcrypt/GCryptUtilities.cpp: Copied from Source/WebCore/crypto/gcrypt/GCryptUtilities.h.
        (WebCore::hmacAlgorithm):
        (WebCore::digestAlgorithm):
        (WebCore::hashCryptoDigestAlgorithm):
        (WebCore::mpiLength):
        (WebCore::mpiData):
        (WebCore::mpiZeroPrefixedData):
        (WebCore::mpiSignedData):
        * crypto/gcrypt/GCryptUtilities.h:
        (WebCore::hmacAlgorithm): Deleted.
        (WebCore::digestAlgorithm): Deleted.
        (WebCore::hashCryptoDigestAlgorithm): Deleted.
        (WebCore::mpiLength): Deleted.
        (WebCore::mpiData): Deleted.
        (WebCore::mpiZeroPrefixedData): Deleted.
        (WebCore::mpiSignedData): Deleted.
        * platform/SourcesGCrypt.txt:

2018-06-26  Yusuke Suzuki  <utatane.tea@gmail.com>

        [JSC] Pass VM& to functions more
        https://bugs.webkit.org/show_bug.cgi?id=186241

        Reviewed by Mark Lam.

        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::JSCustomElementRegistry::define):

2018-06-26  Simon Fraser  <simon.fraser@apple.com>

        CSSGradientValue's color stops vector wastes 12KB on theverge.com
        https://bugs.webkit.org/show_bug.cgi?id=186988

        Reviewed by Sam Weinig.

        Shrink the color stops vector when we're done parsing the stops.

        * css/CSSGradientValue.h:
        (WebCore::CSSGradientValue::doneAddingStops):
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::consumeDeprecatedGradient):
        (WebCore::CSSPropertyParserHelpers::consumeGradientColorStops):
        (WebCore::CSSPropertyParserHelpers::consumeAngularGradientColorStops):

2018-06-25  Yusuke Suzuki  <utatane.tea@gmail.com>

        Remove static initializers more
        https://bugs.webkit.org/show_bug.cgi?id=186969

        Reviewed by Michael Catanzaro.

        This patch removes static initializers more. They typically exists in GTK port.

        No behavior change.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * page/ResourceUsageData.cpp: Removed.
        * page/ResourceUsageData.h:
        Remove ResourceUsageData constructors since default constructors are enough.

        (WebCore::MemoryCategoryInfo::MemoryCategoryInfo):
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::markupPrefix):
        (WebCore::removeMarkupPrefix):
        (WebCore::PasteboardHelper::fillSelectionData):
        Use NeverDestroyed<> and static functions.

        * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
        (WebCore::defaultVolumeCapability):
        (WebCore::GStreamerAudioCaptureSource::capabilities const):
        CapabilityValueOrRange's constructor is not constexpr.

        * platform/network/soup/SoupNetworkSession.cpp:
        (WebCore::initialAcceptLanguages):
        (WebCore::proxySettings):
        (WebCore::SoupNetworkSession::SoupNetworkSession):
        (WebCore::SoupNetworkSession::setupProxy):
        (WebCore::SoupNetworkSession::setProxySettings):
        (WebCore::SoupNetworkSession::setInitialAcceptLanguages):
        Use NeverDestroyed<> and static functions.

2018-06-26  Daniel Bates  <dabates@apple.com>

        REGRESSION (r231479): Unable to buy Odeon cinema tickets in STP (bogus 'X-Frame-Options' to 'SAMEORIGIN')
        https://bugs.webkit.org/show_bug.cgi?id=186090
        <rdar://problem/40692595>

        Reviewed by Andy Estes.

        Fix up Content Security Policy logic for checking the frame ancestors now that we
        exclude the frame that initiated the load request.

        Test: http/tests/security/XFrameOptions/cross-origin-iframe-post-form-to-parent-same-origin-x-frame-options-page-allow.html

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

2018-06-26  Chris Dumez  <cdumez@apple.com>

        Simplify NetworkStorageSession::getAllStorageAccessEntries()
        https://bugs.webkit.org/show_bug.cgi?id=187016

        Reviewed by Youenn Fablet.

        Iterate over the HashMaps' values instead of iterating over their keys and then looking them
        up in the HashMap.

        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::getAllStorageAccessEntries const):

2018-06-26  Eric Carlson  <eric.carlson@apple.com>

        [Mac] AirPlay picker uses incorrect theme in Dark mode
        https://bugs.webkit.org/show_bug.cgi?id=187054
        <rdar://problem/41291093>

        Reviewed by Timothy Hatcher.

        * Modules/mediasession/WebMediaSessionManager.cpp:
        (WebCore::WebMediaSessionManager::showPlaybackTargetPicker): Add useDefaultAppearance parameter.
        * Modules/mediasession/WebMediaSessionManager.h:

        * platform/graphics/MediaPlaybackTargetPicker.cpp:
        (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker): Ditto.
        * platform/graphics/MediaPlaybackTargetPicker.h:

        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
        (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker): Choose theme based on
        useDefaultAppearance parameter.

        * platform/mock/MediaPlaybackTargetPickerMock.cpp:
        (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker): Log parameter.
        * platform/mock/MediaPlaybackTargetPickerMock.h:

2018-06-26  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Do not forget to set stream on track switching
        https://bugs.webkit.org/show_bug.cgi?id=187049

        Reviewed by Philippe Normand.

        This was an overlooked issue introduced in Bug #186678

        This is already tested, but we currently run only tests against playbin2

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::enableTrack):

2018-06-26  Zalan Bujtas  <zalan@apple.com>

        [LFC] Fixed positioning is a subcategory of absolute positioning.
        https://bugs.webkit.org/show_bug.cgi?id=187043

        Reviewed by Antti Koivisto.

        https://www.w3.org/TR/CSS22/visuren.html#absolute-positioning
        References in this specification to an absolutely positioned element (or its box) imply that the element's 'position'
        property has the value 'absolute' or 'fixed'.

        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::isAbsolutelyPositioned const):
        * layout/layouttree/LayoutBox.h:
        (WebCore::Layout::Box::isOutOfFlowPositioned const):

2018-06-26  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r233143.
        https://bugs.webkit.org/show_bug.cgi?id=187046

        broke media/video-ended-event-negative-playback.html
        (Requested by philn on #webkit).

        Reverted changeset:

        "[GStreamer] Remove useless workaround"
        https://bugs.webkit.org/show_bug.cgi?id=186921
        https://trac.webkit.org/changeset/233143

2018-06-25  Zalan Bujtas  <zalan@apple.com>

        [LFC] Computed height for in-flow non-replaced should not include padding and border.
        https://bugs.webkit.org/show_bug.cgi?id=187031

        Reviewed by Antti Koivisto.

        In certain cases the height of a non-replaced in-flow box is computed using the bottom position of its last in-flow child.
        The in-flow child's bottom position is in the coordinate system of the containing block's border box (border box's top left is 0, 0) ->
        it includes both the (top) border and the padding of the containing block.

        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

2018-06-26  Zan Dobersek  <zdobersek@igalia.com>

        Crash in WebAnimation::runPendingPlayTask
        https://bugs.webkit.org/show_bug.cgi?id=186189

        Reviewed by Carlos Garcia Campos.

        Avoid crashes on nullopt std::optional dereference in the
        runPendingPlayTask() and runPendingPauseTask() methods of the
        WebAnimation class by defaulting to a Seconds(0) value.

        In both cases the std::optional value is the current time retrieved from
        the associated DocumentTimeline object. But there's no guarantee that
        the timeline is active and the resulting time value is resolved (i.e.
        not nullopt). Dereferencing the nullopt Seconds value doesn't cause a
        problem on configurations still building as C++14 and the fallback
        std::optional implementation provided by WTF -- no signal is raised, and
        a 0 value is returned. Configurations building as C++17 on the other
        hand use the stdlib-provided std::optional that does raise a signal on
        invalid access, leading to crashes.

        The default-to-Seconds(0) solution avoids crashes on configurations
        that build with C++17 support enabled, and thus match configurations
        that are still using WTF's std::optional. This still doesn't address the
        underlying problem of retrieving current time from an inactive document
        timeline and using it as ready time for the pending play/pause task
        execution.

        runPendingPlayTask() change addresses crashes in the following tests:
        - fast/animation/css-animation-resuming-when-visible.html
        - fast/animation/css-animation-resuming-when-visible-with-style-change.html
        - imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/animate-no-browsing-context.html
        - imported/w3c/web-platform-tests/web-animations/interfaces/Animatable/getAnimations.html

        runPendingPauseTask() change addresses crashes in the following tests:
        - animations/multiple-animations-timing-function.html

        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::runPendingPlayTask):
        (WebCore::WebAnimation::runPendingPauseTask):

2018-06-26  Antoine Quint  <graouts@apple.com>

        [Web Animations] Show the feature as "Supported in Preview"
        https://bugs.webkit.org/show_bug.cgi?id=187037

        Reviewed by Dean Jackson.

        Web Animations are enabled by default in STP.

        * features.json:

2018-06-26  Miguel Gomez  <magomez@igalia.com>

        [GTK] Many webpages can crash the browser in WebCore::CoordinatedGraphicsLayer::transformedVisibleRect
        https://bugs.webkit.org/show_bug.cgi?id=179304

        Reviewed by Michael Catanzaro.

        When adding new CoordinatedGraphicsLayers to the tree, check that they have the appropriate
        CompositingCoordinator. If that's not the case, set the appropriate one to the layer and its
        children and set the state of those layers so they are rendered properly.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::addChild):
        (WebCore::CoordinatedGraphicsLayer::addChildAtIndex):
        (WebCore::CoordinatedGraphicsLayer::addChildAbove):
        (WebCore::CoordinatedGraphicsLayer::addChildBelow):
        (WebCore::CoordinatedGraphicsLayer::replaceChild):
        (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2018-06-25  Keith Rollin  <krollin@apple.com>

        Adjust WEBCORE_EXPORT annotations for LTO
        https://bugs.webkit.org/show_bug.cgi?id=186944
        <rdar://problem/41384880>

        Reviewed by David Kilzer.

        Adjust a number of places that result in WebKit's
        'check-for-weak-vtables-and-externals' script reporting weak external
        symbols:

            ERROR: WebCore has a weak external symbol in it (/Volumes/Data/dev/webkit/OpenSource/WebKitBuild/Release/WebCore.framework/Versions/A/WebCore)
            ERROR: A weak external symbol is generated when a symbol is defined in multiple compilation units and is also marked as being exported from the library.
            ERROR: A common cause of weak external symbols is when an inline function is listed in the linker export file.
            ...

        These cases are caused by inline methods being marked with WTF_EXPORT
        (or related macro) or with an inline function being in a class marked
        as such, and when enabling LTO builds.

        For the most part, address these by removing the WEBCORE_EXPORT
        annotation from inline methods. In some cases, move the implementation
        out-of-line because it's the class that has the WEBCORE_EXPORT on it
        and removing the annotation from the class would be too disruptive.
        Finally, in other cases, move the implementation out-of-line because
        check-for-weak-vtables-and-externals still complains when keeping the
        implementation inline and removing the annotation; this seems to
        typically (but not always) happen with destructors.

        No new tests. There is no changed functionality. Only the annotation
        and treatment of inline methods are altered.

        * animation/AnimationTimeline.h:
        (WebCore::AnimationTimeline::pause):
        * page/CacheStorageProvider.h:
        (): Deleted.
        * page/scrolling/ScrollingTree.h:
        (WebCore::ScrollingTree::reportSynchronousScrollingReasonsChanged):
        (WebCore::ScrollingTree::reportExposedUnfilledArea):
        * platform/audio/PlatformMediaSessionManager.h:
        (WebCore::PlatformMediaSessionManager::hasActiveNowPlayingSession const):
        (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingTitle const):
        (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingDuration const):
        (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingElapsedTime const):
        (WebCore::PlatformMediaSessionManager::lastUpdatedNowPlayingInfoUniqueIdentifier const):
        (WebCore::PlatformMediaSessionManager::registeredAsNowPlayingApplication const):
        * platform/audio/mac/CARingBuffer.cpp:
        (WebCore::CARingBuffer::~CARingBuffer):
        * platform/audio/mac/CARingBuffer.h:
        (WebCore::CARingBuffer::~CARingBuffer): Deleted.
        * platform/cocoa/VideoFullscreenModelVideoElement.h:
        * platform/gamepad/GamepadProvider.h:
        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::displayListAsText const):
        (WebCore::GraphicsLayer::setIsTrackingDisplayListReplay):
        (WebCore::GraphicsLayer::isTrackingDisplayListReplay const):
        (WebCore::GraphicsLayer::replayDisplayListAsText const):
        * platform/mac/PlaybackSessionInterfaceMac.h:
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        (WebCore::RealtimeMediaSourceCenter::setAudioFactory):
        (WebCore::RealtimeMediaSourceCenter::unsetAudioFactory):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        (WebCore::LibWebRTCProvider::setActive):
        (WebCore::LibWebRTCProvider::createDecoderFactory):
        (WebCore::LibWebRTCProvider::createEncoderFactory):
        (WebCore::LibWebRTCProvider::disableEnumeratingAllNetworkInterfaces):
        (WebCore::LibWebRTCProvider::enableEnumeratingAllNetworkInterfaces):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
        * platform/network/ResourceHandleClient.h:
        (WebCore::ResourceHandleClient::willCacheResponseAsync):
        * testing/MockGamepadProvider.h:
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::~Connection):

2018-06-25  Zalan Bujtas  <zalan@apple.com>

        [LFC] Adjust static position for out-of-flow positioned boxes.
        https://bugs.webkit.org/show_bug.cgi?id=187000

        Reviewed by Antti Koivisto.

        The static position of an out-of-flow positioned box is the the position where box would go
        if it was in-flow positioned. This position needs to the resolved in the containing block's coordinate system.

        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPositionForOutOfFlowPositioned):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):

2018-06-25  Brady Eidson  <beidson@apple.com>

        Remove RELEASE_ASSERT added in r230875.
        <rdar://problem/40860061> and https://bugs.webkit.org/show_bug.cgi?id=187022

        Reviewed by Brent Fulgham.

        There's actually more than one way for a network session to be destroyed, and that can happen
        asynchronously and unpredictably.

        And the request to start up a WebSocket and do its handshake is also asynchronous and unpredictable
 
        It's an expected race.

        If the NetworkStorageSession cannot be found then the WebSocket handshake should just fail.

        * platform/network/SocketStreamHandleImpl.cpp:
        (WebCore::cookieDataForHandshake): If the NetworkStorageSession cannot be found, return std::nullopt.
        (WebCore::SocketStreamHandleImpl::platformSendHandshake): If the cookieData is null, fail the handshake.

2018-06-25  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iPad apps on macOS] Web process crashes when attempting to play embedded YouTube video in News
        https://bugs.webkit.org/show_bug.cgi?id=187011
        <rdar://problem/40906808>

        Reviewed by Tim Horton.

        Disable remote media commands when running iOS WebKit on macOS. The iOS flavor of RemoteCommandListener
        currently throws an exception when attempting to soft-link the MediaPlayer framework, which prevents video from
        being played altogether. For a followup tracking touch bar integration in iOS WebKit on macOS, see:
        <rdar://problem/39164732>.

        Manually tested by playing a YouTube video in News.

        * platform/RemoteCommandListener.cpp:
        * platform/ios/RemoteCommandListenerIOS.h:
        * platform/ios/RemoteCommandListenerIOS.mm:

2018-06-25  Keith Rollin  <krollin@apple.com>
        Unreviewed, rolling out r233087.

        Causes 5% Mac PLT regression.

        Reverted changeset:

        "Recalc styles every time defaultAppearance changes."
        https://bugs.webkit.org/show_bug.cgi?id=186866
        https://trac.webkit.org/changeset/233087

2018-06-25  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r229722): WebKitLegacy clients can crash when loading alternate page
        https://bugs.webkit.org/show_bug.cgi?id=187008
        
        Reviewed by Chris Dumez.

        The new call to 'clearProvisionalLoadForPolicyCheck' added in r229722 broke loading
        behavior in WebKitLegacy.

        1. We can now enter 'cancelPolicyCheckIfNeeded' without a Frame loader, in what appears
           to be a recursive call during the load cancellation (the 'm_waitingForContentPolicy'
           and 'm_waitingForNavigationPolicy' have already been nulled). It seems like we should
           return early here, or perhaps just move the RELEASE_ASSERT inside the case where we
           have an active policy check happening.

        2. We also enter FrameLoader::checkContentPolicy without an active document loader. We
           should recognize this case and handle it, rather than trying to dereference a nullptr
           document loader.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::cancelPolicyCheckIfNeeded): Move the RELEASE_ASSERT inside the
        conditional where the frameLoader is actually used.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::checkContentPolicy): Recognize that the activeDocumentLoader may
        be nullptr at this point, and take appropriate action (rather than crashing).

2018-06-25  Simon Fraser  <simon.fraser@apple.com>

        MatchedPropertiesCacheItem wastes 388KB of vector capacity on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=186990

        Reviewed by Antti Koivisto.

        MatchedPropertiesCacheItem.matchedProperties was appended to, so it allocated capacity
        in 16-size chunks. Instead, assign to it so it only allocates as much capacity as is needed.
        Copy-constructing is more wasteful, since it copies the 64-chunk size from the right-hand side.

        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::addToMatchedPropertiesCache):
        * css/StyleResolver.h:
        (WebCore::StyleResolver::MatchedPropertiesCacheItem::MatchedPropertiesCacheItem):

2018-06-25  Chris Dumez  <cdumez@apple.com>

        Null dereference crash un ApplicationCacheGroup::startLoadingEntry()
        https://bugs.webkit.org/show_bug.cgi?id=187012
        <rdar://problem/40793716>

        Reviewed by Youenn Fablet.

        m_entryLoader can be null because ApplicationCacheResourceLoader::create() return null when
        CachedResourceLoader::requestRawResource() fails synchronously. In such case, the completion
        handler gets called with a ApplicationCacheResourceLoader::Error::CannotRequestResource error.

        To address the issue, we capture the request's URL in the lambda and use it instead of trying
        to get the URL from the loader's resource.

        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::startLoadingEntry):

2018-06-25  Ross Kirsling  <ross.kirsling@sony.com>

        REGRESSION (r233140): Windows build failure due to incomplete FrameView and RenderBox types
        https://bugs.webkit.org/show_bug.cgi?id=186997

        * animation/KeyframeEffectReadOnly.cpp:

2018-06-25  Antoine Quint  <graouts@apple.com>

        REGRESSION: hardware-accelerated animation fails on inline element
        https://bugs.webkit.org/show_bug.cgi?id=186981
        <rdar://problem/41418697>

        Reviewed by Dean Jackson.

        Ensure we only queue accelerated actions when we have a renderer so we don't attempt
        to start an accelerated animation too soon.

        Test: webanimations/opacity-animation-yields-compositing-span.html

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::updateAcceleratedAnimationState):

2018-06-25  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r233140): v2: Windows build failure due to incomplete DocumentAnimationScheduler type
        <https://webkit.org/b/186997>

        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        (WebCore::Document::windowScreenDidChange):
        * dom/Document.h:
        - DocumentAnimationScheduler is behind the
          USE(REQUEST_ANIMATION_FRAME_DISPLAY_MONITOR) macro, which
          is disabled on Windows.
        - This also reverts my fix in r233144 since it didn't work.

2018-06-25  Youenn Fablet  <youenn@apple.com>

        Add API to control mock media devices
        https://bugs.webkit.org/show_bug.cgi?id=186958

        Reviewed by Eric Carlson.

        Refactor code to introduce a MockDevice structure that can be used in multiple processes.
        Update mock sources and center to use MockDevice.
        Add API to update mock media devices.

        Make MediaDevices an ActiveDOMObject so that it does not get collected when ondevicechange is set.

         Test: fast/mediastream/device-change-event-2.html

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::MediaDevices):
        (WebCore::MediaDevices::stop):
        (WebCore::MediaDevices::scheduledEventTimerFired):
        (WebCore::MediaDevices::hasPendingActivity const):
        (WebCore::MediaDevices::activeDOMObjectName const):
        (WebCore::MediaDevices::canSuspendForDocumentSuspension const):
        * Modules/mediastream/MediaDevices.h:
        * Modules/mediastream/MediaDevices.idl:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/RealtimeMediaSourceCenter.h:
        * platform/mock/MockMediaDevice.h: Added.
        (WebCore::MockMicrophoneProperties::encode const):
        (WebCore::MockMicrophoneProperties::decode):
        (WebCore::MockCameraProperties::encode const):
        (WebCore::MockCameraProperties::decode):
        (WebCore::MockDisplayProperties::encode const):
        (WebCore::MockDisplayProperties::decode):
        (WebCore::MockMediaDevice::isMicrophone const):
        (WebCore::MockMediaDevice::isCamera const):
        (WebCore::MockMediaDevice::isDisplay const):
        (WebCore::MockMediaDevice::type const):
        (WebCore::MockMediaDevice::encode const):
        (WebCore::MockMediaDevice::decodeMockMediaDevice):
        (WebCore::MockMediaDevice::decode):
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::startProducingData):
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::defaultDevices):
        (WebCore::devices):
        (WebCore::deviceMap):
        (WebCore::deviceListForDevice):
        (WebCore::MockRealtimeMediaSource::createCaptureDevice):
        (WebCore::MockRealtimeMediaSource::resetDevices):
        (WebCore::MockRealtimeMediaSource::setDevices):
        (WebCore::MockRealtimeMediaSource::addDevice):
        (WebCore::MockRealtimeMediaSource::removeDevice):
        (WebCore::MockRealtimeMediaSource::captureDeviceWithPersistentID):
        (WebCore::MockRealtimeMediaSource::audioDevices):
        (WebCore::MockRealtimeMediaSource::videoDevices):
        (WebCore::MockRealtimeMediaSource::displayDevices):
        (WebCore::MockRealtimeMediaSource::MockRealtimeMediaSource):
        (WebCore::MockRealtimeMediaSource::initializeCapabilities):
        (WebCore::MockRealtimeMediaSource::initializeSettings):
        (WebCore::MockRealtimeMediaSource::settings const):
        (WebCore::MockRealtimeMediaSource::supportedConstraints):
        * platform/mock/MockRealtimeMediaSource.h:
        (WebCore::MockRealtimeMediaSource::device const):
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::singleton):
        (WebCore::MockRealtimeMediaSourceCenter::setMockRealtimeMediaSourceCenterEnabled):
        (WebCore::MockRealtimeMediaSourceCenter::setDevices):
        (WebCore::MockRealtimeMediaSourceCenter::addDevice):
        (WebCore::MockRealtimeMediaSourceCenter::removeDevice):
        * platform/mock/MockRealtimeMediaSourceCenter.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
        (WebCore::MockRealtimeVideoSource::initializeCapabilities):
        (WebCore::MockRealtimeVideoSource::drawText):
        (WebCore::MockRealtimeVideoSource::generateFrame):
        * platform/mock/MockRealtimeVideoSource.h:
        (WebCore::MockRealtimeVideoSource::mockCamera const):
        (WebCore::MockRealtimeVideoSource::mockScreen const):

2018-06-25  Simon Fraser  <simon.fraser@apple.com>

        AutoTableLayout wastes 52KB of Vector capacity on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=186710

        Reviewed by Zalan Bujtas.
        
        Call resizeToFit() to only allocate enough capacity for the number of columns.

        * rendering/AutoTableLayout.cpp:
        (WebCore::AutoTableLayout::fullRecalc):
        (WebCore::AutoTableLayout::insertSpanCell): Whitespace fix.
        * rendering/AutoTableLayout.h:

2018-06-25  Zalan Bujtas  <zalan@apple.com>

        [LFC] Adjust static position with containing block's content box top/left
        https://bugs.webkit.org/show_bug.cgi?id=186999

        Reviewed by Antti Koivisto.

        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::contentBox const):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::contentBoxTop const):
        (WebCore::Display::Box::contentBoxLeft const):

2018-06-25  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r233140): Windows build failure due to incomplete DocumentAnimationScheduler type
        <https://webkit.org/b/186997>

        * dom/Document.cpp:
        * dom/Document.h:
        - Attempt to fix Windows build failure by moving include of
          DocumentAnimationScheduler.h from Document.cpp to Document.h.

2018-06-25  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] Remove useless workaround
        https://bugs.webkit.org/show_bug.cgi?id=186921

        Reviewed by Xabier Rodriguez-Calvar.

        In bug 67407 a workaround was added for GStreamer 0.10. With 1.x
        the media/video-reverse-play-duration.html test passes without any
        workaround needed. The other test mentioned in that bug was
        removed, it seems.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::currentMediaTime const):

2018-06-24  Tomas Popela  <tpopela@redhat.com>

        Unreviewed, address Darin's comment
        https://bugs.webkit.org/show_bug.cgi?id=186757

        * page/linux/ResourceUsageThreadLinux.cpp:
        (WebCore::cpuPeriod):

2018-06-25  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-animations/test_animation-pausing.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183826
        <rdar://problem/40997412>

        Reviewed by Dean Jackson.

        The CSS Animations Level 2 specification defines that calling pause() on a CSSAnimation object is "sticky"
        until a call to play() is made, meaning that any changes to the running state via the CSS animation-play-state
        property is overridden by the stickiness of the pause() call. In this patch we add an m_stickyPaused flag which
        is set in API calls to pause() and play(). While this flag is true, changes to the animation-play-state property
        to the "running" value are ignored.

        * animation/CSSAnimation.cpp:
        (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):
        (WebCore::CSSAnimation::bindingsPlay):
        (WebCore::CSSAnimation::bindingsPause):
        * animation/CSSAnimation.h:

2018-06-25  Antoine Quint  <graouts@apple.com>

        [Web Animations] Ensure animations are updated prior to requestAnimationFrame callbacks
        https://bugs.webkit.org/show_bug.cgi?id=186997
        <rdar://problem/41419414>

        Reviewed by Dean Jackson.

        Some sub-tests of imported/mozilla/css-animations/test_animation-pausing.html clearly expect that animations
        would be resolved prior to firing a requestAnimationFrame() callback, as the HTML5 event loop mandates. But until
        now, both DocumentTimeline and ScriptedAnimationController would make calls to DisplayRefreshMonitorManager::scheduleAnimation()
        that were not coordinated and so the order in which the DocumentTimeline and ScriptedAnimationController callbacks
        were performed was not guaranteed.

        In this patch we add a new DocumentAnimationScheduler class which is created by a Document to manage this specific
        situation. Now DocumentTimeline and ScriptedAnimationController use this supporting object instead of being their
        own DisplayRefreshMonitorClient and call scheduleWebAnimationsResolution() and scheduleScriptedAnimationResolution()
        respectively to indicate the need to schedule an animation through the DisplayRefreshMonitorManager to serve the specific
        needs of either, or both, classes. Then DocumentAnimationScheduler ensures that Web Animations resolution happens
        prior to requestAnimationFrame callbacks when both are scheduled.

        In the future we should be able to move more code from DocumentTimeline and ScriptedAnimationController over to
        DocumentAnimationScheduler, such as support for throttling and using a timer-based fallback, but this patch provides
        the minimal functionality required to provide a sounder foundation.

        * Modules/webvr/VRDisplay.cpp:
        (WebCore::VRDisplay::requestAnimationFrame):
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * animation/DocumentAnimationScheduler.cpp: Added.
        (WebCore::DocumentAnimationScheduler::create):
        (WebCore::DocumentAnimationScheduler::DocumentAnimationScheduler):
        (WebCore::DocumentAnimationScheduler::detachFromDocument):
        (WebCore::DocumentAnimationScheduler::scheduleWebAnimationsResolution):
        (WebCore::DocumentAnimationScheduler::scheduleScriptedAnimationResolution):
        (WebCore::DocumentAnimationScheduler::displayRefreshFired):
        (WebCore::DocumentAnimationScheduler::windowScreenDidChange):
        (WebCore::DocumentAnimationScheduler::createDisplayRefreshMonitor const):
        * animation/DocumentAnimationScheduler.h: Copied from Source/WebCore/animation/CSSAnimation.h.
        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::create):
        (WebCore::DocumentTimeline::DocumentTimeline):
        (WebCore::DocumentTimeline::scheduleAnimationResolution):
        (WebCore::DocumentTimeline::windowScreenDidChange): Deleted.
        (WebCore::DocumentTimeline::createDisplayRefreshMonitor const): Deleted.
        * animation/DocumentTimeline.h:
        * dom/Document.cpp:
        (WebCore::Document::prepareForDestruction):
        (WebCore::Document::windowScreenDidChange):
        (WebCore::Document::requestAnimationFrame):
        (WebCore::Document::animationScheduler):
        (WebCore::Document::timeline):
        * dom/Document.h:
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::ScriptedAnimationController):
        (WebCore::ScriptedAnimationController::scheduleAnimation):
        (WebCore::ScriptedAnimationController::documentAnimationSchedulerDidFire):
        (WebCore::ScriptedAnimationController::windowScreenDidChange): Deleted.
        (WebCore::ScriptedAnimationController::displayRefreshFired): Deleted.
        (WebCore::ScriptedAnimationController::createDisplayRefreshMonitor const): Deleted.
        * dom/ScriptedAnimationController.h:
        (WebCore::ScriptedAnimationController::create):

2018-06-25  Zan Dobersek  <zdobersek@igalia.com>

        [GCrypt] Zero-prefix (if necessary) output of RSA-based encryption and signing operations
        https://bugs.webkit.org/show_bug.cgi?id=186967

        Reviewed by Michael Catanzaro.

        Output for RSA-based encryption and signing operations should match the
        length of the RSA key. The way we retrieve the MPI data means libgcrypt
        can ignore the high-bit zero values and leave us with a valid result
        that's shorter in length compared to the RSA key. For instance, if the
        output MPI fits into 2040 bits while a 2048-bit key was used we'll end
        up with MPI data that will be fitted into a 255-byte Vector, one byte
        short of the expected output length.

        To avoid this, mpiZeroPrefixedData() is now used when retrieving output
        of these RSA operations, and the value of the key size in bytes is
        passed to it. This efficiently prepares the output Vector and then
        copies the MPI data into it, respecting the MPI data length as well as
        the desired length of the output.

        No new tests -- relevant tests are now stable (i.e. not sporadically
        failing anymore), associated expectations are removed.

        * crypto/gcrypt/CryptoAlgorithmECDHGCrypt.cpp:
        (WebCore::gcryptDerive): Also use mpiZeroPrefixedData().
        * crypto/gcrypt/CryptoAlgorithmRSAES_PKCS1_v1_5GCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::CryptoAlgorithmRSAES_PKCS1_v1_5::platformEncrypt):
        * crypto/gcrypt/CryptoAlgorithmRSASSA_PKCS1_v1_5GCrypt.cpp:
        (WebCore::gcryptSign):
        (WebCore::CryptoAlgorithmRSASSA_PKCS1_v1_5::platformSign):
        * crypto/gcrypt/CryptoAlgorithmRSA_OAEPGCrypt.cpp:
        (WebCore::gcryptEncrypt):
        (WebCore::CryptoAlgorithmRSA_OAEP::platformEncrypt):
        * crypto/gcrypt/CryptoAlgorithmRSA_PSSGCrypt.cpp:
        (WebCore::gcryptSign):
        (WebCore::CryptoAlgorithmRSA_PSS::platformSign):
        * crypto/gcrypt/GCryptUtilities.h:
        (WebCore::mpiZeroPrefixedData):

2018-06-24  Simon Fraser  <simon.fraser@apple.com>

        Fix the DUMP_NODE_STATISTICS code so that it compiles
        https://bugs.webkit.org/show_bug.cgi?id=186982

        Reviewed by Anders Carlsson.

        The DUMP_NODE_STATISTICS code had bitrotted. ENTITY_NODE no longer exists.
        liveNodeSet needs to be a static function with a NeverDestroyed<>.

        * dom/Node.cpp:
        (WebCore::Node::dumpStatistics):
        (WebCore::Node::trackForDebugging):
        (WebCore::Node::~Node):

2018-06-24  Simon Fraser  <simon.fraser@apple.com>

        Fix the composition underline to be transformed by -apple-color-filter
        https://bugs.webkit.org/show_bug.cgi?id=186983
        rdar://problem/40515558

        Reviewed by Zalan Bujtas.
        
        Transform the composition underline color with the color filter.

        Test: css3/color-filters/color-filter-composition-underline-color.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintCompositionUnderline const):

2018-06-23  Zalan Bujtas  <zalan@apple.com>

        [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
        https://bugs.webkit.org/show_bug.cgi?id=186585
        <rdar://problem/30685325>

        Reviewed by Tim Horton.

        Use the existing "override viewport size for viewport units" mechanism to compute the preferred
        viewport unit values for the Mail Viewer html content. 

        Test: fast/dynamic/mail-autosize-viewport-unit.html

        * page/FrameView.cpp:
        (WebCore::FrameView::FrameView):
        (WebCore::FrameView::enableAutoSizeMode):
        (WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits):
        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
        (WebCore::FrameView::overrideViewportSizeForCSSViewportUnits):
        (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
        * page/FrameView.h:

2018-06-23  Zalan Bujtas  <zalan@apple.com>

        [LFC] Relatively positioned renderer needs offsetting for validation
        https://bugs.webkit.org/show_bug.cgi?id=186959

        Reviewed by Antti Koivisto.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):

2018-06-23  Zalan Bujtas  <zalan@apple.com>

        [LFC] Miscellaneous fixes to fix simple absolute positioning.
        https://bugs.webkit.org/show_bug.cgi?id=186962

        Reviewed by Antti Koivisto.

        1. Collect out-of-flow formatting root descendants.
        2. Remove invalid and redundant ASSERTs
          invalid because the assertion is missing border, padding etc.
          redundant becasue we assert on geometry correctness in validateGeometryConstraintsAfterLayout.  

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/layouttree/LayoutContainer.cpp:
        (WebCore::Layout::Container::addOutOfFlowDescendant):
        (WebCore::Layout::Container::setOutOfFlowDescendants): Deleted.
        * layout/layouttree/LayoutContainer.h:
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::TreeBuilder::createSubTree):

2018-06-23  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Add user-defined literal for ASCIILiteral
        https://bugs.webkit.org/show_bug.cgi?id=186839

        Reviewed by Darin Adler.

        No behavior change.

        * Modules/applicationmanifest/ApplicationManifestParser.cpp:
        (WebCore::ApplicationManifestParser::parseManifest):
        (WebCore::ApplicationManifestParser::logManifestPropertyNotAString):
        (WebCore::ApplicationManifestParser::logManifestPropertyInvalidURL):
        (WebCore::ApplicationManifestParser::logDeveloperWarning):
        (WebCore::ApplicationManifestParser::parseStartURL):
        (WebCore::ApplicationManifestParser::parseDisplay):
        (WebCore::ApplicationManifestParser::parseName):
        (WebCore::ApplicationManifestParser::parseDescription):
        (WebCore::ApplicationManifestParser::parseShortName):
        (WebCore::ApplicationManifestParser::parseScope):
        * Modules/beacon/NavigatorBeacon.cpp:
        (WebCore::NavigatorBeacon::logError):
        (WebCore::NavigatorBeacon::sendBeacon):
        * Modules/cache/DOMCache.cpp:
        (WebCore::DOMCache::requestFromInfo):
        (WebCore::DOMCache::addAll):
        (WebCore::DOMCache::put):
        * Modules/cache/DOMCacheEngine.cpp:
        (WebCore::DOMCacheEngine::errorToException):
        * Modules/credentialmanagement/BasicCredential.cpp:
        (WebCore::BasicCredential::type const):
        * Modules/credentialmanagement/CredentialsContainer.cpp:
        (WebCore::CredentialsContainer::get):
        (WebCore::CredentialsContainer::store):
        (WebCore::CredentialsContainer::isCreate):
        (WebCore::CredentialsContainer::preventSilentAccess const):
        * Modules/entriesapi/DOMFileSystem.cpp:
        (WebCore::DOMFileSystem::root):
        (WebCore::validatePathIsExpectedType):
        (WebCore::resolveRelativeVirtualPath):
        (WebCore::DOMFileSystem::getEntry):
        * Modules/entriesapi/FileSystemDirectoryEntry.cpp:
        (WebCore::FileSystemDirectoryEntry::getEntry):
        * Modules/entriesapi/FileSystemDirectoryReader.cpp:
        (WebCore::FileSystemDirectoryReader::readEntries):
        * Modules/fetch/FetchBody.cpp:
        (WebCore::FetchBody::consumeAsStream):
        * Modules/fetch/FetchBodyConsumer.cpp:
        (WebCore::FetchBodyConsumer::loadingFailed):
        * Modules/fetch/FetchBodyOwner.cpp:
        (WebCore::FetchBodyOwner::arrayBuffer):
        (WebCore::FetchBodyOwner::blob):
        (WebCore::FetchBodyOwner::consumeOnceLoadingFinished):
        (WebCore::FetchBodyOwner::formData):
        (WebCore::FetchBodyOwner::json):
        (WebCore::FetchBodyOwner::text):
        (WebCore::FetchBodyOwner::blobLoadingFailed):
        (WebCore::FetchBodyOwner::consumeBodyAsStream):
        * Modules/fetch/FetchHeaders.cpp:
        (WebCore::canWriteHeader):
        * Modules/fetch/FetchLoader.cpp:
        (WebCore::FetchLoader::startLoadingBlobURL):
        (WebCore::FetchLoader::start):
        * Modules/fetch/FetchRequest.cpp:
        (WebCore::setMethod):
        (WebCore::computeReferrer):
        (WebCore::buildOptions):
        (WebCore::FetchRequest::initializeOptions):
        (WebCore::FetchRequest::initializeWith):
        (WebCore::FetchRequest::setBody):
        (WebCore::FetchRequest::referrer const):
        (WebCore::FetchRequest::clone):
        * Modules/fetch/FetchResponse.cpp:
        (WebCore::FetchResponse::create):
        (WebCore::FetchResponse::redirect):
        (WebCore::FetchResponse::clone):
        (WebCore::FetchResponse::BodyLoader::didFail):
        * Modules/fetch/FetchResponse.h:
        * Modules/geolocation/GeoNotifier.cpp:
        (WebCore::GeoNotifier::timerFired):
        * Modules/geolocation/Geolocation.cpp:
        (WebCore::Geolocation::startRequest):
        (WebCore::Geolocation::requestUsesCachedPosition):
        (WebCore::Geolocation::makeCachedPositionCallbacks):
        (WebCore::Geolocation::setIsAllowed):
        (WebCore::Geolocation::cancelRequests):
        (WebCore::Geolocation::handlePendingPermissionNotifiers):
        * Modules/indexeddb/IDBCursor.cpp:
        (WebCore::IDBCursor::update):
        (WebCore::IDBCursor::advance):
        (WebCore::IDBCursor::continuePrimaryKey):
        (WebCore::IDBCursor::continueFunction):
        (WebCore::IDBCursor::deleteFunction):
        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::createObjectStore):
        (WebCore::IDBDatabase::transaction):
        (WebCore::IDBDatabase::deleteObjectStore):
        * Modules/indexeddb/IDBFactory.cpp:
        (WebCore::IDBFactory::open):
        (WebCore::IDBFactory::openInternal):
        (WebCore::IDBFactory::deleteDatabase):
        (WebCore::IDBFactory::cmp):
        * Modules/indexeddb/IDBIndex.cpp:
        (WebCore::IDBIndex::setName):
        (WebCore::IDBIndex::openCursor):
        (WebCore::IDBIndex::openKeyCursor):
        (WebCore::IDBIndex::count):
        (WebCore::IDBIndex::doCount):
        (WebCore::IDBIndex::get):
        (WebCore::IDBIndex::doGet):
        (WebCore::IDBIndex::getKey):
        (WebCore::IDBIndex::doGetKey):
        (WebCore::IDBIndex::getAll):
        (WebCore::IDBIndex::getAllKeys):
        * Modules/indexeddb/IDBKeyData.cpp:
        (WebCore::IDBKeyData::loggingString const):
        * Modules/indexeddb/IDBKeyRangeData.cpp:
        (WebCore::IDBKeyRangeData::loggingString const):
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::setName):
        (WebCore::IDBObjectStore::openCursor):
        (WebCore::IDBObjectStore::openKeyCursor):
        (WebCore::IDBObjectStore::get):
        (WebCore::IDBObjectStore::getKey):
        (WebCore::IDBObjectStore::putOrAdd):
        (WebCore::IDBObjectStore::doDelete):
        (WebCore::IDBObjectStore::deleteFunction):
        (WebCore::IDBObjectStore::clear):
        (WebCore::IDBObjectStore::createIndex):
        (WebCore::IDBObjectStore::index):
        (WebCore::IDBObjectStore::deleteIndex):
        (WebCore::IDBObjectStore::count):
        (WebCore::IDBObjectStore::doCount):
        (WebCore::IDBObjectStore::getAll):
        (WebCore::IDBObjectStore::getAllKeys):
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::result const):
        (WebCore:: const):
        (WebCore::IDBRequest::uncaughtExceptionInEventHandler):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::objectStore):
        (WebCore::IDBTransaction::abort):
        (WebCore::IDBTransaction::putOrAddOnServer):
        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::performGetAllDatabaseNames):
        * Modules/indexeddb/server/MemoryIDBBackingStore.cpp:
        (WebCore::IDBServer::MemoryIDBBackingStore::deleteRange):
        (WebCore::IDBServer::MemoryIDBBackingStore::addRecord):
        (WebCore::IDBServer::MemoryIDBBackingStore::getRecord):
        (WebCore::IDBServer::MemoryIDBBackingStore::getAllRecords):
        (WebCore::IDBServer::MemoryIDBBackingStore::getIndexRecord):
        (WebCore::IDBServer::MemoryIDBBackingStore::getCount):
        (WebCore::IDBServer::MemoryIDBBackingStore::openCursor):
        (WebCore::IDBServer::MemoryIDBBackingStore::iterateCursor):
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::createAndPopulateInitialDatabaseInfo):
        (WebCore::IDBServer::SQLiteIDBBackingStore::extractExistingDatabaseInfo):
        (WebCore::IDBServer::SQLiteIDBBackingStore::databaseNameFromEncodedFilename):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getOrEstablishDatabaseInfo):
        (WebCore::IDBServer::SQLiteIDBBackingStore::beginTransaction):
        (WebCore::IDBServer::SQLiteIDBBackingStore::abortTransaction):
        (WebCore::IDBServer::SQLiteIDBBackingStore::commitTransaction):
        (WebCore::IDBServer::SQLiteIDBBackingStore::createObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::renameObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::clearObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::createIndex):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedHasIndexRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedPutIndexRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteIndex):
        (WebCore::IDBServer::SQLiteIDBBackingStore::renameIndex):
        (WebCore::IDBServer::SQLiteIDBBackingStore::keyExistsInObjectStore):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteUnusedBlobFileRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteRange):
        (WebCore::IDBServer::SQLiteIDBBackingStore::updateAllIndexesForAddRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getBlobRecordsForObjectStoreRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getAllObjectStoreRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getAllIndexRecords):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getIndexRecord):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetIndexRecordForOneKey):
        (WebCore::IDBServer::SQLiteIDBBackingStore::getCount):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedGetKeyGeneratorValue):
        (WebCore::IDBServer::SQLiteIDBBackingStore::uncheckedSetKeyGeneratorValue):
        (WebCore::IDBServer::SQLiteIDBBackingStore::generateKeyNumber):
        (WebCore::IDBServer::SQLiteIDBBackingStore::revertGeneratedKeyNumber):
        (WebCore::IDBServer::SQLiteIDBBackingStore::maybeUpdateKeyGeneratorNumber):
        (WebCore::IDBServer::SQLiteIDBBackingStore::openCursor):
        (WebCore::IDBServer::SQLiteIDBBackingStore::iterateCursor):
        (WebCore::IDBServer::SQLiteIDBBackingStore::deleteBackingStore):
        * Modules/indexeddb/server/SQLiteIDBTransaction.cpp:
        (WebCore::IDBServer::SQLiteIDBTransaction::begin):
        (WebCore::IDBServer::SQLiteIDBTransaction::commit):
        (WebCore::IDBServer::SQLiteIDBTransaction::abort):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::deleteObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::renameObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabase::deleteIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::renameIndex):
        (WebCore::IDBServer::UniqueIDBDatabase::performPutOrAdd):
        (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
        (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
        * Modules/indexeddb/shared/IDBError.h:
        (WebCore::IDBError::userDeleteError):
        * Modules/indexeddb/shared/IDBTransactionInfo.cpp:
        (WebCore::IDBTransactionInfo::loggingString const):
        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasChanged):
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::addIceCandidate):
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::deny):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::doSetLocalDescription):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::doAddIceCandidate):
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::checkAndCanonicalizeTotal):
        (WebCore::PaymentRequest::create):
        * Modules/quota/DOMWindowQuota.cpp:
        (WebCore::DOMWindowQuota::webkitStorageInfo const):
        * Modules/webaudio/AudioBufferSourceNode.cpp:
        (WebCore::AudioBufferSourceNode::looping):
        (WebCore::AudioBufferSourceNode::setLooping):
        * Modules/webaudio/AudioNode.cpp:
        (WebCore::AudioNode::channelCountMode):
        (WebCore::AudioNode::channelInterpretation):
        * Modules/webaudio/MediaStreamAudioSource.cpp:
        (WebCore::MediaStreamAudioSource::MediaStreamAudioSource):
        * Modules/webauthn/AuthenticatorManager.cpp:
        (WebCore::AuthenticatorManagerInternal::produceClientDataJson):
        (WebCore::AuthenticatorManagerInternal::initTimeoutTimer):
        (WebCore::AuthenticatorManager::create const):
        (WebCore::AuthenticatorManager::discoverFromExternalSource const):
        (WebCore::AuthenticatorManager::isUserVerifyingPlatformAuthenticatorAvailable const):
        * Modules/webauthn/cocoa/LocalAuthenticator.mm:
        (WebCore::LocalAuthenticator::makeCredential):
        (WebCore::LocalAuthenticator::getAssertion):
        * Modules/webdatabase/DatabaseTracker.cpp:
        (WebCore::DatabaseTracker::usage):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect):
        (WebCore::WebSocket::close):
        (WebCore::WebSocket::binaryType const):
        * Modules/websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::readStatusLine):
        (WebCore::WebSocketHandshake::readHTTPHeaders):
        (WebCore::WebSocketHandshake::checkResponseHeaders):
        * Modules/webvr/VRDisplay.cpp:
        (WebCore::VRDisplay::requestPresent):
        (WebCore::VRDisplay::exitPresent):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::defaultLiveRegionStatusForRole):
        (WebCore::AccessibilityObject::invalidStatus const):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::textUnderElement const):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::constructCustomElementSynchronously):
        * bindings/js/JSCustomElementRegistryCustom.cpp:
        (WebCore::getCustomElementCallback):
        (WebCore::validateCustomElementNameAndThrowIfNeeded):
        (WebCore::JSCustomElementRegistry::define):
        * bindings/js/JSCustomXPathNSResolver.cpp:
        (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
        * bindings/js/JSDOMConstructorBase.cpp:
        (WebCore::callThrowTypeError):
        * bindings/js/JSDOMConstructorBase.h:
        (WebCore::JSDOMConstructorBase::className):
        * bindings/js/JSDOMConstructorNotConstructable.h:
        (WebCore::JSDOMConstructorNotConstructable::callThrowTypeError):
        * bindings/js/JSDOMExceptionHandling.cpp:
        (WebCore::createDOMException):
        (WebCore::throwSequenceTypeError):
        (WebCore::throwNonFiniteTypeError):
        * bindings/js/JSDOMIterator.h:
        (WebCore::iteratorForEach):
        (WebCore::IteratorTraits>::next):
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::isResponseCorrect):
        (WebCore::handleResponseOnStreamingAction):
        (WebCore::JSDOMWindowBase::compileStreaming):
        (WebCore::JSDOMWindowBase::instantiateStreaming):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::preventExtensions):
        (WebCore::JSDOMWindow::toStringName):
        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement):
        * bindings/js/JSLocationCustom.cpp:
        (WebCore::JSLocation::preventExtensions):
        (WebCore::JSLocation::toStringName):
        * bindings/js/JSReadableStreamPrivateConstructors.cpp:
        (WebCore::constructJSReadableStreamDefaultController):
        (WebCore::constructJSReadableByteStreamController):
        (WebCore::constructJSReadableStreamBYOBRequest):
        * bindings/js/JSRemoteDOMWindowCustom.cpp:
        (WebCore::JSRemoteDOMWindow::preventExtensions):
        (WebCore::JSRemoteDOMWindow::toStringName):
        * bindings/js/ReadableStreamDefaultController.cpp:
        (WebCore::ReadableStreamDefaultController::invoke):
        * bindings/js/ScriptModuleLoader.cpp:
        (WebCore::resolveModuleSpecifier):
        (WebCore::ScriptModuleLoader::resolve):
        (WebCore::ScriptModuleLoader::fetch):
        (WebCore::ScriptModuleLoader::evaluate):
        (WebCore::ScriptModuleLoader::importModule):
        (WebCore::ScriptModuleLoader::notifyFinished):
        * bindings/js/SerializedScriptValue.cpp:
        (WebCore::maybeThrowExceptionIfSerializationFailed):
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateDefaultValue):
        (GenerateConstructorHelperMethods):
        (GenerateCallTracer):
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::JSInterfaceNameConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSMapLike.cpp:
        (WebCore::JSMapLikeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        (WebCore::JSReadOnlyMapLikeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::JSTestActiveDOMObjectConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        (WebCore::JSTestCEReactionsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        (WebCore::JSTestCEReactionsStringifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::JSTestCallTracerConstructor::initializeProperties):
        (WebCore::jsTestCallTracerTestAttributeInterfaceGetter):
        (WebCore::setJSTestCallTracerTestAttributeInterfaceSetter):
        (WebCore::jsTestCallTracerTestAttributeSpecifiedGetter):
        (WebCore::setJSTestCallTracerTestAttributeSpecifiedSetter):
        (WebCore::jsTestCallTracerTestAttributeWithVariantGetter):
        (WebCore::setJSTestCallTracerTestAttributeWithVariantSetter):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationInterfaceBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationSpecifiedBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithArgumentsBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithNullableVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithOptionalVariantArgumentBody):
        (WebCore::jsTestCallTracerPrototypeFunctionTestOperationWithDefaultVariantArgumentBody):
        * bindings/scripts/test/JS/JSTestCallbackInterface.cpp:
        (WebCore::JSTestCallbackInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::JSTestClassWithJSBuiltinConstructorConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        (WebCore::JSTestDOMJITConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        (WebCore::JSTestEnabledBySettingConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructorConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::JSTestEventTargetConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestException.cpp:
        (WebCore::JSTestExceptionConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::JSTestGenerateIsReachableConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::JSTestGlobalObjectConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestIndexedSetterNoIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        (WebCore::JSTestIndexedSetterThrowingExceptionConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestIndexedSetterWithIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterfaceConstructor::construct):
        (WebCore::JSTestInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        (WebCore::JSTestInterfaceLeadingUnderscoreConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::JSTestIterableConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestJSBuiltinConstructor.cpp:
        (WebCore::JSTestJSBuiltinConstructorConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::JSTestMediaQueryListListenerConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructorConstructor::initializeProperties):
        (WebCore::JSTestNamedConstructorNamedConstructor::construct):
        (WebCore::JSTestNamedConstructorNamedConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        (WebCore::JSTestNamedDeleterNoIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        (WebCore::JSTestNamedDeleterThrowingExceptionConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        (WebCore::JSTestNamedDeleterWithIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedDeleterWithIndexedGetterConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        (WebCore::JSTestNamedGetterCallWithConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        (WebCore::JSTestNamedGetterNoIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        (WebCore::JSTestNamedGetterWithIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedSetterNoIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        (WebCore::JSTestNamedSetterThrowingExceptionConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedSetterWithIdentifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithOverrideBuiltinsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNodeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::convertDictionary<TestObj::Dictionary>):
        (WebCore::JSTestObjConstructor::initializeProperties):
        (WebCore::jsTestObjPrototypeFunctionMethodWithOptionalStringAndDefaultValueBody):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::JSTestOverloadedConstructorsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::JSTestOverloadedConstructorsWithSequenceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::JSTestOverrideBuiltinsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
        (WebCore::JSTestPluginInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        (WebCore::JSTestPromiseRejectionEventConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::JSTestSerializationConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
        (WebCore::JSTestSerializationIndirectInheritanceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        (WebCore::JSTestSerializationInheritConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        (WebCore::JSTestSerializationInheritFinalConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::JSTestSerializedScriptValueInterfaceConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        (WebCore::JSTestStringifierConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        (WebCore::JSTestStringifierAnonymousOperationConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        (WebCore::JSTestStringifierNamedOperationConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        (WebCore::JSTestStringifierOperationImplementedAsConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        (WebCore::JSTestStringifierOperationNamedToStringConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        (WebCore::JSTestStringifierReadOnlyAttributeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        (WebCore::JSTestStringifierReadWriteAttributeConstructor::initializeProperties):
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefsConstructor::initializeProperties):
        * bridge/c/c_instance.cpp:
        (JSC::Bindings::CInstance::invokeMethod):
        (JSC::Bindings::CInstance::invokeDefaultMethod):
        (JSC::Bindings::CInstance::invokeConstruct):
        (JSC::Bindings::CInstance::stringValue const):
        (JSC::Bindings::CInstance::toJSPrimitive const):
        * bridge/objc/objc_instance.mm:
        (ObjcInstance::invokeMethod):
        * bridge/objc/objc_runtime.mm:
        (JSC::Bindings::ObjcArray::setValueAt const):
        * contentextensions/ContentExtensionsBackend.cpp:
        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
        * crypto/SubtleCrypto.cpp:
        (WebCore::rejectWithException):
        (WebCore::SubtleCrypto::encrypt):
        (WebCore::SubtleCrypto::decrypt):
        (WebCore::SubtleCrypto::sign):
        (WebCore::SubtleCrypto::verify):
        (WebCore::SubtleCrypto::deriveKey):
        (WebCore::SubtleCrypto::deriveBits):
        (WebCore::SubtleCrypto::exportKey):
        (WebCore::SubtleCrypto::wrapKey):
        (WebCore::SubtleCrypto::unwrapKey):
        * crypto/keys/CryptoKeyEC.cpp:
        (WebCore::CryptoKeyEC::algorithm const):
        * css/CSSInheritedValue.cpp:
        (WebCore::CSSInheritedValue::customCSSText const):
        * css/CSSInitialValue.cpp:
        (WebCore::CSSInitialValue::customCSSText const):
        * css/CSSKeyframesRule.cpp:
        (WebCore::CSSKeyframesRule::insertRule):
        * css/CSSRevertValue.cpp:
        (WebCore::CSSRevertValue::customCSSText const):
        * css/CSSStyleSheet.h:
        * css/CSSUnsetValue.cpp:
        (WebCore::CSSUnsetValue::customCSSText const):
        * css/CSSValueList.cpp:
        (WebCore::CSSValueList::customCSSText const):
        * css/DOMMatrixReadOnly.cpp:
        (WebCore::DOMMatrixReadOnly::validateAndFixup):
        (WebCore::DOMMatrixReadOnly::toFloat32Array const):
        (WebCore::DOMMatrixReadOnly::toFloat64Array const):
        (WebCore::DOMMatrixReadOnly::toString const):
        * css/DeprecatedCSSOMValueList.cpp:
        (WebCore::DeprecatedCSSOMValueList::cssText const):
        * css/FontFace.cpp:
        (WebCore::FontFace::create):
        (WebCore::FontFace::unicodeRange const):
        (WebCore::FontFace::featureSettings const):
        * css/MediaQuery.cpp:
        (WebCore::MediaQuery::serialize const):
        * css/PropertySetCSSStyleDeclaration.cpp:
        (WebCore::PropertySetCSSStyleDeclaration::getPropertyPriority):
        * css/WebKitCSSMatrix.cpp:
        (WebCore::WebKitCSSMatrix::toString const):
        * css/parser/MediaQueryParser.cpp:
        (WebCore::MediaQueryParser::commitMediaQuery):
        * dom/CDATASection.cpp:
        (WebCore::CDATASection::nodeName const):
        * dom/Comment.cpp:
        (WebCore::Comment::nodeName const):
        * dom/DOMException.cpp:
        (WebCore::DOMException::description const):
        (WebCore::DOMException::create):
        * dom/DOMException.h:
        (WebCore::DOMException::name):
        (WebCore::DOMException::message):
        * dom/DOMImplementation.cpp:
        (WebCore::DOMImplementation::createHTMLDocument):
        * dom/DataTransfer.cpp:
        (WebCore::DataTransfer::DataTransfer):
        (WebCore::DataTransfer::types const):
        (WebCore::DataTransfer::createForInputEvent):
        (WebCore::DataTransfer::dropEffect const):
        (WebCore::DataTransfer::effectAllowed const):
        * dom/DataTransferItem.cpp:
        (WebCore::DataTransferItem::kind const):
        * dom/Document.cpp:
        (WebCore::Document::suggestedMIMEType const):
        (WebCore::Document::contentType const):
        (WebCore::Document::nodeName const):
        (WebCore::Document::writeln):
        (WebCore::Document::canNavigate):
        (WebCore::Document::designMode const):
        (WebCore::Document::requestFullScreenForElement):
        * dom/DocumentFragment.cpp:
        (WebCore::DocumentFragment::nodeName const):
        * dom/InlineStyleSheetOwner.cpp:
        (WebCore::InlineStyleSheetOwner::createSheet):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::initMouseEventQuirk):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::requestModuleScript):
        * dom/ScriptElementCachedScriptFetcher.cpp:
        (WebCore::ScriptElementCachedScriptFetcher::requestModuleScript const):
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::dispatchErrorEvent):
        * dom/ScriptedAnimationController.cpp:
        (WebCore::throttlingReasonsToString):
        * dom/Text.cpp:
        (WebCore::Text::nodeName const):
        * dom/TextEncoder.cpp:
        (WebCore::TextEncoder::encoding const):
        * dom/Traversal.cpp:
        (WebCore::NodeIteratorBase::acceptNode):
        * editing/EditCommand.cpp:
        (WebCore::inputTypeNameForEditingAction):
        * editing/Editing.cpp:
        (WebCore::createTabSpanElement):
        * editing/Editor.cpp:
        (WebCore::createDataTransferForClipboardEvent):
        * editing/EditorCommand.cpp:
        (WebCore::executeInsertBacktab):
        (WebCore::executeInsertLineBreak):
        (WebCore::executeInsertNewline):
        (WebCore::executeInsertTab):
        (WebCore::executeJustifyCenter):
        (WebCore::executeJustifyFull):
        (WebCore::executeJustifyLeft):
        (WebCore::executeJustifyRight):
        (WebCore::executeStrikethrough):
        (WebCore::executeSubscript):
        (WebCore::executeSuperscript):
        (WebCore::executeToggleBold):
        (WebCore::executeToggleItalic):
        (WebCore::executeUnderline):
        (WebCore::executeUnscript):
        (WebCore::stateBold):
        (WebCore::stateItalic):
        (WebCore::stateStrikethrough):
        (WebCore::stateSubscript):
        (WebCore::stateSuperscript):
        (WebCore::stateUnderline):
        (WebCore::stateJustifyCenter):
        (WebCore::stateJustifyFull):
        (WebCore::stateJustifyLeft):
        (WebCore::stateJustifyRight):
        (WebCore::Editor::Command::value const):
        * editing/SmartReplace.cpp:
        (WebCore::getSmartSet):
        * fileapi/FileCocoa.mm:
        (WebCore::File::computeNameAndContentTypeForReplacedFile):
        * html/BaseCheckableInputType.cpp:
        (WebCore::BaseCheckableInputType::saveFormControlState const):
        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::fallbackValue const):
        * html/DOMFormData.cpp:
        (WebCore::DOMFormData::createFileEntry):
        * html/FTPDirectoryDocument.cpp:
        (WebCore::processFilesizeString):
        (WebCore::FTPDirectoryDocumentParser::loadDocumentTemplate):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::relList const):
        (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
        * html/HTMLAppletElement.cpp:
        (WebCore::HTMLAppletElement::HTMLAppletElement):
        (WebCore::HTMLAppletElement::updateWidget):
        * html/HTMLCanvasElement.cpp:
        (WebCore::toEncodingMimeType):
        (WebCore::HTMLCanvasElement::toDataURL):
        (WebCore::HTMLCanvasElement::captureStream):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::contentEditable const):
        * html/HTMLFormControlElement.cpp:
        (WebCore::shouldAutofocus):
        * html/HTMLHtmlElement.cpp:
        (WebCore::HTMLHtmlElement::insertedByParser):
        * html/HTMLKeygenElement.cpp:
        (WebCore::HTMLKeygenElement::keytype const):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::canPlayType const):
        (WebCore::stringForNetworkState):
        (WebCore::HTMLMediaElement::preload const):
        (WebCore::HTMLMediaElement::ensureMediaControlsInjectedScript):
        * html/HTMLObjectElement.cpp:
        (WebCore::mapDataParamToSrc):
        * html/HTMLPlugInElement.cpp:
        (WebCore::HTMLPlugInElement::setReplacement):
        * html/ImageData.cpp:
        (WebCore::ImageData::create):
        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::createDocumentStructure):
        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::appendFormData const):
        * html/PluginDocument.cpp:
        (WebCore::PluginDocumentParser::createDocumentStructure):
        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::getExtension):
        (WebCore::WebGL2RenderingContext::getSupportedExtensions):
        (WebCore::WebGL2RenderingContext::getParameter):
        * html/canvas/WebGLCompressedTextureASTC.cpp:
        (WebCore::WebGLCompressedTextureASTC::WebGLCompressedTextureASTC):
        (WebCore::WebGLCompressedTextureASTC::getSupportedProfiles):
        (WebCore::WebGLCompressedTextureASTC::supported):
        (WebCore::m_isLDRSupported): Deleted.
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::getExtension):
        (WebCore::WebGLRenderingContext::getSupportedExtensions):
        (WebCore::WebGLRenderingContext::getParameter):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create):
        (WebCore::WebGLRenderingContextBase::enableSupportedExtension):
        * html/canvas/WebGLRenderingContextBase.h:
        * html/canvas/WebGPUEnums.cpp:
        (WebCore::web3DCompareFunctionName):
        * html/parser/HTMLParserIdioms.cpp:
        (WebCore::parseCORSSettingsAttribute):
        * html/parser/HTMLPreloadScanner.cpp:
        (WebCore::TokenPreloadScanner::initiatorFor):
        * html/parser/HTMLResourcePreloader.cpp:
        (WebCore::PreloadRequest::resourceRequest):
        * html/parser/HTMLTreeBuilder.cpp:
        (WebCore::HTMLTreeBuilder::insertPhoneNumberLink):
        * html/track/DataCue.cpp:
        (WebCore::DataCue::toJSONString const):
        * html/track/InbandGenericTextTrack.cpp:
        (WebCore::InbandGenericTextTrack::updateCueFromCueData):
        * html/track/TextTrackCue.cpp:
        (WebCore::TextTrackCue::toJSON const):
        * html/track/TextTrackCueGeneric.cpp:
        (WebCore::TextTrackCueGeneric::toJSONString const):
        * html/track/TrackBase.cpp:
        (WebCore::TrackBase::setLanguage):
        * html/track/VTTCue.cpp:
        (WebCore::VTTCue::toJSON const):
        * inspector/CommandLineAPIModule.cpp:
        (WebCore::CommandLineAPIModule::CommandLineAPIModule):
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::getCanvasContentAsDataURL):
        (WebCore::InspectorCanvas::indexForData):
        (WebCore::InspectorCanvas::buildInitialState):
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        (WebCore::InspectorCanvas::buildArrayForCanvasPattern):
        * inspector/InspectorFrontendClient.h:
        (WebCore::InspectorFrontendClient::debuggableType):
        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::openInNewTab):
        * inspector/InspectorFrontendHost.cpp:
        (WebCore::InspectorFrontendHost::userInterfaceLayoutDirection):
        (WebCore::InspectorFrontendHost::platform):
        (WebCore::InspectorFrontendHost::port):
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::setIndicating):
        (WebCore::InspectorOverlay::drawPaintRects):
        (WebCore::InspectorOverlay::drawRulers):
        (WebCore::appendPathSegment):
        * inspector/InspectorStyleSheet.h:
        (WebCore::InspectorCSSId::InspectorCSSId):
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::createGenericRecord):
        (WebCore::TimelineRecordFactory::createFunctionCallData):
        (WebCore::TimelineRecordFactory::createConsoleProfileData):
        (WebCore::TimelineRecordFactory::createProbeSampleData):
        (WebCore::TimelineRecordFactory::createEventDispatchData):
        (WebCore::TimelineRecordFactory::createGenericTimerData):
        (WebCore::TimelineRecordFactory::createTimerInstallData):
        (WebCore::TimelineRecordFactory::createEvaluateScriptData):
        (WebCore::TimelineRecordFactory::createTimeStampData):
        (WebCore::TimelineRecordFactory::createAnimationFrameData):
        (WebCore::TimelineRecordFactory::createPaintData):
        (WebCore::TimelineRecordFactory::appendLayoutRoot):
        * inspector/WebInjectedScriptHost.cpp:
        (WebCore::WebInjectedScriptHost::subtype):
        (WebCore::jsStringForPaymentRequestState):
        (WebCore::WebInjectedScriptHost::getInternalProperties):
        * inspector/agents/InspectorApplicationCacheAgent.cpp:
        (WebCore::InspectorApplicationCacheAgent::InspectorApplicationCacheAgent):
        * inspector/agents/InspectorCSSAgent.cpp:
        (WebCore::InspectorCSSAgent::InspectorCSSAgent):
        (WebCore::InspectorCSSAgent::getMatchedStylesForNode):
        (WebCore::InspectorCSSAgent::createStyleSheet):
        (WebCore::InspectorCSSAgent::addRule):
        (WebCore::InspectorCSSAgent::elementForId):
        (WebCore::InspectorCSSAgent::assertStyleSheetForId):
        * inspector/agents/InspectorCanvasAgent.cpp:
        (WebCore::InspectorCanvasAgent::InspectorCanvasAgent):
        (WebCore::InspectorCanvasAgent::requestNode):
        (WebCore::InspectorCanvasAgent::requestContent):
        (WebCore::InspectorCanvasAgent::resolveCanvasContext):
        (WebCore::InspectorCanvasAgent::startRecording):
        (WebCore::InspectorCanvasAgent::stopRecording):
        (WebCore::InspectorCanvasAgent::requestShaderSource):
        (WebCore::InspectorCanvasAgent::updateShader):
        (WebCore::InspectorCanvasAgent::setShaderProgramDisabled):
        (WebCore::InspectorCanvasAgent::setShaderProgramHighlighted):
        (WebCore::InspectorCanvasAgent::assertInspectorCanvas):
        (WebCore::InspectorCanvasAgent::assertInspectorProgram):
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::InspectorDOMAgent):
        (WebCore::InspectorDOMAgent::assertNode):
        (WebCore::InspectorDOMAgent::assertDocument):
        (WebCore::InspectorDOMAgent::assertElement):
        (WebCore::InspectorDOMAgent::assertEditableNode):
        (WebCore::InspectorDOMAgent::assertEditableElement):
        (WebCore::InspectorDOMAgent::getDocument):
        (WebCore::InspectorDOMAgent::pushNodeToFrontend):
        (WebCore::InspectorDOMAgent::requestChildNodes):
        (WebCore::InspectorDOMAgent::querySelector):
        (WebCore::InspectorDOMAgent::querySelectorAll):
        (WebCore::InspectorDOMAgent::releaseBackendNodeIds):
        (WebCore::InspectorDOMAgent::setAttributesAsText):
        (WebCore::InspectorDOMAgent::removeNode):
        (WebCore::InspectorDOMAgent::setOuterHTML):
        (WebCore::InspectorDOMAgent::insertAdjacentHTML):
        (WebCore::InspectorDOMAgent::setNodeValue):
        (WebCore::InspectorDOMAgent::setEventListenerDisabled):
        (WebCore::InspectorDOMAgent::performSearch):
        (WebCore::InspectorDOMAgent::getSearchResults):
        (WebCore::InspectorDOMAgent::highlightConfigFromInspectorObject):
        (WebCore::InspectorDOMAgent::highlightQuad):
        (WebCore::InspectorDOMAgent::highlightSelector):
        (WebCore::InspectorDOMAgent::highlightNode):
        (WebCore::InspectorDOMAgent::highlightNodeList):
        (WebCore::InspectorDOMAgent::moveTo):
        (WebCore::InspectorDOMAgent::focus):
        (WebCore::InspectorDOMAgent::setInspectedNode):
        (WebCore::InspectorDOMAgent::resolveNode):
        (WebCore::InspectorDOMAgent::pushNodeByPathToFrontend):
        (WebCore::InspectorDOMAgent::pushNodeByBackendIdToFrontend):
        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::InspectorDOMDebuggerAgent):
        (WebCore::InspectorDOMDebuggerAgent::setBreakpoint):
        (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint):
        (WebCore::domTypeName):
        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
        * inspector/agents/InspectorDOMStorageAgent.cpp:
        (WebCore::InspectorDOMStorageAgent::InspectorDOMStorageAgent):
        (WebCore::InspectorDOMStorageAgent::getDOMStorageItems):
        (WebCore::InspectorDOMStorageAgent::setDOMStorageItem):
        (WebCore::InspectorDOMStorageAgent::removeDOMStorageItem):
        (WebCore::InspectorDOMStorageAgent::findStorageArea):
        * inspector/agents/InspectorDatabaseAgent.cpp:
        (WebCore::InspectorDatabaseAgent::InspectorDatabaseAgent):
        (WebCore::InspectorDatabaseAgent::getDatabaseTableNames):
        * inspector/agents/InspectorIndexedDBAgent.cpp:
        (WebCore::Inspector::idbKeyRangeFromKeyRange):
        (WebCore::InspectorIndexedDBAgent::InspectorIndexedDBAgent):
        (WebCore::InspectorIndexedDBAgent::requestData):
        * inspector/agents/InspectorLayerTreeAgent.cpp:
        (WebCore::InspectorLayerTreeAgent::InspectorLayerTreeAgent):
        (WebCore::InspectorLayerTreeAgent::layersForNode):
        (WebCore::InspectorLayerTreeAgent::reasonsForCompositingLayer):
        * inspector/agents/InspectorMemoryAgent.cpp:
        (WebCore::InspectorMemoryAgent::InspectorMemoryAgent):
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::InspectorNetworkAgent):
        (WebCore::InspectorNetworkAgent::getResponseBody):
        (WebCore::InspectorNetworkAgent::loadResource):
        (WebCore::InspectorNetworkAgent::resolveWebSocket):
        (WebCore::InspectorNetworkAgent::createTextDecoder):
        (WebCore::InspectorNetworkAgent::searchInRequest):
        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::resourceContent):
        (WebCore::InspectorPageAgent::InspectorPageAgent):
        (WebCore::InspectorPageAgent::navigate):
        (WebCore::InspectorPageAgent::assertFrame):
        (WebCore::InspectorPageAgent::assertDocumentLoader):
        (WebCore::InspectorPageAgent::snapshotNode):
        (WebCore::InspectorPageAgent::snapshotRect):
        (WebCore::InspectorPageAgent::archive):
        * inspector/agents/InspectorTimelineAgent.cpp:
        (WebCore::InspectorTimelineAgent::InspectorTimelineAgent):
        (WebCore::InspectorTimelineAgent::setInstruments):
        (WebCore::InspectorTimelineAgent::startFromConsole):
        (WebCore::InspectorTimelineAgent::stopFromConsole):
        (WebCore::InspectorTimelineAgent::didCompleteRecordEntry):
        * inspector/agents/InspectorWorkerAgent.cpp:
        (WebCore::InspectorWorkerAgent::InspectorWorkerAgent):
        (WebCore::InspectorWorkerAgent::initialized):
        (WebCore::InspectorWorkerAgent::sendMessageToWorker):
        * inspector/agents/WebConsoleAgent.cpp:
        (WebCore::WebConsoleAgent::setLoggingChannelLevel):
        * inspector/agents/page/PageDebuggerAgent.cpp:
        (WebCore::PageDebuggerAgent::injectedScriptForEval):
        * inspector/agents/page/PageNetworkAgent.cpp:
        (WebCore::PageNetworkAgent::scriptExecutionContext):
        * inspector/agents/page/PageRuntimeAgent.cpp:
        (WebCore::PageRuntimeAgent::injectedScriptForEval):
        * inspector/agents/worker/ServiceWorkerAgent.cpp:
        (WebCore::ServiceWorkerAgent::ServiceWorkerAgent):
        * inspector/agents/worker/WorkerDebuggerAgent.cpp:
        (WebCore::WorkerDebuggerAgent::injectedScriptForEval):
        * inspector/agents/worker/WorkerRuntimeAgent.cpp:
        (WebCore::WorkerRuntimeAgent::injectedScriptForEval):
        * loader/ContentFilter.cpp:
        (WebCore::ContentFilter::handleProvisionalLoadFailure):
        * loader/CrossOriginAccessControl.cpp:
        (WebCore::passesAccessControlCheck):
        (WebCore::validatePreflightResponse):
        * loader/CrossOriginPreflightChecker.cpp:
        (WebCore::CrossOriginPreflightChecker::notifyFinished):
        (WebCore::CrossOriginPreflightChecker::doPreflight):
        * loader/DocumentLoader.cpp:
        (WebCore::isRemoteWebArchive):
        (WebCore::DocumentLoader::startIconLoading):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::reportRedirectionWithBadScheme):
        (WebCore::DocumentThreadableLoader::reportContentSecurityPolicyError):
        (WebCore::DocumentThreadableLoader::reportCrossOriginResourceSharingError):
        (WebCore::DocumentThreadableLoader::reportIntegrityMetadataError):
        * loader/FormSubmission.cpp:
        (WebCore::FormSubmission::Attributes::parseEncodingType):
        * loader/FormSubmission.h:
        (WebCore::FormSubmission::Attributes::methodString):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::initForSynthesizedDocument):
        (WebCore::FrameLoader::loadURLIntoChildFrame):
        (WebCore::FrameLoader::defaultSubstituteDataForURL):
        (WebCore::FrameLoader::addHTTPUpgradeInsecureRequestsIfNeeded):
        (WebCore::FrameLoader::dispatchBeforeUnloadEvent):
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::preconnectIfNeeded):
        * loader/NavigationScheduler.cpp:
        (WebCore::NavigationScheduler::scheduleLocationChange):
        * loader/PingLoader.cpp:
        (WebCore::PingLoader::sendViolationReport):
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::primaryDomain):
        (WebCore::ResourceLoadStatistics::areDomainsAssociated):
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::loadDataURL):
        (WebCore::ResourceLoader::didBlockAuthenticationChallenge):
        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::willSendRequestInternal):
        (WebCore::SubresourceLoader::checkRedirectionCrossOriginAccessControl):
        * loader/ThreadableLoader.cpp:
        (WebCore::ThreadableLoader::logError):
        * loader/appcache/ApplicationCacheGroup.cpp:
        (WebCore::ApplicationCacheGroup::abort):
        (WebCore::ApplicationCacheGroup::didFinishLoadingEntry):
        (WebCore::ApplicationCacheGroup::didFinishLoadingManifest):
        (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete):
        * loader/appcache/ApplicationCacheHost.cpp:
        (WebCore::ApplicationCacheHost::createFileURL):
        * loader/appcache/ManifestParser.cpp:
        (WebCore::parseManifest):
        * loader/archive/ArchiveFactory.cpp:
        (WebCore::createArchiveMIMETypesMap):
        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::canRequest):
        (WebCore::CachedResourceLoader::requestResource):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::acceptHeaderValueFromType):
        (WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
        * loader/cache/CachedScript.cpp:
        (WebCore::CachedScript::CachedScript):
        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::getOriginsWithCache):
        * loader/soup/ResourceLoaderSoup.cpp:
        (WebCore::ResourceLoader::loadGResource):
        * page/DOMSelection.cpp:
        (WebCore::DOMSelection::type const):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::close):
        (WebCore::DOMWindow::addEventListener):
        (WebCore::DOMWindow::createWindow):
        * page/DebugPageOverlays.cpp:
        (WebCore::touchEventRegionColors):
        * page/DiagnosticLoggingKeys.cpp:
        (WebCore::DiagnosticLoggingKeys::mediaLoadedKey):
        (WebCore::DiagnosticLoggingKeys::mediaLoadingFailedKey):
        (WebCore::DiagnosticLoggingKeys::memoryCacheEntryDecisionKey):
        (WebCore::DiagnosticLoggingKeys::memoryCacheUsageKey):
        (WebCore::DiagnosticLoggingKeys::missingValidatorFieldsKey):
        (WebCore::DiagnosticLoggingKeys::pluginLoadedKey):
        (WebCore::DiagnosticLoggingKeys::pluginLoadingFailedKey):
        (WebCore::DiagnosticLoggingKeys::postPageBackgroundingCPUUsageKey):
        (WebCore::DiagnosticLoggingKeys::postPageBackgroundingMemoryUsageKey):
        (WebCore::DiagnosticLoggingKeys::pageHandlesWebGLContextLossKey):
        (WebCore::DiagnosticLoggingKeys::postPageLoadCPUUsageKey):
        (WebCore::DiagnosticLoggingKeys::postPageLoadMemoryUsageKey):
        (WebCore::DiagnosticLoggingKeys::provisionalLoadKey):
        (WebCore::DiagnosticLoggingKeys::pageContainsPluginKey):
        (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOnePluginKey):
        (WebCore::DiagnosticLoggingKeys::pageContainsMediaEngineKey):
        (WebCore::DiagnosticLoggingKeys::pageContainsAtLeastOneMediaEngineKey):
        (WebCore::DiagnosticLoggingKeys::pageLoadedKey):
        (WebCore::DiagnosticLoggingKeys::playedKey):
        (WebCore::DiagnosticLoggingKeys::engineFailedToLoadKey):
        (WebCore::DiagnosticLoggingKeys::entryRightlyNotWarmedUpKey):
        (WebCore::DiagnosticLoggingKeys::entryWronglyNotWarmedUpKey):
        (WebCore::DiagnosticLoggingKeys::navigationKey):
        (WebCore::DiagnosticLoggingKeys::needsRevalidationKey):
        (WebCore::DiagnosticLoggingKeys::networkCacheKey):
        (WebCore::DiagnosticLoggingKeys::networkCacheFailureReasonKey):
        (WebCore::DiagnosticLoggingKeys::networkCacheUnusedReasonKey):
        (WebCore::DiagnosticLoggingKeys::networkCacheReuseFailureKey):
        (WebCore::DiagnosticLoggingKeys::networkKey):
        (WebCore::DiagnosticLoggingKeys::networkProcessCrashedKey):
        (WebCore::DiagnosticLoggingKeys::neverSeenBeforeKey):
        (WebCore::DiagnosticLoggingKeys::noKey):
        (WebCore::DiagnosticLoggingKeys::noCacheKey):
        (WebCore::DiagnosticLoggingKeys::noStoreKey):
        (WebCore::DiagnosticLoggingKeys::nonVisibleStateKey):
        (WebCore::DiagnosticLoggingKeys::notInMemoryCacheKey):
        (WebCore::DiagnosticLoggingKeys::pageCacheKey):
        (WebCore::DiagnosticLoggingKeys::pageCacheFailureKey):
        (WebCore::DiagnosticLoggingKeys::noDocumentLoaderKey):
        (WebCore::DiagnosticLoggingKeys::noLongerInCacheKey):
        (WebCore::DiagnosticLoggingKeys::otherKey):
        (WebCore::DiagnosticLoggingKeys::mainDocumentErrorKey):
        (WebCore::DiagnosticLoggingKeys::mainResourceKey):
        (WebCore::DiagnosticLoggingKeys::isErrorPageKey):
        (WebCore::DiagnosticLoggingKeys::isExpiredKey):
        (WebCore::DiagnosticLoggingKeys::isReloadIgnoringCacheDataKey):
        (WebCore::DiagnosticLoggingKeys::loadingKey):
        (WebCore::DiagnosticLoggingKeys::hasPluginsKey):
        (WebCore::DiagnosticLoggingKeys::httpsNoStoreKey):
        (WebCore::DiagnosticLoggingKeys::imageKey):
        (WebCore::DiagnosticLoggingKeys::inMemoryCacheKey):
        (WebCore::DiagnosticLoggingKeys::inactiveKey):
        (WebCore::DiagnosticLoggingKeys::internalErrorKey):
        (WebCore::DiagnosticLoggingKeys::invalidSessionIDKey):
        (WebCore::DiagnosticLoggingKeys::isAttachmentKey):
        (WebCore::DiagnosticLoggingKeys::isConditionalRequestKey):
        (WebCore::DiagnosticLoggingKeys::isDisabledKey):
        (WebCore::DiagnosticLoggingKeys::noCurrentHistoryItemKey):
        (WebCore::DiagnosticLoggingKeys::quirkRedirectComingKey):
        (WebCore::DiagnosticLoggingKeys::rawKey):
        (WebCore::DiagnosticLoggingKeys::redirectKey):
        (WebCore::DiagnosticLoggingKeys::isLoadingKey):
        (WebCore::DiagnosticLoggingKeys::documentLoaderStoppingKey):
        (WebCore::DiagnosticLoggingKeys::domainCausingCrashKey):
        (WebCore::DiagnosticLoggingKeys::domainCausingEnergyDrainKey):
        (WebCore::DiagnosticLoggingKeys::domainCausingJetsamKey):
        (WebCore::DiagnosticLoggingKeys::simulatedPageCrashKey):
        (WebCore::DiagnosticLoggingKeys::exceededActiveMemoryLimitKey):
        (WebCore::DiagnosticLoggingKeys::exceededInactiveMemoryLimitKey):
        (WebCore::DiagnosticLoggingKeys::exceededBackgroundCPULimitKey):
        (WebCore::DiagnosticLoggingKeys::domainVisitedKey):
        (WebCore::DiagnosticLoggingKeys::cannotSuspendActiveDOMObjectsKey):
        (WebCore::DiagnosticLoggingKeys::cpuUsageKey):
        (WebCore::DiagnosticLoggingKeys::createSharedBufferFailedKey):
        (WebCore::DiagnosticLoggingKeys::activeInForegroundTabKey):
        (WebCore::DiagnosticLoggingKeys::activeInBackgroundTabOnlyKey):
        (WebCore::DiagnosticLoggingKeys::applicationCacheKey):
        (WebCore::DiagnosticLoggingKeys::applicationManifestKey):
        (WebCore::DiagnosticLoggingKeys::audioKey):
        (WebCore::DiagnosticLoggingKeys::backNavigationDeltaKey):
        (WebCore::DiagnosticLoggingKeys::canCacheKey):
        (WebCore::DiagnosticLoggingKeys::cacheControlNoStoreKey):
        (WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationKey):
        (WebCore::DiagnosticLoggingKeys::cachedResourceRevalidationReasonKey):
        (WebCore::DiagnosticLoggingKeys::deniedByClientKey):
        (WebCore::DiagnosticLoggingKeys::deviceMotionKey):
        (WebCore::DiagnosticLoggingKeys::deviceOrientationKey):
        (WebCore::DiagnosticLoggingKeys::diskCacheKey):
        (WebCore::DiagnosticLoggingKeys::diskCacheAfterValidationKey):
        (WebCore::DiagnosticLoggingKeys::reloadKey):
        (WebCore::DiagnosticLoggingKeys::replaceKey):
        (WebCore::DiagnosticLoggingKeys::retrievalRequestKey):
        (WebCore::DiagnosticLoggingKeys::resourceLoadedKey):
        (WebCore::DiagnosticLoggingKeys::resourceResponseSourceKey):
        (WebCore::DiagnosticLoggingKeys::retrievalKey):
        (WebCore::DiagnosticLoggingKeys::revalidatingKey):
        (WebCore::DiagnosticLoggingKeys::reloadFromOriginKey):
        (WebCore::DiagnosticLoggingKeys::reloadRevalidatingExpiredKey):
        (WebCore::DiagnosticLoggingKeys::sameLoadKey):
        (WebCore::DiagnosticLoggingKeys::scriptKey):
        (WebCore::DiagnosticLoggingKeys::serviceWorkerKey):
        (WebCore::DiagnosticLoggingKeys::streamingMedia):
        (WebCore::DiagnosticLoggingKeys::styleSheetKey):
        (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithRevalidationKey):
        (WebCore::DiagnosticLoggingKeys::successfulSpeculativeWarmupWithoutRevalidationKey):
        (WebCore::DiagnosticLoggingKeys::svgDocumentKey):
        (WebCore::DiagnosticLoggingKeys::synchronousMessageFailedKey):
        (WebCore::DiagnosticLoggingKeys::telemetryPageLoadKey):
        (WebCore::DiagnosticLoggingKeys::timedOutKey):
        (WebCore::DiagnosticLoggingKeys::canceledLessThan2SecondsKey):
        (WebCore::DiagnosticLoggingKeys::canceledLessThan5SecondsKey):
        (WebCore::DiagnosticLoggingKeys::canceledLessThan20SecondsKey):
        (WebCore::DiagnosticLoggingKeys::canceledMoreThan20SecondsKey):
        (WebCore::DiagnosticLoggingKeys::failedLessThan2SecondsKey):
        (WebCore::DiagnosticLoggingKeys::failedLessThan5SecondsKey):
        (WebCore::DiagnosticLoggingKeys::failedLessThan20SecondsKey):
        (WebCore::DiagnosticLoggingKeys::failedMoreThan20SecondsKey):
        (WebCore::DiagnosticLoggingKeys::occurredKey):
        (WebCore::DiagnosticLoggingKeys::succeededLessThan2SecondsKey):
        (WebCore::DiagnosticLoggingKeys::succeededLessThan5SecondsKey):
        (WebCore::DiagnosticLoggingKeys::succeededLessThan20SecondsKey):
        (WebCore::DiagnosticLoggingKeys::succeededMoreThan20SecondsKey):
        (WebCore::DiagnosticLoggingKeys::uncacheableStatusCodeKey):
        (WebCore::DiagnosticLoggingKeys::underMemoryPressureKey):
        (WebCore::DiagnosticLoggingKeys::unknownEntryRequestKey):
        (WebCore::DiagnosticLoggingKeys::unlikelyToReuseKey):
        (WebCore::DiagnosticLoggingKeys::unsupportedHTTPMethodKey):
        (WebCore::DiagnosticLoggingKeys::unsuspendableDOMObjectKey):
        (WebCore::DiagnosticLoggingKeys::unusedKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonCredentialSettingsKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonErrorKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonMustRevalidateNoValidatorKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonNoStoreKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonRedirectChainKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonReloadKey):
        (WebCore::DiagnosticLoggingKeys::unusedReasonTypeMismatchKey):
        (WebCore::DiagnosticLoggingKeys::usedKey):
        (WebCore::DiagnosticLoggingKeys::userZoomActionKey):
        (WebCore::DiagnosticLoggingKeys::varyingHeaderMismatchKey):
        (WebCore::DiagnosticLoggingKeys::videoKey):
        (WebCore::DiagnosticLoggingKeys::visibleNonActiveStateKey):
        (WebCore::DiagnosticLoggingKeys::visibleAndActiveStateKey):
        (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithRevalidationKey):
        (WebCore::DiagnosticLoggingKeys::wastedSpeculativeWarmupWithoutRevalidationKey):
        (WebCore::DiagnosticLoggingKeys::webViewKey):
        (WebCore::DiagnosticLoggingKeys::yesKey):
        (WebCore::DiagnosticLoggingKeys::expiredKey):
        (WebCore::DiagnosticLoggingKeys::fontKey):
        (WebCore::DiagnosticLoggingKeys::prunedDueToMemoryPressureKey):
        (WebCore::DiagnosticLoggingKeys::prunedDueToMaxSizeReached):
        (WebCore::DiagnosticLoggingKeys::prunedDueToProcessSuspended):
        (WebCore::WebCore::DiagnosticLoggingKeys::notHTTPFamilyKey):
        (WebCore::WebCore::DiagnosticLoggingKeys::webGLStateKey):
        (WebCore::DiagnosticLoggingKeys::memoryUsageToDiagnosticLoggingKey):
        (WebCore::DiagnosticLoggingKeys::foregroundCPUUsageToDiagnosticLoggingKey):
        (WebCore::DiagnosticLoggingKeys::backgroundCPUUsageToDiagnosticLoggingKey):
        (WebCore::DiagnosticLoggingKeys::resourceLoadStatisticsTelemetryKey):
        * page/DisabledAdaptations.cpp:
        (WebCore::watchAdaptationName):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::handlePasteGlobalSelection):
        (WebCore::convertDragOperationToDropZoneOperation):
        * page/EventSource.cpp:
        (WebCore::EventSource::EventSource):
        * page/History.cpp:
        (WebCore::History::stateObjectAdded):
        * page/NavigatorBase.cpp:
        (WebCore::NavigatorBase::appName):
        (WebCore::NavigatorBase::appCodeName):
        * page/Page.cpp:
        (WebCore::Page::logNavigation):
        * page/PageDebuggable.cpp:
        (WebCore::PageDebuggable::url const):
        * page/PageSerializer.cpp:
        (WebCore::PageSerializer::serializeCSSStyleSheet):
        * page/PerformanceMark.h:
        * page/PerformanceMeasure.h:
        * page/PerformanceObserver.cpp:
        (WebCore::PerformanceObserver::observe):
        * page/PerformanceResourceTiming.cpp:
        (WebCore::PerformanceResourceTiming::PerformanceResourceTiming):
        * page/PerformanceUserTiming.cpp:
        (WebCore::restrictedMarkFunction):
        * page/PointerLockController.cpp:
        (WebCore::PointerLockController::requestPointerLock):
        * page/PrintContext.cpp:
        (WebCore::PrintContext::pageProperty):
        * page/SecurityOrigin.cpp:
        (WebCore::SecurityOrigin::toString const):
        * page/SecurityOriginData.cpp:
        (WebCore::SecurityOriginData::toString const):
        (WebCore::SecurityOriginData::databaseIdentifier const):
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::gcTimerString):
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::reportViolation const):
        (WebCore::ContentSecurityPolicy::reportUnsupportedDirective const):
        * page/linux/ResourceUsageOverlayLinux.cpp:
        (WebCore::cpuUsageString):
        (WebCore::gcTimerString):
        * platform/ContentType.cpp:
        (WebCore::ContentType::codecsParameter):
        (WebCore::ContentType::profilesParameter):
        * platform/Decimal.cpp:
        (WebCore::Decimal::toString const):
        * platform/MIMETypeRegistry.cpp:
        (WebCore::initializeSupportedImageMIMETypes):
        (WebCore::typesForCommonExtension):
        (WebCore::initializeUnsupportedTextMIMETypes):
        (WebCore::MIMETypeRegistry::getNormalizedMIMEType):
        * platform/SchemeRegistry.cpp:
        (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
        * platform/URL.cpp:
        (WebCore::mimeTypeFromDataURL):
        * platform/UserAgentQuirks.cpp:
        (WebCore::UserAgentQuirks::stringForQuirk):
        * platform/cocoa/KeyEventCocoa.mm:
        (WebCore::keyForCharCode):
        * platform/cocoa/NetworkExtensionContentFilter.mm:
        (WebCore::NetworkExtensionContentFilter::unblockHandler const):
        * platform/cocoa/ParentalControlsContentFilter.mm:
        (WebCore::ParentalControlsContentFilter::unblockHandler const):
        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::fileContentState):
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::MacApplication::isSafari):
        (WebCore::MacApplication::isAppleMail):
        (WebCore::MacApplication::isIBooks):
        (WebCore::MacApplication::isITunes):
        (WebCore::MacApplication::isMicrosoftMessenger):
        (WebCore::MacApplication::isAdobeInstaller):
        (WebCore::MacApplication::isAOLInstantMessenger):
        (WebCore::MacApplication::isMicrosoftMyDay):
        (WebCore::MacApplication::isMicrosoftOutlook):
        (WebCore::MacApplication::isQuickenEssentials):
        (WebCore::MacApplication::isAperture):
        (WebCore::MacApplication::isVersions):
        (WebCore::MacApplication::isHRBlock):
        (WebCore::MacApplication::isIAdProducer):
        (WebCore::MacApplication::isSolidStateNetworksDownloader):
        (WebCore::IOSApplication::isMobileMail):
        (WebCore::IOSApplication::isMobileSafari):
        (WebCore::IOSApplication::isWebBookmarksD):
        (WebCore::IOSApplication::isDumpRenderTree):
        (WebCore::IOSApplication::isMobileStore):
        (WebCore::IOSApplication::isSpringBoard):
        (WebCore::IOSApplication::isWebApp):
        (WebCore::IOSApplication::isIBooks):
        (WebCore::IOSApplication::isIBooksStorytime):
        (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
        (WebCore::IOSApplication::isCardiogram):
        (WebCore::IOSApplication::isNike):
        * platform/cocoa/UserAgentCocoa.mm:
        (WebCore::userAgentBundleVersion):
        * platform/gamepad/cocoa/GameControllerGamepad.mm:
        (WebCore::GameControllerGamepad::setupAsExtendedGamepad):
        (WebCore::GameControllerGamepad::setupAsGamepad):
        * platform/graphics/InbandTextTrackPrivateClient.h:
        (WebCore::GenericCueData::toJSONString const):
        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::CDMFactoryFairPlayStreaming::supportsKeySystem):
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::isEqual):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::updateLicense):
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keySystem const):
        * platform/graphics/avfoundation/objc/CDMSessionAVContentKeySession.mm:
        (WebCore::CDMSessionAVContentKeySession::generateKeyRequest):
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.mm:
        (WebCore::CDMSessionAVStreamSession::generateKeyRequest):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::propertyIdToString):
        * platform/graphics/ca/TileController.cpp:
        (WebCore::TileController::tileGridContainerLayerName):
        (WebCore::TileController::zoomedOutTileGridContainerLayerName):
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::toDataURL const):
        (WebCore::dataURL):
        * platform/graphics/cv/VideoTextureCopierCV.cpp:
        (WebCore::VideoTextureCopierCV::initializeContextObjects):
        (WebCore::VideoTextureCopierCV::initializeUVContextObjects):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
        (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
        * platform/graphics/iso/ISOVTTCue.cpp:
        (WebCore::ISOWebVTTCue::toJSONString const):
        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
        (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
        (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::getUnmangledInfoLog):
        * platform/graphics/texmap/TextureMapperContextAttributes.cpp:
        (WebCore::TextureMapperContextAttributes::get):
        * platform/graphics/win/ImageBufferDirect2D.cpp:
        (WebCore::ImageBuffer::toDataURL const):
        (WebCore::ImageDataToDataURL):
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::typesForLegacyUnsafeBindings):
        * platform/gtk/PasteboardHelper.cpp:
        * platform/gtk/PlatformKeyboardEventGtk.cpp:
        (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode):
        (WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode):
        * platform/image-decoders/bmp/BMPImageDecoder.h:
        * platform/image-decoders/gif/GIFImageDecoder.h:
        * platform/image-decoders/ico/ICOImageDecoder.h:
        * platform/image-decoders/jpeg/JPEGImageDecoder.h:
        * platform/image-decoders/png/PNGImageDecoder.h:
        * platform/image-decoders/webp/WEBPImageDecoder.h:
        * platform/ios/Device.cpp:
        (WebCore::deviceName):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
        * platform/ios/PlatformEventFactoryIOS.mm:
        (WebCore::keyForKeyEvent):
        (WebCore::codeForKeyEvent):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::read):
        (WebCore::Pasteboard::addHTMLClipboardTypesForCocoaType):
        * platform/mac/PlatformEventFactoryMac.mm:
        (WebCore::keyForKeyEvent):
        (WebCore::codeForKeyEvent):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::safeTypeForDOMToReadAndWriteForPlatformType):
        * platform/mediastream/MediaConstraints.cpp:
        (WebCore::addDefaultVideoConstraints):
        * platform/mediastream/PeerMediaDescription.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::applyConstraints):
        * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
        (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID):
        * platform/mock/MockRealtimeMediaSource.cpp:
        (WebCore::deviceMap):
        (WebCore::MockRealtimeMediaSource::audioDevices):
        (WebCore::MockRealtimeMediaSource::videoDevices):
        (WebCore::MockRealtimeMediaSource::displayDevices):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::drawText):
        * platform/network/BlobRegistryImpl.cpp:
        (WebCore::BlobRegistryImpl::writeBlobsToTemporaryFiles):
        * platform/network/DataURLDecoder.cpp:
        (WebCore::DataURLDecoder::parseMediaType):
        * platform/network/FormData.cpp:
        (WebCore::FormData::appendMultiPartFileValue):
        * platform/network/HTTPParsers.cpp:
        (WebCore::parseHTTPRequestLine):
        (WebCore::parseHTTPHeader):
        (WebCore::normalizeHTTPMethod):
        * platform/network/ResourceRequestBase.cpp:
        (WebCore::ResourceRequestBase::redirectedRequest const):
        * platform/network/ResourceRequestBase.h:
        (WebCore::ResourceRequestBase::ResourceRequestBase):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::handleDataURL):
        * platform/network/curl/SynchronousLoaderClientCurl.cpp:
        (WebCore::SynchronousLoaderClient::platformBadResponseError):
        * platform/network/win/DownloadBundleWin.cpp:
        (WebCore::DownloadBundle::fileExtension):
        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::SQLiteDatabase::open):
        (WebCore::SQLiteDatabase::setFullsync):
        (WebCore::SQLiteDatabase::maximumSize):
        (WebCore::SQLiteDatabase::pageSize):
        (WebCore::SQLiteDatabase::freeSpaceSize):
        (WebCore::SQLiteDatabase::totalSize):
        (WebCore::SQLiteDatabase::clearAllTables):
        (WebCore::SQLiteDatabase::runVacuumCommand):
        (WebCore::SQLiteDatabase::runIncrementalVacuumCommand):
        (WebCore::SQLiteDatabase::turnOnIncrementalAutoVacuum):
        * platform/sql/SQLiteFileSystem.cpp:
        (WebCore::SQLiteFileSystem::deleteDatabaseFile):
        * platform/text/LocaleICU.cpp:
        (WebCore::LocaleICU::dateFormat):
        (WebCore::getFormatForSkeleton):
        * platform/text/LocaleNone.cpp:
        (WebCore::LocaleNone::dateFormat):
        (WebCore::LocaleNone::monthFormat):
        (WebCore::LocaleNone::shortMonthFormat):
        (WebCore::LocaleNone::timeFormat):
        (WebCore::LocaleNone::shortTimeFormat):
        (WebCore::LocaleNone::dateTimeFormatWithSeconds):
        (WebCore::LocaleNone::dateTimeFormatWithoutSeconds):
        * platform/text/LocaleToScriptMappingDefault.cpp:
        (WebCore::scriptNameToCode):
        (WebCore::localeToScriptCodeForFontSelection):
        * platform/text/TextEncodingRegistry.cpp:
        (WebCore::defaultTextEncodingNameForSystemLanguage):
        * platform/win/FileSystemWin.cpp:
        (WebCore::FileSystem::bundleName):
        * platform/wpe/RenderThemeWPE.cpp:
        (WebCore::RenderThemeWPE::mediaControlsStyleSheet):
        * rendering/RenderMenuList.cpp:
        (RenderMenuList::setText):
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::extraDefaultStyleSheet):
        * svg/SVGComponentTransferFunctionElement.h:
        (WebCore::SVGPropertyTraits<ComponentTransferType>::toString):
        * svg/SVGFEColorMatrixElement.h:
        (WebCore::SVGPropertyTraits<ColorMatrixType>::toString):
        * svg/SVGFECompositeElement.h:
        (WebCore::SVGPropertyTraits<CompositeOperationType>::toString):
        * svg/SVGFEConvolveMatrixElement.h:
        (WebCore::SVGPropertyTraits<EdgeModeType>::toString):
        * svg/SVGFEDisplacementMapElement.h:
        (WebCore::SVGPropertyTraits<ChannelSelectorType>::toString):
        * svg/SVGFEMorphologyElement.h:
        (WebCore::SVGPropertyTraits<MorphologyOperatorType>::toString):
        * svg/SVGFETurbulenceElement.h:
        (WebCore::SVGPropertyTraits<SVGStitchOptions>::toString):
        (WebCore::SVGPropertyTraits<TurbulenceType>::toString):
        * svg/SVGGradientElement.h:
        (WebCore::SVGPropertyTraits<SVGSpreadMethodType>::toString):
        * svg/SVGLocatable.cpp:
        (WebCore::SVGLocatable::getTransformToElement):
        * svg/SVGMarkerTypes.h:
        (WebCore::SVGPropertyTraits<SVGMarkerUnitsType>::toString):
        * svg/SVGMatrixValue.h:
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::SVGSVGElement):
        (WebCore::SVGSVGElement::parseAttribute):
        * svg/SVGTextContentElement.h:
        (WebCore::SVGPropertyTraits<SVGLengthAdjustType>::toString):
        * svg/SVGTextPathElement.h:
        (WebCore::SVGPropertyTraits<SVGTextPathMethodType>::toString):
        (WebCore::SVGPropertyTraits<SVGTextPathSpacingType>::toString):
        * svg/SVGToOTFFontConversion.cpp:
        (WebCore::SVGToOTFFontConverter::appendCFFTable):
        * svg/SVGUnitTypes.h:
        (WebCore::SVGPropertyTraits<SVGUnitTypes::SVGUnitType>::toString):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::toClipPath):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::filenameExtension const):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::userInterfaceDirectionPolicy):
        (WebCore::InternalSettings::systemLayoutDirection):
        * testing/Internals.cpp:
        (WebCore::Internals::areSVGAnimationsPaused const):
        (WebCore::Internals::accessKeyModifiers const):
        (WebCore::Internals::setMediaDeviceState):
        (WebCore::Internals::audioSessionCategory const):
        (WebCore::Internals::systemPreviewRelType):
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDM::sanitizeResponse const):
        (WebCore::MockCDMInstance::updateLicense):
        * testing/MockContentFilter.cpp:
        (WebCore::MockContentFilter::unblockRequestDeniedScript const):
        * testing/MockCredentialsMessenger.cpp:
        (WebCore::MockCredentialsMessenger::~MockCredentialsMessenger):
        (WebCore::MockCredentialsMessenger::makeCredential):
        (WebCore::MockCredentialsMessenger::getAssertion):
        * testing/MockPaymentCoordinator.cpp:
        (WebCore::MockPaymentCoordinator::showPaymentUI):
        * workers/WorkerRunLoop.cpp:
        (WebCore::WorkerRunLoop::debuggerMode):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadSynchronously):
        (WebCore::WorkerScriptLoader::createResourceRequest):
        (WebCore::WorkerScriptLoader::didReceiveData):
        * workers/service/ExtendableEvent.cpp:
        (WebCore::ExtendableEvent::waitUntil):
        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::~FetchEvent):
        (WebCore::FetchEvent::respondWith):
        (WebCore::FetchEvent::promiseIsSettled):
        * workers/service/SWClientConnection.cpp:
        (WebCore::SWClientConnection::clearPendingJobs):
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::postMessage):
        * workers/service/ServiceWorkerClients.cpp:
        (WebCore::ServiceWorkerClients::openWindow):
        (WebCore::ServiceWorkerClients::claim):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::addRegistration):
        (WebCore::ServiceWorkerContainer::getRegistration):
        (WebCore::ServiceWorkerContainer::startScriptFetchForJob):
        * workers/service/ServiceWorkerJob.cpp:
        (WebCore::ServiceWorkerJob::fetchScriptWithContext):
        (WebCore::ServiceWorkerJob::didReceiveResponse):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::update):
        * workers/service/ServiceWorkerWindowClient.cpp:
        (WebCore::ServiceWorkerWindowClient::focus):
        (WebCore::ServiceWorkerWindowClient::navigate):
        * workers/service/context/ServiceWorkerDebuggable.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):
        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::doPushChanges):
        (WebCore::RegistrationDatabase::importRecords):
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::runRegisterJob):
        (WebCore::SWServerJobQueue::runUnregisterJob):
        (WebCore::SWServerJobQueue::runUpdateJob):
        * xml/XMLErrors.cpp:
        (WebCore::createXHTMLParserErrorHeader):
        (WebCore::XMLErrors::insertErrorMessageBlock):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):
        (WebCore::XMLHttpRequest::responseMIMEType const):
        * xml/XMLTreeViewer.cpp:
        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
        * xml/XPathPredicate.cpp:
        (WebCore::XPath::evaluatePredicate):
        * xml/XPathValue.cpp:
        (WebCore::XPath::Value::toString const):
        * xml/parser/CharacterReferenceParserInlines.h:
        (WebCore::consumeCharacterReference):

2018-06-22  Youenn Fablet  <youenn@apple.com>

        Disable WebSocket in WatchOS
        https://bugs.webkit.org/show_bug.cgi?id=186931
        <rdar://problem/39584458>

        Reviewed by Wenson Hsieh.

        Add a runtime flag to enable/disable WebSocket.
        By default, flag is on for all platforms except for WatchOS.

        Test: fast/dom/Window/watchos/websocket/watchos/no-websocket-in-watchos.html

        * Modules/websockets/WebSocket.idl:
        * page/RuntimeEnabledFeatures.cpp:
        (WebCore::RuntimeEnabledFeatures::RuntimeEnabledFeatures):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setWebSocketEnabled):
        (WebCore::RuntimeEnabledFeatures::webSocketEnabled const):

2018-06-22  Woodrow Wang  <woodrow_wang@apple.com>

        SubresourceLoader::didFail() should only log message if state is Initialized
        https://bugs.webkit.org/show_bug.cgi?id=185124

        Reviewed by Daniel Bates.

        Functionality does not change. Moved console logging to be 
        after checking state of subresource loader. We only need to 
        log if the state is initialized. This is consistent with other
        functions in the file. We can also remove a null check for the 
        frame pointer (m_frame). The superclass ResourceLoader constructor
        takes an lvalue reference and initializes m_frame, ensuring
        m_frame cannot be null. It is only set to null by 
        ResourceLoader::releaseResources(), which is only called after the 
        resource finishes loading or fails to load. Thus, in didFail(), 
        m_frame must be non-null when we're logging and up until the end of the function.  

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

2018-06-22  Timothy Hatcher  <timothy@apple.com>

        Corner of two scroll bars is white with dark mode enabled.
        https://bugs.webkit.org/show_bug.cgi?id=186819
        rdar://problem/40434350

        Reviewed by Tim Horton.

        * Configurations/WebCore.xcconfig:
        * WebCore.xcodeproj/project.pbxproj:
        * inspector/InspectorOverlay.cpp:
        (WebCore::InspectorOverlay::paint): Added LocalDefaultSystemAppearance.
        * page/Page.h:
        * platform/ScrollView.cpp:
        (WebCore::ScrollView::paintScrollCorner): Dropped ScrollView argument.
        * platform/ScrollbarTheme.h:
        (WebCore::ScrollbarTheme::paintScrollCorner): Ditto.
        * platform/ScrollbarThemeComposite.cpp:
        (WebCore::ScrollbarThemeComposite::paintScrollCorner): Deleted. Default is the same.
        * platform/ScrollbarThemeComposite.h:
        * platform/mac/LocalDefaultSystemAppearance.h:
        * platform/mac/LocalDefaultSystemAppearance.mm:
        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance): Added recursion early return.
        (WebCore::LocalDefaultSystemAppearance::~LocalDefaultSystemAppearance): Ditto.
        * platform/mac/ScrollbarThemeMac.h:
        * platform/mac/ScrollbarThemeMac.mm:
        (WebCore::ScrollbarThemeMac::paintScrollCorner): Added.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintScrollCorner): Call ScrollbarTheme::paintScrollCorner.
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintContents): Added LocalDefaultSystemAppearance.
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::paintContents): Added LocalDefaultSystemAppearance.
        * rendering/RenderScrollbarTheme.cpp:
        (WebCore::RenderScrollbarTheme::paintScrollCorner): Call ScrollbarTheme::paintScrollCorner.
        * rendering/RenderScrollbarTheme.h:
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::draw): Added LocalDefaultSystemAppearance.

2018-06-22  Tim Horton  <timothy_horton@apple.com>

        Make it possible to add a border around loading or failed-to-load images
        https://bugs.webkit.org/show_bug.cgi?id=186614
        <rdar://problem/39050152>

        Reviewed by Zalan Bujtas.

        Tests: http/tests/images/loading-image-border.html
               http/tests/images/loading-image-no-border.html

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIncompleteImageOutline):
        (WebCore::RenderImage::paintReplaced):
        * rendering/RenderImage.h:
        Factor the missing-image outline out, and - if desired - paint it in
        cases where the image is still loading or otherwise pending, not just
        when the image fails to load.

        * page/Settings.yaml:
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::Backup::Backup):
        (WebCore::InternalSettings::Backup::restoreTo):
        (WebCore::InternalSettings::setIncompleteImageBorderEnabled):
        * testing/InternalSettings.h:
        * testing/InternalSettings.idl:
        Add and expose a setting to enable the feature.

2018-06-22  Brady Eidson  <beidson@apple.com>

        WKURLSchemeHandler doesn't handle sync XHR.
        <rdar://problem/40955884> and https://bugs.webkit.org/show_bug.cgi?id=186902

        Reviewed by Chris Dumez.

        * English.lproj/Localizable.strings:

2018-06-22  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Restore ASSERT_NOT_REACHED() checks in exit fullscreen handler after r231924
        https://bugs.webkit.org/show_bug.cgi?id=186945
        <rdar://problem/37277469>

        Reviewed by Simon Fraser.

        * platform/ios/VideoFullscreenInterfaceAVKit.mm:
        (VideoFullscreenInterfaceAVKit::exitFullscreen):
        (VideoFullscreenInterfaceAVKit::exitFullscreenHandler):
        (VideoFullscreenInterfaceAVKit::cleanupFullscreen):

2018-06-22  Per Arne Vollan  <pvollan@apple.com>

        Unreviewed build fix on Windows.

        * testing/Internals.h:

2018-06-22  Youenn Fablet  <youenn@apple.com>

        Incoming G722 doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=186307
        <rdar://problem/40809745>

        Reviewed by Eric Carlson.

        WebRTC backends usually does the following:
        - Initially call RealtimeIncomingAudioSource with 16KHz data
        - Switch to 48KHz when actual data is decoded.
        We added a check that was discarding any 16KHz data, but in case of G722, the data remains as 16KHz and is then never read.
        The solution is to remove the check that discards 16KHz information.
        We then need to fix a bug in AudioTrackPrivateMediaStreamCocoa that was preventing proper handling of change of audio data configuration.

        Test: webrtc/audio-peer-connection-g722.html

        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
        * platform/mediastream/mac/RealtimeIncomingAudioSourceCocoa.cpp:
        (WebCore::RealtimeIncomingAudioSourceCocoa::OnData):

2018-06-22  Timothy Hatcher  <timothy@apple.com>

        Recalc styles every time defaultAppearance changes.
        https://bugs.webkit.org/show_bug.cgi?id=186866
        rdar://problem/41309805

        Reviewed by Tim Horton.

        * page/Page.cpp:
        (WebCore::Page::setUseSystemAppearance): Added. Recalc styles and update system colors.
        (WebCore::Page::setDefaultAppearance): Added. Ditto.
        * page/Page.h:
        (WebCore::Page::setUseSystemAppearance): Deleted impl.
        (WebCore::Page::setDefaultAppearance): Deleted impl.

2018-06-22  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Avoid sending SELECT_STREAM events when nothing changed
        https://bugs.webkit.org/show_bug.cgi?id=186678

        Reviewed by Philippe Normand.

        This avoid extra work in decodebin3 and should work around a crash
        in decodebin3 when we send spurious SELECT_STREAM in the mediastream
        layout tests.

        GStreamer was also missing safe guards in the GstStream APIs which have been
        added in gstreamer core in 8833ca942ea21c58c0f63822f0e2b61695b39447
        "stream: Add some missing API safe guards".

        Should fix following flakes:
          - fast/mediastream/MediaStream-video-element-track-stop.html
          - fast/mediastream/change-tracks-media-stream-being-played.html

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::enableTrack):

2018-06-22  Michael Catanzaro  <mcatanzaro@igalia.com>

        REGRESSION(r230950): [GTK] WebKit::CoordinatedBackingStoreTile::setBackBuffer(): WebKitWebProcess killed by SIGSEGV (ASSERTION FAILED: it != m_tiles.end())
        https://bugs.webkit.org/show_bug.cgi?id=186206

        Unreviewed manual rollout of r230950

        * platform/graphics/texmap/TextureMapperLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::shouldHaveBackingStore const):

2018-06-20  Darin Adler  <darin@apple.com>

        [Cocoa] Use the isDirectory: variants of NSURL methods more to eliminate unnecessary file system activity
        https://bugs.webkit.org/show_bug.cgi?id=186875

        Reviewed by Anders Carlsson.

        * platform/cocoa/ThemeCocoa.mm:
        (WebCore::passKitBundle): Use isDirectory:YES when creating a URL pointing to a framework,
        since frameworks are directories.

2018-06-22  Miguel Gomez  <magomez@igalia.com>

        [WPE][ThreadedRendering] WPE crashes rendering SVG content when using ThreadedRendering
        https://bugs.webkit.org/show_bug.cgi?id=186914

        Reviewed by Carlos Garcia Campos.

        Add GraphicsContextImpl::clipToImageBuffer() to the interface and the implementors. Forward
        the call to GraphicsContext::clipToImageBuffer() to the implementation if possible in the
        cairo case.

        Covered by existent tests.

        * platform/graphics/GraphicsContextImpl.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::clipToImageBuffer):
        * platform/graphics/cairo/GraphicsContextImplCairo.cpp:
        (WebCore::GraphicsContextImplCairo::clipToImageBuffer):
        * platform/graphics/cairo/GraphicsContextImplCairo.h:
        * platform/graphics/displaylists/DisplayListRecorder.cpp:
        (WebCore::DisplayList::Recorder::clipToImageBuffer):
        * platform/graphics/displaylists/DisplayListRecorder.h:
        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.cpp:
        (Nicosia::CairoOperationRecorder::clipToImageBuffer):
        * platform/graphics/nicosia/cairo/NicosiaCairoOperationRecorder.h:

2018-06-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        [CMake] Generated sources depending on SelectorPseudoClassAndCompatibilityElementMap.in are not regenerated
        https://bugs.webkit.org/show_bug.cgi?id=186911

        Reviewed by Michael Catanzaro.

        This is causing test fullscreen/fullscreen-env.html to fail since it was added in r233066 in the bots that
        didn't start a clean build. The problem is that the CMake command to generate
        SelectorPseudoClassAndCompatibilityElementMap.cpp doesn't depend on
        SelectorPseudoClassAndCompatibilityElementMap.in.

        * CMakeLists.txt:

2018-06-22  Miguel Gomez  <magomez@igalia.com>

        [WPE][ThreadedRendering] WPE crashes rendering some pieces of text when using ThreadedRendering
        https://bugs.webkit.org/show_bug.cgi?id=186886

        Reviewed by Žan Doberšek.

        Modify DisplayList DrawGlyphs element to use a GraphicsContext for replaying. To do so, modify
        GraphicsContext::drawGlyphs() API so it doesn't require a FontCascade, and update all the calls
        to it.

        Covered by existent tests.

        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::drawGlyphBuffer const):
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::drawGlyphs):
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/displaylists/DisplayListItems.cpp:
        (WebCore::DisplayList::DrawGlyphs::apply const):
        * rendering/mathml/MathOperator.cpp:
        (WebCore::MathOperator::paintGlyph):
        (WebCore::MathOperator::paint):
        * rendering/mathml/RenderMathMLToken.cpp:
        (WebCore::RenderMathMLToken::paint):

2018-06-15  Jer Noble  <jer.noble@apple.com>

        Address fullscreen api CSS env feedback
        https://bugs.webkit.org/show_bug.cgi?id=186684

        Reviewed by Simon Fraser.

        Test: fullscreen/fullscreen-env.html

        + Update the phishing alert text to be more explicit about the specific threats
          phishing sites represent.
        + Make the top inset static, rather than dynamic.
        + Add bottom, left, and right insets for completeness.
        + Set the fullscreen animation duration as well as delay.
        + Notify the page when the controls show and hide.

        * English.lproj/Localizable.strings:
        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::selectorText const):
        * css/CSSSelector.h:
        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::checkOne const):
        * css/SelectorCheckerTestFunctions.h:
        (WebCore::matchesFullScreenControlsHiddenPseudoClass):
        * css/SelectorPseudoClassAndCompatibilityElementMap.in:
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::addPseudoClassType):
        * dom/ConstantPropertyMap.cpp:
        (WebCore::ConstantPropertyMap::nameForProperty const):
        (WebCore::ConstantPropertyMap::updateConstantsForFullscreenInsets):
        (WebCore::ConstantPropertyMap::didChangeFullscreenInsets):
        (WebCore::ConstantPropertyMap::setFullscreenAutoHideDuration):
        (WebCore::ConstantPropertyMap::setFullscreenInsetTop): Deleted.
        * dom/ConstantPropertyMap.h:
        * dom/Document.cpp:
        (WebCore::Document::areFullscreenControlsHidden const):
        (WebCore::Document::setFullscreenControlsHidden):
        * dom/Document.h:
        * page/Page.cpp:
        (WebCore::Page::setFullscreenInsets):
        (WebCore::Page::setFullscreenAutoHideDuration):
        (WebCore::Page::setFullscreenControlsHidden):
        (WebCore::Page::setFullscreenInsetTop): Deleted.
        * page/Page.h:
        (WebCore::Page::fullscreenInsets const):
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::setFullscreenInsets):
        (WebCore::Internals::setFullscreenAutoHideDuration):
        (WebCore::Internals::setFullscreenControlsHidden):
        (WebCore::Internals::setFullscreenInsetTop): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2018-06-21  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Page sometimes ends up with an incorrect zoom level after entering fullscreen
        https://bugs.webkit.org/show_bug.cgi?id=186822

        Reviewed by Simon Fraser.

        * dom/Document.cpp:
        (WebCore::Document::setOverrideViewportArguments):
        (WebCore::Document::updateViewportArguments):
        * dom/Document.h:

2018-06-20  Said Abou-Hallawa  <sabouhallawa@apple.com>

        RenderSVGInline has to be inline always regardless of its css display value
        https://bugs.webkit.org/show_bug.cgi?id=186656

        Reviewed by Zalan Bujtas.

        According to https://www.w3.org/TR/SVG2/text.html#TextLayout, the <text>
        element has to be laid out as if it were a block element and any <tspan>,
        <textPath>, <a> and <tref> descendants were inline elements.

        If a css rule, which contains the property "display: block;", is applied
        to any of children of a <text> element, this property has to be ignored.

        We currently ignore this property in RenderSVGInline::updateFromStyle()
        by forcing setInline(true). But we do not do the same thing in 
        RenderTreeBuilder::normalizeTreeAfterStyleChange(). In fact we allow
        making the children of the <text> element to be non-inline. This puts
        the render tree in weired state and causes many assertions to fire while
        laying out RenderSVGText. 

        Test: svg/dom/svg-inline-text-display-block-crash.html

        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::normalizeTreeAfterStyleChange):

2018-06-20  Zalan Bujtas  <zalan@apple.com>

        Do not reuse generated inline renderer for the first letter.
        https://bugs.webkit.org/show_bug.cgi?id=186657
        <rdar://problem/41157892>

        Reviewed by Simon Fraser.

        When the first letter pseudo element is present, we construct a dedicated subtree for its content like this:

        <div><span>foobar</span></div> -> with ::first-letter on the <div>
        DIV RenderBlock
            SPAN RenderInline
                RenderInline (generated wrapper for the first letter content)
                    RenderText (fist letter content)
                RenderText (remaining text content)

        "display: contents" on the <span> forces us not to construct a RenderInline for the <span> (or just come up with a wrapper at best).
        FirstLetter::createRenderers logic needs to check for such cases and pick the correct parent for the first letter subtree accordingly.

        Test: fast/text/first-letter-with-display-contents-crash.html
              imported/w3c/web-platform-tests/css/css-display/display-contents-first-letter-002.html is not crashing anymore either.

        * rendering/updating/RenderTreeBuilderFirstLetter.cpp:
        (WebCore::RenderTreeBuilder::FirstLetter::createRenderers):

2018-06-21  Chris Dumez  <cdumez@apple.com>

        JSPerformanceObserverCallback creates a GC strongly-referenced Function that is never cleaned up
        https://bugs.webkit.org/show_bug.cgi?id=186873
        <rdar://problem/41271574>

        Reviewed by Simon Fraser.

        Add [IsWeakCallback] to PerformanceObserverCallback interface so that the generated
        JSPerformanceObserverCallback uses a JSC::Weak instead of a JSC::Strong to store the
        js function. To keep the function alive, add [JSCustomMarkFunction] to PerformanceObserver
        interface and have its visitAdditionalChildren() visit the callback's js function.
        Finally, because we want the callback to still be called even if the JS does not keep
        the PerformanceObserver wrapper alive, add [CustomIsReachable] to PerformanceObserver
        interface and have its isReachableFromOpaqueRoots() return true if the observer is
        registered (i.e. it may need to call the callback in the future).

        I have confirmed locally, that the Performance / PerformanceObserver / Document
        objects properly get destroyed if I navigate away from a page that had a performance
        observer and trigger a memory pressure warning. Also,
        `notifyutil -p com.apple.WebKit.showAllDocuments` no longer shows the old document.

        Tests: performance-api/performance-observer-callback-after-gc.html
               performance-api/performance-observer-no-document-leak.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSPerformanceObserverCustom.cpp: Added.
        (WebCore::JSPerformanceObserver::visitAdditionalChildren):
        (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
        * bindings/js/ScriptController.cpp:
        * page/PerformanceObserver.cpp:
        (WebCore::PerformanceObserver::disassociate):
        * page/PerformanceObserver.h:
        (WebCore::PerformanceObserver::isRegistered const):
        (WebCore::PerformanceObserver::callback):
        * page/PerformanceObserver.idl:
        * page/PerformanceObserverCallback.h:
        * page/PerformanceObserverCallback.idl:

2018-06-20  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-animations/test_animation-ready.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183830
        <rdar://problem/40997539>

        Reviewed by Dean Jackson.

        The CSS Animations Level 2 spec explains how the Web Animations API and CSS Animations interact and requires
        pending styles changes on the target element of a CSS Animation to be flushed when using a Web Animations API
        on it in order to ensure that any animation- CSS property is accounted for.

        * animation/CSSAnimation.cpp:
        (WebCore::CSSAnimation::bindingsStartTime const):
        (WebCore::CSSAnimation::setBindingsStartTime):
        (WebCore::CSSAnimation::bindingsCurrentTime const):
        (WebCore::CSSAnimation::setBindingsCurrentTime):
        (WebCore::CSSAnimation::bindingsPlayState const):
        (WebCore::CSSAnimation::bindingsPending const):
        (WebCore::CSSAnimation::bindingsReady):
        (WebCore::CSSAnimation::bindingsFinished):
        (WebCore::CSSAnimation::bindingsPlay):
        (WebCore::CSSAnimation::bindingsPause):
        (WebCore::CSSAnimation::flushPendingStyleChanges const):
        * animation/CSSAnimation.h:
        * animation/WebAnimation.h:
        (WebCore::WebAnimation::bindingsPlayState const):
        (WebCore::WebAnimation::bindingsPending const):
        (WebCore::WebAnimation::bindingsReady):
        (WebCore::WebAnimation::bindingsFinished):
        (WebCore::WebAnimation::bindingsPlay):
        (WebCore::WebAnimation::bindingsPause):
        * animation/WebAnimation.idl:

2018-06-21  Jer Noble  <jer.noble@apple.com>

        [Fullscreen] Suspend page (and pause video) while phishing warning is presented
        https://bugs.webkit.org/show_bug.cgi?id=186856
        <rdar://problem/41212444>

        Reviewed by Tim Horton.

        Pause the media element when the page is suspended, and unpause when the page resumes.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::HTMLMediaElement):
        (WebCore::HTMLMediaElement::suspend):
        (WebCore::HTMLMediaElement::resume):
        * html/HTMLMediaElement.h:

2018-06-21  Michael Catanzaro  <mcatanzaro@igalia.com>

        Bad optional access in WebCore::ContentSecurityPolicySource::portMatches
        https://bugs.webkit.org/show_bug.cgi?id=186535

        Reviewed by Daniel Bates.

        Make sure the ports have explicit values before dereferencing them.

        This is hard to test. If the layout test script-src-parsing-implicit-and-explicit-port-number
        continues to pass for WebKitLegacy, then I have at least probably not broken anything. To
        reproduce the crash in a layout test that I can run, I think I would need to implement
        internals.registerDefaultPortForProtocol for modern WebKit, which is too much work for this
        crash. Otherwise, we'd need to run the test server on port 80, which would be unfriendly.

        * page/csp/ContentSecurityPolicySource.cpp:
        (WebCore::ContentSecurityPolicySource::portMatches const):

2018-06-21  Fujii Hironori  <Hironori.Fujii@sony.com>

        [GStreamer] ASSERTION FAILED: end.isValid() in PlatformTimeRanges::add
        https://bugs.webkit.org/show_bug.cgi?id=186880

        Reviewed by Xabier Rodriguez-Calvar.

        Bug 180253 has added assertions the arugments `start` and `end` is
        valid MediaTime in PlatformTimeRanges::add. Since then, some
        LayoutTests fail due to the assertion failure.

        The invalid MediaTime is added into the PlatformTimeRanges in
        MediaPlayerPrivateGStreamer::buffered. Before adding MediaTime,
        original implementation checks MediaTime::operator bool() returns
        true. But, this method returns true if the time value is invalid.
        Then, PlatformTimeRanges::add is called with an invalid MediaTime.

        No new tests (No behavior change).

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::buffered const): Check
        maxTimeLoaded() is valid before adding to `timeRanges`.

2018-06-20  David Kilzer  <ddkilzer@apple.com>

        Fix leaks in WebCore found by clang static analyzer in deep mode
        <https://webkit.org/b/186865>

        Reviewed by Joseph Pecoraro.

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::mapHostNames): Fix leak of an empty NSMutableArray
        during an early return.  RetainPtr<> is not used here since
        a pointer to the NSMutableArray * is passed around.
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
        (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
        Fix leak of a CGDisplayModeRef during an early return.

2018-06-20  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the watchOS build after r233016.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::selectionExtentRespectingEditingBoundary):

        Move this helper out of the ENABLE(DRAG_SUPPORT) guard.

        * page/EventHandler.h:

2018-06-20  Simon Fraser  <simon.fraser@apple.com>

        AnimationList wastes 60KB of vector capacity
        https://bugs.webkit.org/show_bug.cgi?id=186701

        Reviewed by Chris Dumez.

        AnimationList was the second most wasteful call site for Vector capacity on theverge.com,
        wasting almost 60KB. Lists had between 1 and 3 entries, so give AnimationList's vector of
        Animations a min capacity of zero so it doesn't grow in increments of 16.
        
        Also shrink Animation from 88 bytes to 72 bytes by optimizing packing.

        * platform/animation/Animation.cpp:
        (WebCore::Animation::Animation):
        (WebCore::Animation::operator=):
        (WebCore::Animation::animationsMatch const):
        * platform/animation/Animation.h:
        (WebCore::Animation::animationMode const):
        (WebCore::Animation::setAnimationMode):
        * platform/animation/AnimationList.h:

2018-06-20  Simon Fraser  <simon.fraser@apple.com>

        ContentSecurityPolicySourceList wastes 51KB of Vector capacity on cnn.com
        https://bugs.webkit.org/show_bug.cgi?id=186706

        Reviewed by Chris Dumez.

        Make ContentSecurityPolicySourceList::parse() call shrinkToFit() on m_list
        after parsing to eliminate wasted vector capacity.
        
        Shrink ContentSecurityPolicySource down to 40 bytes by optimizing packing.

        * page/csp/ContentSecurityPolicySource.cpp:
        (WebCore::ContentSecurityPolicySource::ContentSecurityPolicySource):
        * page/csp/ContentSecurityPolicySource.h:
        * page/csp/ContentSecurityPolicySourceList.cpp:
        (WebCore::ContentSecurityPolicySourceList::matches const):
        (WebCore::ContentSecurityPolicySourceList::parse):
        (WebCore::ContentSecurityPolicySourceList::matches): Deleted.
        * page/csp/ContentSecurityPolicySourceList.h:

2018-06-20  Megan Gardner  <megan_gardner@apple.com>

        Restrict Selection in contenteditable the extent of that contenteditable
        https://bugs.webkit.org/show_bug.cgi?id=186792

        Reviewed by Wenson Hsieh.

        My system currently will not allow me to run tests. I will add one when I can update.

        Expose the already existing funcitonality to restrict a selection to a single contentenditable

        * page/EventHandler.cpp:
        (WebCore::EventHandler::selectionExtentRespectingEditingBoundary):
        (WebCore::selectionExtentRespectingEditingBoundary): Deleted.
        * page/EventHandler.h:
        * rendering/HitTestResult.h:

2018-06-20  Simon Fraser  <simon.fraser@apple.com>

        CSSFontFace wastes 59KB of Vector capacity on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=186708

        Reviewed by Anders Carlsson.

        Most CSSFontFace have one or two CSSFontFaceSource so don't allocate
        vector capacity in the default 16-size chunks.

        * css/CSSFontFace.h:

2018-06-20  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-transitions/test_element-get-animations.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183841
        <rdar://problem/40998101>

        Reviewed by Dean Jackson.

        We must ignore CSS Animations with "animation-name: none".

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::updateCSSAnimationsForElement):

2018-06-20  Miguel Gomez  <magomez@igalia.com>

        [GTK][ThreadedRendering][Nicosia] Themed elements cannot be rendered using threaded rendering
        https://bugs.webkit.org/show_bug.cgi?id=186840

        Reviewed by Carlos Garcia Campos.

        Disable threaded rendering for GTK port.

        * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
        (Nicosia::PaintingEngine::create):

2018-06-20  Yusuke Suzuki  <utatane.tea@gmail.com>

        [GTK][WPE][Nicosia] Add name for Nicosia Painting Threads
        https://bugs.webkit.org/show_bug.cgi?id=186836

        Reviewed by Carlos Garcia Campos.

        Use "PaintingThread" name.

        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
        (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):

2018-06-19  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-animations/test_pseudoElement-get-animations.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183818
        <rdar://problem/40997015>

        Reviewed by Dean Jackson.

        We add a new opt-in flag to return sorted animations when calling AnimationTimeline::animationsForElement() so that
        Element::getAnimations() can opt into returning animations sorted by the rules defined by the CSS Transitions spec.
        The rule is that CSS Transitions must be sorted prior to CSS Animations and regular Web Animations, and then sorted
        by the time they were generated and, if generated at the same time, sorted alphabetically based on the transitioned
        property. To be able to accomodate this, we add a new generationTime() method to CSSTransition.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::animationsForElement const):
        (WebCore::AnimationTimeline::updateCSSTransitionsForElement):
        * animation/AnimationTimeline.h:
        * animation/CSSTransition.cpp:
        (WebCore::CSSTransition::create):
        (WebCore::CSSTransition::CSSTransition):
        * animation/CSSTransition.h:
        * dom/Element.cpp:
        (WebCore::Element::getAnimations):

2018-06-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Allow passing contents of Root CA data directly.
        https://bugs.webkit.org/show_bug.cgi?id=185782

        Currently the data must be in a file and set by its path. This patch
        allow application to set root CA data by passing binary data directly.

        Reviewed by Yusuke Suzuki.

        No new tests. Tested internally.

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupTransfer):
        * platform/network/curl/CurlSSLHandle.cpp:
        (WebCore::CurlSSLHandle::CurlSSLHandle):
        (WebCore::CurlSSLHandle::getCACertPathEnv):
        (WebCore::CurlSSLHandle::setCACertPath):
        (WebCore::CurlSSLHandle::setCACertData):
        (WebCore::CurlSSLHandle::clearCACertInfo):
        * platform/network/curl/CurlSSLHandle.h:
        (WebCore::CurlSSLHandle::getCipherList const):
        (WebCore::CurlSSLHandle::getSignatureAlgorithmsList const):
        (WebCore::CurlSSLHandle::getCurvesList const):
        (WebCore::CurlSSLHandle::setCipherList):
        (WebCore::CurlSSLHandle::setSignatureAlgorithmsList):
        (WebCore::CurlSSLHandle::setCurvesList):
        (WebCore::CurlSSLHandle::setIgnoreSSLErrors):
        (WebCore::CurlSSLHandle::getCACertInfo const):
        (WebCore::CurlSSLHandle::getCACertPath const): Deleted.
        (WebCore::CurlSSLHandle::setCACertPath): Deleted.
        * platform/network/curl/CurlSSLVerifier.cpp:
        (WebCore::CurlSSLVerifier::CurlSSLVerifier):

2018-06-19  Dean Jackson  <dino@apple.com>

        ARKit badge drop shadow updates its blur radius based on page zoom
        https://bugs.webkit.org/show_bug.cgi?id=186829
        <rdar://problem/40738779>

        Reviewed by Tim Horton.

        We need to make sure the shadow blur radius takes into account the
        current zoom. Thankfully, the GraphicsContext platform code already
        does this, so just use it.

        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::paintSystemPreviewBadge):

2018-06-19  Dean Jackson  <dino@apple.com>

        Blank viewer comes up and then auto-dismisses when device is not connected to Internet
        https://bugs.webkit.org/show_bug.cgi?id=186825
        <rdar://problem/40294170>

        Reviewed by Tim Horton.

        Export isSuccessful() to WebKit.

        * platform/network/ResourceResponseBase.h:

2018-06-19  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Enable Proxy Authentication.
        https://bugs.webkit.org/show_bug.cgi?id=185266

        Add support for Proxy Authentication to curl network layer.

        Reviewed by Alex Christensen.

        No new tests in public. Tested internally.

        * platform/network/curl/AuthenticationChallenge.h:
        * platform/network/curl/AuthenticationChallengeCurl.cpp:
        (WebCore::AuthenticationChallenge::protectionSpaceServerTypeFromURI):
        (WebCore::AuthenticationChallenge::protectionSpaceFromHandle):
        (WebCore::AuthenticationChallenge::determineProxyPort):
        (WebCore::AuthenticationChallenge::authenticationSchemeFromCurlAuth):
        (WebCore::AuthenticationChallenge::parseRealm):
        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::enableProxyIfExists):
        (WebCore::CurlHandle::getProxyUrl):
        (WebCore::CurlHandle::getProxyAuthAvail):
        (WebCore::CurlHandle::getPrimaryPort): Deleted.
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlContext::setDefaultProxyAuthMethod):
        (WebCore::CurlContext::setProxyAuthMethod):
        * platform/network/curl/CurlProxySettings.cpp:
        (WebCore::determineAuthMethod):
        (WebCore::CurlProxySettings::setAuthMethod):
        (WebCore::protocolIsInSocksFamily):
        * platform/network/curl/CurlProxySettings.h:
        (WebCore::CurlProxySettings::setDefaultAuthMethod):
        (WebCore::CurlProxySettings::authMethod const):
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::didReceiveHeader):
        * platform/network/curl/CurlResponse.h:
        (WebCore::CurlResponse::isolatedCopy const):
        * platform/network/curl/ResourceResponse.h:
        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::isProxyAuthenticationRequired const):

2018-06-19  Tim Horton  <timothy_horton@apple.com>

        Unpainted area while scrolling in Reader is white
        https://bugs.webkit.org/show_bug.cgi?id=186541
        <rdar://problem/40471363>

        Reviewed by Timothy Hatcher.

        New test: tiled-drawing/simple-document-with-dynamic-background-color.html

        For platforms that do not use the overhang layer, we depend on
        RenderView's background color to fill unpainted space.

        RenderView's background color is only updated inside updateRootLayerConfiguration,
        and it is possible with a simple enough page to change the document's
        background color without running that code.

        * page/FrameView.cpp:
        (WebCore::FrameView::setTransparent):
        (WebCore::FrameView::setBaseBackgroundColor):
        Make use of the newly added rootBackgroundColorOrTransparencyChanged.

        (WebCore::FrameView::calculateExtendedBackgroundMode const):
        Update a comment, since the function it mentioned is no longer.

        (WebCore::FrameView::updateTilesForExtendedBackgroundMode):
        Remove this code that clears the root extended background color
        if using tiles to extend in both directions. Two reasons:
        1) it seems harmless to also have a root extended background color
        2) this just gets clobbered by the call in RenderView::paintBoxDecorations

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingLayers):
        Add a bit that will do a updateConfiguration() on the root layer if no
        other work needs to be done, so that we can update the root layer's
        transparency or background color without doing a full layer rebuild.

        (WebCore::RenderLayerCompositor::rootOrBodyStyleChanged):
        Make use of the newly added rootBackgroundColorOrTransparencyChanged.

        (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
        Change rootBackgroundTransparencyChanged to also cover color changes.
        Fold setRootExtendedBackgroundColor in here, and make use of
        setRootLayerConfigurationNeedsUpdate() instead of doing a full rebuild.
        Previously, we would bail if the transparency state hadn't changed;
        now, we'll also update the root layer's background color and the
        exposed-to-WebKit extended background color if they change too.

        (WebCore::RenderLayerCompositor::rootBackgroundTransparencyChanged): Deleted.
        (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): Deleted.

        * rendering/RenderLayerCompositor.h:
        Add setRootLayerConfigurationNeedsUpdate, remove setRootExtendedBackgroundColor,
        and add both a bit indicating that the root layer configuration needs updating
        and the cached view background color to make the early return in
        rootBackgroundColorOrTransparencyChanged possible.

        * rendering/RenderView.cpp:
        (WebCore::RenderView::paintBoxDecorations):
        Make use of the newly added rootBackgroundColorOrTransparencyChanged.

2018-06-19  Youenn Fablet  <youenn@apple.com>

        Need to properly handle removal of worker in SWServer::unregisterServiceWorkerClient timer lambda
        https://bugs.webkit.org/show_bug.cgi?id=186674
        <rdar://problem/40974812>

        Reviewed by Chris Dumez.

        While looping over the running workers map and trying to terminate some of the workers,
        there is a chance that the map will be modified synchronously which may affect iterating the map.
        This patch removes that potential threat.

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

2018-06-19  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-animations/test_animation-playstate.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183828
        <rdar://problem/40997469>

        Reviewed by Dean Jackson.

        We need to ensure pending styles have been resolved prior to returning the play state for a CSS Animation since
        it can be controlled by the animation-play-state CSS property. To that end we expose a specific bindings-only
        method which we override for CSSAnimation to force a style update.

        * animation/CSSAnimation.cpp:
        (WebCore::CSSAnimation::bindingsPlayState const):
        * animation/CSSAnimation.h:
        * animation/WebAnimation.h:
        (WebCore::WebAnimation::bindingsPlayState const):
        * animation/WebAnimation.idl:

2018-06-19  David Kilzer  <ddkilzer@apple.com>

        Revert: Add logging when splashboardd enables WebThread
        <https://webkit.org/b/186793>
        <rdar://problem/41213255>

        Turns out this isn't needed, so reverting r232959.

        * platform/RuntimeApplicationChecks.h:
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::IOSApplication::isSplashBoardd): Deleted.
        * platform/ios/wak/WebCoreThread.mm:
        (WebThreadEnable):

2018-06-19  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Vend username text content type when using scribble in login fields
        https://bugs.webkit.org/show_bug.cgi?id=186791
        <rdar://problem/41226935>

        Reviewed by Beth Dakin.

        Expose AutofillElements' autofillable username input element. See WebKit ChangeLog for more details.

        * editing/ios/AutofillElements.h:
        (WebCore::AutofillElements::username const):

2018-06-19  Chris Dumez  <cdumez@apple.com>

        WebCoreNSURLSessionDataTaskClient::redirectReceived() calls WebCore on non-main thread
        https://bugs.webkit.org/show_bug.cgi?id=186805
        <rdar://problem/36960714>

        Reviewed by Youenn Fablet.

        Make sure WebCoreNSURLSessionDataTaskClient::redirectReceived() dispatches to the main
        thread before calling its completion handler. Otherwise, we end up calling into WebCore
        on a NSOperationQueue background thread and we crash.

        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):

2018-06-19  Chris Dumez  <cdumez@apple.com>

        HTTPHeaderMap wastes 226KB of HashTable capacity on cnn.com
        https://bugs.webkit.org/show_bug.cgi?id=186735
        <rdar://problem/41189164>

        Reviewed by Geoffrey Garen.

        Resource requests and responses normally do not have a large amount of HTTP headers
        (local testing shows 6 common headers on average and 0.3 uncommon ones).
        As a result, move the internal representation of HTTPHeaderMap from HashMaps to
        Vectors. Given the number of headers, the impact on performance should be negligible.
        However, the new implementation uses a lot less memory. In a follow-up, we can save
        even more memory by calling HTTPHeaderMap::shrinkToFit() when possible.

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::createAccessControlPreflightRequest):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::responseReceived):
        * loader/cache/CachedRawResource.cpp:
        (WebCore::CachedRawResource::canReuse const):
        * platform/network/HTTPHeaderMap.cpp:
        (WebCore::HTTPHeaderMap::isolatedCopy const):
        (WebCore::HTTPHeaderMap::get const):
        (WebCore::HTTPHeaderMap::set):
        (WebCore::HTTPHeaderMap::add):
        (WebCore::HTTPHeaderMap::append):
        (WebCore::HTTPHeaderMap::addIfNotPresent):
        (WebCore::HTTPHeaderMap::contains const):
        (WebCore::HTTPHeaderMap::remove):
        * platform/network/HTTPHeaderMap.h:
        (WebCore::HTTPHeaderMap::CommonHeader::isolatedCopy const):
        (WebCore::HTTPHeaderMap::CommonHeader::operator== const):
        (WebCore::HTTPHeaderMap::UncommonHeader::isolatedCopy const):
        (WebCore::HTTPHeaderMap::UncommonHeader::operator== const):
        (WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::HTTPHeaderMapConstIterator):
        (WebCore::HTTPHeaderMap::HTTPHeaderMapConstIterator::updateKeyValue):
        (WebCore::HTTPHeaderMap::shrinkToFit):
        (WebCore::HTTPHeaderMap::commonHeaders const):
        (WebCore::HTTPHeaderMap::uncommonHeaders const):
        (WebCore::HTTPHeaderMap::commonHeaders):
        (WebCore::HTTPHeaderMap::uncommonHeaders):
        (WebCore::HTTPHeaderMap::CommonHeader::encode const):
        (WebCore::HTTPHeaderMap::CommonHeader::decode):
        (WebCore::HTTPHeaderMap::UncommonHeader::encode const):
        (WebCore::HTTPHeaderMap::UncommonHeader::decode):
        (WebCore::HTTPHeaderMap::encode const):
        (WebCore::HTTPHeaderMap::decode):
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::ResourceResponseBase::filter):
        (WebCore::ResourceResponseBase::sanitizeHTTPHeaderFields):

2018-06-19  Youenn Fablet  <youenn@apple.com>

        Network Preflights do not show in WebInspector after moving CORS checks to NetworkProcess
        https://bugs.webkit.org/show_bug.cgi?id=186312
        <rdar://problem/40495434>

        Reviewed by Chris Dumez.

        Test: http/wpt/fetch/inspect-preflight.html

        No change of behavior in regular conditions.
        All intermediate requests/responses are now buffered in NetworkProcess if Web inspector shows up.
        Add NetworkLoadInformation and NetworkIntermediateLoadInformation for that purpose.

        Add a new LoaderStrategy method to grab this information from NetworkProcess synchronously.
        Add Internals API for testing the storage by the Network Process and the sending to WebProcess.

        * WebCore.xcodeproj/project.pbxproj:
        * loader/LoaderStrategy.cpp:
        (WebCore::LoaderStrategy::intermediateLoadInformationFromResourceLoadIdentifier):
        * loader/LoaderStrategy.h:
        * platform/network/NetworkLoadInformation.h: Added.
        (WebCore::NetworkTransactionInformation::encode const):
        (WebCore::NetworkTransactionInformation::decode):
        * testing/Internals.cpp:
        (WebCore::Internals::setCaptureExtraNetworkLoadMetricsEnabled):
        (WebCore::Internals::ongoingLoadDescriptions):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-06-19  Antoine Quint  <graouts@apple.com>

        [Web Animations] Make imported/mozilla/css-transitions/test_animation-cancel.html pass reliably
        https://bugs.webkit.org/show_bug.cgi?id=183821
        <rdar://problem/40997034>

        Reviewed by Dean Jackson.

        If an element gets a "display: none" style RenderTreeUpdater::tearDownRenderers() will be called with a RendererUpdateCancelingAnimations
        teardown type on all of its children. We need to ensure all declarative animations, and only those since regular Web Animations should be
        kept active regardless of their target's style, are canceled in this situation.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::cancelDeclarativeAnimationsForElement):
        * animation/AnimationTimeline.h:
        * rendering/updating/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::tearDownRenderers):

2018-06-19  David Kilzer  <ddkilzer@apple.com>

        Add logging when splashboardd enables WebThread
        <https://webkit.org/b/186793>
        <rdar://problem/41213255>

        Reviewed by Daniel Bates.

        * platform/RuntimeApplicationChecks.h:
        (WebCore::IOSApplication::isSplashBoardd): Add declaration.
        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
        (WebCore::IOSApplication::isSplashBoardd): Add implementation.
        * platform/ios/wak/WebCoreThread.mm:
        (WebThreadEnable): Call RELEASE_LOG_FAULT() if this is called by
        splashboardd.

2018-06-19  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE][Nicosia] Add environment variable to enable threaded rendering and set the number of painting threads
        https://bugs.webkit.org/show_bug.cgi?id=186801

        Reviewed by Carlos Garcia Campos.

        Add and environment variable to enable the usage of the threaded renderer and define the number
        of painting threads.

        No new tests.

        * platform/graphics/nicosia/NicosiaPaintingEngine.cpp:
        (Nicosia::PaintingEngine::create):
        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
        (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:

2018-06-19  Youenn Fablet  <youenn@apple.com>

        RTCRtpSender.replaceTrack(null) ends current track
        https://bugs.webkit.org/show_bug.cgi?id=184911
        <rdar://problem/40758138>

        Reviewed by Eric Carlson.

        Before the patch, when replacing the sender track by null, the previous track was stopped.
        Instead of doing that, the track now stays alive and it is the realtime source that is stopped.
        This ensures that the data is no longer sent while the track can still be used elsewhere.

        Covered by updated and rebased tests.

        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTransceiver):
        (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
        (WebCore::RTCPeerConnection::replaceTrack):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::replaceTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::updateTrackSource):
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

2018-06-18  Chris Dumez  <cdumez@apple.com>

        Better pack ResourceRequest
        https://bugs.webkit.org/show_bug.cgi?id=186717

        Reviewed by Darin Adler.

        Better pack ResourceRequest to reduce its size from 240 to 232 bytes
        on Mac.

        * platform/network/ResourceRequestBase.h:

2018-06-18  Antoine Quint  <graouts@apple.com>

        [Web Animations] Implement "Starting of transitions" section from CSS Transitions
        https://bugs.webkit.org/show_bug.cgi?id=186517
        <rdar://problem/41000798>

        Reviewed by Dean Jackson.

        We implement the whole section at https://drafts.csswg.org/css-transitions-1/#starting so that we have spec-compliant starting of CSS Transitions.
        To correctly implement this we now maintain two maps of transitions for a given property, a set of running transitions (m_elementToRunningCSSTransitionByCSSPropertyID)
        and a set of completed transition (m_elementToCompletedCSSTransitionByCSSPropertyID).

        * animation/AnimationTimeline.cpp:
        (WebCore::removeCSSTransitionFromMap): Add a utility to remove a CSSTransition from one of the two HashMap<Element*, HashMap<CSSPropertyID, RefPtr<CSSTransition>>>
        managed by AnimationTimeline (m_elementToRunningCSSTransitionByCSSPropertyID and m_elementToCompletedCSSTransitionByCSSPropertyID).
        (WebCore::AnimationTimeline::animationWasRemovedFromElement): Use the new removeCSSTransitionFromMap() utility.
        (WebCore::AnimationTimeline::updateCSSAnimationsForElement): We rename "oldStyle" to "currentStyle" to align with the naming used by updateCSSAnimationsForElement().
        We also remove an initial check that has been pushed up to Style::TreeResolver::createAnimatedElementUpdate().
        (WebCore::propertyInStyleMatchesValueForTransitionInMap): When running the steps mandated by the spec we often need to check whether a given property has a transition
        in an AnimationList that matches the value used in a given RenderStyle.
        (WebCore::transitionCombinedDuration): We need to compute the combined duration twice while running the steps mandated by the spec, so we have a dedicated utility.
        (WebCore::transitionMatchesProperty): New utility that indicates whether a WebCore::Animation matches a given property, by virtue of targeting it directly, targeting
        a shorthand for which this property is a longhand, or targeting "all".
        (WebCore::AnimationTimeline::updateCSSTransitionsForElement): This is where all of the new implementation for starting transitions happens. We implement the steps
        as they appear in the spec.
        (WebCore::shouldBackingAnimationBeConsideredForCSSTransition): Deleted.
        * animation/AnimationTimeline.h:
        * animation/CSSAnimation.cpp:
        (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation): Since only CSS Animations respect the delay and duration values as parsed directly in a WebCore:Animation
        object, we move code that was previously in DeclarativeAnimation::syncPropertiesWithBackingAnimation to this method. CSS Transitions set those values based on the
        delay and duration parameters passed to CSSTransition::create() and computed in AnimationTimeline::updateCSSTransitionsForElement().
        * animation/CSSTransition.cpp:
        (WebCore::CSSTransition::create): Since the transition's delay and duration is computed in AnimationTimeline::updateCSSTransitionsForElement(), we now require them
        to be passed when creating a CSSTransition and pass those to the new setTimingProperties() function. We also expect a target style and reversing-adjusted start style,
        as well as a reversing-shortening factor.
        (WebCore::CSSTransition::CSSTransition): 
        (WebCore::CSSTransition::resolve): We need to be able to query the last style computed by a call to resolve() from AnimationTimeline::updateCSSTransitionsForElement(),
        we subclass this newly-virtual WebAnimation method and clone the style after we blended the property targeted by this transition.
        (WebCore::CSSTransition::setTimingProperties): Set the transition delay and duration as provided in the call to create().
        (WebCore::CSSTransition::canBeListed const): Fix a crash that was found while working on this bug where we could access a null effect.
        (WebCore::CSSTransition::initialize): Deleted.
        (WebCore::CSSTransition::matchesBackingAnimationAndStyles const): Deleted.
        * animation/CSSTransition.h:
        * animation/DeclarativeAnimation.cpp:
        (WebCore::DeclarativeAnimation::syncPropertiesWithBackingAnimation): This virtual method now has an empty definition since the timing properties are now only set
        for CSSAnimation.
        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::stylesWouldYieldNewCSSTransitionsBlendingKeyframes const): Deleted.
        * animation/KeyframeEffectReadOnly.h:
        * animation/WebAnimation.h:
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::AnimationPropertyWrapperBase::canInterpolate const): Since we need to be able to determine whether some property values can be interpolated, we add a new
        canInterpolate() method to the base wrapper class so the cases where we can't interpolate values (length with an "auto" type) may return false.
        (WebCore::LengthPropertyWrapper::LengthPropertyWrapper): Lengths can only be interpolated if both the start and end values are not "auto".
        (WebCore::LengthVariantPropertyWrapper::LengthVariantPropertyWrapper):
        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
        (WebCore::CSSPropertyAnimation::canPropertyBeInterpolated):
        * page/animation/CSSPropertyAnimation.h:
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate): Move a check found in both updateCSSAnimationsForElement() and updateCSSTransitionsForElement() to their
        shared call site.

2018-06-18  Nan Wang  <n_wang@apple.com>

        AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
        https://bugs.webkit.org/show_bug.cgi?id=186697

        Reviewed by Darin Adler.

        Now that web process doesn't have access to NSScreen. The conversion of the 
        rects is wrong. Fixed this by using the right function that's available in
        WebCore to get the rects.

        * editing/mac/FrameSelectionMac.mm:
        (WebCore::accessibilityConvertScreenRect):

2018-06-18  Youenn Fablet  <youenn@apple.com>

        Expose RTCPeerConnectionIceEventInit constructor
        https://bugs.webkit.org/show_bug.cgi?id=186770

        Reviewed by Alex Christensen.

        Add event constructor as per specification.
        Add support for the url attribute.
        For that purpose, we need to pipe that information from LibWebRTCMediaEndpoint
        up to RTCPeerConnectionIceEvent.

        Covered by rebased test.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::fireICECandidateEvent):
        (WebCore::PeerConnectionBackend::disableICECandidateFiltering):
        (WebCore::PeerConnectionBackend::newICECandidate):
        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
        (WebCore::PeerConnectionBackend::finishedRegisteringMDNSName):
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
        (WebCore::RTCPeerConnectionIceEvent::create):
        (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
        * Modules/mediastream/RTCPeerConnectionIceEvent.h:
        (WebCore::RTCPeerConnectionIceEvent::url const):
        * Modules/mediastream/RTCPeerConnectionIceEvent.idl:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::OnIceCandidate):
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventNames.in:

2018-06-18  Simon Fraser  <simon.fraser@apple.com>

        SVGTransformListValues wastes 127KB of Vector capacity on nytimes.com
        https://bugs.webkit.org/show_bug.cgi?id=186704

        Reviewed by Said Abou-Hallawa.

        SVGTransformListValues has inline capacity 1, and every SVGGraphicsElement has
        a SVGSynchronizableAnimatedProperty<WebCore::SVGTransformListValues>, so the inline
        capacity wastes space for every SVGGraphicsElement that doesn't have a transform (i.e.
        most of them).
        
        So make SVGTransformListValues have zero inline capacity, and set its min capacity to
        2, rather than the default 16, since most transform lists are short.

        * svg/SVGTransformListValues.h:

2018-06-18  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Document should not be mutated under SMILTimeContainer::updateAnimations()
        https://bugs.webkit.org/show_bug.cgi?id=186658

        Reviewed by Simon Fraser.

        To update the animation of an SVG <animate> element, we call
        SVGAnimateElementBase::resetAnimatedType(). It ensures the pointer m_animator
        is valid. If it animates a css property, it calls computeCSSPropertyValue()
        which calls resolveStyle() via other calls. resolveStyle() may call delayed
        callbacks through the destructor of PostResolutionCallbackDisabler. These
        callbacks may fire events. These events may execute JS event handlers.
        If one of these event handlers deletes the same SVG <animate> we animate,
        we will end up calling SVGAnimateElementBase::resetAnimatedPropertyType()
        of the same <animate> element. This function  will delete the same m_animator
        which resetAnimatedType() still holds and will use later. This code
        re-entrance is unexpected and unwanted.

        The fix is to disable mutating the DOM while updating the SVG animations.

        Test: svg/dom/css-animate-input-foucs-crash.html

        * svg/animation/SMILTimeContainer.cpp:
        (WebCore::SMILTimeContainer::updateAnimations):

2018-06-18  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r232935.
        https://bugs.webkit.org/show_bug.cgi?id=186783

        This patch broke macOS 32-bit build (Requested by n_wang on
        #webkit).

        Reverted changeset:

        "AX: [macOS] When zoom is enabled, focus doesn't follow text
        cursor"
        https://bugs.webkit.org/show_bug.cgi?id=186697
        https://trac.webkit.org/changeset/232935

2018-06-18  Nan Wang  <n_wang@apple.com>

        AX: [macOS] When zoom is enabled, focus doesn't follow text cursor
        https://bugs.webkit.org/show_bug.cgi?id=186697

        Reviewed by Darin Adler.

        Now that web process doesn't have access to NSScreen. The conversion of the 
        rects is wrong. Fixed this by using the right function that's available in
        WebCore to convert the rects.

        * editing/mac/FrameSelectionMac.mm:
        (WebCore::accessibilityConvertScreenRect):

2018-06-18  Youenn Fablet  <youenn@apple.com>

        Validate Cross-Origin-Resource-Policy for resources cached in the MemoryCache
        https://bugs.webkit.org/show_bug.cgi?id=186639
        <rdar://problem/41106984>

        Reviewed by Geoffrey Garen.

        Add a method to check CORP.
        Make use of it to validate any memory cached resource.
        Whitelist CORP header so that it is not filtered out by Network Process.

        Test: http/wpt/cross-origin-resource-policy/image-in-iframe-loads.html

        * loader/CrossOriginAccessControl.cpp:
        (WebCore::shouldCrossOriginResourcePolicyCancelLoad):
        (WebCore::validateCrossOriginResourcePolicy):
        * loader/CrossOriginAccessControl.h:
        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::requestResource):
        * platform/network/ResourceResponseBase.cpp:
        (WebCore::isSafeRedirectionResponseHeader):
        (WebCore::isSafeCrossOriginResponseHeader):

2018-06-18  Carlos Alberto Lopez Perez  <clopez@igalia.com>

        [WTF] Remove workarounds needed to support libstdc++-4
        https://bugs.webkit.org/show_bug.cgi?id=186762

        Reviewed by Michael Catanzaro.

        Revert r226299, r226300 r226301 and r226302.

        No new tests, no change in behaviour.

        * platform/graphics/FontSelectionAlgorithm.h:
        (WebCore::FontSelectionValue::clampFloat):
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundationCF::currentMediaTime const):
        * platform/graphics/win/UniscribeController.cpp:
        (WebCore::UniscribeController::shapeAndPlaceItem):

2018-06-18  Karl Leplat  <karl.leplat_ext@softathome.com>

        [Threaded paintingEngine] Fix rendering glitches
        https://bugs.webkit.org/show_bug.cgi?id=186764

        Reviewed by Žan Doberšek.

        * platform/graphics/nicosia/NicosiaPaintingEngineBasic.cpp:
        (Nicosia::PaintingEngineBasic::paint):
        To keep backwards compatibility with no multi-threaded,
        we call Nicosia::Buffer functions beginPainting() and completePainting().


2018-06-18  Tomas Popela  <tpopela@redhat.com>

        Properly check the sscanf return valua
        https://bugs.webkit.org/show_bug.cgi?id=186757

        Reviewed by Carlos Garcia Campos.

        Check if we matched anything and if we matched the expected amount of
        data.

        * page/linux/ResourceUsageThreadLinux.cpp:
        (WebCore::cpuPeriod):

2018-06-18  Tomas Popela  <tpopela@redhat.com>

        [GTK] Wrong variable used in RenderThemeGtk
        https://bugs.webkit.org/show_bug.cgi?id=186756

        Reviewed by Carlos Garcia Campos.

        Use SliderThumbHorizontalPart instead of SliderHorizontalPart.

        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::adjustSliderThumbSize const):

2018-06-18  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] Crash when adding in-band text track with playbin3 enabled
        https://bugs.webkit.org/show_bug.cgi?id=186654

        Reviewed by Xabier Rodriguez-Calvar.

        Text track indexes should be relative to the total amount of
        in-band text tracks. The previous code would induce the creation
        of in-band text tracks with indexes relative to the total amount
        of all in-band (audio, video, text) tracks.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::updateTracks):

2018-06-17  Zalan Bujtas  <zalan@apple.com>

        Anonymous block collapsing can destroy the renderer's parent.
        https://bugs.webkit.org/show_bug.cgi?id=186655
        <rdar://problem/41157554>

        Reviewed by Antti Koivisto.

        While destroying a chain of renderers (text renderer -> first letter renderer), we need to
        check if the anonymous block collapsing destroyed the parent renderer (see webkit.org/b/186746).

        Test: fast/text/first-letter-with-anon-wrapper-crash.html

        * rendering/updating/RenderTreeBuilder.cpp:
        (WebCore::RenderTreeBuilder::destroyAndCleanUpAnonymousWrappers):

2018-06-17  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 3)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Darin Adler.

        Rename references to "Extra zoom mode". No change in behavior.

        * page/DisabledAdaptations.cpp:
        (WebCore::watchAdaptationName):
        (WebCore::extraZoomModeAdaptationName): Deleted.
        * page/DisabledAdaptations.h:
        * page/ViewportConfiguration.cpp:
        (WebCore::needsUpdateAfterChangingDisabledAdaptations):
        (WebCore::ViewportConfiguration::shouldOverrideDeviceWidthAndShrinkToFit const):
        * page/WindowFeatures.cpp:
        (WebCore::parseDisabledAdaptations):
        * testing/Internals.cpp:
        (WebCore::Internals::extraZoomModeAdaptationName const): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

2018-06-17  Youenn Fablet  <youenn@apple.com>

        Rename Document::hasHadActiveMediaStreamTrack to Document::hasHadCaptureMediaStreamTrack
        https://bugs.webkit.org/show_bug.cgi?id=186743
        rdar://problem/41151193

        Reviewed by Eric Carlson.

        Covered by existing tests.

        Rename setter and getter to be more accurate.
        Move the place to call the setter to when creating a capture stream.

        * Modules/mediastream/MediaDevicesRequest.cpp:
        (WebCore::MediaDevicesRequest::start):
        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::statusDidChange):
        * Modules/mediastream/UserMediaRequest.cpp:
        (WebCore::UserMediaRequest::mediaStreamIsReady):
        * dom/Document.h:
        (WebCore::Document::setHasCaptureMediaStreamTrack):
        (WebCore::Document::hasHadCaptureMediaStreamTrack const):
        (WebCore::Document::setHasActiveMediaStreamTrack): Deleted.
        (WebCore::Document::hasHadActiveMediaStreamTrack const): Deleted.

2018-06-17  Zalan Bujtas  <zalan@apple.com>

        [LFC] DisplayBox API should be more clear about height/width vs. contentBoxHeight/width
        https://bugs.webkit.org/show_bug.cgi?id=186744

        Reviewed by Antti Koivisto.

        Display::Box::height/width -> border box size.
        Display::Box::contentBoxHeight/width -> content box size.
        Display::Box::top/left/bottom/right -> border box position in the containing box's coordinate system.
        Display::Box::marginBox/borderBox/paddingBox/contentBox -> relative to border box (border box is { 0, 0 })
 
        (This patch also removes the box-sizing logic from Display::Box. FormattingContext::Geometry should set the
        correct contentBoxSize/borderBoxSize based on the CSS property.)

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
        (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::computedPadding):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::initializeRoot):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::marginBox const):
        (WebCore::Display::Box::borderBox const):
        (WebCore::Display::Box::paddingBox const):
        (WebCore::Display::Box::contentBox const):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::top const):
        (WebCore::Display::Box::left const):
        (WebCore::Display::Box::bottom const):
        (WebCore::Display::Box::right const):
        (WebCore::Display::Box::topLeft const):
        (WebCore::Display::Box::bottomRight const):
        (WebCore::Display::Box::size const):
        (WebCore::Display::Box::width const):
        (WebCore::Display::Box::height const):
        (WebCore::Display::Box::rect const):
        (WebCore::Display::Box::setTopLeft):
        (WebCore::Display::Box::setTop):
        (WebCore::Display::Box::setLeft):
        (WebCore::Display::Box::moveHorizontally):
        (WebCore::Display::Box::moveVertically):
        (WebCore::Display::Box::setHasValidContentHeight):
        (WebCore::Display::Box::setHasValidContentWidth):
        (WebCore::Display::Box::setContentBoxHeight):
        (WebCore::Display::Box::setContentBoxWidth):
        (WebCore::Display::Box::contentBoxHeight const):
        (WebCore::Display::Box::contentBoxWidth const):
        (WebCore::Display::Box::setWidth): Deleted.
        (WebCore::Display::Box::setHeight): Deleted.
        (WebCore::Display::Box::setSize): Deleted.

2018-06-17  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>

        [GTK] Correct behavior for dark themes
        https://bugs.webkit.org/show_bug.cgi?id=186219

        Reviewed by Michael Catanzaro.

        Override RenderThemeGtk::isControlStyled() to not style
        text inputs if color is set different than default.

        No new tests. Manual theme test and existing layout tests already cover it.

        * rendering/RenderThemeGtk.cpp:
        (WebCore::RenderThemeGtk::isControlStyled const):
        * rendering/RenderThemeGtk.h:

2018-06-12  Darin Adler  <darin@apple.com>

        [Cocoa] Make some RetainPtr refinements to get more ready for ARC
        https://bugs.webkit.org/show_bug.cgi?id=186526

        Reviewed by Anders Carlsson.

        * platform/ios/UserAgentIOS.mm:
        (WebCore::deviceNameForUserAgent): Drop unnecessary use of RetainPtr.

        * platform/mac/URLMac.mm:
        (WebCore::URL::operator NSURL * const): Use bridgingAutorelease.

2018-06-16  Chris Dumez  <cdumez@apple.com>

        Better pack ResourceResponse
        https://bugs.webkit.org/show_bug.cgi?id=186718

        Reviewed by Simon Fraser.

        Better pack ResourceResponse to reduce its size on Mac from 632 to 616 bytes.

        * platform/network/ResourceResponseBase.h:

2018-06-15  Chris Dumez  <cdumez@apple.com>

        Better pack MediaQuery
        https://bugs.webkit.org/show_bug.cgi?id=186716

        Reviewed by Simon Fraser.

        Better pack MediaQuery to reduce its size from 48 bytes to 40 and save
        some memory.

        * css/MediaQuery.cpp:
        (WebCore::MediaQuery::MediaQuery):
        * css/MediaQuery.h:

2018-06-15  Chris Dumez  <cdumez@apple.com>

        StyleRuleMedia wastes 158KB of Vector capacity on cnn.com
        https://bugs.webkit.org/show_bug.cgi?id=186705
        <rdar://problem/41173637>

        Reviewed by Simon Fraser.

        Call shrinkToFit on RefPtr<StyleRuleBase> vectors in CSSParserImpl, after we're
        done parsing and before constructing StyleRuleMedia, StyleRuleSupports and
        deferred rules in StyleRuleGroup.

        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::parseDeferredRuleList):
        (WebCore::CSSParserImpl::consumeMediaRule):
        (WebCore::CSSParserImpl::consumeSupportsRule):

2018-06-15  Chris Dumez  <cdumez@apple.com>

        MediaQuerySet wastes a lot of vector capacity
        https://bugs.webkit.org/show_bug.cgi?id=186696
        <rdar://problem/41172850>

        Reviewed by Simon Fraser.

        Call shrinkToFit() on the MediaQuerySet after we're done parsing it
        to avoid wasting memory.

        * css/parser/MediaQueryParser.cpp:
        (WebCore::MediaQueryParser::parseInternal):

2018-06-15  Chris Dumez  <cdumez@apple.com>

        CachedRawResource wastes 57K of Vector capacity
        https://bugs.webkit.org/show_bug.cgi?id=186703
        <rdar://problem/41173515>

        Reviewed by Simon Fraser.

        Use 0 as minimum capacity for CachedRawResource::m_redirectChain, instead of the
        default value of 16. m_redirectChain usually contains very few items so 16 is
        wasteful, especially considering that m_redirectChain contains fairly large
        objects (std::pair<ResourceRequest, ResourceResponse>). CachedRawResource are
        stored in the memory cache so it is important to not use more memory than
        necessary.

        We are also not worried about the performance cost of allocations here since
        this vector is only populated on HTTP redirects.

        * loader/cache/CachedRawResource.h:

2018-06-15  Antti Koivisto  <antti@apple.com>

        Semantic colors should not be transformed by color-filter
        https://bugs.webkit.org/show_bug.cgi?id=186566
        <rdar://problem/40705739>

        Reviewed by Simon Fraser.

        Test: css3/color-filters/color-filter-ignore-semantic.html

        * platform/graphics/Color.h:
        (WebCore::Color::Color):
        (WebCore::Color::isSemantic const):
        (WebCore::Color::setIsSemantic):

        Add a bit to Color to indicate it originated from a semantic color name.
        Note that a color compares unequal to the semantic version of the same color.

        * platform/graphics/filters/FilterOperations.cpp:
        (WebCore::FilterOperations::transformColor const):
        * platform/graphics/mac/ColorMac.h:
        * platform/graphics/mac/ColorMac.mm:
        (WebCore::semanticColorFromNSColor):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::systemColor const):

        Set the bit for semantic system colors.

        * rendering/RenderTreeAsText.cpp:
        (WebCore::RenderTreeAsText::writeRenderObject):

        Fix up the output to avoid unneccary render tree dump changes.

2018-06-15  Chris Dumez  <cdumez@apple.com>

        Add API test coverage for SW RegistrationDatabase destruction and fix issues found by the test
        https://bugs.webkit.org/show_bug.cgi?id=186681

        Reviewed by Brady Eidson.

        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::RegistrationDatabase):
        (WebCore::RegistrationDatabase::importRecords):
        * workers/service/server/RegistrationDatabase.h:
        Rename m_session to m_sessionID for clarity.

        * workers/service/server/RegistrationStore.cpp:
        (WebCore::RegistrationStore::~RegistrationStore):
        Drop bad assertion now that the RegistrationDatabase is refcounted
        and can outlive the RegistrationStore. The RegistrationDatabase will
        take care of closing / destroying the SQLiteDatabase on the background
        thread when destroyed.

2018-06-15  Timothy Hatcher  <timothy@apple.com>

        REGRESSION (r232799): Form controls are blank in dark mode.

        https://bugs.webkit.org/show_bug.cgi?id=186677
        rdar://problem/41162899

        Reviewed by Wenson Hsieh.

        * rendering/RenderThemeMac.mm:
        (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
        Dark mode controls don't have borders, just a semi-transparent background of shadows.
        In the dark mode case we can't disable borders, or we will not paint anything for the control.

2018-06-15  Zalan Bujtas  <zalan@apple.com>

        [LFC] Fix static position left/top
        https://bugs.webkit.org/show_bug.cgi?id=186640

        Reviewed by Antti Koivisto.

        In visual formatting model, we normally go like [top, left] while LayoutPoint takes [x, y]. Let's make this less error prone.

        * layout/FormattingContext.h:
        (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):

2018-06-15  Chris Dumez  <cdumez@apple.com>

        Crash under WebCore::SWServer::registrationStoreImportComplete()
        https://bugs.webkit.org/show_bug.cgi?id=186644
        <rdar://problem/40982257>

        Reviewed by Brady Eidson.

        Fix lifetime management issues with RegistrationDatabase. RegistrationDatabase
        was previously subclassing CrossThreadTaskHandler. CrossThreadTaskHandler
        currently is not safe for objects that can get destroyed (such as
        RegistrationDatabase). This is because it does not keep the object alive
        when going to the background thread or back to the main thread. This would
        cause crashes such as the one in the radar.

        To address the issue, stop subclassing CrossThreadTaskHandler and use a
        simple WorkQueue instead. RegistrationDatabase is now ThreadSafeRefCounted
        and we take care of ref'ing it whenever we dispatch a task to the work queue
        or back to the main thread. Because the RegistrationDatabase can now outlive
        the RegistrationStore, m_store is now a WeakPtr.

        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::RegistrationDatabase):
        (WebCore::RegistrationDatabase::~RegistrationDatabase):
        (WebCore::RegistrationDatabase::postTaskToWorkQueue):
        (WebCore::RegistrationDatabase::openSQLiteDatabase):
        (WebCore::RegistrationDatabase::importRecordsIfNecessary):
        (WebCore::RegistrationDatabase::pushChanges):
        (WebCore::RegistrationDatabase::clearAll):
        (WebCore::RegistrationDatabase::importRecords):
        (WebCore::RegistrationDatabase::addRegistrationToStore):
        (WebCore::RegistrationDatabase::databaseFailedToOpen):
        (WebCore::RegistrationDatabase::databaseOpenedAndRecordsImported):
        * workers/service/server/RegistrationDatabase.h:
        (WebCore::RegistrationDatabase::create):
        * workers/service/server/RegistrationStore.cpp:
        (WebCore::RegistrationStore::RegistrationStore):
        (WebCore::RegistrationStore::~RegistrationStore):
        (WebCore::RegistrationStore::pushChangesToDatabase):
        (WebCore::RegistrationStore::clearAll):
        * workers/service/server/RegistrationStore.h:

2018-06-15  Zalan Bujtas  <zalan@apple.com>

        [LFC] Align compute functions styles.
        https://bugs.webkit.org/show_bug.cgi?id=186649

        Reviewed by Antti Koivisto.

        Improve code readability.

        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):
        (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
        (WebCore::Layout::computedValueIfNotAuto): Deleted.
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):

2018-06-15  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add FormattingContextLayout logging channel
        https://bugs.webkit.org/show_bug.cgi?id=186637

        Reviewed by Antti Koivisto.

        Add some basic layout logging (-WebCoreLogging "FormattingContextLayout").

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):
        (WebCore::Layout::shrinkToFitWidth):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::computedBorder):
        (WebCore::Layout::FormattingContext::Geometry::computedPadding):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):
        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBoxInformationIfNeeded):
        (WebCore::Layout::verifyAndOutputSubtree):
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::outputLayoutBox):
        (WebCore::Layout::outputLayoutTree):
        (WebCore::Layout::TreeBuilder::showLayoutTree):
        (WebCore::Layout::printLayoutTreeForLiveDocuments):
        * layout/layouttree/LayoutTreeBuilder.h:
        * platform/Logging.h:

2018-06-15  Antoine Quint  <graouts@apple.com>

        [Web Animations] CSS Animations should take precedence over CSS Transitions
        https://bugs.webkit.org/show_bug.cgi?id=186651

        Reviewed by Dean Jackson.

        Ensure CSS Animations override CSS Transitions by modifying the order in which animations are returned by animationsForElement().

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::animationsForElement const):

2018-06-14  Youenn Fablet  <youenn@apple.com>

        Make NetworkProcess get cache storage parameters at creation of the CacheStorage engine
        https://bugs.webkit.org/show_bug.cgi?id=186166

        Reviewed by Alex Christensen.

        Covered by existing tests.

        * platform/network/NetworkStorageSession.h:
        (WebCore::NetworkStorageSession::cacheStorageDirectory const): Deleted.
        (WebCore::NetworkStorageSession::setCacheStorageDirectory): Deleted.
        (WebCore::NetworkStorageSession::cacheStoragePerOriginQuota const): Deleted.
        (WebCore::NetworkStorageSession::setCacheStoragePerOriginQuota): Deleted.

2018-06-14  Matt Lewis  <jlewis3@apple.com>

        Unreviewed, rolling out r232823.

        This caused both test timeouts and api failures.

        Reverted changeset:

        "[Mail] Use the Mail Viewer width as the base for resolving
        horizontal viewport units"
        https://bugs.webkit.org/show_bug.cgi?id=186585
        https://trac.webkit.org/changeset/232823

2018-06-14  Nan Wang  <n_wang@apple.com>

        AX: Crash in AccessibilityNodeObject::textUnderElement(WebCore::AccessibilityTextUnderElementMode) const + 536
        https://bugs.webkit.org/show_bug.cgi?id=186629

        Reviewed by Chris Fleizach.

        This crashed when we passed a null node to ancestorsOfType. Fixed it
        by adding a null check.

        Test: accessibility/hidden-object-text-value-crash.html

        * accessibility/AccessibilityNodeObject.cpp:
        (WebCore::AccessibilityNodeObject::textUnderElement const):

2018-06-14  Timothy Hatcher  <timothy@apple.com>

        Expose more semantic system colors.

        https://bugs.webkit.org/show_bug.cgi?id=186609
        rdar://problem/39287277

        Reviewed by Tim Horton.

        Add the following semantic colors:
         -apple-system-control-accent
         -apple-system-even-alternating-content-background
         -apple-system-odd-alternating-content-background
         -apple-system-selected-content-background
         -apple-system-unemphasized-selected-content-background
         -apple-system-selected-text
         -apple-system-unemphasized-selected-text
         -apple-system-selected-text-background
         -apple-system-unemphasized-selected-text-background
         -apple-system-placeholder-text
         -apple-system-find-highlight-background
         -apple-system-separator

        * css/CSSValueKeywords.in:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::systemColor const):

2018-06-14  Eric Carlson  <eric.carlson@apple.com>

        [iOS] WebAVPlayerController isPlayingOnSecondScreen should be declared read-write
        https://bugs.webkit.org/show_bug.cgi?id=186621
        <rdar://problem/40243303>

        Reviewed by Jer Noble.

        * platform/ios/WebAVPlayerController.h:

2018-06-13  Zalan Bujtas  <zalan@apple.com>

        [LFC] Miscellaneous fixes to be able to layout <div> with fixed width/height
        https://bugs.webkit.org/show_bug.cgi?id=186616

        Reviewed by Antti Koivisto.

        1. Move box horizontally/vertically when relevant margin is computed.
        2. Fix isStretchedToViewport() logic and make sure that the width/height is adjusted with the margin when the box is stretchy.
        3. Fix isPaddingApplicable() and add "GenericElement" for elements that don't need special handling.

        With this patch LFC produces the correct geometry for the following content:
        <html><body><div style="width: 100px; height: 100px;"></div></body></html>

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
        (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::isStretchedToViewport):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::staticPosition):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::moveHorizontally):
        (WebCore::Display::Box::moveVertically):
        (WebCore::Display::Box::Rect::setWidth):
        (WebCore::Display::Box::Rect::setHeight):
        (WebCore::Display::Box::Rect::moveHorizontally):
        (WebCore::Display::Box::Rect::moveVertically):
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::isPaddingApplicable const):
        * layout/layouttree/LayoutBox.h:
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::TreeBuilder::createSubTree):

2018-06-13  Chris Dumez  <cdumez@apple.com>

        Crash under SWServer::unregisterConnection(Connection&)
        https://bugs.webkit.org/show_bug.cgi?id=186584
        <rdar://problem/40931680>

        Reviewed by Youenn Fablet.

        The crash was due to SWServer::Connection objects outliving their SWServer, even
        though SWServer::Connection::m_server is a C++ reference. This was possible because
        SWServer does not own the connections, StorageToWebProcessConnection does. This
        started crashing recently, after r232423, because SWServer can get destroyed now.
        The SWServer might get destroyed before the StorageToWebProcessConnection, in which
        case the SWServer::Connection objects will get destroyed later. We were crashing
        because the SWServer::Connection destructor tries to unregister the connection from
        the SWServer (which is dead).

        To address the issue, the SWServer now owns the connections. StorageToWebProcessConnection
        merely has weak pointers to the connections.

        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::Connection::Connection):
        (WebCore::SWServer::addConnection):
        (WebCore::SWServer::removeConnection):
        (WebCore::SWServer::resolveRegistrationReadyRequests):
        * workers/service/server/SWServer.h:
        (WebCore::SWServer::Connection::~Connection):
        (WebCore::SWServer::Connection::server):
        (WebCore::SWServer::connection):
        * workers/service/server/SWServerRegistration.cpp:
        (WebCore::SWServerRegistration::forEachConnection):
        (WebCore::SWServerRegistration::notifyClientsOfControllerChange):
        (WebCore::SWServerRegistration::controlClient):

2018-06-13  Zalan Bujtas  <zalan@apple.com>

        [Mail] Use the Mail Viewer width as the base for resolving horizontal viewport units
        https://bugs.webkit.org/show_bug.cgi?id=186585
        <rdar://problem/30685325>

        Reviewed by Tim Horton.

        Use the existing "override viewport size for viewport units" mechanism to compute the preferred
        viewport unit values for the Mail Viewer html content. 

        Test: fast/dynamic/mail-autosize-viewport-unit.html

        * page/FrameView.cpp:
        (WebCore::FrameView::FrameView):
        (WebCore::FrameView::enableAutoSizeMode):
        (WebCore::FrameView::clearViewportSizeOverrideForCSSViewportUnits):
        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
        (WebCore::FrameView::overrideViewportSizeForCSSViewportUnits):
        (WebCore::FrameView::viewportSizeForCSSViewportUnits const):
        * page/FrameView.h:

2018-06-13  Dean Jackson  <dino@apple.com>

        Disable AR support in WKWebView clients
        https://bugs.webkit.org/show_bug.cgi?id=186611
        <rdar://problem/39544684>

        Reviewed by Jon Lee.

        Since it hasn't been adequately tested, System Preview (AR) should
        be disabled by default for WKWebViews.

        Add a new RuntimeEnabledFeature to control this, and guard for
        this case everywhere we use system previews.

        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::isSystemPreviewLink const):
        (WebCore::HTMLAnchorElement::handleClick):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::isSystemPreviewImage const):
        * html/HTMLPictureElement.cpp:
        (WebCore::HTMLPictureElement::isSystemPreviewImage const):
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setSystemPreviewEnabled):
        (WebCore::RuntimeEnabledFeatures::systemPreviewEnabled const):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):

2018-06-13  Youenn Fablet  <youenn@apple.com>

        Supported plugin check should be based on plugin identifier
        https://bugs.webkit.org/show_bug.cgi?id=186578
        <rdar://problem/40523828>

        Reviewed by Darin Adler.

        Rename SupportedPluginName in SupportedPluginIdentifier.
        Add cross-platform support for plug-in identifier.

        Update built-in PDF plug-in to check its identifier instead of its name.
        This is stronger as the name may change according localization.

        * loader/EmptyClients.cpp:
        * plugins/PluginData.cpp:
        (WebCore::isBuiltInPDFPlugIn):
        (WebCore::PluginData::initPlugins):
        * plugins/PluginData.h:
        (WebCore::operator==):
        (WebCore::isSupportedPlugin):
        (WebCore::SupportedPluginIdentifier::decode):
        (WebCore::SupportedPluginIdentifier::encode const):
        (WebCore::SupportedPluginName::decode): Deleted.
        (WebCore::SupportedPluginName::encode const): Deleted.
        * plugins/PluginInfoProvider.h:

2018-06-13  Chris Dumez  <cdumez@apple.com>

        PSON: http/tests/resourceLoadStatistics/classify-as-prevalent-based-on-top-frame-redirect-collusion.html ASSERTS with process swap enabled
        https://bugs.webkit.org/show_bug.cgi?id=186545

        Reviewed by Brady Eidson.

        Move frame navigation logging for ITP purposes from the WebProcess to the UIProcess.
        This information was previously logged in DocumentLoader::willSendRequest() and was getting
        sync'd to the UIProcess at regular intervals or when the layout tests call testRunner's
        statisticsNotifyObserver(). We now do the logging directly in the UIProcess, in
        WebPageProxy::decidePolicyForNavigationAction (which was getting called via IPC from
        DocumentLoader::willSendRequest()).

        This is more efficient and will also be needed soon due to the way process swap on navigation
        deals with cross-origin redirects. On cross-origin redirect of the main frame, PSON cancels
        the load and started a new load to the redirected to URL in the new WebProcess. As a result,
        the new WebProcess is not aware that the load is a redirect, which is information that ITP
        requires. By moving the ITP logging to the UIProcess, we still have access to this
        information. 

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::willSendRequest):
        Stop logging the navigation now that it is logged in the UIProcess.

        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithDocumentLoader):
        * loader/FrameLoaderClient.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * loader/PolicyChecker.h:
        We now pass the full redirect request to the decidePolicyForNavigationAction
        delegate instead of a simple isRedirect boolean, so that we have the redirect
        response URL in the UIProcess for ITP logging.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::areDomainsAssociated):
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
        * loader/ResourceLoadObserver.h:
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::areDomainsAssociated):
        (WebCore::ResourceLoadStatistics::reduceTimeResolution):
        * loader/ResourceLoadStatistics.h:
        - Remove ResourceLoadObserver::logFrameNavigation() now that it is on the WebResourceLoadStatisticsStore.
        - Move some code from ResourceLoadObserver to ResourceLoadStatistics so that it can
          be called from the UIProcess and to avoid code duplication.

2018-06-13  Mark Lam  <mark.lam@apple.com>

        FloatingPointEnvironment is only needed for ARM CPUs.
        https://bugs.webkit.org/show_bug.cgi?id=186567
        <rdar://problem/40929441>

        Reviewed by Michael Saboff.

        No new tests.  This behavior is already covered by existing tests.

        * platform/ios/wak/FloatingPointEnvironment.cpp:
        * platform/ios/wak/FloatingPointEnvironment.h:
        (WebCore::FloatingPointEnvironment::enableDenormalSupport):
        (WebCore::FloatingPointEnvironment::saveMainThreadEnvironment):
        (WebCore::FloatingPointEnvironment::propagateMainThreadEnvironment):
        (WebCore::FloatingPointEnvironment::singleton):

2018-06-13  Timothy Hatcher  <timothy@apple.com>

        Input form controls have a white background in dark mode, when they should not.

        https://bugs.webkit.org/show_bug.cgi?id=186577
        rdar://problem/39258325

        Reviewed by Tim Horton.

        * DerivedSources.make: Allow WTF_PLATFORM_MAC ifdefs to preprocess in html.css.
        * css/CSSValueKeywords.in: Added -apple-system-control-background.
        * css/MediaQueryExpression.cpp:
        (WebCore::featureWithValidIdent): Allow dark mode media query in user agent stylesheets.
        (WebCore::isFeatureValidWithoutValue): Ditto.
        * css/MediaQueryParserContext.cpp:
        (WebCore::MediaQueryParserContext::MediaQueryParserContext): Transfer the CSSParserMode from CSSParserContext.
        * css/MediaQueryParserContext.h:
        * css/html.css: Set color and background-color to semantic colors for input, textarea, and select.
        Make input background-color transparent in dark mode to match AppKit.
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::systemColor const): Added -apple-system-control-background.
        (WebCore::RenderThemeMac::paintTextField): Adjust the drawing rect to match new artwork in macOS 10.14.

2018-06-13  Said Abou-Hallawa  <sabouhallawa@apple.com>

        TileFirstPaint strategy for async image decoding should be disabled for non root RenderLayers
        https://bugs.webkit.org/show_bug.cgi?id=186336
        <rdar://problem/40808099>

        Reviewed by Simon Fraser.

        When showing a composited RenderLayer for the first time, the images in 
        this layer have to be decoded synchronously to avoid unwanted flashing.

        To create a layout test for this patch, FrameDecodingDurationForTesting
        needs to be generalized for large and animated images. The decoding thread
        now forces the decoding time to be at least equal to 
        FrameDecodingDurationForTesting.

        Test: fast/images/async-image-composited-show.html

        * platform/graphics/BitmapImage.cpp:
        (WebCore::BitmapImage::shouldUseAsyncDecodingForAnimatedImages const):
        (WebCore::BitmapImage::internalStartAnimation):
        (WebCore::BitmapImage::advanceAnimation):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/ImageSource.cpp:
        (WebCore::ImageSource::startAsyncDecodingQueue):
        * platform/graphics/ImageSource.h:
        (WebCore::ImageSource::setFrameDecodingDurationForTesting):
        (WebCore::ImageSource::frameDecodingDurationForTesting const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintLayerContents):

2018-06-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        CSS "background-color" style no longer affects natively rendered text fields
        https://bugs.webkit.org/show_bug.cgi?id=186597
        <rdar://problem/41050528>

        Reviewed by Tim Horton.

        AppKit currently does not support rendering background color to the edges of a text field cell. This means that
        in WebCore, when natively rendering text inputs with background color, we need to only draw the bezels of a text
        field, such that the background color we paint behind the text field will be shown. Currently, the way we
        accomplish this is by intercepting an internal NSTextField method that computes drawing options for CoreUI, and
        inserting a `"borders only" => true` entry.

        However, in a recent build of macOS Mojave, AppKit tweaked -_coreUIDrawOptionsWithFrame:inView:includeFocus: to
        add an extra argument (such that it's now -_coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:), which
        negates the above workaround. To fix this in the short term, augment the workaround to apply to the latest macOS
        Mojave as well. A longer-term fix is already tracked in <rdar://problem/11385461>, which would allow WebKit to
        simply specify a background color on the text field cell, and have AppKit render it properly to the edges of the
        bezels.

        Covered by a test that is currently failing on Mojave: fast/forms/hidpi-textfield-background-bleeding.html

        * rendering/RenderThemeMac.mm:
        (-[WebCoreTextFieldCell _adjustedCoreUIDrawOptionsForDrawingBordersOnly:]):
        (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
        (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:maskOnly:]):

2018-06-13  Thibault Saunier  <tsaunier@igalia.com>

        [WPE] Build getUserMedia support
        https://bugs.webkit.org/show_bug.cgi?id=186547

        Reviewed by Alejandro G. Castro.

        Enable mediastream tests.

        * PlatformWPE.cmake: Build MediaStream support.
        * SourcesGTK.txt: Moved GStreamer related files to GStreamer.cmake.
        * SourcesWPE.txt: Removed `platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp`
        which is now in GStreamer.cmake.
        * platform/GStreamer.cmake: Build more MediaStream/webrtc related files.
        * platform/graphics/ImageBuffer.cpp: Handle the fact that toBGRAData is
        now built directly into the Cairo backend and not GTK anymore.
        * platform/graphics/cairo/ImageBufferCairo.cpp: Implement `toBGRAData`
        * platform/graphics/gtk/ImageBufferGtk.cpp: Removed `toBGRAData` as it is
        now implemented in the Cairo backend itself.
        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Switch an
        ASSERT to RELEASE_ASSERT when adding the GhostPad to itself. This was making
        test fail when built in RELEASE mode.
        (WebCore::webkitMediaStreamSrcChain): Minor variable name change to make it
        more accurate.
        (WebCore::webkitMediaStreamSrcAddPad): Now add the ghost pad to the element
        before setting its chain function, making things clearer.
        (WebCore::webkitMediaStreamSrcSetupSrc): Remove extra new line.

2018-06-13  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] fast/canvas/webgl crashes
        https://bugs.webkit.org/show_bug.cgi?id=186590

        Reviewed by Carlos Alberto Lopez Perez.

        After r232747 the sample managed by the player can be empty,
        without buffer. So we need to check for this before mapping video
        frames. Also use the GstVideoFrameHolder in more places to reduce
        copy-paste churn.

        * platform/graphics/gstreamer/ImageGStreamer.h:
        * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
        (ImageGStreamer::ImageGStreamer):
        (ImageGStreamer::~ImageGStreamer):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
        (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):

2018-06-13  Philippe Normand  <pnormand@igalia.com>

        Unreviewed GTK build fix for --cmakeargs=-DUSE_GSTREAMER_GL=OFF

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::load):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):

2018-06-12  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] Video freezes when GStreamerGL is not installed
        https://bugs.webkit.org/show_bug.cgi?id=184925

        Reviewed by Žan Doberšek.

        At runtime when the GStreamer opengl plugin isn't available the
        player will fallback to the internal WebKit video sink. The
        VideoFrameHolder was refactored to handle both cases (opengl,
        non-opengl).

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::GstVideoFrameHolder::GstVideoFrameHolder):
        (WebCore::GstVideoFrameHolder::~GstVideoFrameHolder):
        (WebCore::GstVideoFrameHolder::frame const):
        (WebCore::GstVideoFrameHolder::updateTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
        (WebCore::GstVideoFrameHolder::isValid const): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerBase::updateTexture): Deleted.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:

2018-06-12  Zalan Bujtas  <zalan@apple.com>

        Complex text handling should opt out of bounded text layout.
        https://bugs.webkit.org/show_bug.cgi?id=186571
        <rdar://problem/41060908>

        Reviewed by Tim Horton.

        Test: fast/text/complex-long-text-crash.html

        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

2018-06-12  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r232774.

        Breaks internal builds.

        Reverted changeset:

        "Complex text handling should opt out of bounded text layout."
        https://bugs.webkit.org/show_bug.cgi?id=186571
        https://trac.webkit.org/changeset/232774

2018-06-12  Ryosuke Niwa  <rniwa@webkit.org>

        iOS WK1: Occasional crash in FrameView::setScrollPosition
        https://bugs.webkit.org/show_bug.cgi?id=186575

        Reviewed by David Kilzer.

        The bug was caused by ScrollView::platformSetScrollPosition releasing the web thread lock
        and DumpRenderTree requesting a new page load thereby destroying FrameView.

        Fixed the crash by keeping FrameView alive while scrollToFocusedElementTimerFired is getting called.

        No new tests since the bug is caught by existing layout tests under guard malloc.

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

2018-06-12  Zalan Bujtas  <zalan@apple.com>

        Complex text handling should opt out of bounded text layout.
        https://bugs.webkit.org/show_bug.cgi?id=186571
        <rdar://problem/40801429>

        Reviewed by Tim Horton.

        Test: fast/text/complex-long-text-crash.html

        * platform/graphics/mac/ComplexTextControllerCoreText.mm:
        (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):

2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        Unreviewed, fix the Windows build after r232757

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):

2018-06-12  Wenson Hsieh  <wenson_hsieh@apple.com>

        REGRESSION(r228724): Occasional crash when executing ReplaceSelectionCommand at the end of the document
        https://bugs.webkit.org/show_bug.cgi?id=186555
        <rdar://problem/39703004>

        Reviewed by Ryosuke Niwa.

        r228724 removed a null check for m_lastNodeInserted in InsertedNodes::pastLastLeaf(). This null check was
        guarding against the case where m_firstNodeInserted might exist, but m_lastNodeInserted is null, which may
        happen when inserting content at the end of the document, since InsertedNodes::willRemoveNodePreservingChildren
        may cause m_lastNodeInserted to be null. This is because the removed node may be at the very end of the document
        _and also_ not have any children, which means that both `node->lastChild()` as well as
        `NodeTraversal::nextSkippingChildren(*node)` will be null.

        After getting into this state, we subsequently crash when attempting to compute InsertedNodes::pastLastLeaf().
        To fix this, avoid accidentally clearing out m_lastNodeInserted; if the last inserted node has neither a child
        nor a next node, seek backwards to the previous node in the DOM instead, and clamp to the first inserted node,
        such that the last inserted node's document position is at or after the first inserted node's position.

        Test: editing/execCommand/insert-apple-style-span-at-document-end.html

        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::InsertedNodes::willRemoveNodePreservingChildren):

2018-06-12  Jianjun Zhu  <jianjun.zhu@intel.com>

        Hash deviceId and groupId of MediaTrackCapabilities.
        https://bugs.webkit.org/show_bug.cgi?id=186471

        Reviewed by Eric Carlson.

        This change makes the identifier for the source of the MediaStreamTrack
        has the same value returned by enumerateDevices(). It also prevents real
        device ID being leaked.

        (WebCore::MediaStreamTrack::getCapabilities const):
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/mediastream/MediaStreamTrack.idl:

2018-06-12  Philippe Normand  <pnormand@igalia.com>

        Unreviewed WPE build fix after r232749.

        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:

2018-06-12  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add vertical margin computation for inflow non-replaced box and for the (10.6.6) complicated cases.
        https://bugs.webkit.org/show_bug.cgi?id=186469

        Reviewed by Antti Koivisto.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

2018-06-12  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] Bump required version to 1.8.3
        https://bugs.webkit.org/show_bug.cgi?id=186558

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/GStreamer.cmake: Remove useless file.
        * platform/audio/gstreamer/WebKitWebAudioSourceGStreamer.cpp:
        (webKitWebAudioSrcChangeState): Remove useless version check.
        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.cpp:
        Removed. createDecryptor() is dead code since the decryptors moved
        to the MSE playback pipeline.
        * platform/graphics/gstreamer/eme/GStreamerEMEUtilities.h:
        (WebCore::GStreamerEMEUtilities::keySystemToUuid):

2018-06-11  Philippe Normand  <philn@igalia.com>

        [GStreamer] flush video sample upon DRAIN query
        https://bugs.webkit.org/show_bug.cgi?id=186481

        Reviewed by Xabier Rodriguez-Calvar.

        Use the appsink sink pad pad probe for both event and drain query
        management. This patch is partially based on
        https://github.com/WebPlatformForEmbedded/WPEWebKit/commit/d3a336523d123119fe1dd53da5d9006c92cf078c
        by Enrique Ocaña González <eocanha@igalia.com>.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
        (WebCore::MediaPlayerPrivateGStreamerBase::createGLAppSink):

2018-06-11  Zalan Bujtas  <zalan@apple.com>

        [LFC] Replace HorizontalGeometry::width and margin with WidthAndMargin (Vertical too)
        https://bugs.webkit.org/show_bug.cgi?id=186556

        Reviewed by Sam Weinig.

        HorizontalGeometry::width and margin -> WidthAndMargin
        VerticalGeometry::height and margin -> HeightAndMargin

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):

2018-06-11  Youenn Fablet  <youenn@apple.com>

        Improve error messages in case FetchEvent.respondWith has a rejected promise
        https://bugs.webkit.org/show_bug.cgi?id=186368

        Reviewed by Chris Dumez.

        Covered by rebased tests.

        Introduce a new error domain for service worker ResourceError.
        Used this domain to log in the console any such error.

        Update FetchEvent implementation to get meaningful error messages for respondWith error cases.
        In particular, convert the rejected promise JS value as a string to populate the error message.

        * loader/SubresourceLoader.cpp:
        (WebCore::SubresourceLoader::didFail):
        * platform/network/ResourceErrorBase.cpp:
        * platform/network/ResourceErrorBase.h:
        * testing/ServiceWorkerInternals.cpp:
        (WebCore::ServiceWorkerInternals::waitForFetchEventToFinish):
        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::~FetchEvent):
        (WebCore::FetchEvent::createResponseError):
        (WebCore::FetchEvent::onResponse):
        (WebCore::FetchEvent::respondWithError):
        (WebCore::FetchEvent::processResponse):
        (WebCore::FetchEvent::promiseIsSettled):
        * workers/service/FetchEvent.h:
        * workers/service/context/ServiceWorkerFetch.cpp:
        (WebCore::ServiceWorkerFetch::processResponse):
        (WebCore::ServiceWorkerFetch::dispatchFetchEvent):

2018-06-11  Chris Dumez  <cdumez@apple.com>

        http/tests/security/xss-DENIED-script-inject-into-inactive-window2.html times out with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=186546

        Reviewed by Brady Eidson.

        Add a hasOpenedFrames flag to NavigationAction, which we'll use in the UIProcess when deciding
        to process swap on navigation or not.

        Test: http/tests/security/xss-DENIED-script-inject-into-inactive-window2-pson.html

        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        * loader/NavigationAction.h:
        (WebCore::NavigationAction::hasOpenedFrames const):
        (WebCore::NavigationAction::setHasOpenedFrames):

2018-06-11  Tim Horton  <timothy_horton@apple.com>

        Link drag image is inconsistently unreadable in dark mode
        https://bugs.webkit.org/show_bug.cgi?id=186472

        Reviewed by Timothy Hatcher.

        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForLink):
        Use LocalDefaultSystemAppearance so that NSColors used inside
        createDragImageForLink are interpreted correctly. This function
        always follows the system appearance regardless of what the preference
        is set to, because it's generating UI that isn't part of the page.

        Use controlBackgroundColor to get a consistently contrasting background
        for the link drag image.

2018-06-11  Chris Dumez  <cdumez@apple.com>

        http/tests/security/cors-post-redirect-307.html fails with PSON enabled
        https://bugs.webkit.org/show_bug.cgi?id=186441

        Reviewed by Brady Eidson.

        When we are continuing a load in a new process, we currently bypass the navigation policy
        check. We now also bypass the adding of headers such as the Origin one since the request
        was already processed in the previous process. This is important because in the case of
        a cross-origin redirect, the previous process has removed the Origin header from the
        request and we do not want the new process to add it again.

        Test: http/tests/security/cors-post-redirect-307-pson.html

        * WebCore.xcodeproj/project.pbxproj:
        * history/BackForwardController.cpp:
        (WebCore::BackForwardController::goBackOrForward):
        (WebCore::BackForwardController::goBack):
        (WebCore::BackForwardController::goForward):
        * loader/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::setShouldTreatAsContinuingLoad):
        (WebCore::FrameLoadRequest::shouldTreatAsContinuingLoad const):
        (WebCore::FrameLoadRequest::setShouldCheckNavigationPolicy): Deleted.
        (WebCore::FrameLoadRequest::shouldCheckNavigationPolicy const): Deleted.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURLIntoChildFrame):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::loadWithNavigationAction):
        (WebCore::FrameLoader::loadWithDocumentLoader):
        (WebCore::FrameLoader::reloadWithOverrideEncoding):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::addExtraFieldsToRequest):
        (WebCore::FrameLoader::addHTTPOriginIfNeeded):
        (WebCore::FrameLoader::loadDifferentDocumentItem):
        (WebCore::FrameLoader::loadItem):
        (WebCore::FrameLoader::retryAfterFailedCacheOnlyMainResourceLoad):
        * loader/FrameLoader.h:
        * loader/HistoryController.cpp:
        (WebCore::HistoryController::goToItem):
        (WebCore::HistoryController::setDefersLoading):
        (WebCore::HistoryController::recursiveGoToItem):
        * loader/HistoryController.h:
        * loader/ShouldTreatAsContinuingLoad.h: Renamed from Source/WebCore/loader/NavigationPolicyCheck.h.
        * page/Page.cpp:
        (WebCore::Page::goToItem):
        * page/Page.h:

2018-06-11  Youenn Fablet  <youenn@apple.com>

        Accept request header values should be more tightly checked after r232572 in case of CORS load
        https://bugs.webkit.org/show_bug.cgi?id=186533
        <rdar://problem/40933880>

        Reviewed by Darin Adler.

        Covered by updated test.

        * platform/network/HTTPParsers.cpp:
        (WebCore::isValidAcceptHeaderValue): Checking that Accept header value conforms with RFC7370.
        If not, this will trigger preflighting for CORS cross origin loads.
        Current checks for Accept-Language and Content-Language are sufficient to ensure values conform with RFC7370.

2018-06-11  Chris Dumez  <cdumez@apple.com>

        Crash under com.apple.WebKit.Networking at WebCore: WebCore::NetworkStorageSession::hasStorageAccess const
        https://bugs.webkit.org/show_bug.cgi?id=186433
        <rdar://problem/40750907>

        Reviewed by Geoffrey Garen.

        Do some hardening in NetworkStorageSession::hasStorageAccess() to make sure
        we do not try and do a HashMap lookup with a null firstPartyDomain, as this
        would crash.

        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::hasStorageAccess const):

2018-06-11  Zalan Bujtas  <zalan@apple.com>

        [LFC] Remove redundant position functions for out-of-flow elements
        https://bugs.webkit.org/show_bug.cgi?id=186525

        Reviewed by Antti Koivisto.

        Position is computed as part of the Horizontal/Vertical geometry computation.
        (see outOfFlow(Non)ReplacedHorizontalGeometry/outOfFlow(Non)ReplacedVerticalGeometry functions)

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowPosition const): Deleted.
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::outOfFlowNonReplacedPosition): Deleted.
        (WebCore::Layout::outOfFlowReplacedPosition): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowPosition): Deleted.

2018-06-11  Zalan Bujtas  <zalan@apple.com>

        [LFC] Merge top, bottom, height and vertical margin computation for out-of-flow replaced elements
        https://bugs.webkit.org/show_bug.cgi?id=186524

        Reviewed by Antti Koivisto.

        Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-height
        (10.6.5 Absolutely positioned, replaced elements)

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):

2018-06-11  Zalan Bujtas  <zalan@apple.com>

        [LFC] Merge left, right, width and horizontal margin computation for out-of-flow replaced elements
        https://bugs.webkit.org/show_bug.cgi?id=186475

        Reviewed by Antti Koivisto.

        Implement https://www.w3.org/TR/CSS22/visudet.html#abs-replaced-width
        (10.3.8 Absolutely positioned, replaced elements)

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::computedValueIfNotAuto):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.

2018-06-11  Zalan Bujtas  <zalan@apple.com>

        [LFC] Merge left, right, width and horizontal margin computation for out-of-flow non-replaced elements
        https://bugs.webkit.org/show_bug.cgi?id=186474

        Reviewed by Antti Koivisto.

        Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-width 
        (10.3.7 Absolutely positioned, non-replaced elements)

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowWidthAndMargin const): Deleted.
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedWidthAndMargin): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedWidthAndMargin): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowWidthAndMargin): Deleted.

2018-06-10  Zalan Bujtas  <zalan@apple.com>

        [LFC] Merge top, bottom, height and vertical margin computation for out-of-flow non-replaced elements
        https://bugs.webkit.org/show_bug.cgi?id=186476

        Reviewed by Antti Koivisto.

        Implement https://www.w3.org/TR/CSS22/visudet.html#abs-non-replaced-height
        (10.6.4 Absolutely positioned, non-replaced elements)

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const): Deleted.
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::computedValueIfNotAuto):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin): Deleted.

2018-06-10  Carlos Garcia Campos  <cgarcia@igalia.com>

        [GTK][WPE] Add API run run javascript from a WebKitWebView in an isolated world
        https://bugs.webkit.org/show_bug.cgi?id=186192

        Reviewed by Michael Catanzaro.

        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::executeScriptInWorld): Add ExceptionDetails parameter.
        * bindings/js/ScriptController.h:

2018-06-10  Michael Catanzaro  <mcatanzaro@igalia.com>

        [WPE][GTK] paypal.com requires user agent quirk
        https://bugs.webkit.org/show_bug.cgi?id=186466

        Reviewed by Carlos Garcia Campos.

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

2018-06-09  Dan Bernstein  <mitz@apple.com>

        [Xcode] Clean up and modernize some build setting definitions
        https://bugs.webkit.org/show_bug.cgi?id=186463

        Reviewed by Sam Weinig.

        * Configurations/Base.xcconfig: Removed definition for macOS 10.11.
        * Configurations/DebugRelease.xcconfig: Ditto.
        * Configurations/FeatureDefines.xcconfig: Simplified the definitions of ENABLE_APPLE_PAY and
          ENABLE_VIDEO_PRESENTATION_MODE now macOS 10.12 is the earliest supported version.
        * Configurations/Version.xcconfig: Removed definition for macOS 10.11.
        * Configurations/WebCore.xcconfig: Simplified the definition of WK_PRIVATE_FRAMEWORKS_DIR
          now that WK_XCODE_SUPPORTS_TEXT_BASED_STUBS is true for all supported Xcode versions.
        * Configurations/WebKitTargetConditionals.xcconfig: Removed definitions for macOS 10.11.

2018-06-09  Dan Bernstein  <mitz@apple.com>

        Added missing file references to the Configuration group.

        * WebCore.xcodeproj/project.pbxproj:

2018-06-09  Zalan Bujtas  <zalan@apple.com>

        REGRESSION (r230480): Cannot adjust photo position on LinkedIn's profile page
        https://bugs.webkit.org/show_bug.cgi?id=186464
        <rdar://problem/40369448>

        Reviewed by Simon Fraser.

        The optimization logic for skipping image layout when we only need overflow computation should check if the image actually needs
        simplified layout only. The needsSimplifiedNormalFlowLayout() flag means that the overflow information needs to be updated but
        it does not mean that overflow is the only property that we need to recompute.

        Test: fast/images/positioned-image-when-transform-is-present.html

        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::layout):
        * rendering/RenderObject.h:
        (WebCore::RenderObject::needsSimplifiedNormalFlowLayoutOnly const):

2018-06-09  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(macOS Mojave): move-by-word-visually-multi-line.html fails
        https://bugs.webkit.org/show_bug.cgi?id=186454

        Reviewed by Darin Adler.

        Like r232635, this patch fixes a selection test failure caused by the change in ICU's behavior in macOS Mojave,
        which caused isWordTextBreak to return true in more cases.

        In this particular failing test case, previousTextOrLineBreakBox and nextTextOrLineBreakBox were failing to find
        an inline text box when it found an inline box for a BR, which was mentioned by an existing FIXME comment.
        Consequently, visualWordPosition were erroneously detecting the end of a word followed by a blank line created by
        a BR as a valid word boundary to move when the Windows editing behavior is enacted.

        Addressed the FIXME comment by finding the next inline text box skipping all inline boxes for BRs. Renamed
        misleadingly named previousBoxInDifferentBlock and nextBoxInDifferentBlock to previousBoxInDifferentLine and
        nextBoxInDifferentLine respectively, and set them to true as they're really indicating whether line boxes
        belong to a distinct line or not; whether an inline box belong to two (render) blocks or not is irrelevant.

        Finally, this patch fixes a bug in visualWordPosition that it was failing to skip blank lines when a word break is
        found as we traversed past a line break. In those cases, we must skip all line breaks before stopping.

        Tests: editing/selection/move-by-word-visually-mac.html
               editing/selection/move-by-word-visually-multi-line.htm

        * editing/VisibleUnits.cpp:
        (WebCore::CachedLogicallyOrderedLeafBoxes::previousTextOrLineBreakBox):
        (WebCore::CachedLogicallyOrderedLeafBoxes::nextTextOrLineBreakBox):
        (WebCore::CachedLogicallyOrderedLeafBoxes::boxIndexInLeaves const):
        (WebCore::logicallyPreviousBox):
        (WebCore::logicallyNextBox):
        (WebCore::wordBreakIteratorForMinOffsetBoundary):
        (WebCore::wordBreakIteratorForMaxOffsetBoundary):
        (WebCore::visualWordPosition):

2018-06-09  Zalan Bujtas  <zalan@apple.com>

        [LFC] MarginCollapse functions should be able to resolve non-fixed margin values
        https://bugs.webkit.org/show_bug.cgi?id=186461

        Reviewed by Antti Koivisto.

        We need the containing block's computed width to resolve vertical and horizontal margins.

        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
        (WebCore::Layout::collapsedMarginTopFromFirstChild): Deleted.
        (WebCore::Layout::nonCollapsedMarginTop): Deleted.

2018-06-08  Darin Adler  <darin@apple.com>

        [Cocoa] Remove all uses of NSAutoreleasePool as part of preparation for ARC
        https://bugs.webkit.org/show_bug.cgi?id=186436

        Reviewed by Anders Carlsson.

        * bridge/objc/objc_class.mm: Use import instead of include.

        * bridge/objc/objc_instance.h: Replaced _pool member to hold an object with
        m_autoreleasePool member to hold a token from objc_autoreleasePoolPush. Also
        initialize all data members here in the class definition.

        * bridge/objc/objc_instance.mm:
        (ObjcInstance::ObjcInstance): Moved most initialization to class definition.
        (ObjcInstance::virtualBegin): Use objc_autoreleasePoolPush instead of
        NSAutoreleasePool class.
        (ObjcInstance::virtualEnd): Use objc_autoreleasePoolPop.

        * bridge/objc/objc_runtime.mm: Use import instead of include.
        * bridge/objc/objc_utility.mm: Ditto.

        * platform/audio/mac/AudioBusMac.mm:
        (WebCore::AudioBus::loadPlatformResource): Use @autoreleasepool.

        * platform/ios/wak/WebCoreThread.mm: Re-sorted includes. Removed declaration of
        autorelease pool SPI and use FoundationSPI.h instead.

        * platform/network/cocoa/ResourceResponseCocoa.mm:
        (WebCore::ResourceResponse::platformLazyInit): Use @autoreleasepool.

2018-06-08  Wenson Hsieh  <wenson_hsieh@apple.com>

        [WebKit on watchOS] Upstream watchOS source additions to OpenSource (Part 1)
        https://bugs.webkit.org/show_bug.cgi?id=186442
        <rdar://problem/40879364>

        Reviewed by Tim Horton.

        No change in behavior.

        * Configurations/FeatureDefines.xcconfig:
        * page/DisabledAdaptations.cpp:
        (WebCore::extraZoomModeAdaptationName):

2018-06-08  Per Arne Vollan  <pvollan@apple.com>

        Only display refresh monitors having requested display refresh callback should get notified on screen updates.
        https://bugs.webkit.org/show_bug.cgi?id=186397
        <rdar://problem/40897835>

        Reviewed by Brent Fulgham.

        Since all display refresh monitors in the WebContent process share a single UI process display link,
        we should make sure that only the monitors having requested callback are getting notified on screen
        updates. I have not been able to reproduce a case where a monitor is being notified without having
        requested updates, but we should safeguard the code for future code changes.

        No new tests, since this is a safeguarding measure.

        * platform/graphics/DisplayRefreshMonitor.h:
        (WebCore::DisplayRefreshMonitor::hasRequestedRefreshCallback const):
        * platform/graphics/DisplayRefreshMonitorManager.cpp:
        (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):

2018-06-07  Jer Noble  <jer.noble@apple.com>

        REGRESSION:  Cannot listen to audio on Google Translate with side switch set to "vibrate"
        https://bugs.webkit.org/show_bug.cgi?id=186415
        <rdar://problem/40584651>

        Reviewed by Eric Carlson.

        Test: platform/mac/media/audio-session-category-audio-autoplay.html

        Make sure that the PlatformMediaSession's state has already been set when calling updateSessionStates().

        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::PlatformMediaSession::setState):
        * platform/audio/PlatformMediaSessionManager.cpp:
        (WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
        (WebCore::PlatformMediaSessionManager::sessionStateChanged):

2018-06-08  Dean Jackson  <dino@apple.com>

        'setRenderPipelineState:' is unavailable: not available on iOS
        https://bugs.webkit.org/show_bug.cgi?id=186449
        <rdar://problem/40880602>

        Reviewed by Simon Fraser.

        Be more explicit about the protocol type to avoid
        the compiler getting confused by a similar signature.

        * platform/graphics/cocoa/GPURenderCommandEncoderMetal.mm:
        (WebCore::GPURenderCommandEncoder::setRenderPipelineState):

2018-06-08  Darin Adler  <darin@apple.com>

        Fix iOS build.

        * platform/ios/QuickLookSoftLink.mm: Removed QLPreviousScheme, which I said I did in the
        change log but looks like it didn't happen.

2018-06-08  Darin Adler  <darin@apple.com>

        [Cocoa] Make more of our soft linking ARC-compatible
        https://bugs.webkit.org/show_bug.cgi?id=186437

        Reviewed by Daniel Bates.

        * editing/cocoa/DataDetection.mm:
        (WebCore::removeResultLinksFromAnchor): Fix comment referring to unused constant DDURLScheme.

        * platform/cocoa/DataDetectorsCoreSoftLink.h: Removed unused DDURLScheme.
        * platform/cocoa/DataDetectorsCoreSoftLink.mm: Ditto.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        Use SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
        SOFT_LINK_POINTER_OPTIONAL. Required moving iOS-specific items inside the
        #if PLATFORM(IOS) section.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Use the
        canLoad functions instead of checking for null to handle possibly-missing string constants.
        (WebCore::metadataType): Ditto.

        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm: Removed unused
        AVMediaTypeVideo, AVMediaTypeAudio, and AVMediaTypeText soft linking.

        * platform/ios/QuickLook.mm:
        (WebCore::isQuickLookPreviewURL): Removed unneeded assertion.

        * platform/ios/QuickLookSoftLink.h: Removed unneeded QLPreviousScheme, which was used only
        for an assertion, one we can do without.
        * platform/ios/QuickLookSoftLink.mm: Ditto.

        * platform/mediastream/mac/AVVideoCaptureSource.mm: Removed unused soft linking of
        AVCaptureVideoPreviewLayer class and AVCaptureSessionPresetLow string constant. Use
        SOFT_LINK_CONSTANT_MAY_FAIL for NSString constants instead of using
        SOFT_LINK_POINTER_OPTIONAL.
        (WebCore::AVVideoCaptureSource::initializeCapabilities): Use the canLoad functions
        instead of checking for null to handle possibly-missing string constants.
        (WebCore::sizeForPreset): Ditto.
        (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Ditto.

2018-06-08  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist] Allow TextFieldInputType to show and hide suggestions
        https://bugs.webkit.org/show_bug.cgi?id=186151

        Reviewed by Tim Horton.

        TextFieldInputTypes with a list attribute should be able to display suggestions as the user
        interacts with the input field. In order to display suggestions for an input field with a list
        attribute, we need provide certain information - including the items to suggest and the location
        to present the suggestions. TextFieldInputType can now provide this information by conforming to
        the DataListSuggestionsClient interface.

        In this initial patch, the suggestions can be shown in two ways. The first is by clicking on the
        input field. The other is by typing text in the field. In a later patch, we will add a third way
        to display suggestions, using a button. These ways to activate the suggestions are enumerated in
        DataListSuggestionInformation.

        We hide the suggestions if there are no more to show, or if the input has blurred.

        Tests to be added once work has been done in the UIProcess.

        * WebCore.xcodeproj/project.pbxproj:
        * html/DataListSuggestionInformation.h: Added. Contains the information necessary to display suggestions.
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::~TextFieldInputType):
        (WebCore::TextFieldInputType::handleClickEvent): Show suggestions when the element is clicked.
        (WebCore::TextFieldInputType::handleKeydownEvent): Allow users to interact with the suggestions using the keyboard.
        (WebCore::TextFieldInputType::elementDidBlur): Hide the suggestions.
        (WebCore::TextFieldInputType::shouldRespectListAttribute):
        (WebCore::TextFieldInputType::didSetValueByUserEdit): Update the suggestions if the text has changed.
        (WebCore::TextFieldInputType::elementRectRelativeToRootView const): Provide the location where the suggestions should be shown.
        (WebCore::TextFieldInputType::suggestions const): Provide the list of suggestions.
        (WebCore::TextFieldInputType::didSelectDataListOption): Update the text once an suggestion has been selected.
        (WebCore::TextFieldInputType::didCloseSuggestions):
        (WebCore::TextFieldInputType::displaySuggestions):
        (WebCore::TextFieldInputType::closeSuggestions):
        * html/TextFieldInputType.h:
        * loader/EmptyClients.cpp:
        (WebCore::EmptyChromeClient::createDataListSuggestionPicker):
        * loader/EmptyClients.h:
        * page/Chrome.cpp:
        (WebCore::Chrome::createDataListSuggestionPicker):
        * page/Chrome.h:
        * page/ChromeClient.h:
        * platform/DataListSuggestionPicker.h: Added.
        (WebCore::DataListSuggestionPicker::close):
        (WebCore::DataListSuggestionPicker::handleKeydownWithIdentifier):
        (WebCore::DataListSuggestionPicker::displayWithActivationType):
        * platform/DataListSuggestionsClient.h: Added.

2018-06-07  Ryosuke Niwa  <rniwa@webkit.org>

        REGRESSION(macOS Mojave): move-by-word-visually-inline-block-positioned-element.html fails
        https://bugs.webkit.org/show_bug.cgi?id=186424

        Reviewed by Wenson Hsieh.

        The test failure is ultimately caused by the change in ICU's behavior. With the CPU in the latest macOS Mojave,
        ubrk_getRuleStatus returns 200 / UBRK_WORD_LETTER at the end of a buffer given to UBreakIterator. This caused
        isWordTextBreak to return true instead of false in isLogicalStartOfWord at the end of the buffer.

        This ICU behavior shouldn't have caused a problem in theory. However, WebKit had a bug in visualWordPosition which
        caused UBreakIterator to not include the succeeding word when traversing words to the left (backwards in LTR text)
        at the beginning of the last block element with exactly one line box after an non-statically positioned element.

        In this case, visualWordPosition invokes wordBreakIteratorForMaxOffsetBoundary (because adjacentCharacterPosition
        is now at the end of the last word in the non-statically positioned element) to setup UBreakIterator. Because
        there are no line boxes left in the current line (in the last block element with exactly one line box),
        logicallyNextBox enters the while loop and invoke nextRootInlineBoxCandidatePosition to find the next root line box.
        However, the visible position given to this function is at the beginning of the first word in the block element.
        As a result, nextRootInlineBoxCandidatePosition skips over this entire line and finds no line box after the one
        we had in the non-statically positioned element.

        Let us consider the following concrete example in which a position: static div is followed by another div, and each
        div contains text nodes "hello" and "world" respectively:
        - div position: static (1)
            - "hello"
        - div (2)
            - "world"
        Suppose we're at the offset 0 of "world", and trying to move to the left. In this case, adjacentCharacterPosition is
        at offset 5 of "world". The next line box should be that of "world". However, because we invoke logicallyNextBox via
        wordBreakIteratorForMaxOffsetBoundary with the visible position at offset 0 of "world", it skips this line and return
        nullptr.

        This patch addresses this test failure by fixing visualWordPosition by passing adjacentCharacterPosition (at offset 5
        of "hello") as the visible position to find the next text box so that nextRootInlineBoxCandidatePosition invoked in
        logicallyNextBox would not skip the line ("world") from which we started the traversal to find the next line box.

        Tests: editing/selection/move-by-word-visually-inline-block-positioned-element.html

        * editing/VisibleUnits.cpp:
        (WebCore::visualWordPosition):

2018-06-08  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION (r230930): Link drag image is very blurry
        https://bugs.webkit.org/show_bug.cgi?id=186435
        <rdar://problem/40797202>

        Reviewed by Tim Horton.

        Tell NSImage the proper display scale factor it needs when performing a 'lockFocus' by passing
        the correct scaling transform as an NSImageHintCTM.

        I reviewed the other drag operations (selection, image, and attachment) and confirmed through
        manual testing that these operations already properly scale the images. It appears that links
        were the only place where we relied on NSImage to determine and use the relevant device scale
        factor.

        * SourcesCocoa.txt: Add new WebKitNSImageExtras.mm file.
        * WebCore.xcodeproj/project.pbxproj: Update for new files.
        * platform/graphics/mac/WebKitNSImageExtras.h: Added.
        * platform/graphics/mac/WebKitNSImageExtras.mm: Added.
        (-[NSImage _web_lockFocusWithTransform:]): Helper method that takes a device scale factor, creates the
        relevant scaling NSAffineTransform and passes it to the internal NSImage 'lockFocusWithRect' as the
        NSImageHintCTM hint.
        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForLink): Use the new helper function.

2018-06-08  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add vertical margin computation for inline, block-level, inline-block and floating replaced elements
        https://bugs.webkit.org/show_bug.cgi?id=186432

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin): Use the computed non-auto values when margin is not auto.
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedHorizontalMarginValue):
        (WebCore::Layout::FormattingContext::Geometry::computedNonCollapsedVerticalMarginValue):

2018-06-07  Yusuke Suzuki  <utatane.tea@gmail.com>

        [WTF] Add WorkerPool
        https://bugs.webkit.org/show_bug.cgi?id=174569

        Reviewed by Carlos Garcia Campos.

        We start using WorkerPool for NicosiaPaintingEngineThreaded instead of glib thread pool.
        This makes NicosiaPaintingEngineThreaded platform-independent and usable for WinCairo.

        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
        (Nicosia::PaintingEngineThreaded::PaintingEngineThreaded):
        (Nicosia::PaintingEngineThreaded::~PaintingEngineThreaded):
        (Nicosia::PaintingEngineThreaded::paint):
        (Nicosia::s_threadFunc): Deleted.
        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:

2018-06-08  Miguel Gomez  <magomez@igalia.com>

        [GTK][WPE] Wrong result when calling ImageBufferCairo's getImageData()
        https://bugs.webkit.org/show_bug.cgi?id=186384

        Reviewed by Michael Catanzaro.

        Fix calculations so the result is the expected one.

        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::getImageData):

2018-06-07  Fujii Hironori  <Hironori.Fujii@sony.com>

        Add base class to get WeakPtrFactory member and avoid some boilerplate code
        https://bugs.webkit.org/show_bug.cgi?id=186407
        <rdar://problem/40922716>

        Unreviewed WinCairo build fix

        MediaPlayerPrivateMediaFoundation.cpp(1726): error C2039: 'makeWeakPtr': is not a member of 'WebCore::MediaPlayerPrivateMediaFoundation'

        No new tests (No behavior change).

        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):

2018-06-07  Chris Dumez  <cdumez@apple.com>

        Add base class to get WeakPtrFactory member and avoid some boilerplate code
        https://bugs.webkit.org/show_bug.cgi?id=186407

        Reviewed by Brent Fulgham.

        Add CanMakeWeakPtr base class to get WeakPtrFactory member and its getter, in
        order to avoid some boilerplate code in every class needing a WeakPtrFactory.
        This also gets rid of old-style createWeakPtr() methods in favor of the newer
        makeWeakPtr().

        * Modules/credentialmanagement/CredentialsMessenger.h:
        * Modules/credentialmanagement/NavigatorCredentials.cpp:
        (WebCore::NavigatorCredentials::credentials):
        * Modules/encryptedmedia/CDM.cpp:
        (WebCore::CDM::doSupportedConfigurationStep):
        (WebCore::CDM::getConsentStatus):
        * Modules/encryptedmedia/CDM.h:
        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::generateRequest):
        (WebCore::MediaKeySession::load):
        (WebCore::MediaKeySession::update):
        (WebCore::MediaKeySession::close):
        (WebCore::MediaKeySession::remove):
        * Modules/encryptedmedia/MediaKeySession.h:
        * Modules/encryptedmedia/MediaKeys.cpp:
        (WebCore::MediaKeys::createSession):
        * Modules/encryptedmedia/MediaKeys.h:
        * Modules/gamepad/GamepadManager.cpp:
        (WebCore::GamepadManager::platformGamepadDisconnected):
        (WebCore::GamepadManager::makeGamepadVisible):
        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::MediaDevices):
        * Modules/mediastream/MediaDevices.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::applyConstraints):
        * Modules/mediastream/MediaStreamTrack.h:
        * Modules/webauthn/cocoa/LocalAuthenticator.h:
        * Modules/webauthn/cocoa/LocalAuthenticator.mm:
        (WebCore::LocalAuthenticator::makeCredential):
        * accessibility/AccessibilityRenderObject.h:
        * accessibility/AccessibilitySVGRoot.cpp:
        (WebCore::AccessibilitySVGRoot::setParent):
        * crypto/SubtleCrypto.cpp:
        (WebCore::SubtleCrypto::encrypt):
        (WebCore::SubtleCrypto::decrypt):
        (WebCore::SubtleCrypto::sign):
        (WebCore::SubtleCrypto::verify):
        (WebCore::SubtleCrypto::digest):
        (WebCore::SubtleCrypto::generateKey):
        (WebCore::SubtleCrypto::deriveKey):
        (WebCore::SubtleCrypto::deriveBits):
        (WebCore::SubtleCrypto::importKey):
        (WebCore::SubtleCrypto::exportKey):
        (WebCore::SubtleCrypto::wrapKey):
        (WebCore::SubtleCrypto::unwrapKey):
        * crypto/SubtleCrypto.h:
        * css/CSSFontFace.cpp:
        (WebCore::CSSFontFace::CSSFontFace):
        (WebCore::CSSFontFace::wrapper):
        (WebCore::CSSFontFace::setWrapper):
        * css/DeprecatedCSSOMValue.h:
        * css/FontFace.cpp:
        * css/FontFace.h:
        * css/MediaQueryEvaluator.cpp:
        (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
        * css/StyleSheetContents.h:
        * css/parser/CSSDeferredParser.cpp:
        (WebCore::CSSDeferredParser::CSSDeferredParser):
        * dom/DataTransferItemList.cpp:
        (WebCore::DataTransferItemList::add):
        (WebCore::DataTransferItemList::ensureItems const):
        (WebCore::DataTransferItemList::didSetStringData):
        * dom/DataTransferItemList.h:
        * dom/Document.cpp:
        (WebCore::Document::postTask):
        (WebCore::Document::hasStorageAccess):
        (WebCore::Document::requestStorageAccess):
        * dom/Document.h:
        (WebCore::Document::setContextDocument):
        * dom/MessagePort.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::setPictureElement):
        * html/HTMLInputElement.h:
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::mediaPlayerCreateResourceLoader):
        * html/HTMLMediaElement.h:
        * html/HTMLPictureElement.h:
        * html/parser/HTMLResourcePreloader.h:
        * layout/layouttree/LayoutBox.h:
        (WebCore::Layout::Box::style const):
        * loader/FormState.h:
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::preconnectIfNeeded):
        * loader/LinkLoader.h:
        * loader/LinkPreloadResourceClients.cpp:
        (WebCore::LinkPreloadResourceClient::LinkPreloadResourceClient):
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::MediaResourceLoader):
        * loader/MediaResourceLoader.h:
        * page/DOMWindow.h:
        * page/EventHandler.cpp:
        (WebCore::widgetForElement):
        (WebCore::EventHandler::updateLastScrollbarUnderMouse):
        * platform/GenericTaskQueue.cpp:
        (WebCore::TaskDispatcher<Timer>::postTask):
        * platform/GenericTaskQueue.h:
        (WebCore::GenericTaskQueue::enqueueTask):
        (WebCore::GenericTaskQueue::cancelAllTasks):
        * platform/ScrollView.h:
        * platform/ScrollableArea.h:
        * platform/Scrollbar.h:
        * platform/Widget.cpp:
        (WebCore::Widget::setParent):
        * platform/Widget.h:
        * platform/audio/gstreamer/AudioFileReaderGStreamer.cpp:
        (WebCore::AudioFileReader::decodeAudioForBusCreation):
        * platform/audio/mac/AudioHardwareListenerMac.cpp:
        (WebCore::AudioHardwareListenerMac::AudioHardwareListenerMac):
        * platform/audio/mac/AudioHardwareListenerMac.h:
        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::CDMInstanceClearKey::requestLicense):
        (WebCore::CDMInstanceClearKey::updateLicense):
        (WebCore::CDMInstanceClearKey::loadSession):
        (WebCore::CDMInstanceClearKey::closeSession):
        (WebCore::CDMInstanceClearKey::removeSessionData):
        * platform/encryptedmedia/clearkey/CDMClearKey.h:
        * platform/graphics/FontCascade.h:
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::scheduleMainThreadNotification):
        (WebCore::MediaPlayerPrivateAVFoundation::dispatchNotification):
        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.h:
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::didProvideRequest):
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/CDMSessionAVFoundationObjC.mm:
        (WebCore::CDMSessionAVFoundationObjC::CDMSessionAVFoundationObjC):
        * platform/graphics/avfoundation/objc/CDMSessionAVStreamSession.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createVideoLayer):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::checkPlayability):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::beginLoadingMetadata):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::seekToTime):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createSession):
        (WebCore::MediaPlayerPrivateAVFoundationObjC::setShouldPlayToPlaybackTarget):
        (-[WebCoreAVFMovieObserver observeValueForKeyPath:ofObject:change:context:]):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.h:
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::requestNotificationWhenReadyForVideoData):
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::scheduleDeferredTask):
        * platform/graphics/cv/TextureCacheCV.h:
        * platform/graphics/cv/TextureCacheCV.mm:
        (WebCore::TextureCacheCV::textureFromImage):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfVideo):
        (WebCore::MediaPlayerPrivateGStreamer::notifyPlayerOfAudio):
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::handleSyncMessage):
        (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::connectDemuxerSrcPadToAppsink):
        * platform/graphics/mac/DisplayRefreshMonitorMac.cpp:
        (WebCore::DisplayRefreshMonitorMac::displayLinkFired):
        * platform/graphics/mac/DisplayRefreshMonitorMac.h:
        * platform/graphics/texmap/TextureMapperLayer.cpp:
        (WebCore::TextureMapperLayer::setMaskLayer):
        (WebCore::TextureMapperLayer::setReplicaLayer):
        * platform/graphics/texmap/TextureMapperLayer.h:
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.cpp:
        (WebCore::MediaPlayerPrivateMediaFoundation::endCreatedMediaSource):
        (WebCore::MediaPlayerPrivateMediaFoundation::endGetEvent):
        (WebCore::MediaPlayerPrivateMediaFoundation::CustomVideoPresenter::processInputNotify):
        * platform/graphics/win/MediaPlayerPrivateMediaFoundation.h:
        * platform/ios/RemoteCommandListenerIOS.h:
        * platform/ios/RemoteCommandListenerIOS.mm:
        (WebCore::RemoteCommandListenerIOS::RemoteCommandListenerIOS):
        * platform/mac/RemoteCommandListenerMac.h:
        * platform/mac/RemoteCommandListenerMac.mm:
        (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac):
        * platform/mediastream/MediaStreamPrivate.cpp:
        (WebCore::MediaStreamPrivate::scheduleDeferredTask):
        * platform/mediastream/MediaStreamPrivate.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::scheduleDeferredTask):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
        (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
        * platform/vr/VRPlatformDisplay.h:
        * platform/vr/openvr/VRPlatformManagerOpenVR.cpp:
        (WebCore::VRPlatformManagerOpenVR::getVRDisplays):
        * rendering/FloatingObjects.h:
        (WebCore::FloatingObject::setOriginatingLine):
        * rendering/RenderObject.h:
        * rendering/RootInlineBox.cpp:
        * rendering/RootInlineBox.h:
        * svg/SVGPathElement.h:
        * svg/SVGPathSegWithContext.h:
        (WebCore::SVGPathSegWithContext::SVGPathSegWithContext):
        (WebCore::SVGPathSegWithContext::setContextAndRole):
        * svg/SVGTransformList.h:
        * svg/properties/SVGAnimatedListPropertyTearOff.h:
        (WebCore::SVGAnimatedListPropertyTearOff::baseVal):
        (WebCore::SVGAnimatedListPropertyTearOff::animVal):
        * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
        * svg/properties/SVGAnimatedPropertyTearOff.h:
        * svg/properties/SVGAnimatedTransformListPropertyTearOff.h:
        * svg/properties/SVGListProperty.h:
        (WebCore::SVGListProperty::initializeValuesAndWrappers):
        (WebCore::SVGListProperty::getItemValuesAndWrappers):
        (WebCore::SVGListProperty::insertItemBeforeValuesAndWrappers):
        (WebCore::SVGListProperty::replaceItemValuesAndWrappers):
        (WebCore::SVGListProperty::appendItemValuesAndWrappers):
        * svg/properties/SVGMatrixTearOff.h:
        * svg/properties/SVGPropertyTearOff.h:
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMFactory::createCDM):
        (WebCore::MockCDM::createInstance):
        * testing/MockCDMFactory.h:
        * workers/service/ExtendableEvent.h:
        * workers/service/FetchEvent.cpp:
        (WebCore::FetchEvent::respondWith):
        * workers/service/server/SWServer.h:
        * xml/DOMParser.cpp:
        (WebCore::DOMParser::DOMParser):

2018-06-07  Chris Dumez  <cdumez@apple.com>

        PopStateEvent should not be cancelable by default
        https://bugs.webkit.org/show_bug.cgi?id=186420

        Reviewed by Darin Adler.

        PopStateEvent should not be cancelable by default:
        - https://github.com/web-platform-tests/wpt/pull/11355
        - https://html.spec.whatwg.org/#history-traversal

        All other browsers agree with the specification.

        No new tests, updated existing tests.

        * dom/PopStateEvent.cpp:
        (WebCore::PopStateEvent::PopStateEvent):

2018-06-07  Simon Fraser  <simon.fraser@apple.com>

        Remove a log that was left in by mistake.

        * loader/cache/MemoryCache.cpp:
        (WebCore::MemoryCache::pruneLiveResourcesToSize):

2018-06-07  Antoine Quint  <graouts@apple.com>

        [ASan / StressGC] DumpRenderTree crashed in com.apple.WebCore: WebCore::EventTarget::ref + 16
        https://bugs.webkit.org/show_bug.cgi?id=186207
        <rdar://problem/40568747>

        Reviewed by Dean Jackson.

        Ensure that we clear the DOM event queue for declarative animations once an animation is cleared for
        an element since the element can be deleted before events get dispatched asynchronouly for this animation.

        We also only call AnimationTimeline::removeAnimationsForElement() from RenderTreeUpdater::tearDownRenderers()
        in the case where we're tearing down the whole document as otherwise this would yield early clearing of the event
        queue in the case where an element would get a "display: none" style.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::removeAnimationsForElement):
        * animation/DeclarativeAnimation.cpp:
        (WebCore::DeclarativeAnimation::~DeclarativeAnimation):
        (WebCore::DeclarativeAnimation::prepareAnimationForRemoval):
        * animation/DeclarativeAnimation.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::prepareAnimationForRemoval):
        * animation/WebAnimation.h:
        * rendering/updating/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::tearDownRenderers):

2018-06-07  Don Olmstead  <don.olmstead@sony.com>

        [CoordGraphics] Fix compilation errors around USE(COORDINATED_GRAPHICS)
        https://bugs.webkit.org/show_bug.cgi?id=186374

        Reviewed by Žan Doberšek.

        No new tests. No change in behavior.

        * page/scrolling/AsyncScrollingCoordinator.cpp:
        (WebCore::AsyncScrollingCoordinator::reconcileScrollingState):
        (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions):
        * page/scrolling/coordinatedgraphics/ScrollingCoordinatorCoordinatedGraphics.cpp:
        * page/scrolling/coordinatedgraphics/ScrollingTreeFixedNode.cpp:
        * page/scrolling/coordinatedgraphics/ScrollingTreeStickyNode.cpp:
        * platform/PlatformWheelEvent.h:
        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.cpp:
        * platform/graphics/nicosia/NicosiaPaintingEngineThreaded.h:
        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.cpp:
        * platform/graphics/texmap/TextureMapperPlatformLayerBuffer.h:

2018-06-07  Thibault Saunier  <tsaunier@igalia.com> and Alejandro G. Castro  <alex@igalia.com>

        [GTK][WPE] Start implementing MediaStream API
        https://bugs.webkit.org/show_bug.cgi?id=185787

        Reviewed by Philippe Normand.

        We are adding all the required classes to make the
        MediaStream API work, that means our own RealtimeMediaSourceCenterLibWebRTC
        for the platform, the GStreamerCaptureDeviceManager, the audio/video capturers
        and their respective audio/video sources as well as a dedicated GStreamer Source
        that adds support for using MediaStream stream inside playbin3.
        We are using the GstDeviceMonitor to list devices on the devices.

        Enable mediastream tests.

        * platform/GStreamer.cmake: Added the new files to the compilation.
        * platform/audio/AudioStreamDescription.h: Added new GStreamer type.
        * platform/audio/PlatformAudioData.h: Added new GStreamer type for
        the GStreamerAudioData class.
        * platform/graphics/gstreamer/GStreamerCommon.cpp:
        (WebCore::simpleBusMessageCallback): This function and the next
        one help us to connect a monitoring callback to a pipeline for
        debugging.
        (WebCore::connectSimpleBusMessageCallback): Ditto.
        * platform/graphics/gstreamer/GStreamerCommon.h: Ditto
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::load): Make use of the loadFull() method.
        (WebCore::MediaPlayerPrivateGStreamer::loadFull): Very similar to load()
        but allows specifying what pipeline type to use (null to let the function determine
        which one should be used). This is required as we force to always use playbin3 for the
        mediastream source as it relies on the GstStream API.
        (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const): Style fix.
        (WebCore::MediaPlayerPrivateGStreamer::naturalSize const): Added, use MediaStream specific information if available.
        (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Some style fixes.
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Enhance dotfiles names.
        (WebCore::MediaPlayerPrivateGStreamer::processTableOfContentsEntry): Minor formatting fix.
        (WebCore::MediaPlayerPrivateGStreamer::sourceSetup): Set MediaStream on WebKitMediaStreamSource when setting it up.
        (WebCore::MediaPlayerPrivateGStreamer::supportsType): Advertise that we support MediaStream if support is built.
        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin): Make sure playbin3 is forced when loading a MediaStream.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add a reference to the MediaStream object and declare loadFull and naturalSize override.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::registerWebKitGStreamerElements): Register the new MediaStreamSrc element.
        * platform/graphics/gstreamer/VideoTrackPrivateGStreamer.cpp:
        (WebCore::VideoTrackPrivateGStreamer::VideoTrackPrivateGStreamer): Make sure that MediaStream MAIN tracks are selected by default. We have no way to do it in MediaStreamSrc now as the GstStreamCollection is recreated by parsebin.
        * platform/mediastream/RealtimeMediaSource.h: Make CaptureFailed a virtual method as in our mocks we require need to make
        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::singleton): Remove the code
        used for compilation for the platform when we do not have a
        RealtimeMediaSourceCenterLibWebRTC. Now we return the proper class
        for the platform.
        * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
        Added class representing the RealtimeMediaSource for the Audio
        with GStreamer.
        * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
        Ditto.
        * platform/mediastream/gstreamer/GStreamerAudioCapturer.cpp: Added
        this class that represents the GStreamer pipeline that captures
        audio from the system devices, it inherits from GStreamerCapturer.
        * platform/mediastream/gstreamer/GStreamerAudioCapturer.h: Dito.
        * platform/mediastream/gstreamer/GStreamerAudioData.h: Added this
        class implementing PlatformAudioData for the GStreamer platform,
        used to pass the samples information.
        * platform/mediastream/gstreamer/GStreamerAudioStreamDescription.h:
        Added this class implementing AudioStreamDescription to export the
        information about the audio stream to libwebrtc.
        * platform/mediastream/gstreamer/GStreamerCaptureDevice.h: Added
        this base class for the audio and video capturing devices, it
        implements general WebKit CaptureDevice class.
        * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.cpp:
        Added this class that implements the system monitor to get the
        list of available devices in the system. It uses GstDeviceMonitor
        to handle the operation. It uses two singleton device managers one
        for audio and another one for video, as required by the
        RealtimeMediaSourceCenter design.
        * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: Ditto.
        * platform/mediastream/gstreamer/GStreamerCapturer.cpp: Added this
        base class representing how GStreamer captures the media from the
        input devices in the system. Two classes inherit from this one to
        capture audio and video. It setups the GStreamer pipeline and adds
        functions to control it.
        * platform/mediastream/gstreamer/GStreamerCapturer.h: Ditto.
        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp: Added.
        Implements a subclass of GstBin as a source element that will contain several
        GstAppSrc, basically one per MediaStreamTrackPrivate of the MediaStreamPrivate
        passed in parameter. It adds Observers on the MediaStreamTracks and
        pushes the data to the sources as required. The element implements the GstURIHandler
        interface so it can be used in playbin. The MediaPlayerPrivateGStreamer is responsible
        for passing the MediaStreamPrivate object to the source when required.
        (WebCore::webkitMediaStreamSrcPadProbeCb): Event probe that fixes stream_start events (setting the ID etc)
        and finally add src pads to the pipeline.
        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.h: Ditto.
        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
        Added this RealtimeMediaSource representing the source of the
        video data for the GStreamer platform. It handles the settings and
        capabilities of the source and creates the capturer used to
        control the operation of the stream.
        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h: Ditto.
        * platform/mediastream/gstreamer/GStreamerVideoCapturer.cpp: Added
        this class that inherits from the GStreamerCapturer and controls
        the GStreamer pipelines of the video streams of the system.
        * platform/mediastream/gstreamer/GStreamerVideoCapturer.h: Ditto.
        * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.cpp: Added. Implementation of a Mock capturer for audio stream.
        Subclasses GStreamerAudioCapturer and wraps a MockRealtimeAudioSource so that the behaviour is the same a MockRealtimeAudioSource
        but still the GStreamer implementation code paths are tested.
        * platform/mediastream/gstreamer/MockGStreamerAudioCaptureSource.h: Ditto.
        * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp: Added. Implementation of a Mock capturer for video stream.
        Subclasses GStreamerVideoCapturer and wraps a MockRealtimeVideoSource so that the behaviour is the same a MockRealtimeVideoSource
        but still the GStreamer implementation code paths are tested.
        * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.h: Ditto.
        * platform/mediastream/gstreamer/RealtimeMediaSourceCenterLibWebRTC.cpp:
        Added this class that implements the key RealtimeMediaSourceCenter
        functions to configure the base class for the platform, using the
        other GStreamer classes.
        * platform/mock/MockRealtimeAudioSource.cpp: Do not build ::create if GStreamer implementation is built
        * platform/mock/MockRealtimeVideoSource.cpp: Do not build ::create if GStreamer implementation is built

2018-06-07  Brent Fulgham  <bfulgham@apple.com>

        Handle Storage Access API calls in the absence of an attached frame
        https://bugs.webkit.org/show_bug.cgi?id=186373
        <rdar://problem/40028265>

        Reviewed by Daniel Bates.

        Tests: http/tests/storageAccess/has-storage-access-crash.html
               http/tests/storageAccess/request-storage-access-crash.html

        The new frame-specific storage access checks were done without confirming a
        frame was present, although the frame state was validated in other parts of
        the same method.
        
        This patch checks for a non-null frame before making frame-specific calls.

        * dom/Document.cpp:
        (WebCore::Document::hasStorageAccess):
        (WebCore::Document::requestStorageAccess):

2018-06-07  Zalan Bujtas  <zalan@apple.com>

        [LFC] Merge height and vertical margin computation
        https://bugs.webkit.org/show_bug.cgi?id=186394

        Reviewed by Antti Koivisto.

        To match the spec (and the width/horizontal margin computation). -currently with default values.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHeight const):
        (WebCore::Layout::FormattingContext::computeFloatingHeight const): Deleted.
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::outOfFlowNonReplacedHeight): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHeight): Deleted.
        (WebCore::Layout::floatingNonReplacedHeight): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeight): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHeight): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::floatingHeight): Deleted.
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeight): Deleted.
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeHeight const): Deleted.
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeight const): Deleted.
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeight): Deleted.
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeight): Deleted.

2018-06-07  Antti Koivisto  <antti@apple.com>

        Don't start service worker fetch when there is substitute data
        https://bugs.webkit.org/show_bug.cgi?id=186349
        <rdar://problem/38881568>

        Reviewed by Youenn Fablet.

        Loading content via WKWebView.loadData may also end up starting a main resource service worker fetch.
        This breaks DocumentWriter assumptions.

        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::tryLoadingRequestFromApplicationCache):
        (WebCore::DocumentLoader::tryLoadingSubstituteData):

        Factor substitute resource loading out from tryLoadingRequestFromApplicationCache.

        (WebCore::DocumentLoader::startLoadingMainResource):

        If we have substitute data already (typically from WKWebView.loadData), allow service worker registration
        but load the main resource using the substitute data.

        (WebCore::DocumentLoader::handleSubstituteDataLoadSoon): Deleted.

        Merge to tryLoadingSubstituteData.

        * loader/DocumentLoader.h:

2018-06-07  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Fix the way GstStreamCollection is handled
        https://bugs.webkit.org/show_bug.cgi?id=184588

        Reviewed by Philippe Normand.

        The stream collection message replaces the collection of stream previously
        advertised, this means that we should rebuild our set of Track from scratch
        and not update previously exposed tracks.

        In the end, this simplifies the code as we do not care about what
        tracks existed previously, we just need to expose what GStreamer tells
        us, deleting any previous state.

        Handle the STREAM_COLLECTION message from the sync handler so that tracks
        are updated before we mark the pipeline as READY for the live case (everything
        happen synchronously with the call to the `load()` method in that case),
        the update still always happens on the main thread.

        No new tests is added as this is mostly refactoring, it is already tested and it
        will fix MediaStream tests that are currently disabled as the support is being
        implemented in #185787.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::clearTracks): Removes all tracks.
        (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Updates configured tracks from the new GstStreamColection track.
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage): Stop handling GST_STREAM_COLLECTION event.
        (WebCore::MediaPlayerPrivateGStreamer::handleSyncMessage): Handle stream collection event synchronously.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Add handleSyncMessage

2018-06-07  Michael Catanzaro  <mcatanzaro@igalia.com>

        Remove unused image encoders
        https://bugs.webkit.org/show_bug.cgi?id=186365

        Reviewed by Carlos Garcia Campos.

        * platform/image-encoders/JPEGImageEncoder.cpp: Removed.
        * platform/image-encoders/JPEGImageEncoder.h: Removed.
        * platform/image-encoders/PNGImageEncoder.cpp: Removed.
        * platform/image-encoders/PNGImageEncoder.h: Removed.

2018-06-06  Youenn Fablet  <youenn@apple.com>

        HTTP Header values validation is too strict
        https://bugs.webkit.org/show_bug.cgi?id=167112

        Reviewed by Alex Christensen.

        Moving header values and names from DOMString to ByteString as per spec.
        Updating WebCore::isValidHTTPHeaderValue as per https://fetch.spec.whatwg.org/#terminology-headers.

        Covered by rebased and updated tests.
        Updated test is now also passing in other browsers.

        * platform/network/HTTPParsers.cpp:
        (WebCore::isValidHTTPHeaderValue):

2018-06-06  Youenn Fablet  <youenn@apple.com>

        Add Accept-Encoding: identity to Range requests
        https://bugs.webkit.org/show_bug.cgi?id=186335
        <rdar://problem/40837190>

        Reviewed by Eric Carlson.

        Tests: imported/w3c/web-platform-tests/fetch/range/general.any.html
               imported/w3c/web-platform-tests/fetch/range/general.any.worker.html

        * loader/cache/CachedResourceLoader.cpp:
        (WebCore::CachedResourceLoader::updateHTTPRequestHeaders):
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::updateAcceptEncodingHeader):
        * loader/cache/CachedResourceRequest.h:

2018-06-06  Per Arne Vollan  <pvollan@apple.com>

        Display links are sometimes not notifying WebCore when fired.
        https://bugs.webkit.org/show_bug.cgi?id=186367
        <rdar://problem/40439109>

        Reviewed by Brent Fulgham.

        When the WebContent process is receiving an IPC message notifying about a screen update, all display refresh monitors
        are notified by the manager in DisplayRefreshMonitorManager::displayWasUpdated(). The manager checks that the monitor
        is scheduled before notifying. This is a problem, since the scheduled flag is always set to false in the
        DisplayRefreshMonitor::displayDidRefresh() method, when the monitor is first notified about a screen update. This can
        lead to display links running without notifying the monitors, causing extra CPU usage. It can also prevent them from
        being deleted, since the monitors are not notified. Instead, we can check that the display refresh monitor is active
        before notifying it. This matches the original display link implementation used when the WebContent process has
        WindowServer access, where the monitors are always notified.

        No new tests, since I have not been able to reproduce this in a test case yet.

        * platform/graphics/DisplayRefreshMonitorManager.cpp:
        (WebCore::DisplayRefreshMonitorManager::displayWasUpdated):

2018-06-06  Antoine Quint  <graouts@apple.com>

        Rename color-filter to -apple-color-filter and do not expose it to Web content
        https://bugs.webkit.org/show_bug.cgi?id=186306
        <rdar://problem/39874167>

        Reviewed by Simon Fraser.

        Rename the color-filter CSS property to -apple-color-filter.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::checkForMatchingColorFilterFunctionLists):
        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
        * css/CSSGradientValue.cpp:
        (WebCore::CSSGradientValue::image):
        (WebCore::CSSGradientValue::computeStops):
        (WebCore::CSSGradientValue::knownToBeOpaque const):
        * css/CSSProperties.json:
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseSingleValue):
        * page/animation/CSSPropertyAnimation.cpp:
        (WebCore::blendFunc):
        (WebCore::CSSPropertyAnimationWrapperMap::CSSPropertyAnimationWrapperMap):
        * page/animation/ImplicitAnimation.cpp:
        (WebCore::ImplicitAnimation::checkForMatchingColorFilterFunctionLists):
        * page/animation/KeyframeAnimation.cpp:
        (WebCore::KeyframeAnimation::checkForMatchingColorFilterFunctionLists):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintMarkedTextForeground):
        (WebCore::InlineTextBox::paintMarkedTextDecoration):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresRepaint const):
        (WebCore::RenderStyle::visitedDependentColorWithColorFilter const):
        (WebCore::RenderStyle::colorByApplyingColorFilter const):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::mutableAppleColorFilter):
        (WebCore::RenderStyle::appleColorFilter const):
        (WebCore::RenderStyle::hasAppleColorFilter const):
        (WebCore::RenderStyle::setAppleColorFilter):
        (WebCore::RenderStyle::initialAppleColorFilter):
        (WebCore::RenderStyle::mutableColorFilter): Deleted.
        (WebCore::RenderStyle::colorFilter const): Deleted.
        (WebCore::RenderStyle::hasColorFilter const): Deleted.
        (WebCore::RenderStyle::setColorFilter): Deleted.
        (WebCore::RenderStyle::initialColorFilter): Deleted.
        * rendering/style/StyleRareInheritedData.cpp:
        (WebCore::StyleRareInheritedData::StyleRareInheritedData):
        (WebCore::StyleRareInheritedData::operator== const):
        (WebCore::StyleRareInheritedData::hasColorFilters const):
        * rendering/style/StyleRareInheritedData.h:

2018-06-06  Jer Noble  <jer.noble@apple.com>

        REGRESSION (r231817?): Layout Test media/track/track-delete-during-setup.html is a flaky timeout
        https://bugs.webkit.org/show_bug.cgi?id=185889
        <rdar://problem/40583180>

        Reviewed by Eric Carlson.

        Explicitly update the network and ready states when detaching the AVPlayerItem
        from the AVPlayer.

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

2018-06-06  Antoine Quint  <graouts@apple.com>

        Use the default label for snapshotted plug-ins if no mime-type is available
        https://bugs.webkit.org/show_bug.cgi?id=186348

        Reviewed by Jon Lee.

        In case the mime-type is not available, use the default labels otherwise we'd crash trying to look up the empty string in the HashMap.

        * html/HTMLPlugInImageElement.cpp:
        (WebCore::titleText):
        (WebCore::subtitleText):

2018-06-06  Timothy Hatcher  <timothy@apple.com>

        Wrong NSVisualEffectMaterial used for exit full screen overlay in dark mode.

        https://bugs.webkit.org/show_bug.cgi?id=186350
        rdar://problem/39135535

        Reviewed by Anders Carlsson.

        * platform/mac/WebCoreFullScreenPlaceholderView.mm:
        (-[WebCoreFullScreenPlaceholderView initWithFrame:]):
        Use the NSVisualEffectMaterialFullScreenUI on macOS 10.14 and don't
        set an explicit NSAppearance.

2018-06-06  Jer Noble  <jer.noble@apple.com>

        Regions outside of the fullscreen window are exposed during zoom operations
        https://bugs.webkit.org/show_bug.cgi?id=186330
        <rdar://problem/34698009>

        Reviewed by Simon Fraser.

        Test: fullscreen/full-screen-layer-dump.html

        Introduce the concept of "requiresBackgroundLayer" to RenderLayerBacking, for use by
        RenderFullScreen. Previously, the backgroundLayer in RenderLayerBacking was only used
        by the root renderer with fixed backgrounds. Give the RenderFullScreen a background layer
        that's approximately 3x as tall and wide as the renderer itself, so nothing is exposed
        during pinch operations.

        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::RenderLayerBacking):
        (WebCore::RenderLayerBacking::updateConfiguration):
        (WebCore::RenderLayerBacking::updateGeometry):
        (WebCore::RenderLayerBacking::updateDrawsContent):
        (WebCore::RenderLayerBacking::setRequiresBackgroundLayer):
        (WebCore::RenderLayerBacking::updateBackgroundLayer):
        (WebCore::RenderLayerBacking::updateDirectlyCompositedBackgroundColor):
        (WebCore::RenderLayerBacking::paintIntoLayer):
        * rendering/RenderLayerBacking.h:

2018-06-06  Jer Noble  <jer.noble@apple.com>

        Set the AVAssetResourceLoaderRequest's contentType to AVStreamingKeyDeliveryContentKeyType in the case of a FPS key request.
        https://bugs.webkit.org/show_bug.cgi?id=186328
        <rdar://problem/40829228>

        Reviewed by Eric Carlson.

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

2018-06-06  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add margin computation for floating, replaced elements.
        https://bugs.webkit.org/show_bug.cgi?id=186337

        Reviewed by Antti Koivisto.

        If 'margin-left' or 'margin-right' are computed as 'auto', their used value is '0'.

        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):

2018-06-06  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add margin computation for floating, no-replaced elements.
        https://bugs.webkit.org/show_bug.cgi?id=186334

        Reviewed by Antti Koivisto.

        If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):

2018-06-06  Antti Koivisto  <antti@apple.com>

        Use minimal coverage rect for tiled layers when under memory pressure
        https://bugs.webkit.org/show_bug.cgi?id=186185
        <rdar://problem/40713608>

        Reviewed by Darin Adler.

        We do this for the main content layer already.

        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::adjustTiledLayerVisibleRect):

2018-06-05  Antoine Quint  <graouts@apple.com>

        [Web Animations] Only expose CSSAnimation and CSSTransition if the WebAnimationsCSSIntegration runtime flag is enabled
        https://bugs.webkit.org/show_bug.cgi?id=186305

        Reviewed by Dean Jackson.

        * animation/CSSAnimation.idl:
        * animation/CSSTransition.idl:

2018-06-05  Per Arne Vollan  <pvollan@apple.com>

        Move OpenGL display mask to screen data struct.
        https://bugs.webkit.org/show_bug.cgi?id=186198
        <rdar://problem/40724854>

        Reviewed by Brent Fulgham.

        Currently, the OpenGL display mask is a global in the WebContent process. This is not correct in all cases, since
        it is possible to have two Web views in the same WebContent process, displayed on different displays. This can be
        resolved by moving the OpenGL display mask to a new ScreenData struct, containing information specific to each
        display. The display ID of the host window is used to find the OpenGL display mask when needed. This patch makes
        the host window available when creating an IOSurface, in order to find the right OpenGL display mask. If no host
        window is available, the OpenGL display mask of the main display is used.

        No new tests, since testing this requires two Web views in the same WebContent process, displayed on
        two different monitors.

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::createImageBuffer const):
        * platform/PlatformScreen.h:
        * platform/ScreenProperties.h:
        (WebCore::ScreenProperties::encode const):
        (WebCore::ScreenProperties::decode):
        (WebCore::ScreenData::encode const):
        (WebCore::ScreenData::decode):
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/ImageBuffer.cpp:
        (WebCore::ImageBuffer::create):
        * platform/graphics/ImageBuffer.h:
        * platform/graphics/cg/ImageBufferCG.cpp:
        (WebCore::ImageBuffer::createCompatibleBuffer):
        (WebCore::ImageBuffer::ImageBuffer):
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        (WebCore::GraphicsContext3D::allowOfflineRenderers const):
        (WebCore::GraphicsContext3D::setOpenGLDisplayMask): Deleted.
        (WebCore::GraphicsContext3D::getOpenGLDisplayMask): Deleted.
        * platform/graphics/cocoa/IOSurface.h:
        * platform/graphics/cocoa/IOSurface.mm:
        (WebCore::IOSurface::ensurePlatformContext):
        * platform/mac/PlatformScreenMac.mm:
        (WebCore::screenProperties):
        (WebCore::collectScreenProperties):
        (WebCore::setScreenProperties):
        (WebCore::screenData):
        (WebCore::primaryOpenGLDisplayMask):
        (WebCore::displayMaskForDisplay):
        (WebCore::getScreenProperties):
        (WebCore::screenIsMonochrome):
        (WebCore::screenHasInvertedColors):
        (WebCore::screenDepth):
        (WebCore::screenDepthPerComponent):
        (WebCore::screenRectForDisplay):
        (WebCore::screenRect):
        (WebCore::screenAvailableRect):
        (WebCore::screenColorSpace):
        (WebCore::screenSupportsExtendedColor):

2018-06-05  Jer Noble  <jer.noble@apple.com>

        REGRESSION (231817): Videos permanently blank out after switching out of a tab and back in
        https://bugs.webkit.org/show_bug.cgi?id=186326
        <rdar://problem/40778157>

        Reviewed by Eric Carlson.

        Check whether the element is visible in the viewport when the web view itself becomes visible, and if so, clear the m_elementIsHiddenUntilVisibleInViewport flag.

        * html/MediaElementSession.cpp:
        (WebCore::MediaElementSession::visibilityChanged):
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:

2018-06-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Move inflow, replaced width and margin computation to a dedicated function.
        https://bugs.webkit.org/show_bug.cgi?id=186327

        Reviewed by Sam Weinig.

        I was searching for the function inFlowReplacedWidthAndMargin() and there was none.

        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

2018-06-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add missing margins for inflow, non replaced block and replaced inline elements
        https://bugs.webkit.org/show_bug.cgi?id=186332

        Reviewed by Darin Adler.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):

2018-06-05  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Spelling errors in the middle of an inserted paragraph are not displayed
        https://bugs.webkit.org/show_bug.cgi?id=185584
        <rdar://problem/38676081>

        Reviewed by Ryosuke Niwa.

        Currently when typing, we only consider the range of adjacent words when determining where to place spelling
        correction markers, even though we provide NSSpellChecker with the full context of the sentence (and get back
        results encompassing the full range). In macOS Mojave, NSSpellChecker may now return spell checking results that
        include correctly spelled words that are misused in the context of the sentence. This means that while typing a
        sentence, a different part of the sentence may gain or lose spelling markers as a result.

        To support this, WebKit needs to mark or unmark spelling corrections in the full range of the sentence whenever
        a full word is typed (since the context of other words within the sentence may have changed, resulting in
        different platform spellchecking results). In markMisspellingsAfterTypingToWord, we expand the spell checking
        range past the adjacent words so that it encompasses the largest subrange of the full sentence that includes the
        start of the typed word, and does not include any position that is under an element with `spellcheck=false`.

        This guarantees that we don't erroneously place spelling document markers under elements where spellchecking is
        disabled, while allowing for sentence retro corrections when spellchecking is enabled. However, this doesn't
        handle the case where an element with spellchecking disabled lies between a sentence retro correction range and
        the currently typed word. In the future, we could fix this by refactoring SpellCheckRequest to track a list of
        non-contiguous spelling correction ranges — see the FIXME in markMisspellingsAfterTypingToWord for more detail.

        Covered by 2 new layout tests, as well as an existing spell-checking test that should now be passing.

        Tests: editing/spelling/retro-correction-spelling-markers.html
               editing/spelling/spelling-markers-after-pasting-sentence.html

        * editing/Editor.cpp:
        (WebCore::Editor::markMisspellingsAfterTypingToWord):
        * testing/Internals.h:
        * testing/Internals.idl:

        Add an internal testing helper to determine whether retro sentence corrections are enabled.

2018-06-05  Darin Adler  <darin@apple.com>

        [Cocoa] Retire DispatchPtr, and add more move semantics and simpler #ifs to other smart pointers
        https://bugs.webkit.org/show_bug.cgi?id=186324

        Reviewed by Anders Carlsson.

        * platform/FileMonitor.h: Use OSObjectPtr instead of DispatchPtr.
        * platform/cocoa/FileMonitorCocoa.mm:
        (WebCore::FileMonitor::FileMonitor): Ditto.

2018-06-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, fix the macOS build with recent SDKs.

        * page/mac/ServicesOverlayController.mm:
        (WebCore::ServicesOverlayController::Highlight::paintContents):

2018-06-05  Brent Fulgham  <bfulgham@apple.com>

        Adjust compile and runtime flags to match shippable state of features
        https://bugs.webkit.org/show_bug.cgi?id=186319
        <rdar://problem/40352045>

        Reviewed by Maciej Stachowiak, Jon Lee, and others.

        * Configurations/FeatureDefines.xcconfig: Don't build ENABLE_INPUT_TYPE_COLOR
        or ENABLE_INPUT_TYPE_COLOR_POPOVER.

2018-06-05  Timothy Hatcher  <timothy@apple.com>

        Clean up LocalDefaultSystemAppearance and prefers-dark-interface media query

        https://bugs.webkit.org/show_bug.cgi?id=186323
        rdar://problem/38382252

        Reviewed by Tim Horton.

        * css/MediaFeatureNames.h:
        * css/MediaQueryEvaluator.cpp:
        (WebCore::prefersDarkInterfaceEvaluate):
        (WebCore::defaultAppearanceEvaluate): Deleted.
        * css/MediaQueryExpression.cpp:
        (WebCore::featureWithValidIdent):
        (WebCore::isFeatureValidWithoutValue):
        * platform/mac/LocalDefaultSystemAppearance.mm:
        (WebCore::LocalDefaultSystemAppearance::LocalDefaultSystemAppearance):

2018-06-05  Darin Adler  <darin@apple.com>

        [Cocoa] Improve some soft linking compatibility with ARC
        https://bugs.webkit.org/show_bug.cgi?id=186309

        Reviewed by Anders Carlsson.

        * platform/audio/ios/AudioSessionIOS.mm: Use SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER
        for NSString constants.
        * platform/audio/ios/MediaSessionManagerIOS.mm: Ditto.
        * platform/graphics/avfoundation/AudioSourceProviderAVFObjC.mm: Ditto.
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateAVFObjC.mm: Ditto.
        * platform/graphics/avfoundation/objc/InbandTextTrackPrivateLegacyAVFObjC.mm: Ditto.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm: Ditto.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::synchronizeTextTrackState): Use __bridge for
        some bridging casts.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::createAVAssetForURL): Ditto.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::updateLastImage): Ditto.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::processCue): Ditto.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm: Use
        SOFT_LINK_CONSTANT instead of SOFT_LINK_POINTER for NSString constants.
        * platform/mediastream/ios/CoreAudioCaptureSourceIOS.mm: Ditto.
        * platform/mediastream/mac/AVCaptureDeviceManager.mm: Ditto.
        * platform/mediastream/mac/AVMediaCaptureSource.mm: Ditto.
        * platform/mediastream/mac/AVVideoCaptureSource.mm: Ditto.

2018-06-05  Youenn Fablet  <youenn@apple.com>

        ServiceWorker registration should store any script fetched through importScripts
        https://bugs.webkit.org/show_bug.cgi?id=182444
        <rdar://problem/37164835>

        Reviewed by Chris Dumez.

        Covered by added test http/wpt/service-workers/persistent-importScripts.html.

        Update importScripts implementation to look for/update the resource map in case of service worker scope.
        This resource map is stored persistently and sent when running the service worker.

        Add support to persistent storage of this resource map.
        This requires updating the schema database.
        The schema version is bumped to 2 and we delete any data related to old registrations.

        When updating the service worker, the resource map is currently flushed so that all scripts will be retrieved from the network.

        Did some limited refactoring to put more loading handling in WorkerScriptLoader.

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::importScripts):
        * workers/WorkerScriptLoader.cpp:
        (WebCore::WorkerScriptLoader::loadSynchronously):
        (WebCore::WorkerScriptLoader::script):
        * workers/WorkerScriptLoader.h:
        * workers/service/ServiceWorkerContextData.cpp:
        (WebCore::ServiceWorkerContextData::isolatedCopy const):
        * workers/service/ServiceWorkerContextData.h:
        (WebCore::ServiceWorkerContextData::ImportedScript::isolatedCopy const):
        (WebCore::ServiceWorkerContextData::ImportedScript::encode const):
        (WebCore::ServiceWorkerContextData::ImportedScript::decode):
        (WebCore::ServiceWorkerContextData::encode const):
        (WebCore::ServiceWorkerContextData::decode):
        * workers/service/ServiceWorkerGlobalScope.cpp:
        (WebCore::ServiceWorkerGlobalScope::scriptResource const):
        (WebCore::ServiceWorkerGlobalScope::setScriptResource):
        * workers/service/ServiceWorkerGlobalScope.h:
        * workers/service/context/SWContextManager.h:
        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::v1RecordsTableSchema):
        (WebCore::RegistrationDatabase::doPushChanges):
        (WebCore::RegistrationDatabase::importRecords):
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::addRegistrationFromStore):
        (WebCore::SWServer::updateWorker):
        (WebCore::SWServer::installContextData):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerJobQueue.cpp:
        (WebCore::SWServerJobQueue::scriptFetchFinished):
        * workers/service/server/SWServerToContextConnection.cpp:
        (WebCore::SWServerToContextConnection::setScriptResource):
        * workers/service/server/SWServerToContextConnection.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::SWServerWorker):
        (WebCore::m_scriptResourceMap):
        (WebCore::SWServerWorker::contextData const):
        (WebCore::SWServerWorker::setScriptResource):
        * workers/service/server/SWServerWorker.h:

2018-06-05  Brent Fulgham  <bfulgham@apple.com>

        Revise DEFAULT_EXPERIMENTAL_FEATURES_ENABLED to work properly on Apple builds
        https://bugs.webkit.org/show_bug.cgi?id=186286
        <rdar://problem/40782992>

        Reviewed by Dan Bernstein.

        Use the WK_RELOCATABLE_FRAMEWORKS flag (which is always defined for non-production builds)
        to define ENABLE(EXPERIMENTAL_FEATURES) so that we do not need to manually
        change this flag when preparing for a production release.

        * Configurations/FeatureDefines.xcconfig: Use WK_RELOCATABLE_FRAMEWORKS to determine
        whether experimental features should be enabled, and use it to properly define the
        feature flag.

2018-06-05  Brent Fulgham  <bfulgham@apple.com>

        Unreviewed build fix after r232511.
        https://bugs.webkit.org/show_bug.cgi?id=186304

        * platform/ios/WebItemProviderPasteboard.mm: Add missing include.

2018-06-05  Antoine Quint  <graouts@apple.com>

        Fix the iOS build after r232496
        https://bugs.webkit.org/show_bug.cgi?id=186304

        Reviewed by Brent Fulgham.

        The changes in r232496 changed the InputType::element() signature from HTMLInputElement&
        to HTMLInputElement* and some call sites did not expect that.

        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleDOMActivateEvent):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::createShadowSubtree):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::updateInnerTextValue):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::didChooseValue):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeydownEvent):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::handleKeypressEvent):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::accessKeyAction):
        (WebCore::BaseChooserOnlyDateAndTimeInputType::isMouseFocusable const):
        * html/BaseDateAndTimeInputType.cpp:
        (WebCore::BaseDateAndTimeInputType::setValueAsDate const):
        (WebCore::BaseDateAndTimeInputType::valueAsDouble const):
        (WebCore::BaseDateAndTimeInputType::setValueAsDecimal const):
        (WebCore::BaseDateAndTimeInputType::typeMismatch const):
        (WebCore::BaseDateAndTimeInputType::serializeWithComponents const):
        (WebCore::BaseDateAndTimeInputType::localizeValue const):
        (WebCore::BaseDateAndTimeInputType::visibleValue const):
        (WebCore::BaseDateAndTimeInputType::valueMissing const):
        (WebCore::BaseDateAndTimeInputType::isKeyboardFocusable const):
        * html/DateInputType.cpp:
        (WebCore::DateInputType::createStepRange const):
        * html/DateTimeLocalInputType.cpp:
        (WebCore::DateTimeLocalInputType::createStepRange const):
        * html/MonthInputType.cpp:
        (WebCore::MonthInputType::valueAsDate const):
        (WebCore::MonthInputType::createStepRange const):
        * html/TimeInputType.cpp:
        (WebCore::TimeInputType::createStepRange const):
        * html/WeekInputType.cpp:
        (WebCore::WeekInputType::createStepRange const):

2018-06-03  Darin Adler  <darin@apple.com>

        Simplify and remove some unused video element code (helpful for ARC-compatibility)
        https://bugs.webkit.org/show_bug.cgi?id=186258

        Reviewed by Daniel Bates.

        My main mission was to remove the PlatformMedia struct, which had a union
        of Objective-C object pointers in it, which doesn't work in ARC. However, I
        found some other unused code to remove and simple mistakes to fix.

        * Modules/mediasource/VideoPlaybackQuality.cpp:
        (WebCore::VideoPlaybackQuality::create): Use unsigned instead of unsigned long,
        since IDL "unsigned long" really means unsigned.
        (WebCore::VideoPlaybackQuality::VideoPlaybackQuality): Ditto.
        * Modules/mediasource/VideoPlaybackQuality.h: Updated for the above.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::platformMedia const): Deleted.
        * html/HTMLMediaElement.h: Updated for the above.

        * platform/graphics/MediaPlayer.cpp:
        (WebCore::MediaPlayer::MediaPlayer): Moved initialization of many data members
        to the class definition.
        (WebCore::MediaPlayer::load): Use nullptr instead of 0.
        (WebCore::MediaPlayer::platformMedia const): Deleted.
        (WebCore::MediaPlayer::videoPlaybackQualityMetrics): Updated name of return type.
        (WebCore::MediaPlayer::objCAVFoundationAVPlayer const): Added. Replaces
        platformMedia for the one case where it was being used.
        * platform/graphics/MediaPlayer.h: Removed unneeded includes. Re-sorted things.
        Updated for the above. Removed PlatformMedia struct and NoPlatformMedia constant.
        Removed explicit constructor in MediaEngineSupportParameters. Renamed
        PlatformVideoPlaybackQualityMetrics struct to VideoPlaybackQualityMetrics,
        removed its constructor, and changed types from unsigned long to unsigned.
        Un-nested #if statements. Removed some Chromium-specific comments.

        * platform/graphics/MediaPlayerPrivate.h: Removed unneeded includes and
        forward declarations. Removed platformMedia. Updated return type for
        videoPlaybackQualityMetrics. Added objCAVFoundationAVPlayer.

        * platform/graphics/avfoundation/MediaPlayerPrivateAVFoundation.h:
        Removed platformMedia.

        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.cpp:
        (WebCore::MediaPlayerPrivateAVFoundation::platformMedia const): Deleted.
        * platform/graphics/avfoundation/cf/MediaPlayerPrivateAVFoundationCF.h:
        Updated for the above.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        Added override of objCAVFoundationAVPlayer. Removed platformMedia.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::platformMedia const): Deleted.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        Removed platformMedia. Updated return type for videoPlaybackQualityMetrics.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::platformMedia const): Deleted.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::videoPlaybackQualityMetrics):
        Updated return type, changed to use aggregate initialization instead of
        calling a constructor, and added casts to unsigned.

        * platform/graphics/cocoa/WebCoreDecompressionSession.h: Switched from
        unsigned long to unsigned for frame counts and from long to int for
        quality of service tier.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::platformMedia): Deleted.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        Updated for the above.

        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
        Removed videoPlaybackQualityMetrics since it was overriding a derived function
        without changing its behavior, and the type has changed.

        * platform/mock/mediasource/MockMediaPlayerMediaSource.cpp:
        (WebCore::MockMediaPlayerMediaSource::load): Pass two references.
        (WebCore::MockMediaPlayerMediaSource::videoPlaybackQualityMetrics):
        Updated return type.
        * platform/mock/mediasource/MockMediaPlayerMediaSource.h: Updated for the above.

        * platform/mock/mediasource/MockMediaSourcePrivate.cpp:
        (WebCore::MockMediaSourcePrivate::create): Return a Ref, take references.
        (WebCore::MockMediaSourcePrivate::MockMediaSourcePrivate): Moved most data
        member initialization into the class definition. Take references.
        (WebCore::MockMediaSourcePrivate::~MockMediaSourcePrivate): Use a modern for loop.
        (WebCore::MockMediaSourcePrivate::durationChanged): Update since m_player is a
        reference.
        (WebCore::MockMediaSourcePrivate::markEndOfStream): Ditto.
        (WebCore::MockMediaSourcePrivate::readyState): Ditto.
        (WebCore::MockMediaSourcePrivate::setReadyState): Ditto.
        (WebCore::MockMediaSourcePrivate::waitForSeekCompleted): Ditto.
        (WebCore::MockMediaSourcePrivate::seekCompleted): Ditto.
        (WebCore::MockMediaSourcePrivate::removeSourceBuffer): Use Vector::removeFirst
        instead of find/remove pairs.
        (WebCore::MockMediaSourcePrivate::sourceBufferPrivateDidChangeActiveState): Ditto.
        (WebCore::MockMediaSourcePrivate::seekToTime): Use modern for loop.
        (WebCore::MockMediaSourcePrivate::videoPlaybackQualityMetrics): Updated return
        type, changed to use aggregate initialization instead of calling a constructor.
        * platform/mock/mediasource/MockMediaSourcePrivate.h: Updated for the above.

        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
        (WebCore::MockSourceBufferPrivate::readyState): Updated since player is now
        a reference.
        (WebCore::MockSourceBufferPrivate::setReadyState): Ditto.

2018-06-04  Darin Adler  <darin@apple.com>

        [Cocoa] Improve smart pointer support for ARC (OSObjectPtr/DispatchPtr)
        https://bugs.webkit.org/show_bug.cgi?id=186300

        Reviewed by Daniel Bates.

        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm: Removed unnecessary
        include of OSObjectPtr.h.
        * platform/ios/WebItemProviderPasteboard.mm: Ditto.

2018-06-05  Joanmarie Diggs  <jdiggs@igalia.com>

        AX: Implement support for new blockquote, caption, and paragraph ARIA roles
        https://bugs.webkit.org/show_bug.cgi?id=186274

        Reviewed by Chris Fleizach.

        Add the three new ARIA roles to the internal rolemap so that they are treated in
        the same fashion as their HTML element counterparts. Also ensure that an element
        with an explicit caption role does not get pruned from the macOS accessibility tree.

        No new tests. Instead add the roles to the existing role-exposure tests.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::initializeRoleMap):
        * accessibility/mac/AccessibilityObjectMac.mm:
        (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject const):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap):

2018-06-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Merge width and margin computation for block-level, replaced elements in normal flow
        https://bugs.webkit.org/show_bug.cgi?id=186270

        Reviewed by Sam Weinig.

        https://www.w3.org/TR/CSS22/visudet.html#block-replaced-width
        10.3.4 Block-level, replaced elements in normal flow

        The used value of 'width' is determined as for inline replaced elements.
        Then the rules for non-replaced block-level elements are applied to determine the margins.

        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

2018-06-04  Enrique Ocaña González  <eocanha@igalia.com>

        [GStreamer][MSE] MediaPlayerPrivateGStreamerMSE.h includes and forward declares PlaybackPipeline
        https://bugs.webkit.org/show_bug.cgi?id=186190

        Reviewed by Xabier Rodriguez-Calvar.

        This is just a compilation improvement.

        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:
        * platform/graphics/gstreamer/mse/MediaSourceClientGStreamerMSE.cpp:

2018-06-03  Darin Adler  <darin@apple.com>

        [Cocoa] Update more code to be more ARC-compatible to prepare for future ARC adoption
        https://bugs.webkit.org/show_bug.cgi?id=186245

        Reviewed by Daniel Bates.

        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        (convertToNSArray): Explicitly cast to WebAccessibilityObjectWrapperBase so we don't
        make method calls on WebAccessibilityObjectWrapper, a forward-declared class.
        (-[WebAccessibilityObjectWrapperBase convertPathToScreenSpace:]): Use CFAutorelease
        for the CGPathRef return value instead of Objective-C autorelease. Another option
        would be to use RetainPtr for the return type instead.

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (AXObjectIsTextMarker): Use __bridge for bridging typecast.
        (AXObjectIsTextMarkerRange): Ditto.
        (AXTextMarkerRange): Ditto.
        (AXTextMarkerRangeStart): Ditto.
        (AXTextMarkerRangeEnd): Ditto.
        (isTextMarkerIgnored): Ditto.
        (accessibilityObjectForTextMarker): Ditto.
        (-[WebAccessibilityObjectWrapper characterOffsetForTextMarker:]): Ditto.
        (-[WebAccessibilityObjectWrapper visiblePositionForTextMarker:]): Ditto.
        (visiblePositionForStartOfTextMarkerRange): Ditto.
        (visiblePositionForEndOfTextMarkerRange): Ditto.
        (AXAttributeStringSetFont): Ditto. Also use @{} syntax to make NSDictionary
        and @() to make NSNumber.
        (AXAttributeStringSetColor): Use __bridge for bridging typecast, rearranging
        code so that the typecasts are on function arguments, not local variables,
        which makes lifetimes clearer.
        (AXAttributeStringSetElement): Use __bridge for bridging typecast.
        (WebTransformCGPathToNSBezierPath):
        (-[WebAccessibilityObjectWrapper bezierPathFromPath:]): Added a bridging
        typecast when passing an NSBezierPath through as a void* context argument;
        silent conversion to void* is not compatible with ARC.
        (createAccessibilityRoleMap): Use __unsafe_unretained for a table of
        NSString constants.

        * bindings/js/ScriptControllerMac.mm:
        (WebCore::ScriptController::createScriptInstanceForWidget): Use __bridge
        for bridging typecast.

        * bridge/objc/objc_class.mm:
        (JSC::Bindings::ObjcClass::classForIsA): Added bridging typecasts
        to convert a Class into a CFTypeRef.
        (JSC::Bindings::ObjcClass::methodNamed const): Use __bridge for bridging
        typecast.
        (JSC::Bindings::ObjcClass::fieldNamed const): Ditto.
        * bridge/objc/objc_instance.mm:
        (ObjcInstance::invokeObjcMethod): Ditto.
        * bridge/objc/objc_runtime.mm:
        (JSC::Bindings::ObjcField::valueFromInstance const): Ditto.
        (JSC::Bindings::ObjcField::setValueToInstance const): Ditto.
        * bridge/objc/objc_utility.mm:
        (JSC::Bindings::convertObjcValueToValue): Ditto. Also add a missing const
        to make it clearer to the compiler that the code is correct.
        * crypto/mac/SerializedCryptoKeyWrapMac.mm:
        (WebCore::createAndStoreMasterKey): Ditto.
        (WebCore::findMasterKey): Ditto.
        * editing/cocoa/DataDetection.mm:
        (WebCore::detectItemAtPositionWithRange): Ditto.
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::fontAttributesForSelectionStart const): Ditto.
        * editing/cocoa/HTMLConverter.mm:
        (_font): Ditto.
        (fileWrapperForElement): Ditto.
        * fileapi/FileCocoa.mm:
        (WebCore::File::shouldReplaceFile): Ditto.
        * loader/archive/cf/LegacyWebArchiveMac.mm:
        (WebCore::LegacyWebArchive::createResourceResponseFromMacArchivedData): Ditto.
        * page/mac/TextIndicatorWindow.mm:
        (-[WebTextIndicatorView initWithFrame:textIndicator:margin:offset:]): Ditto.
        (createContentCrossfadeAnimation): Ditto.
        * platform/cocoa/LocalizedStringsCocoa.mm:
        (WebCore::localizedString): Ditto.
        * platform/cocoa/SharedBufferCocoa.mm:
        (WebCore::SharedBuffer::create): Ditto.
        (WebCore::SharedBuffer::append): Ditto.
        * platform/graphics/FontPlatformData.h:
        (WebCore::toCTFont): Ditto.
        (WebCore::toNSFont): Ditto.
        * platform/graphics/avfoundation/objc/AVAssetTrackUtilities.mm:
        (WebCore::assetTrackMeetsHardwareDecodeRequirements): Ditto.
        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        (WebCore::ImageDecoderAVFObjC::storeSampleBuffer): Ditto.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::updateLastImage): Ditto.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaStreamAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaStreamAVFObjC::updateCurrentFrameImage): Ditto.
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::MediaDescriptionAVFObjC::MediaDescriptionAVFObjC): Ditto.
        (WebCore::bufferWasConsumedCallback): Ditto.
        (WebCore::SourceBufferPrivateAVFObjC::enqueueSample): Ditto.
        * platform/graphics/avfoundation/objc/VideoFullscreenLayerManagerObjC.mm:
        (WebCore::VideoFullscreenLayerManagerObjC::updateVideoFullscreenInlineImage): Ditto.
        (WebCore::VideoFullscreenLayerManagerObjC::setVideoFullscreenLayer): Ditto.
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::create): Ditto.
        (PlatformCALayer::platformCALayer): Ditto.
        (PlatformCALayerCocoa::superlayer const): Ditto.
        (PlatformCALayerCocoa::contents const): Ditto.
        (PlatformCALayerCocoa::setContents): Ditto.
        * platform/graphics/cocoa/IOSurface.h: Ditto.
        * platform/graphics/cocoa/TextTrackRepresentationCocoa.mm:
        (TextTrackRepresentationCocoa::update): Ditto.
        * platform/graphics/cocoa/WebCoreDecompressionSession.mm:
        (WebCore::WebCoreDecompressionSession::ensureDecompressionSessionForSample): Ditto.
        (WebCore::WebCoreDecompressionSession::resetQosTier): Ditto.
        * platform/graphics/cocoa/WebGLLayer.mm:
        (-[WebGLLayer display]): Ditto.
        * platform/graphics/mac/ImageMac.mm:
        (WebCore::BitmapImage::nsImage): Ditto.
        (WebCore::BitmapImage::snapshotNSImage): Ditto.
        * platform/graphics/mac/WebLayer.mm:
        (-[WebLayer drawInContext:]): Ditto.
        (-[WebSimpleLayer setNeedsDisplay]): Ditto.
        (-[WebSimpleLayer setNeedsDisplayInRect:]): Ditto.
        (-[WebSimpleLayer display]): Ditto.
        (-[WebSimpleLayer drawInContext:]): Ditto.

        * platform/mac/CursorMac.mm:
        (WebCore::cursor): Mark pointer __strong to match the globals it points to.

        * platform/mac/FileSystemMac.mm:
        (WebCore::FileSystem::setMetadataURL): Use RetainPtr instead of autorelease.

        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::bufferForType): Use __bridge for bridging
        typecast.
        * platform/mac/PlatformSpeechSynthesizerMac.mm:
        (WebCore::speechSynthesisGetVoiceIdentifiers): Ditto.
        (WebCore::speechSynthesisGetDefaultVoiceIdentifierForLocale): Ditto.

        * platform/mac/PluginBlacklist.h: Use RetainPtr instead of explicit retain
        and release for NSDictionary and NSSet.
        * platform/mac/PluginBlacklist.mm:
        (WebCore::PluginBlacklist::create): Use __bridge for bridging typecast.
        (WebCore::PluginBlacklist::~PluginBlacklist): Remove explicit CFRelease calls.
        (WebCore::PluginBlacklist::PluginBlacklist): Add adoptNS calls and remove
        explciit CFRetain/release pairs.

        * platform/mac/PublicSuffixMac.mm:
        (WebCore::isPublicSuffix): Use __bridge for bridging typecast.
        * platform/mac/RemoteCommandListenerMac.mm:
        (WebCore::RemoteCommandListenerMac::RemoteCommandListenerMac): Ditto.
        * platform/mac/SerializedPlatformRepresentationMac.mm:
        (WebCore::jsValueWithDictionaryInContext): Ditto.
        * platform/mac/URLMac.mm:
        (WebCore::URL::URL): Ditto.
        (WebCore::URL::createCFURL const): Ditto.

        * platform/mac/WebCoreNSURLExtras.mm:
        (WebCore::collectRangesThatNeedMapping): Mark pointer __strong to match the
        local variable it eventually points to.
        (WebCore::stringByTrimmingWhitespace): Use __bridge for bridging typecast.
        (WebCore::URLByTruncatingOneCharacterBeforeComponent): Use
        CFBridgingRelease instead of autorelease, reducing typecasts.
        (WebCore::URLByRemovingComponentAndSubsequentCharacter): Ditto.
        (WebCore::userVisibleString): Use __bridge for bridging typecast.
        (WebCore::isUserVisibleURL): Ditto.

        * platform/mac/WebGLBlacklist.mm:
        (WebCore::WebGLBlacklist::create): Use __bridge for bridging typecast.
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::setPreset): Ditto.
        (WebCore::AVVideoCaptureSource::setupCaptureSession): Ditto. Also use @()
        instead of NSNumber.
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer): Ditto.
        * platform/network/cocoa/ResourceRequestCocoa.mm:
        (WebCore::ResourceRequest::doUpdatePlatformHTTPBody): Ditto.

        * platform/network/cocoa/ResourceResponseCocoa.mm: Use CFStringRef and
        CFSTR for constant string array commonHeaderFields rather than using
        NSString * and then relying on implicit bridging conversion.

        * platform/network/mac/CertificateInfoMac.mm:
        (WebCore::CertificateInfo::dump const): Use __bridge for bridging typecast.
        * platform/network/mac/FormDataStreamMac.mm:
        (WebCore::createHTTPBodyNSInputStream): Ditto.
        (WebCore::httpBodyFromStream): Ditto.
        * platform/network/mac/ResourceErrorMac.mm:
        (WebCore::ResourceError::ResourceError): Ditto.
        (WebCore::ResourceError::cfError const): Ditto.

        * rendering/RenderThemeMac.mm:
        (-[WebCoreTextFieldCell _coreUIDrawOptionsWithFrame:inView:includeFocus:]):
        Use CFSTR("") instead of @"" for a string that is passed to CFDIctionaryRef.
        (WebCore::AttachmentLayout::layOutTitle): Use __bridge for bridging typecast.
        (WebCore::AttachmentLayout::layOutSubtitle): Ditto.

        * testing/cocoa/WebArchiveDumpSupport.mm:
        (WebCoreTestSupport::createCFURLResponseFromResponseData): Use __bridge for
        bridging typecast.
        (WebCoreTestSupport::supportedNonImageMIMETypes): Deleted.
        (WebCoreTestSupport::convertWebResourceDataToString): Use the
        MIMETypeRegistry::isSupportedNonImageMIMEType function directly instead of
        building a CFArray out of MIMETypeRegistry::getSupportedNonImageMIMETypes
        and using CFArrayContainsValue. This is both much more direct and much more
        efficient as well.

2018-06-04  Timothy Hatcher  <timothy@apple.com>

        [Win] REGRESSION(r232486) 'WebCore::RenderTheme::activeListBoxSelectionBackgroundColor': function does not take 0 arguments
        https://bugs.webkit.org/show_bug.cgi?id=186296

        Unreviewed build fix.

        * platform/win/PopupMenuWin.cpp:
        (WebCore::PopupMenuWin::paint):
        * rendering/RenderThemeWin.cpp:
        (WebCore::RenderThemeWin::platformInactiveSelectionForegroundColor const):

2018-06-04  Chris Dumez  <cdumez@apple.com>

        Rename "Cross-Origin-Options" HTTP header to "Cross-Origin-Window-Policy"
        https://bugs.webkit.org/show_bug.cgi?id=186287
        <rdar://problem/40783352>

        Reviewed by Youenn Fablet.

        Tests: http/wpt/cross-origin-window-policy/allow-postmessage-from-deny.html
               http/wpt/cross-origin-window-policy/allow-postmessage.html
               http/wpt/cross-origin-window-policy/cross-origin-window-policy-header.html
               http/wpt/cross-origin-window-policy/navigation-from-opener-via-open-target.html
               http/wpt/cross-origin-window-policy/navigation-from-subframe-via-anchor-target.html

        * bindings/js/JSDOMBindingSecurity.cpp:
        (WebCore::BindingSecurity::shouldAllowAccessToDOMWindowGivenMinimumCrossOriginWindowPolicy):
        * bindings/js/JSDOMBindingSecurity.h:
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::effectiveCrossOriginWindowPolicyForAccess):
        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
        (WebCore::JSDOMWindow::getOwnPropertySlotByIndex):
        (WebCore::addCrossOriginWindowPropertyNames):
        (WebCore::addScopedChildrenIndexes):
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateAttributeGetterBodyDefinition):
        (GetCrossOriginsOptionsFromExtendedAttributeValue):
        (GenerateAttributeSetterBodyDefinition):
        (GenerateOperationBodyDefinition):
        * bindings/scripts/IDLAttributes.json:
        * dom/Document.cpp:
        (WebCore::Document::canNavigate):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::didBeginDocument):
        * page/AbstractDOMWindow.cpp:
        (WebCore::AbstractDOMWindow::AbstractDOMWindow):
        * page/AbstractDOMWindow.h:
        (WebCore::AbstractDOMWindow::crossOriginWindowPolicy):
        (WebCore::AbstractDOMWindow::setCrossOriginWindowPolicy):
        * page/DOMWindow.idl:
        * page/Settings.yaml:
        * platform/network/HTTPHeaderNames.in:
        * platform/network/HTTPParsers.cpp:
        (WebCore::parseCrossOriginWindowPolicyHeader):
        * platform/network/HTTPParsers.h:

2018-06-04  Brent Fulgham  <bfulgham@apple.com>

        REGRESSION(r231291): InputType should hold a WeakPtr to its HTMLInputElement
        https://bugs.webkit.org/show_bug.cgi?id=186096
        <rdar://problem/40651015>

        Reviewed by Ryosuke Niwa.

        Now that the InputType may be kept alive as part of in-flight form submissions, we
        shouldn't assume that the referenced HTMLInputElement is still valid before using it.

        The only time we should be lacking a referencing element is in cases where the InputType
        is changing, either through a change in the HTMLInputElement's type attribute. In those
        cases we should check for a valid HTMLInputElement. In other cases, we should ASSERT.

        * html/BaseButtonInputType.cpp:
        (WebCore::BaseButtonInputType::createInputRenderer):
        (WebCore::BaseButtonInputType::setValue):
        * html/BaseCheckableInputType.cpp:
        (WebCore::BaseCheckableInputType::saveFormControlState const):
        (WebCore::BaseCheckableInputType::restoreFormControlState):
        (WebCore::BaseCheckableInputType::appendFormData const):
        (WebCore::BaseCheckableInputType::handleKeydownEvent):
        (WebCore::BaseCheckableInputType::accessKeyAction):
        (WebCore::BaseCheckableInputType::setValue):
        * html/BaseChooserOnlyDateAndTimeInputType.cpp:
        (WebCore::BaseChooserOnlyDateAndTimeInputType::attributeChanged): Add a nullptr check
        here, since this is called directly by code that causes the old InputType to be removed,
        which could leave us with a nullptr element().
        * html/BaseClickableWithKeyInputType.cpp:
        (WebCore::BaseClickableWithKeyInputType::handleKeydownEvent):
        (WebCore::BaseClickableWithKeyInputType::handleKeypressEvent):
        (WebCore::BaseClickableWithKeyInputType::accessKeyAction):
        * html/BaseDateAndTimeInputType.cpp:
        (WebCore::BaseDateAndTimeInputType::attributeChanged): Add a nullptr check
        here, since this is called directly by code that causes the old InputType to be removed,
        which could leave us with a nullptr element().
        * html/BaseTextInputType.cpp:
        (WebCore::BaseTextInputType::patternMismatch const):
        * html/CheckboxInputType.cpp:
        (WebCore::CheckboxInputType::valueMissing const):
        (WebCore::CheckboxInputType::willDispatchClick):
        (WebCore::CheckboxInputType::didDispatchClick):
        (WebCore::CheckboxInputType::shouldAppearIndeterminate const):
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::valueAsColor const):
        (WebCore::ColorInputType::createShadowSubtree):
        (WebCore::ColorInputType::handleDOMActivateEvent):
        (WebCore::ColorInputType::didChooseColor):
        (WebCore::ColorInputType::updateColorSwatch):
        (WebCore::ColorInputType::shadowColorSwatch const):
        (WebCore::ColorInputType::elementRectRelativeToRootView const):
        (WebCore::ColorInputType::shouldShowSuggestions const):
        (WebCore::ColorInputType::suggestions const):
        * html/EmailInputType.cpp:
        (WebCore::EmailInputType::typeMismatchFor const):
        (WebCore::EmailInputType::typeMismatch const):
        (WebCore::EmailInputType::typeMismatchText const):
        (WebCore::EmailInputType::sanitizeValue const):
        * html/FileInputType.cpp:
        (WebCore::FileInputType::appendFormData const):
        (WebCore::FileInputType::attributeChanged): Add a nullptr check here, since
        this is called directly by code that causes the old InputType to be removed,
        which could leave us with a nullptr element().
        (WebCore::FileInputType::valueMissing const):
        (WebCore::FileInputType::valueMissingText const):
        (WebCore::FileInputType::handleDOMActivateEvent):
        (WebCore::FileInputType::createInputRenderer):
        (WebCore::FileInputType::setValue):
        (WebCore::FileInputType::createShadowSubtree):
        (WebCore::FileInputType::disabledAttributeChanged):
        (WebCore::FileInputType::multipleAttributeChanged):
        (WebCore::FileInputType::allowsDirectories const):
        (WebCore::FileInputType::setFiles):
        (WebCore::FileInputType::iconLoaded):
        (WebCore::FileInputType::receiveDroppedFiles):
        (WebCore::FileInputType::defaultToolTip const):
        * html/HTMLInputElement.h:
        (WebCore::HTMLInputElement::weakPtrFactory const):
        * html/HiddenInputType.cpp:
        (WebCore::HiddenInputType::saveFormControlState const):
        (WebCore::HiddenInputType::restoreFormControlState):
        (WebCore::HiddenInputType::setValue):
        (WebCore::HiddenInputType::appendFormData const):
        * html/ImageInputType.cpp:
        (WebCore::ImageInputType::appendFormData const):
        (WebCore::ImageInputType::handleDOMActivateEvent):
        (WebCore::ImageInputType::createInputRenderer):
        (WebCore::ImageInputType::altAttributeChanged):
        (WebCore::ImageInputType::srcAttributeChanged):
        (WebCore::ImageInputType::attach):
        (WebCore::ImageInputType::height const):
        (WebCore::ImageInputType::width const):
        * html/InputType.cpp:
        (WebCore::InputType::saveFormControlState const):
        (WebCore::InputType::restoreFormControlState):
        (WebCore::InputType::isFormDataAppendable const):
        (WebCore::InputType::appendFormData const):
        (WebCore::InputType::sizeShouldIncludeDecoration const):
        (WebCore::InputType::validationMessage const):
        (WebCore::InputType::createInputRenderer):
        (WebCore::InputType::blur):
        (WebCore::InputType::destroyShadowSubtree):
        (WebCore::InputType::dispatchSimulatedClickIfActive const):
        (WebCore::InputType::chrome const):
        (WebCore::InputType::isKeyboardFocusable const):
        (WebCore::InputType::isMouseFocusable const):
        (WebCore::InputType::accessKeyAction):
        (WebCore::InputType::setValue):
        (WebCore::InputType::visibleValue const):
        (WebCore::InputType::applyStep):
        (WebCore::InputType::stepUpFromRenderer):
        * html/InputType.h:
        (WebCore::InputType::InputType):
        (WebCore::InputType::element const):
        * html/NumberInputType.cpp:
        (WebCore::NumberInputType::attributeChanged): Add a nullptr check here, since
        this is called directly by code that causes the old InputType to be removed,
        which could leave us with a nullptr element().
        (WebCore::NumberInputType::setValue):
        (WebCore::NumberInputType::valueAsDouble const):
        (WebCore::NumberInputType::setValueAsDouble const):
        (WebCore::NumberInputType::setValueAsDecimal const):
        (WebCore::NumberInputType::typeMismatch const):
        (WebCore::NumberInputType::createStepRange const):
        (WebCore::NumberInputType::sizeShouldIncludeDecoration const):
        (WebCore::NumberInputType::decorationWidth const):
        (WebCore::NumberInputType::localizeValue const):
        (WebCore::NumberInputType::visibleValue const):
        (WebCore::NumberInputType::convertFromVisibleValue const):
        (WebCore::NumberInputType::hasBadInput const):
        (WebCore::NumberInputType::minOrMaxAttributeChanged):
        (WebCore::NumberInputType::stepAttributeChanged):
        * html/RadioInputType.cpp:
        (WebCore::RadioInputType::valueMissing const):
        (WebCore::RadioInputType::handleKeydownEvent):
        (WebCore::RadioInputType::handleKeyupEvent):
        (WebCore::RadioInputType::isKeyboardFocusable const):
        (WebCore::RadioInputType::shouldSendChangeEventAfterCheckedChanged):
        (WebCore::RadioInputType::willDispatchClick):
        (WebCore::RadioInputType::didDispatchClick):
        (WebCore::RadioInputType::matchesIndeterminatePseudoClass const):
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::attributeChanged): Add a nullptr check here, since
        this is called directly by code that causes the old InputType to be removed,
        which could leave us with a nullptr element().
        (WebCore::RangeInputType::valueAsDouble const):
        (WebCore::RangeInputType::setValueAsDecimal const):
        (WebCore::RangeInputType::createStepRange const):
        (WebCore::RangeInputType::handleMouseDownEvent):
        (WebCore::RangeInputType::handleTouchEvent):
        (WebCore::RangeInputType::handleKeydownEvent):
        (WebCore::RangeInputType::createShadowSubtree):
        (WebCore::RangeInputType::sliderTrackElement const):
        (WebCore::RangeInputType::createInputRenderer):
        (WebCore::RangeInputType::accessKeyAction):
        (WebCore::RangeInputType::minOrMaxAttributeChanged):
        (WebCore::RangeInputType::setValue):
        (WebCore::RangeInputType::updateTickMarkValues):
        * html/ResetInputType.cpp:
        (WebCore::ResetInputType::handleDOMActivateEvent):
        * html/SearchInputType.cpp:
        (W