ChangeLog-2018-09-11   [plain text]


2018-09-11  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] use-after-free in MockVideoCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=189462

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/mediastream/gstreamer/MockGStreamerVideoCaptureSource.cpp:
        (WebCore::WrappedMockRealtimeVideoSource::updateSampleBuffer):
        Copy the BGRA data before passing ownership to GStreamer. Also
        include a few code style cosmetic changes.

2018-09-11  Jiewen Tan  <jiewen_tan@apple.com>

        [WebAuthN] Polish AuthenticatorManager and rename it to AuthenticatorCoordinator
        https://bugs.webkit.org/show_bug.cgi?id=189277
        <rdar://problem/44115936>

        Reviewed by Chris Dumez.

        This patch aims to polish AuthenticatorManager such that:
        1) It is no longer a singleton. Instead, it will live with Page. It was a singleton simply because static
        PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable() have to access it. However, this request
        can be fulfilled by adding an attribute [CallWith=Document] to the IDL defination. Therefore, there is no
        such need. Also, the singleton is illy implemented as it owns a single IPC proxy to UI Process which means
        different web pages will talk to the same web page proxy. Anyway, making it live with Page should fix everything.
        2) Since we are now planning to support external authenticators, the manager of all authenticators will then
        have to live in UI Process which makes this AuthenticatorManager obsolete. Instead, rename it to AuthenticatorCoordinator.
        3) Rename CredentialsMessenger to AuthenticatorCoordinatorClient to tight it to WebAuthN. Also, simplify the
        message reply model as PublicKeyCredentialCreationOptions/PublicKeyCredentialRequestOptions =>
        ExceptionData/PublicKeyCredentialData for makeCredential/getAssertion operations.
        4) Restrict one request per time, i.e. makeCredential/getAssertion for a single page.
        5) Unifying makeCredentialReply/getAssertionReply/exceptionReply into requestReply for IPC. Correspondingly,
        unify callback and exceptionCallback into callback as well for LocalAuthenticator.
        6) Enhance PublicKeyCredentialCreationOptions encoding/decoding with encoder.encodeFixedLengthData/decoder.decodeFixedLengthData.

        Covered by existing tests.

        * DerivedSources.make:
        * Modules/credentialmanagement/CredentialsContainer.cpp:
        (WebCore::CredentialsContainer::get):
        (WebCore::CredentialsContainer::isCreate):
        * Modules/credentialmanagement/CredentialsContainer.h:
        * Modules/credentialmanagement/CredentialsMessenger.cpp: Removed.
        * Modules/credentialmanagement/CredentialsMessenger.h: Removed.
        * Modules/webauthn/AuthenticatorAssertionResponse.cpp: Removed.
        * Modules/webauthn/AuthenticatorAssertionResponse.h:
        (WebCore::AuthenticatorAssertionResponse::create):
        (WebCore::AuthenticatorAssertionResponse::authenticatorData const):
        (WebCore::AuthenticatorAssertionResponse::signature const):
        (WebCore::AuthenticatorAssertionResponse::userHandle const):
        (WebCore::AuthenticatorAssertionResponse::AuthenticatorAssertionResponse):
        * Modules/webauthn/AuthenticatorAttestationResponse.cpp: Removed.
        * Modules/webauthn/AuthenticatorAttestationResponse.h:
        (WebCore::AuthenticatorAttestationResponse::create):
        (WebCore::AuthenticatorAttestationResponse::attestationObject const):
        (WebCore::AuthenticatorAttestationResponse::AuthenticatorAttestationResponse):
        * Modules/webauthn/AuthenticatorCoordinator.cpp: Renamed from Source/WebCore/Modules/webauthn/AuthenticatorManager.cpp.
        (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJson):
        (WebCore::AuthenticatorCoordinatorInternal::produceClientDataJsonHash):
        (WebCore::AuthenticatorCoordinatorInternal::initTimeoutTimer):
        (WebCore::AuthenticatorCoordinatorInternal::didTimeoutTimerFire):
        (WebCore::AuthenticatorCoordinator::AuthenticatorCoordinator):
        (WebCore::AuthenticatorCoordinator::setClient):
        (WebCore::AuthenticatorCoordinator::create const):
        (WebCore::AuthenticatorCoordinator::discoverFromExternalSource const):
        (WebCore::AuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable const):
        * Modules/webauthn/AuthenticatorCoordinator.h: Renamed from Source/WebCore/Modules/webauthn/AuthenticatorManager.h.
        * Modules/webauthn/AuthenticatorCoordinatorClient.cpp: Added.
        (WebCore::AuthenticatorCoordinatorClient::~AuthenticatorCoordinatorClient):
        (WebCore::AuthenticatorCoordinatorClient::requestReply):
        (WebCore::AuthenticatorCoordinatorClient::isUserVerifyingPlatformAuthenticatorAvailableReply):
        (WebCore::AuthenticatorCoordinatorClient::setRequestCompletionHandler):
        (WebCore::AuthenticatorCoordinatorClient::addQueryCompletionHandler):
        * Modules/webauthn/AuthenticatorCoordinatorClient.h: Copied from Source/WebKit/UIProcess/CredentialManagement/WebCredentialsMessengerProxy.h.
        * Modules/webauthn/AuthenticatorResponse.cpp: Removed.
        * Modules/webauthn/AuthenticatorResponse.h:
        (WebCore::AuthenticatorResponse::AuthenticatorResponse):
        (WebCore::AuthenticatorResponse::clientDataJSON const):
        * Modules/webauthn/PublicKeyCredential.cpp:
        (WebCore::PublicKeyCredential::create):
        (WebCore::PublicKeyCredential::tryCreate):
        (WebCore::PublicKeyCredential::PublicKeyCredential):
        (WebCore::PublicKeyCredential::isUserVerifyingPlatformAuthenticatorAvailable):
        * Modules/webauthn/PublicKeyCredential.h:
        * Modules/webauthn/PublicKeyCredential.idl:
        * Modules/webauthn/PublicKeyCredentialCreationOptions.h:
        (WebCore::PublicKeyCredentialCreationOptions::encode const):
        (WebCore::PublicKeyCredentialCreationOptions::decode):
        * Modules/webauthn/PublicKeyCredentialData.h: Added.
        (WebCore::PublicKeyCredentialData::encode const):
        (WebCore::PublicKeyCredentialData::decode):
        * Modules/webauthn/cocoa/LocalAuthenticator.h:
        * Modules/webauthn/cocoa/LocalAuthenticator.mm:
        (WebCore::LocalAuthenticator::makeCredential):
        (WebCore::LocalAuthenticator::getAssertion):
        * Modules/webvr/VRStageParameters.cpp:
        Add a header file to prevent linkage error.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * page/Page.cpp:
        * page/Page.h:
        (WebCore::Page::authenticatorCoordinator const):
        * page/PageConfiguration.cpp:
        * page/PageConfiguration.h:
        * testing/Internals.cpp:
        (WebCore::Internals::Internals):
        (WebCore::Internals::mockAuthenticatorCoordinator const):
        (WebCore::Internals::mockCredentialsMessenger const): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:
        * testing/MockAuthenticatorCoordinator.cpp: Added.
        (WebCore::MockAuthenticatorCoordinator::setCreationReturnBundle):
        (WebCore::MockAuthenticatorCoordinator::setAssertionReturnBundle):
        (WebCore::MockAuthenticatorCoordinator::makeCredential):
        (WebCore::MockAuthenticatorCoordinator::getAssertion):
        (WebCore::MockAuthenticatorCoordinator::isUserVerifyingPlatformAuthenticatorAvailable):
        * testing/MockAuthenticatorCoordinator.h: Renamed from Source/WebCore/testing/MockCredentialsMessenger.h.
        * testing/MockAuthenticatorCoordinator.idl: Renamed from Source/WebCore/testing/MockCredentialsMessenger.idl.
        * testing/MockCredentialsMessenger.cpp: Removed.

2018-09-10  Fujii Hironori  <Hironori.Fujii@sony.com>

        Remove unused needsDestruction class variables from HashTraits
        https://bugs.webkit.org/show_bug.cgi?id=189490

        Reviewed by Daniel Bates.

        needsDestruction has been obsoleted in Bug 121983.

        No new tests (No behavior change).

        * css/makeprop.pl: Removed needsDestruction.
        * platform/graphics/FloatSizeHash.h: Ditto.
        * platform/graphics/IntPointHash.h: Ditto.
        * platform/graphics/IntRectHash.h: Ditto.
        * platform/graphics/IntSizeHash.h: Ditto.
        * platform/graphics/WidthCache.h: Ditto.

2018-09-10  Michael Saboff  <msaboff@apple.com>

        Test262 failure with Named Capture Groups - using a reference before the group is defined
        https://bugs.webkit.org/show_bug.cgi?id=189407

        Reviewed by Alex Christensen.

        Created new delegate stubs for RegExp parsing.  These are not needed for the URL filtering
        use cases.  Also changed all the delegate methods that take a String to take 
        const String& to eliminate copy churn.

        Updated TestWebKitAPI/Tests/WebCore/ContentExtensions.cpp.

        * contentextensions/URLFilterParser.cpp:
        (WebCore::ContentExtensions::PatternParser::atomNamedBackReference):
        (WebCore::ContentExtensions::PatternParser::isValidNamedForwardReference):
        (WebCore::ContentExtensions::PatternParser::atomNamedForwardReference):
        (WebCore::ContentExtensions::URLFilterParser::statusString):
        * contentextensions/URLFilterParser.h:

2018-09-10  Megan Gardner  <megan_gardner@apple.com>

        Correctly interpret from angle for conic gradients
        https://bugs.webkit.org/show_bug.cgi?id=189445

        Reviewed by Simon Fraser

        No new tests, no functionality is changing.

        Just renaming angle to angleRadians to make the type more clear, 
        and hopefully avoid bugs in the future. Update patch to original bug
        fix.

        * css/CSSGradientValue.cpp:
        (WebCore::CSSConicGradientValue::createGradient):
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        * platform/graphics/Gradient.cpp:
        (WebCore::Gradient::hash const):
        * platform/graphics/Gradient.h:
        * platform/graphics/cg/GradientCG.cpp:
        (WebCore::Gradient::paint):

2018-09-10  Youenn Fablet  <youenn@apple.com>

        ontrack events should be fired even if an existing transceiver exists
        https://bugs.webkit.org/show_bug.cgi?id=189477

        Reviewed by Eric Carlson.

        In case of an OnTrack callback from libwebrtc, make sure the ontrack event is called even if a transceiver already exists for that track.

        Covered by updated video-addTransceiver.html
        New test video-addLegacyTransceiver.html keeps testing the old transceiver behavior.
        Test: webrtc/video-addLegacyTransceiver.html

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

2018-09-10  Megan Gardner  <megan_gardner@apple.com>

        Correctly interpret from angle for conic gradients
        https://bugs.webkit.org/show_bug.cgi?id=189445
        <rdar://problem/44158271>

        Reviewed by Tim Horton.

        Test: fast/gradients/conic-from-angle.html

        We were pulling the angle as degrees when we really need radians.

        * css/CSSGradientValue.cpp:
        (WebCore::CSSConicGradientValue::createGradient):

2018-09-10  James Savage  <james.savage@apple.com>

        Expose -apple-system-container-border color to internal web views.
        https://bugs.webkit.org/show_bug.cgi?id=189178.

        Reviewed by Timothy Hatcher.

        Tests: LayoutTests/fast/css/apple-system-colors.html

        * css/CSSValueKeywords.in: Add new semantic color name.
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::systemColor const): Use system color on supported
        systems, and fall back to approximation for older systems.

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

        mouseenter and mouseleave events don't get dispatched even when there is a capturing event listener for a slot ancestor
        https://bugs.webkit.org/show_bug.cgi?id=188561

        Reviewed by Darin Adler.

        This patch makes mouseenter and mouseleave events to work with shadow trees and slots therein, and makes them uncomposed
        as discussed in https://github.com/w3c/uievents/issues/208.

        This patch also makes these events dispatched on DOM tree ancestors of the currently hovered element instead of
        render tree's hover ancestors to be consistent with the check in hierarchyHasCapturingEventListeners and other browsers.
        In particular, using hover ancestors is problematic when there is an element with display: contents such as slot elements,
        which do not have a render object.

        Tests: fast/shadow-dom/mouseenter-mouseleave-across-shadow-boundary.html
               fast/shadow-dom/mouseenter-mouseleave-inside-shadow-tree.html
               fast/shadow-dom/mouseenter-mouseleave-on-slot-parent.html

        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create):
        * page/EventHandler.cpp:
        (WebCore::nearestCommonHoverAncestor): Deleted.
        (WebCore::hierarchyHasCapturingEventListeners): Use parentInComposedTree. Else we would miss capturing event listeners
        on inclusive ancestors of slots.
        (WebCore::EventHandler::updateMouseEventTargetNode): Use the composed tree's ancestor chain to fire mouseenter and
        mouseleave events. This is needed to dispatch mouseenter / mouseleave events on slot elements. Also removed comments
        which just state what is self-evident from the code beneath them.


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

        Remove isOrphan check in ShadowRoot::setInnerHTML
        https://bugs.webkit.org/show_bug.cgi?id=189449

        Reviewed by Darin Adler.

        Removed isOrphan() check in ShadowRoot::setInnerHTML needed for webkit.org/b/88834.

        The only reason this check was kept in the code was because the fix for V8 couldn't be landed
        due to a perf regression but V8 binding isn't even a thing in WebKit anymore.

        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::setInnerHTML):
        * dom/ShadowRoot.h:

2018-09-10  Simon Fraser  <simon.fraser@apple.com>

        Many textarea tests leak documents because Document::removeFocusNavigationNodeOfSubtree() can trigger a Document retain cycle
        https://bugs.webkit.org/show_bug.cgi?id=188722

        Reviewed by Ryosuke Niwa.

        Fix a retain cycle created when Document::adjustFocusNavigationNodeOnNodeRemoval() sets
        m_focusNavigationStartingNode to itself. m_focusNavigationStartingNode is a Node* (not sure why it's not an Element*),
        making it possible to assign the Document to it, which creates a reference to the document which prevents
        Document::removedLastRef() ever running and doing the necessary cleanup.
        
        Fix by setting m_focusNavigationStartingNode to null if code tries to set it to the Document. This can happen
        when an element is focused and the page calls document.write(), which removes all children.
        
        Will be tested by future leak testing. Fixes the document leak in at least the following tests:
          fast/forms/append-children-during-form-submission.html
          fast/forms/empty-textarea-toggle-disabled.html
          fast/forms/textarea-paste-newline.html
          fast/forms/textarea-trailing-newline.html

        * dom/Document.cpp:
        (WebCore::Document::setFocusNavigationStartingNode):
        (WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval):

2018-09-10  Simon Fraser  <simon.fraser@apple.com>

        svg/W3C-SVG-1.1/render-groups-03-t.svg and some other SVG tests leak documents
        https://bugs.webkit.org/show_bug.cgi?id=189147

        Reviewed by Dean Jackson.
        
        Document::removedLastRef() needs to clean up m_fontSelector, because it can reference
        CSSFontFaceSources that keep SVGFontFaceElements alive, and they in turn will keep
        the Document alive.
        
        Also add the beginnings of a Fonts log channel.

        This will be tested by world leak testing (webkit.org/b/189332).

        * css/CSSFontSelector.cpp:
        (WebCore::CSSFontSelector::CSSFontSelector):
        (WebCore::CSSFontSelector::~CSSFontSelector):
        * dom/Document.cpp:
        (WebCore::Document::removedLastRef):
        * platform/Logging.h:
        * platform/graphics/FontCache.cpp:
        (WebCore::FontCache::purgeInactiveFontDataIfNeeded):
        (WebCore::FontCache::purgeInactiveFontData):
        * svg/SVGFontFaceElement.cpp:
        (WebCore::SVGFontFaceElement::SVGFontFaceElement):
        (WebCore::SVGFontFaceElement::~SVGFontFaceElement):
        * svg/SVGFontFaceElement.h:

2018-09-10  Don Olmstead  <don.olmstead@sony.com>

        CBOR coders should only be compiled if WebAuthN is enabled
        https://bugs.webkit.org/show_bug.cgi?id=189425

        Reviewed by Jiewen Tan.

        No new tests. No change in behavior.

        Just places ENABLE(WEB_AUTHN) guards around all CBOR files.

        * Modules/webauthn/cbor/CBORBinary.h:
        * Modules/webauthn/cbor/CBORReader.cpp:
        * Modules/webauthn/cbor/CBORReader.h:
        * Modules/webauthn/cbor/CBORValue.cpp:
        * Modules/webauthn/cbor/CBORValue.h:
        * Modules/webauthn/cbor/CBORWriter.cpp:
        * Modules/webauthn/cbor/CBORWriter.h:

2018-09-10  Daniel Bates  <dabates@apple.com>

        [iOS] Arrow keys do not dispatch DOM events to non-editable elements
        https://bugs.webkit.org/show_bug.cgi?id=189389

        Reviewed by Simon Fraser.

        On iOS the arrow keys are identified by special multi character key strings: UIKeyInput{Up,
        Down, Left, Right}Arrow as opposed to special key codes as on Mac. When converting the iOS-
        specific WebEvent we need to take care to recognize when the key string for the event is
        one of these special key strings when computing key code, character code, and key identifier
        properties for the WebCore platform-specific event. These details will be included in
        the corresponding DOM keyboard events that are dispatched when the arrow keys are pressed.

        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Mark file PlatformEventFactoryIOS as @no-unify as it is not compatible with the unified sources
        build strategy given its use of wtf/cocoa/SoftLinking.h macros.

        * platform/ios/PlatformEventFactoryIOS.h:
        * platform/ios/PlatformEventFactoryIOS.mm:
        (WebCore::convertSpecialKeyToCharCode): Manufacture the appropriate character code for an
        event that represents an arrow key. Otherwise, return std::nullopt to indicate that the
        event is not for an arrow key.
        (WebCore::keyCodeForEvent): Manufacture the appropriate Windows virtual key code for an
        event that represents an arrow key. Otherwise, do what we do now and return the key code
        associated with the WebEvent.
        (WebCore::keyIdentifierForKeyEvent): Modified to test if the event is for an arrow key
        and return the appropriate key identifier.
        (WebCore::keyForKeyEvent): Modified to test if the event is for an arrow key
        and return the appropriate character code.
        (WebCore::codeForKeyEvent): Modified to call keyCodeForEvent(), which knows how to account
        for events that represent arrow keys.
        (WebCore::PlatformKeyboardEventBuilder::PlatformKeyboardEventBuilder):

2018-09-10  Dan Bernstein  <mitz@apple.com>

        [macOS] Editor::readSelectionFromPasteboard’s MailBlockquoteHandling argument is effectively unused
        https://bugs.webkit.org/show_bug.cgi?id=189480

        Reviewed by Anders Carlsson.

        No new tests, because this doesn’t change behavior.

        * editing/Editor.h: Removed the MailBlockquoteHandling argument from
          readSelectionFromPasteboard.
        * editing/mac/EditorMac.mm:
        (WebCore::Editor::readSelectionFromPasteboard): Don’t pass mailBlockquoteHandling to
          pasteWithPasteboard. It was always set to RespectBlockquote, which is the latter’s
          default.

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

        [Payment Request] Use JSValueInWrappedObject for PaymentResponse's details attribute
        https://bugs.webkit.org/show_bug.cgi?id=189458

        Reviewed by Youenn Fablet.

        Test: http/tests/paymentrequest/payment-response-reference-cycle-leak.https.html

        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::ApplePayPaymentHandler::didAuthorizePayment):

        Created a PaymentResponse::DetailsFunction that converts the ApplePayPayment into a JSValue.

        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::accept):

        Passed detailsFunction into PaymentResponse::create().

        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentResponse.cpp:
        (WebCore::PaymentResponse::PaymentResponse):
        * Modules/paymentrequest/PaymentResponse.h:
        * Modules/paymentrequest/PaymentResponse.idl:

        Removed m_details and replaced it with a DetailsFunction and a cached JSValueInWrappedObject.
        JSPaymentResponseCustom.cpp uses these values to implement the details attribute getter.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSPaymentResponseCustom.cpp: Added.
        (WebCore::JSPaymentResponse::details const):

        Called PaymentResponse::detailsFunction() to cache a JSValue for the details attribute.

        (WebCore::JSPaymentResponse::visitAdditionalChildren):

        Visited PaymentResponse::cachedDetails().

        * bindings/js/JSServiceWorkerClientCustom.cpp:

        Fixed a missing include issue that cropped up due to unified source shuffling.

2018-09-10  Antoine Quint  <graouts@apple.com>

        [Web Animations] Positive delays of accelerated animations are not respected
        https://bugs.webkit.org/show_bug.cgi?id=189411
        <rdar://problem/44151416>

        Reviewed by Dean Jackson.

        Test: webanimations/accelerated-animation-with-delay-and-seek.html

        We were only accounting for negative delays for accelerated actions. We also were misbehaving
        when seeking an animation with a delay (positive or negative) since we wouldn't reset the animation
        begin time to be the current time when adjusting its time offset, while the begin time set when
        first creating the animation would be set accounting for the time offset.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::seekCAAnimationOnLayer):

2018-09-10  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        [WTF] Add Markable<T, Traits>
        https://bugs.webkit.org/show_bug.cgi?id=189231

        Reviewed by Sam Weinig.

        Use Markable<Seconds> and Markable<WallTime> in ResourceResponseBase.
        Since these fields are parsed results from http header fields, Seconds::nan() and WallTime::nan()
        can be used as an empty value for these fields. Thus we can use Markable because it uses
        these nan values as an empty values (they are configured by Seconds::MarkableTraits and WallTime::MarkableTraits).
        This reduces the size of ResourceResponseBase from 448 to 416.

        * platform/network/ResourceResponseBase.h:

2018-09-07  Matt Rajca  <mrajca@apple.com>

        Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)
        https://bugs.webkit.org/show_bug.cgi?id=189433
        <rdar://problem/44186498> Touch Bar displays an active PIP button for audio elements (and it doesn't do anything)

        Reviewed by Eric Carlson.

        When playing an audio element, the media Touch Bar displays an active PIP button even though only
        videos are PIP-able. Pressing it does not do anything. The issue is canTogglePictureInPicture is set
        to YES unconditionally on the WebPlaybackControlsManager. It is then only updated based on whether or
        not external playback is enabled.

        This patch extends that logic such that the picture-in-picture Touch Bar button will be disabled for
        audio elements. Since PlaybackSessionModelMediaElement today does not know whether we're dealing
        with an audio or video element, a new isPictureInPictureSupported flag has been added (as well as
        the plumbing necessary to get the state over from the web process).

        An API test has been added that checks the value of the canTogglePictureInPicture and ensures it
        is NO when audio elements are playing. To expose it to tests, a _canTogglePictureInPictureForTesting
        property has been added to the WKTesting category.

        * platform/cocoa/PlaybackSessionModel.h:
        (WebCore::PlaybackSessionModelClient::isPictureInPictureSupportedChanged):
        * platform/cocoa/PlaybackSessionModelMediaElement.h:
        * platform/cocoa/PlaybackSessionModelMediaElement.mm:
        (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
        (WebCore::PlaybackSessionModelMediaElement::isPictureInPictureSupported const):
        * platform/mac/PlaybackSessionInterfaceMac.h:
        * platform/mac/PlaybackSessionInterfaceMac.mm:
        (WebCore::PlaybackSessionInterfaceMac::isPictureInPictureSupportedChanged):
        (WebCore::PlaybackSessionInterfaceMac::externalPlaybackChanged):
        (WebCore::PlaybackSessionInterfaceMac::updatePlaybackControlsManagerCanTogglePictureInPicture):

2018-09-10  Alicia Boya García  <aboya@igalia.com>

        [GStreamer] Fix overflow in buffered ranges
        https://bugs.webkit.org/show_bug.cgi?id=189419

        Reviewed by Philippe Normand.

        Scale operations on big numbers (like media timestamps or durations)
        should be made with GStreamer utility functions to avoid overflows.

        This fixes an assertion when a 24 hour long fragmented MP4 file is
        played.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::buffered const):

2018-09-07  Frederic Wang  <fwang@igalia.com>

        Refactor filter list checking code
        https://bugs.webkit.org/show_bug.cgi?id=185087

        Reviewed by Yusuke Suzuki.

        No new tests, behavior unchanged.

        * animation/KeyframeEffectReadOnly.h: Add missing forward-declaration FilterOperations.

2018-09-10  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] Several media related tests timing out around the same revision
        https://bugs.webkit.org/show_bug.cgi?id=189349

        Reviewed by Carlos Garcia Campos.

        The timeouts were happening because the `ended` event was no
        longer properly emitted. The change in playbackPosition also
        ensures `timeupdate` event remains emitted in a... timely manner.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
        Reduce the position cache threshold to 200ms, which is a value
        slightly lower than the 250ms defined in HTMLMediaElement.
        (WebCore::MediaPlayerPrivateGStreamer::didEnd): Reset the cached
        position value to ensure the following query will most likely
        return the same value as reported by the duration query.

2018-09-10  Rob Buis  <rbuis@igalia.com>

        XMLHttpRequest: overrideMimeType should not update the response's "Content-Type" header
        https://bugs.webkit.org/show_bug.cgi?id=189465

        Reviewed by Frédéric Wang.

        The xhr spec changed [1, 2] so that overrideMimeType should not update the
        response's "Content-Type" header anymore.

        Behavior matches Firefox and Chrome.

        [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-overridemimetype
        [2] https://github.com/whatwg/xhr/issues/157

        Tests: http/tests/xmlhttprequest/xmlhttprequest-overridemimetype-content-type-header.html
               web-platform-tests/xhr/overridemimetype-invalid-mime-type.htm

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::didReceiveResponse):

2018-09-10  Antoine Quint  <graouts@apple.com>

        [Web Animations] Interrupting an accelerated CSS transition on a composited element in flight fails
        https://bugs.webkit.org/show_bug.cgi?id=189405
        <rdar://problem/43342639>

        Reviewed by Simon Fraser.

        Test: webanimations/accelerated-transition-interrupted-on-composited-element.html

        If we interrupt an animation on an element that is composited also outside of the duration of the animation,
        the "stop" accelerated action would fail to be performed because we no longer had a resolved current time and
        the accelerated animation applied to the layer would never be removed.

        However, having a resolved current time is not necessary to stop an animation, only for the other types of
        actions (play, pause and seek). So we now simply default to a 0s time for an unresolved current time for a
        simple fix to this issue.

        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        Add specialized template declarations of HashTraits and DefaultHash to detect misuse
        https://bugs.webkit.org/show_bug.cgi?id=189044

        Reviewed by Yusuke Suzuki.

        Some classes have a separate header for specializations of
        WTF::HashTraits and WTF::DefaultHash to reduce the number of
        header files included. For example, ColorHash.h and Color.h.

        If someone is mistakenly using HashSet or HashMap without
        including the specialization header, unexpected template
        instantiation can cause subtle bugs. For example, MSVC linker
        would silently produce an broken executable (Bug 188893).

        By applying this change, I found three misuse cases in
        DebugPageOverlays.cpp, AVVideoCaptureSource.h and WebPage.h. As
        far as I analyzed, I concluded that these misuses don't introduce
        any bugs at the moment, and they are not testable (Bug 189044 Comment 9),
        except the MSVC issue (Bug 188893).

        No new tests (Covered by existing tests).

        * Modules/webdatabase/SQLResultSetRowList.h: Removed unused #include <wtf/HashTraits.h>.
        * bindings/js/SerializedScriptValue.cpp: Ditto.
        * page/DebugPageOverlays.cpp: Added #include "ColorHash.h" to instantiate HashMap<String, Color>.
        * platform/URLHash.h: Added DefaultHash<URL> specialization definition.
        * platform/URL.h: Added specialized template declarations.
        * platform/graphics/Color.h: Ditto.
        * platform/graphics/FloatSize.h: Ditto.
        * platform/graphics/IntPoint.h: Ditto.
        * platform/graphics/IntSize.h: Ditto.
        * platform/network/ProtectionSpace.h: Ditto.
        * platform/network/ProtectionSpaceHash.h: Removed unnecessary DefaultHash declaration.
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        Added #include "IntSizeHash.h" to instantiate HashMap<String, IntSize>.

2018-09-09  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][Clang] Add FloatRect(const RECT&) constructor
        https://bugs.webkit.org/show_bug.cgi?id=189398

        Reviewed by Alex Christensen.

        While trying to build WebKit WinCairo port with the latest Clang
        (Bug 171618), the following compilation errors were reported.

          error: no viable conversion from returned value of type 'RECT' (aka 'tagRECT') to function return type 'WebCore::FloatRect'

        No new tests (No behavior change).

        * platform/graphics/FloatRect.h:
        * platform/graphics/win/FloatRectDirect2D.cpp:
        (WebCore::FloatRect::FloatRect): Added a new constructor taking a RECT as the argument.

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

        [Apple Pay] Dispatch a paymentmethodchange event when the payment method changes
        https://bugs.webkit.org/show_bug.cgi?id=189386

        Reviewed by Darin Adler.

        Implemented the "payment method changed" algorithm as defined in the Payment Request API W3C
        Editor's Draft of 05 September 2018.

        Payment Request says that the user agent MAY run this algorithm when the payment method
        changes. In our case, we only wish to dispatch this event when a listener is registered for
        it. Since PassKit requires merchants to respond to this event by calling updateWith() within
        30 seconds, firing the event unconditionally would break compatibility with existing
        clients.

        For merchants that do not listen for this event, they can continue to use modifiers to
        update details based on the selected payment method type.
        
        Also made PaymentMethodChangeEvent.methodDetails a cached attribute in a way that avoids
        potential reference cycles from holding a JSC::Strong in the wrapped object.

        Test: http/tests/ssl/applepay/ApplePayPaymentMethodChangeEvent.https.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::toJSDictionary):
        (WebCore::ApplePayPaymentHandler::didAuthorizePayment):
        (WebCore::ApplePayPaymentHandler::didSelectPaymentMethod):
        * Modules/paymentrequest/PaymentMethodChangeEvent.cpp:
        (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
        * Modules/paymentrequest/PaymentMethodChangeEvent.h:
        * Modules/paymentrequest/PaymentMethodChangeEvent.idl:
        * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Removed.
        * Modules/paymentrequest/PaymentRequest.cpp:
        (WebCore::PaymentRequest::paymentMethodChanged):
        * Modules/paymentrequest/PaymentRequest.h:
        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
        (WebCore::PaymentRequestUpdateEvent::updateWith):
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSPaymentMethodChangeEventCustom.cpp: Added.
        (WebCore::JSPaymentMethodChangeEvent::methodDetails const):
        (WebCore::JSPaymentMethodChangeEvent::visitAdditionalChildren):

2018-09-08  Simon Fraser  <simon.fraser@apple.com>

        Clean up code related to Document node removal
        https://bugs.webkit.org/show_bug.cgi?id=189452

        Reviewed by Wenson Hsieh.

        Replace the "amongChildrenOnly" boolean argument with an enum for clarity.
        
        Rename the remove*OfSubtree functions, because that naming is very unclear.
        Instead, use adjust*OnNodeRemoval which better describes what the code does.

        * dom/Document.cpp:
        (WebCore::isNodeInSubtree):
        (WebCore::Document::adjustFocusedNodeOnNodeRemoval):
        (WebCore::Document::nodeChildrenWillBeRemoved):
        (WebCore::Document::nodeWillBeRemoved):
        (WebCore::Document::adjustFocusNavigationNodeOnNodeRemoval):
        (WebCore::Document::adjustFullScreenElementOnNodeRemoval):
        (WebCore::Document::removeFocusedNodeOfSubtree): Deleted.
        (WebCore::Document::removeFocusNavigationNodeOfSubtree): Deleted.
        (WebCore::Document::removeFullScreenElementOfSubtree): Deleted.
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::removeShadowRoot):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::clear):

2018-09-08  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        [CSSJIT] Use lshiftPtr instead of mul32
        https://bugs.webkit.org/show_bug.cgi?id=189451

        Reviewed by Sam Weinig.

        Use `value << 4` instead of `value * 16`. In 64bit environment, sizeof(Style::Relation) is 16,
        so that we can use `value << 4` in CSS JIT.

        No behavior change.

        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::SelectorCodeGenerator::generateAddStyleRelation):

2018-09-07  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][Clang] exceptionShouldTerminateProgram of StructuredExceptionHandlerSuppressor.cpp should take DWORD
        https://bugs.webkit.org/show_bug.cgi?id=189402

        Reviewed by Alex Christensen.

        Clang reports compilation errors like following:

        > StructuredExceptionHandlerSuppressor.cpp(38,10):  error: case value evaluates to 2147483650, which cannot be narrowed to type 'int' [-Wc++11-narrowing]
        >     case EXCEPTION_DATATYPE_MISALIGNMENT:
        >          ^

        No new tests (no behavioral change).

        * platform/win/StructuredExceptionHandlerSuppressor.cpp:
        (exceptionShouldTerminateProgram): Changed the type of argument from int to DWORD.

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

        [Curl] Stop sending request with credential if no authorization requested.
        https://bugs.webkit.org/show_bug.cgi?id=189057

        Reviewed by Alex Christensen.

        When 401 response returns without 'www-authenticate' header, suppress another request with credential.

        Test: http/tests/xmlhttprequest/unauthorized-without-authenticate-header.html

        * platform/network/curl/CurlResourceHandleDelegate.cpp:
        (WebCore::CurlResourceHandleDelegate::curlDidReceiveResponse):

2018-09-07  Fujii Hironori  <Hironori.Fujii@sony.com>

        [Win][Clang] duplicated variable name `advance` in UniscribeController::shapeAndPlaceItem
        https://bugs.webkit.org/show_bug.cgi?id=189399

        Reviewed by Myles C. Maxfield.

        Clang reports the following compilation error:

        UniscribeController.cpp(372,56):  error: invalid operands to binary expression ('float' and 'WebCore::GlyphBufferAdvance' (aka 'WebCore::FloatSize'))
             GlyphBufferAdvance advance(-origin.width() + advance, -origin.height());
                                        ~~~~~~~~~~~~~~~ ^ ~~~~~~~
        No new tests (No behavior change).

        * platform/graphics/win/UniscribeController.cpp:
        (WebCore::UniscribeController::shapeAndPlaceItem): Replaced the second variable named `advance` with `glyphAdvance`.

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

        RTCRtpReceiver::track should return a MediaStreamTrack reference
        https://bugs.webkit.org/show_bug.cgi?id=189420

        Reviewed by Eric Carlson.

        As per spec, a receiver always has a track.
        Remove unneeded RTCRtpSenderReceiverBase and make RTCRtpReceiver have a Ref<MediaStreamTrack>.
        RTCRtpSender keeps having a RefPtr<MediaStreamTrack>.
        Update call sites accordingly. 
        No change of behavior.

        * Modules/mediastream/RTCRtpReceiver.cpp:
        (WebCore::RTCRtpReceiver::RTCRtpReceiver):
        (WebCore::RTCRtpReceiver::stop):
        * Modules/mediastream/RTCRtpReceiver.h:
        (WebCore::RTCRtpReceiver::track):
        * Modules/mediastream/RTCRtpReceiver.idl:
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::RTCRtpSender):
        * Modules/mediastream/RTCRtpSender.h:
        (WebCore::RTCRtpSender::track):
        * Modules/mediastream/RTCRtpSender.idl:
        * Modules/mediastream/RTCRtpSenderReceiverBase.h: Removed.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
        * WebCore.xcodeproj/project.pbxproj:

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

        Cleanup: Remove extraneous "using namespace" and scope WebCore::LogThreading
        https://bugs.webkit.org/show_bug.cgi?id=189381

        Reviewed by Simon Fraser.

        * platform/ios/wak/WKGraphics.mm:
        * platform/ios/wak/WebCoreThread.mm:
        (WebThreadEnable):

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

        Clean up FontAttributeChanges.cpp after r235748
        https://bugs.webkit.org/show_bug.cgi?id=189394

        Reviewed by Tim Horton.

        * Sources.txt: Move FontAttributeChanges.cpp into unified sources.
        * WebCore.xcodeproj/project.pbxproj:
        * editing/FontAttributeChanges.cpp: Replace `#import`s with `#include`s.

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

        [Curl][WebKitLegacy] Stop sending credential embedded in the url via XHR.
        https://bugs.webkit.org/show_bug.cgi?id=189198

        Reviewed by Alexey Proskuryakov.

        Because sync XHR of Curl port uses passed request directly, the credential information in
        url is not removed. Use ResourceHandleInternal's firstRequest because those are
        already takne out.

        Test: http/tests/xmlhttprequest/url-with-credentials.html

        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):

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

        RealtimeOutgoingVideoSourceCocoa should use VTImageRotationSession to rotate CVPixelBuffers
        https://bugs.webkit.org/show_bug.cgi?id=189427

        Reviewed by Eric Carlson.

        Previously, we were relying on libwebrtc utils to do the rotation.
        This is inefficient compared to VTImageRotateSession and also induces additional memory cost
        since libwebrtc is rotating using its own buffers and the encoder will convert this buffer back to a CVPixelBuffer.

        Instead use VTImageRotationSession when rotation must be done at sending side.
        Covered by webrtc/video-rotation.html.

        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
        (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm:
        (WebCore::computeRotatedWidthAndHeight):
        (WebCore::RealtimeOutgoingVideoSourceCocoa::rotatePixelBuffer):

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

        Add support for unified plan transceivers
        https://bugs.webkit.org/show_bug.cgi?id=189390

        Reviewed by Eric Carlson.

        Keep previous transceiver behavior when unified plan flag is off.
        Otherwise, use the libwebrtc transceiver API to create and use unified plan transceivers.
        Fuel the implementation of transceivers through a dedicated backend.

        Update transceiver IDL and make some smaller fixes at the same time:
        - Make sure remote sources have a proper name as per https://w3c.github.io/webrtc-pc/#dfn-create-an-rtcrtpreceiver.
        - Add support for transceiver.currentDirection.

        Our mock peer connections are only supporting plan B APIs at the moment.
        We therefore mandate plan B when using such mocks until we can upgrade mocks to support unified plan APIs.

        Covered by modified and rebased tests.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::addTrack):
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::addTransceiver):
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::RTCRtpSender):
        * Modules/mediastream/RTCRtpTransceiver.cpp:
        (WebCore::RTCRtpTransceiver::mid const):
        (WebCore::RTCRtpTransceiver::currentDirection const):
        * Modules/mediastream/RTCRtpTransceiver.h:
        (WebCore::RTCRtpTransceiver::backend):
        * Modules/mediastream/RTCRtpTransceiver.idl:
        * Modules/mediastream/RTCRtpTransceiverBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        (WebCore::LibWebRTCMediaEndpoint::newTransceiver):
        (WebCore::LibWebRTCMediaEndpoint::addTransceiver):
        (WebCore::LibWebRTCMediaEndpoint::transceiverBackendFromSender):
        (WebCore::LibWebRTCMediaEndpoint::OnAddTrack):
        (WebCore::LibWebRTCMediaEndpoint::OnTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::createReceiverForSource):
        (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
        (WebCore::backendFromRTPTransceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::existingTransceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::newTransceiver):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
        (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.cpp: Added.
        (WebCore::LibWebRTCRtpTransceiverBackend::createReceiverBackend):
        (WebCore::LibWebRTCRtpTransceiverBackend::createSenderBackend):
        (WebCore::LibWebRTCRtpTransceiverBackend::direction const):
        (WebCore::LibWebRTCRtpTransceiverBackend::currentDirection const):
        (WebCore::LibWebRTCRtpTransceiverBackend::setDirection):
        (WebCore::LibWebRTCRtpTransceiverBackend::mid):
        (WebCore::LibWebRTCRtpTransceiverBackend::stop):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpTransceiverBackend.h: Added.
        * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
        (WebCore::toRTCRtpTransceiverDirection):
        (WebCore::fromRTCRtpTransceiverDirection):
        (WebCore::fromRtpTransceiverInit):
        * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/RealtimeIncomingAudioSource.cpp:
        (WebCore::RealtimeIncomingAudioSource::RealtimeIncomingAudioSource):
        * platform/mediastream/RealtimeIncomingVideoSource.cpp:
        (WebCore::RealtimeIncomingVideoSource::RealtimeIncomingVideoSource):
        * platform/mediastream/RealtimeMediaSource.h:
        * testing/Internals.cpp:
        (WebCore::Internals::useMockRTCPeerConnectionFactory):

2018-09-07  Rob Buis  <rbuis@igalia.com>

        XMLHttpRequest: open() does not throw a SYNTAX_ERR exception if method is empty or url cannot be resolved
        https://bugs.webkit.org/show_bug.cgi?id=46008

        Reviewed by Chris Dumez.

        Check if passed URL is valid as specified here [1].

        Test: web-platform-tests/xhr/open-url-bogus.htm

        [1] https://xhr.spec.whatwg.org/#the-open()-method Step 7

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::open):

2018-09-07  Frederic Wang  <fwang@igalia.com>

        [CSSOM View] Handle the scrollingElement in Element::scroll(Left/Top/Width/Height/To)
        https://bugs.webkit.org/show_bug.cgi?id=182230

        Reviewed by Simon Fraser.

        This commit moves the special logic for "scrolling element" body from the
        HtmlBodyElement::scroll(Left/Top/Width/Height/To) functions to the Element class. The code
        is executed when the element is the scrolling element which includes the case of body
        in Quirks mode and of documentElement in standard mode. This makes the behavior closer to
        the CSSOM View spec (bug 5991) while not deviating too much from the current implementation.
        Finally, CSSOMViewScrollingAPI is now enabled for running tests and some adjustments are made
        to existing tests. Further improvements will be performed in dependencies of bug 5991.

        No new tests, already covered by existing tests.

        * dom/Document.cpp: Split scrollingElement into two functions so that one can be called
        internally without updating the layout.
        (WebCore::Document::scrollingElement):
        (WebCore::Document::scrollingElementForAPI):
        * dom/Document.h: Ditto.
        * dom/Document.idl: Use the version updating the layout for API calls.
        * dom/Element.cpp: Add include to call DOMWindow::ScrollTo
        (WebCore::Element::scrollTo): Moved some logic from HtmlBodyElement to handle the case of
        the scrolling element. Also skip special handling of documentElement() when
        CSSOMViewScrollingAPI is disabled.
        (WebCore::adjustContentsScrollPositionOrSizeForZoom): Moved some logic from HtmlBodyElement
        to handle the case of the scrolling element. Also add a FIXME for improving these kinds of
        helper functions. Renamed to make more explicit the semantic of the value argument.
        (WebCore::Element::scrollLeft): Moved some logic from HtmlBodyElement to handle the case of
        the scrolling element. Use the new documentFrameWithNonNullView() helper function.
        (WebCore::Element::scrollTop): Ditto.
        (WebCore::Element::setScrollLeft): Ditto
        (WebCore::Element::setScrollTop): Ditto.
        (WebCore::Element::scrollWidth): Ditto.
        (WebCore::Element::scrollHeight): Ditto.
        * dom/Element.h:
        (WebCore::Document::documentFrameWithNonNullView): New helper function to retrieve the
        frame and ensure a view is available.
        * html/HTMLBodyElement.cpp: Remove code that is now in Element.
        * html/HTMLBodyElement.h: Ditto.

2018-09-07  Don Olmstead  <don.olmstead@sony.com>

        [AX] Fix compile error in AXObjectCache constructor when !HAVE(ACCESSIBILITY)
        https://bugs.webkit.org/show_bug.cgi?id=189423
        <rdar://problem/44231775>

        Reviewed by Yusuke Suzuki.

        No new tests. Compilation fix.

        * accessibility/AXObjectCache.h:
        (WebCore::AXObjectCache::AXObjectCache):

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

        [LFC] Replace "computed" value with "used" value to match spec language
        https://bugs.webkit.org/show_bug.cgi?id=189414

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        * layout/FormattingContext.h:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        * 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::complicatedCases):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        * layout/blockformatting/BlockFormattingContext.h:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

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

        ShadowRoot should have its own node flag
        https://bugs.webkit.org/show_bug.cgi?id=189392

        Reviewed by Antti Koivisto.

        Added IsShadowRootFlag and IsDocumentNodeFlag, and removed IsDocumentFragmentFlag and IsStyledElementFlag.
        Also re-ordered flags to group flags used by subclasses below ones directly used by Node in
        accordinate with the comment.

        No new tests since there should be no behavioral change.

        * dom/ContainerNode.h:
        (WebCore::Node::isTreeScope const): Deleted.
        * dom/Node.h:
        (WebCore::Node::isStyledElement const): Check if this is a HTML, SVG, or MathML element instead.
        (WebCore::Node::isDocumentNode const): Simply check IsDocumentNodeFlag.
        (WebCore::Node::isTreeScope const): Check if this is a document or a shadow root Instead of comparing
        the tree scope to this.
        (WebCore::Node::isDocumentFragment const): Check if this is a container node which is neither document,
        element, nor shadow root.
        (WebCore::Node::isShadowRoot const): Simply check IsShadowRootFlag. This is the change needed to fix
        the blockign bug 166748.
        (WebCore::Node::flagIsShadowRoot): Added. Will be used in the bug 166748.

2018-09-06  Zalan Bujtas  <zalan@apple.com>

        [LFC] Inline replaced height calculation should use "used value"
        https://bugs.webkit.org/show_bug.cgi?id=189395

        Reviewed by Antti Koivisto.

        Use the already assigned width value (aka used value) instead of the computed value when computing the inline's height.
        see https://www.w3.org/TR/CSS22/cascade.html#value-stages for "used" and "computed" value.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):

2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        Refactor WebCore::EditAction to be an 8-bit enum class
        https://bugs.webkit.org/show_bug.cgi?id=189383

        Reviewed by Dan Bernstein.

        Currently, EditAction.h defines an EditAction as an enum. This patch changes EditAction to instead be an 8-bit-
        wide enum class, and renames all EditAction values from EditAction(*) to EditAction::(*).

        No change in behavior.

        * editing/ApplyStyleCommand.h:
        (WebCore::ApplyStyleCommand::create):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::apply):
        (WebCore::deleteSelectionEditingActionForEditingAction):
        * editing/CompositeEditCommand.h:
        (WebCore::EditCommandComposition::wasCreateLinkCommand const):
        * editing/CreateLinkCommand.h:
        * editing/DeleteFromTextNodeCommand.h:
        (WebCore::DeleteFromTextNodeCommand::create):
        * editing/DeleteSelectionCommand.h:
        (WebCore::DeleteSelectionCommand::create):
        * editing/DictationCommand.cpp:
        (WebCore::DictationCommand::insertTextRunWithoutNewlines):
        (WebCore::DictationCommand::insertParagraphSeparator):
        * editing/EditAction.h:
        (): Deleted.
        * editing/EditCommand.cpp:
        (WebCore::inputTypeNameForEditingAction):
        * editing/EditCommand.h:
        * editing/Editor.cpp:
        (WebCore::inputEventDataForEditingStyleAndAction):
        (WebCore::ClearTextCommand::editingAction const):
        (WebCore::Editor::handleTextEvent):
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::performCutOrCopy):
        (WebCore::Editor::setBaseWritingDirection):
        (WebCore::Editor::markMisspellingsAfterTypingToWord):
        (WebCore::Editor::changeBackToReplacedString):
        (WebCore::Editor::transpose):
        * editing/Editor.h:
        * editing/EditorCommand.cpp:
        (WebCore::applyCommandToFrame):
        (WebCore::executeInsertFragment):
        (WebCore::executeBackColor):
        (WebCore::executeFontName):
        (WebCore::executeFontSize):
        (WebCore::executeFontSizeDelta):
        (WebCore::executeForeColor):
        (WebCore::executeJustifyCenter):
        (WebCore::executeJustifyFull):
        (WebCore::executeJustifyLeft):
        (WebCore::executeJustifyRight):
        (WebCore::executeMakeTextWritingDirectionLeftToRight):
        (WebCore::executeMakeTextWritingDirectionNatural):
        (WebCore::executeMakeTextWritingDirectionRightToLeft):
        (WebCore::executeStrikethrough):
        (WebCore::executeSubscript):
        (WebCore::executeSuperscript):
        (WebCore::executeToggleBold):
        (WebCore::executeToggleItalic):
        (WebCore::executeUnderline):
        (WebCore::executeUnscript):
        * editing/FormatBlockCommand.h:
        * editing/IndentOutdentCommand.h:
        * editing/InsertIntoTextNodeCommand.h:
        (WebCore::InsertIntoTextNodeCommand::create):
        * editing/InsertListCommand.cpp:
        (WebCore::InsertListCommand::editingAction const):
        * editing/InsertNodeBeforeCommand.h:
        (WebCore::InsertNodeBeforeCommand::create):
        * editing/InsertParagraphSeparatorCommand.h:
        (WebCore::InsertParagraphSeparatorCommand::create):
        * editing/InsertTextCommand.h:
        (WebCore::InsertTextCommand::create):
        (WebCore::InsertTextCommand::createWithMarkerSupplier):
        * editing/MoveSelectionCommand.cpp:
        (WebCore::MoveSelectionCommand::doApply):
        (WebCore::MoveSelectionCommand::editingAction const):
        * editing/RemoveFormatCommand.h:
        * editing/RemoveNodeCommand.h:
        (WebCore::RemoveNodeCommand::create):
        * editing/ReplaceRangeWithTextCommand.cpp:
        (WebCore::ReplaceRangeWithTextCommand::ReplaceRangeWithTextCommand):
        (WebCore::ReplaceRangeWithTextCommand::doApply):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::completeHTMLReplacement):
        (WebCore::ReplaceSelectionCommand::performTrivialReplace):
        * editing/ReplaceSelectionCommand.h:
        (WebCore::ReplaceSelectionCommand::create):
        * editing/SpellingCorrectionCommand.cpp:
        (WebCore::SpellingCorrectionCommand::SpellingCorrectionCommand):
        (WebCore::SpellingCorrectionCommand::doApply):
        * editing/TextInsertionBaseCommand.h:
        * editing/TypingCommand.cpp:
        (WebCore::editActionForTypingCommand):
        (WebCore::editActionIsDeleteByTyping):
        (WebCore::TypingCommand::isBeforeInputEventCancelable const):
        (WebCore::TypingCommand::inputEventData const):
        (WebCore::TypingCommand::inputEventDataTransfer const):
        (WebCore::TypingCommand::insertTextRunWithoutNewlines):
        (WebCore::TypingCommand::insertParagraphSeparator):
        * editing/UnlinkCommand.h:
        * editing/ios/DictationCommandIOS.cpp:
        (WebCore::DictationCommandIOS::DictationCommandIOS):
        * editing/ios/EditorIOS.mm:
        (WebCore::Editor::removeUnchangeableStyles):
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag):

2018-09-06  Simon Fraser  <simon.fraser@apple.com>

        Fix the build for non-Cocoa platforms after r235772.

        * platform/graphics/cairo/GradientCairo.cpp:
        (WebCore::Gradient::createPlatformGradient):
        * platform/graphics/win/GradientDirect2D.cpp:
        (WebCore::Gradient::generateGradient):
        (WebCore::Gradient::fill):

2018-09-06  Zalan Bujtas  <zalan@apple.com>

        [LFC] Add support for min/max-height percentage values.
        https://bugs.webkit.org/show_bug.cgi?id=189391

        Reviewed by Antti Koivisto.

        The percentage is calculated with respect to the height of the generated box's containing block.
        If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element
        is not absolutely positioned, the percentage value is treated as '0' (for 'min-height') or 'none' (for 'max-height').

        Test: fast/block/block-only/min-max-height-percentage.html

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
        (WebCore::Layout::FormattingContext::Geometry::computedMaxHeight):
        (WebCore::Layout::FormattingContext::Geometry::computedMinHeight):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):

2018-09-06  Megan Gardner  <megan_gardner@apple.com>

        Add Support for Conic Gradients
        https://bugs.webkit.org/show_bug.cgi?id=189329
        <rdar://problem/21444701>

        Reviewed by Simon Fraser.

        Add support for rendering CSS conic gradients.
        The parsing work was already done, this just hooks up the data we have
        with the CG functionality for conic gradients. Add the needed plumbing
        to allow for this additional type and fill in the creation of 
        a conic gradient.

        Tests: fast/gradients/conic-repeating.html
               fast/gradients/conic.html

        * css/CSSGradientValue.cpp:
        (WebCore::createGradient):
        (WebCore::LinearGradientAdapter::gradientLength const):
        (WebCore::RadialGradientAdapter::gradientLength const):
        (WebCore::ConicGradientAdapter::ConicGradientAdapter):
        (WebCore::ConicGradientAdapter::gradientLength const):
        (WebCore::ConicGradientAdapter::maxExtent const):
        (WebCore::ConicGradientAdapter::normalizeStopsAndEndpointsOutsideRange):

        Compute what the color stops should be if they extend past 0-1

        (WebCore::CSSGradientValue::computeStops):
        (WebCore::CSSConicGradientValue::createGradient):
        (WebCore::LinearGradientAdapter::startPoint const): Deleted.
        (WebCore::LinearGradientAdapter::endPoint const): Deleted.
        (WebCore::RadialGradientAdapter::startPoint const): Deleted.
        (WebCore::RadialGradientAdapter::endPoint const): Deleted.

        Start and End points weren't very universal. All we really need from these
        gradientAdapters is their length, so just ask for that instead.

        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildArrayForCanvasGradient):
        * platform/graphics/Gradient.cpp:
        (WebCore::Gradient::create):
        (WebCore::Gradient::Gradient):
        (WebCore::Gradient::type const):
        (WebCore::Gradient::adjustParametersForTiledDrawing):
        (WebCore::Gradient::isZeroSize const):
        (WebCore::Gradient::hash const):
        * platform/graphics/Gradient.h:
        * platform/graphics/cg/GradientCG.cpp:
        (WebCore::Gradient::paint):

2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] [WK2] Support changing attributes for selected text (text shadow, underline, strike-through)
        https://bugs.webkit.org/show_bug.cgi?id=189356
        <rdar://problem/44185674>

        Reviewed by Tim Horton.

        Add support for encoding and decoding FontAttributeChanges, so that we can send FontAttributeChanges over IPC in
        WebKit2. Also change m_verticalAlign to a new VerticalAlignChange enum type, so that it's no longer tied to the
        CSS property values of "vertical-align", and can be encoded/decoded separately from VerticalAlign in
        RenderStyleConstants.

        Test: FontManagerTests.ChangeAttributesWithFontEffectsBox

        * editing/FontAttributeChanges.cpp:
        (WebCore::FontAttributeChanges::createEditingStyle const):
        * editing/FontAttributeChanges.h:
        (WebCore::FontAttributeChanges::setVerticalAlign):
        (WebCore::FontShadow::encode const):
        (WebCore::FontShadow::decode):
        (WebCore::FontAttributeChanges::encode const):
        (WebCore::FontAttributeChanges::decode):
        * platform/mac/WebCoreNSFontManagerExtras.mm:
        (WebCore::computedFontAttributeChanges):

2018-09-06  Zalan Bujtas  <zalan@apple.com>

        [LFC][BFC] Add support for min(max)-height
        https://bugs.webkit.org/show_bug.cgi?id=189377

        Reviewed by Antti Koivisto.

        See https://www.w3.org/TR/CSS22/visudet.html#min-max-heights for details.

        Tests: fast/block/block-only/absolute-position-min-max-height.html
               fast/block/block-only/float-min-max-height.html
               fast/block/block-only/inflow-min-max-height.html

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        * layout/FormattingContext.h:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        * layout/blockformatting/BlockFormattingContext.h:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):

2018-09-06  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Include supported frame rates in video capture presets
        https://bugs.webkit.org/show_bug.cgi?id=189351
        <rdar://problem/44188917>

        Reviewed by Youenn Fablet.

        No new tests, no functionality changed.

        Include frame rates as well as width/height in video capture presets, so the mock video
        capture devices model real camera devices more closely.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::setSizeAndFrameRate): Renamed from applySizeAndFrameRate. Use
        setSize instead of setWidth and setHeight.
        (WebCore::RealtimeMediaSource::applyConstraints): applySizeAndFrameRate -> setSizeAndFrameRate.
        (WebCore::RealtimeMediaSource::applySizeAndFrameRate): Deleted.
        (WebCore::RealtimeMediaSource::setWidth): Deleted.
        (WebCore::RealtimeMediaSource::setHeight): Deleted.
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/RealtimeVideoSource.cpp:
        (WebCore::RealtimeVideoSource::setSupportedPresets): New.
        (WebCore::updateMinMax):
        (WebCore::RealtimeVideoSource::addSupportedCapabilities const): Calculate capabilities from
        presets.
        (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate): Use bestSupportedSizeAndFrameRate.
        (WebCore::RealtimeVideoSource::bestSupportedSizeAndFrameRate): 
        (WebCore::RealtimeVideoSource::setSizeAndFrameRate):
        (WebCore::RealtimeVideoSource::setSupportedFrameRates): Deleted.
        (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight): Deleted.
        (WebCore::RealtimeVideoSource::applySizeAndFrameRate): Deleted.
        (WebCore::RealtimeVideoSource::supportsFrameRate): Deleted.
        * platform/mediastream/RealtimeVideoSource.h:
        (WebCore::RealtimeVideoSource::setSupportedCaptureSizes): Deleted.
        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
        (WebCore::GStreamerVideoCaptureSource::stopProducingData):
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::setSizeAndFrameRate):
        (WebCore::AVVideoCaptureSource::applySizeAndFrameRate): Deleted.
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
        (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream):
        * platform/mock/MockMediaDevice.h:
        (WebCore::MockCameraProperties::encode const):
        (WebCore::MockCameraProperties::decode):
        (WebCore::MockDisplayProperties::encode const):
        (WebCore::MockDisplayProperties::decode):
        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::defaultDevices):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource):
        (WebCore::MockRealtimeVideoSource::capabilities const):
        (WebCore::MockRealtimeVideoSource::settings const):

2018-09-06  Antti Koivisto  <antti@apple.com>

        Actively prewarm processes created for prewarm pool
        https://bugs.webkit.org/show_bug.cgi?id=189364

        Reviewed by Chris Dumez.

        Do some basic prewarming for newly created processes.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSDefaultStyleSheets.cpp:
        (WebCore::CSSDefaultStyleSheets::loadFullDefaultStyle):
        * css/CSSDefaultStyleSheets.h:
        * page/Frame.cpp:
        (WebCore::Frame::Frame):
        * page/ProcessWarming.cpp: Added.
        (WebCore::ProcessWarming::initializeNames):

        Factor name initialization into a function.

        (WebCore::ProcessWarming::prewarm):

        Prewarm
        - names
        - settings (system fonts)
        - user agent stylesheet
        - JavaScript VM
        - telephone number detection

        * page/ProcessWarming.h: Added.

2018-09-06  Youenn Fablet  <youenn@apple.com>

        Move replaceTrack logic to RTCRtpSender backend
        https://bugs.webkit.org/show_bug.cgi?id=189359

        Reviewed by Eric Carlson.

        Move replaceTrack handling from LibWebRTCPeerConnectionBackend to LibWebRTCRtpSenderBackend.
        This will allow using SetTrack when fully implementing unified plan.
        No change of behavior.

        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::replaceTrack):
        * Modules/mediastream/RTCRtpSender.h:
        * Modules/mediastream/RTCRtpSender.idl:
        * Modules/mediastream/RTCRtpSenderBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack): Deleted.
        (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask): Deleted.
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
        (WebCore::updateTrackSource):
        (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:

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  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-06  Frederic Wang  <fwang@igalia.com>

        Group options of scrollRectToVisible into a struct
        https://bugs.webkit.org/show_bug.cgi?id=189352

        Reviewed by Simon Fraser.

        RenderLayer::scrollRectToVisible and RenderObject::scrollRectToVisible have several
        parameters to configure the type of scrolling. This patch groups the const options into a
        single struct to make easier to handle them in the future. For example, an #ifdefed scroll
        behavior option will be added in bug 188043. This refactoring can maybe help too for other
        scroll extensions (e.g. bug 176454 and bug 161611).

        No new tests, behavior unchanged.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::scrollToMakeVisible const): Pass options via a struct.
        * dom/Element.cpp:
        (WebCore::Element::scrollIntoView): Ditto.
        (WebCore::Element::scrollIntoViewIfNeeded): Ditto.
        (WebCore::Element::scrollIntoViewIfNotVisible): Ditto.
        * editing/FrameSelection.cpp: Include RenderLayer.h in all WebKit ports in order to define
        ScrollRectToVisibleOptions.
        (WebCore::FrameSelection::revealSelection): Pass options via a struct.
        * page/FrameView.cpp:
        (WebCore::FrameView::scrollToFocusedElementInternal): Ditto.
        (WebCore::FrameView::scrollToAnchor): Ditto.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::scrollRectToVisible): Pass options via a struct. Note that
        absoluteRect and insideFixed are modified in this function.
        (WebCore::RenderLayer::autoscroll): Pass options via a struct.
        * rendering/RenderLayer.h: Add ScrollRectToVisibleOptions and use it in order to pass
        scrollRectToVisible options.
        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::scrollRectToVisible): Pass options via a struct
        * rendering/RenderObject.h: Forward-declare ScrollRectToVisibleOptions and use in order to
        pass scrollRectToVisible options.

2018-09-06  Wenson Hsieh  <wenson_hsieh@apple.com>

        [macOS] Cannot change font size at selection until font panel is shown
        https://bugs.webkit.org/show_bug.cgi?id=189295
        <rdar://problem/35593389>

        Reviewed by Ryosuke Niwa.

        Currently, attempting to alter the font size of currently selected editable text in WKWebView via menu items
        will fail if the font panel has never been shown. This is because WebViewImpl::changeFontFromFontPanel, which is
        responsible for converting the current font at the selection to the new font using -[NSFontManager convertFont:]
        bails as a result of NSFontManager's currently selected font always being nil.

        WKWebView is responsible for keeping NSFontManager up-to-date with the currently selected font; in fact, this
        was initially the case in r180465, which introduced NSFontManager support in WebKit2 by propagating EditorState
        updates that contained font information for the current selection. However, this regressed performance due to
        selected font computation triggering extra layout passes; r180768 addressed this by introducing a mechanism for
        requesting the font at the current selection, and only updating NSFontManager with the new selected font when
        the shared font panel is visible (determined by KVO on NSFontPanel). However, this again regressed WKWebView
        launch performance, due to KVO registration always forcing the shared NSFontPanel to be created. r182037
        addressed this by only registering for KVO on the font panel if the WKWebView has been made editable (SPI on
        WKWebView).

        This leads to two issues when attempting to alter font attributes using macOS UI: (1) in web views that have not
        been made editable using SPI, showing the font panel and attempting to change the font fails due to the selected
        font staying nil, because we've never begun registering for KVO notifications on the font panel so we don't try
        to keep the font manager up to date. (2) Even if the web view is made editable, if the font panel is never
        shown, then the font manager still won't be kept up to date with the current selection, so changing fonts using
        menu items still does not work.

        We fix both of these problems by refactoring font manager support on WebKit2 such that an up-to-date selected
        font in the UI process is no longer necessary in order to alter the font at the current selection. To do this,
        we figure out what changes the NSFontManager would've made to the currently selected font in the UI process, and
        then propagate this information to the web process, where we convert this information into an EditingStyle which
        we apply to the current selection.

        The code to both determine the attributes changed by NSFontManager and to convert these attributes into editing
        styles to be applied via Editor already exists in WebKitLegacy, in WebHTMLView.mm. This patch moves this
        existing logic into WebCore and teases it apart into two portions: the first portion probes NSFontManager to
        determine which aspects of the font changed and constructs FontChanges, which captures these differences. The
        second portion maps FontChanges to an EditingStyle, which can then be applied to the current selection. In
        WebKitLegacy, we construct FontChanges using the font manager, and then immediately use it to create and apply
        an EditingStyle. In WebKit, we construct FontChanges in the UI process using the font manager, and then send
        this over to the web process via WebPage::changeFont, which then creates and applies the EditingStyle.

        Note that this patch also introduces FontAttributeChanges, which is similar in concept to FontChanges, but
        captures a broader range of changes possible via NSFontPanel. This was done so that we can eliminate all of the
        font manager probing code (along with the two specimen fonts) from WebHTMLView, but is also necessary in order
        to allow changing font shadow, strikethrough, and underlines via the font panel to work in WebKit2. This will be
        fixed in a followup, by making FontAttributeChanges IPC encodable and by making WKWebView/WKView respond to the
        -changeAttributes: selector.

        Changes in behavior to WebKit2 are covered by new API tests; legacy WebKit behavior should remain unchanged.

        Tests:  FontManagerTests.ChangeFontSizeWithMenuItems
                FontManagerTests.ChangeFontWithPanel

        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.h:

        Remove applyFontStyles.

        * editing/FontAttributeChanges.cpp: Added.
        (WebCore::FontChanges::platformFontFamilyNameForCSS const):

        Given a font family name and a font name, returns the string to use as the "font-family" style property value.
        Originally from WebHTMLView.mm.

        (WebCore::FontChanges::createEditingStyle const):

        Converts font changes to an EditingStyle that can be used to apply these changes.

        (WebCore::FontChanges::createStyleProperties const):

        Introduce FontChanges, which encapsulates changes which are to be applied to the font in the current selection.

        (WebCore::cssValueListForShadow):
        (WebCore::FontAttributeChanges::createEditingStyle const):

        Converts font attribute changes to an EditingStyle that can be used to apply these changes.

        * editing/FontAttributeChanges.h: Added.

        Introduce FontAttributeChanges, which encapsulates changes which are to be applied to the font attributes in the
        current selection. This includes a set of FontChanges, as well as additional attributes such as strike-through
        and underlines.

        (WebCore::FontChanges::setFontName):
        (WebCore::FontChanges::setFontFamily):
        (WebCore::FontChanges::setFontSize):
        (WebCore::FontChanges::setFontSizeDelta):
        (WebCore::FontChanges::setBold):
        (WebCore::FontChanges::setItalic):
        (WebCore::FontAttributeChanges::setVerticalAlign):
        (WebCore::FontAttributeChanges::setBackgroundColor):
        (WebCore::FontAttributeChanges::setForegroundColor):
        (WebCore::FontAttributeChanges::setShadow):
        (WebCore::FontAttributeChanges::setStrikeThrough):
        (WebCore::FontAttributeChanges::setUnderline):
        (WebCore::FontAttributeChanges::setFontChanges):

        Setters for FontChanges and FontAttributeChanges. Initially, most of these values are optional, indicating that
        there should be no change.

        (WebCore::FontChanges::encode const):
        (WebCore::FontChanges::decode):

        Add encoding/decoding support to FontChanges, so that it can be sent over IPC for WebKit2.

        * editing/cocoa/FontAttributeChangesCocoa.mm: Added.
        (WebCore::FontChanges::platformFontFamilyNameForCSS const):

        Helper method to determine whether the font family or the font name should be used, by looking up the PostScript
        font name using a FontDescriptor and comparing it against the result of -[NSFont fontName]. This logic was
        originally in WebHTMLView.mm.

        * editing/mac/EditorMac.mm:
        (WebCore::Editor::applyFontStyles): Deleted.
        * platform/mac/WebCoreNSFontManagerExtras.h: Added.
        * platform/mac/WebCoreNSFontManagerExtras.mm: Added.

        Add helper functions to compute FontChanges and FontAttributeChanges from NSFontManager.

        (WebCore::firstFontConversionSpecimen):
        (WebCore::secondFontConversionSpecimen):

        Two "specimen fonts" used to determine what changes NSFontManager or NSFontPanel makes when performing font or
        font attribute conversion. Moved from WebHTMLView.mm.

        (WebCore::computedFontChanges):
        (WebCore::computedFontAttributeChanges):

        Moved here from WebHTMLView.mm. Instead of converting font attributes to NSStrings and setting properties on
        DOMCSSStyleDeclaration, we instead specify properties on MutableStyleProperties using CSSValues.

2018-09-06  Zalan Bujtas  <zalan@apple.com>

        [LFC][BFC] Add support for min(max)-width
        https://bugs.webkit.org/show_bug.cgi?id=189358

        Reviewed by Antti Koivisto.

        See https://www.w3.org/TR/CSS22/visudet.html#min-max-widths for details.

        Tests: fast/block/block-only/absolute-position-min-max-width.html
               fast/block/block-only/float-min-max-width.html
               fast/block/block-only/inflow-min-max-width.html

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        * layout/FormattingContext.h:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::computedValueIfNotAuto):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
        * layout/blockformatting/BlockFormattingContext.h:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):

2018-09-06  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Initialize AVVideoCapture video presets
        https://bugs.webkit.org/show_bug.cgi?id=189355

        Reviewed by Youenn Fablet.

        No new tests, no functionality changed.

        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::AVVideoCaptureSource): Don't try to load symbols if they
        aren't available.

2018-09-06  Ali Juma  <ajuma@chromium.org>

        IntersectionObserver leaks documents
        https://bugs.webkit.org/show_bug.cgi?id=189128

        Reviewed by Simon Fraser.

        Currently, Documents own IntersectionObservers while IntersectionObservers own callbacks
        that have strong references to Documents. To break this cycle, make Documents only have
        weak pointers to IntersectionObservers. Instead, manage the lifetime of an
        IntersectionObserver as an ActiveDOMObject, overriding hasPendingActivity to keep
        the observer alive while there are ongoing observations.

        However, there is a still a potential reference cycle. The callback keeps global
        references alive, so if there's a global reference to the observer in JavaScript,
        we have an observer->callback->observer cycle, keeping the callback (and hence the Document)
        alive. To break this cycle, make IntersectionObserver release the callback when its
        Document is stopped.

        With these changes, there are no longer any leaks reported with run-webkit-tests --world-leaks
        on LayoutTests/intersection-observer and LayoutTests/imported/w3c/web-platform-tests/intersection-observer.

        Tests: intersection-observer/no-document-leak.html
               intersection-observer/observer-and-callback-without-js-references.html

        * dom/Document.cpp:
        (WebCore::Document::addIntersectionObserver):
        (WebCore::Document::removeIntersectionObserver):
        * dom/Document.h:
        * dom/Element.cpp:
        (WebCore::Element::didMoveToNewDocument):
        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::IntersectionObserver):
        (WebCore::IntersectionObserver::~IntersectionObserver):
        (WebCore::IntersectionObserver::observe):
        (WebCore::IntersectionObserver::rootDestroyed):
        (WebCore::IntersectionObserver::createTimestamp const):
        (WebCore::IntersectionObserver::notify):
        (WebCore::IntersectionObserver::hasPendingActivity const):
        (WebCore::IntersectionObserver::activeDOMObjectName const):
        (WebCore::IntersectionObserver::canSuspendForDocumentSuspension const):
        (WebCore::IntersectionObserver::stop):
        * page/IntersectionObserver.h:
        (WebCore::IntersectionObserver::trackingDocument const):
        (WebCore::IntersectionObserver::trackingDocument): Deleted.
        * page/IntersectionObserver.idl:

2018-09-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Adapt to the new const WeakPtr<>
        https://bugs.webkit.org/show_bug.cgi?id=189334

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::FormattingContext):
        * layout/FormattingContext.h:
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::initializeRoot):
        * layout/LayoutContext.h:
        * layout/floats/FloatAvoider.cpp:
        (WebCore::Layout::FloatAvoider::FloatAvoider):
        * layout/floats/FloatAvoider.h:
        * layout/floats/FloatingState.cpp:
        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
        (WebCore::Layout::FloatingState::FloatingState):
        * layout/floats/FloatingState.h:
        * layout/layouttree/LayoutContainer.cpp:
        (WebCore::Layout::Container::addOutOfFlowDescendant):
        * layout/layouttree/LayoutContainer.h:
        (WebCore::Layout::Container::outOfFlowDescendants const):

2018-09-06  Xabier Rodriguez Calvar  <calvaris@igalia.com>

        [GStreamer] Extra ASSERTs at MainThreadNotifier
        https://bugs.webkit.org/show_bug.cgi?id=188786

        Reviewed by Carlos Garcia Campos.

        We add a couple of checks in debug mode: there is only one bit on
        per notification and ensure a notifier was invalidated before
        being destroyed.

        * platform/graphics/gstreamer/MainThreadNotifier.h:

2018-09-05  Youenn Fablet  <youenn@apple.com>

        Move ownership of outgoing source to RTCRtpSender backend
        https://bugs.webkit.org/show_bug.cgi?id=189310

        Reviewed by Alex Christensen.

        RTCRtpSender should own the source so that it can replace/stop it.
        Since this is libwebrtc specific, the source is actually owned by the backend.
        Simplified replaceTrack a bit based on that.

        No change of behavior.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::doStop):
        (WebCore::updateTrackSource):
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::applyRotationForOutgoingVideoSources):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:

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-05  Zalan Bujtas  <zalan@apple.com>

        [LFC][BFC] ComputeFloat* methods should take a const FloatingContext&
        https://bugs.webkit.org/show_bug.cgi?id=189333

        Reviewed by Antti Koivisto.

        Only layoutFormattingContextRoot() needs a non-const FloatingContext& object (to add the floating box to the floating state).

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
        * layout/blockformatting/BlockFormattingContext.h:

2018-09-05  Youenn Fablet  <youenn@apple.com>

        Introduce a backend for RTCRtpTransceiver
        https://bugs.webkit.org/show_bug.cgi?id=189322

        Reviewed by Eric Carlson.

        Introduce RTCRtpTransceiverBackend to implement the transceiver functionality using libwebrtc.
        Remove provisional mids as it will be done by the webrtc backend.

        No observable change of behavior yet since there is no transceiver backend yet.

        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCRtpTransceiver.cpp:
        (WebCore::RTCRtpTransceiver::RTCRtpTransceiver):
        (WebCore::RTCRtpTransceiver::mid const):
        (WebCore::RTCRtpTransceiver::direction const):
        (WebCore::RTCRtpTransceiver::setDirection):
        (WebCore::RTCRtpTransceiver::stop):
        (WebCore::RTCRtpTransceiver::getNextMid): Deleted.
        (WebCore::RTCRtpTransceiver::directionString const): Deleted.
        * Modules/mediastream/RTCRtpTransceiver.h:
        (WebCore::RTCRtpTransceiver::create):
        (WebCore::RTCRtpTransceiver::provisionalMid const): Deleted.
        (WebCore::RTCRtpTransceiver::setMid): Deleted.
        * Modules/mediastream/RTCRtpTransceiverBackend.h: Added.
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::createReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * WebCore.xcodeproj/project.pbxproj:

2018-09-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Pass in const LayoutContext& to geometry methods when possible
        https://bugs.webkit.org/show_bug.cgi?id=189331

        Reviewed by Antti Koivisto.

        Only layout and layout-like methods (intrinsic width computation -> shrink to fit -> out-of-flow/floating boxes) should take a
        non-const LayoutContext&. Other geometry functions should not mutate the the context.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
        (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/FormattingContext.h:
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::computedBorder):
        (WebCore::Layout::FormattingContext::Geometry::computedPadding):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
        (WebCore::Layout::LayoutContext::establishedFormattingState const):
        (WebCore::Layout::LayoutContext::createFormattingStateForFormattingRootIfNeeded):
        (WebCore::Layout::LayoutContext::formattingContext const):
        (WebCore::Layout::LayoutContext::establishedFormattingState): Deleted.
        (WebCore::Layout::LayoutContext::formattingContext): Deleted.
        * layout/LayoutContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
        * layout/blockformatting/BlockFormattingContext.h:
        * 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):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
        (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
        * layout/inlineformatting/InlineFormattingContext.h:

2018-09-05  Youenn Fablet  <youenn@apple.com>

        Expose RTCRtpSender.setParameters
        https://bugs.webkit.org/show_bug.cgi?id=189307

        Reviewed by Eric Carlson.

        Implement RTCRtpSender.setParameters.
        This is an incomplete implementation as we need to refresh parameters as per the spec and testing is much easier with full transceiver support.
        Implementation uses sender backend to set the parameters at libwebrtc level.
        Fix the case of a stopped sender/transceiver in which case promise should be rejected.
        Covered by rebased and modified tests.

        * Modules/mediastream/RTCRtpParameters.h:
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::setParameters):
        * Modules/mediastream/RTCRtpSender.h:
        * Modules/mediastream/RTCRtpSender.idl:
        * Modules/mediastream/RTCRtpSenderBackend.h:
        * Modules/mediastream/RTCRtpTransceiver.cpp:
        (WebCore::RTCRtpTransceiver::stop):
        * Modules/mediastream/RTCRtpTransceiver.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp:
        (WebCore::LibWebRTCRtpReceiverBackend::getParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
        (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
        (WebCore::LibWebRTCRtpSenderBackend::setParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp:
        (WebCore::toRTCEncodingParameters):
        (WebCore::fromRTCEncodingParameters):
        (WebCore::toRTCHeaderExtensionParameters):
        (WebCore::fromRTCHeaderExtensionParameters):
        (WebCore::toRTCCodecParameters):
        (WebCore::toRTCRtpParameters):
        (WebCore::fromRTCRtpParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCUtils.h:

2018-09-05  Simon Fraser  <simon.fraser@apple.com>

        Remove some logging that I committed by mistake.

        * rendering/RenderLayerFilters.cpp:
        (WebCore::RenderLayerFilters::RenderLayerFilters):
        (WebCore::RenderLayerFilters::~RenderLayerFilters):

2018-09-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Construct the Display::Box objects on demand.
        https://bugs.webkit.org/show_bug.cgi?id=189320

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::initializeRoot):
        (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
        (WebCore::Layout::LayoutContext::createDisplayBox): Deleted.
        * layout/LayoutContext.h:
        (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const): Deleted.
        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        * layout/displaytree/DisplayBox.h:

2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>

        Add infrastructure to dump resource load statistics
        https://bugs.webkit.org/show_bug.cgi?id=189213

        Reviewed by Daniel Bates. 

        The dumping functionality is not currently used, but will be included in tests for
        <https://bugs.webkit.org/show_bug.cgi?id=187773>.

        * loader/ResourceLoadStatistics.h:

2018-09-05  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, fix the build with recent SDKs.

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

2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>

        Added runtime feature flag for web API statistics
        https://bugs.webkit.org/show_bug.cgi?id=189211

        Reviewed by Daniel Bates.

        Added functionality to get and set the runtime flag.

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setWebAPIStatisticsEnabled):
        (WebCore::RuntimeEnabledFeatures::webAPIStatisticsEnabled const):

2018-09-05  Youenn Fablet  <youenn@apple.com>

        Move replaceTrack logic to LibWebRTCPeerConnectionBackend
        https://bugs.webkit.org/show_bug.cgi?id=189281

        Reviewed by Eric Carlson.

        Move replaceTrack handling code from RTCPeerConnection to LibWebRTCPeerConnectionBackend.
        This makes the logic easier to understand.
        Future refactoring will further try to put more handling in RTCRtpSenderBackend.
        No change of behavior.

        * Modules/mediastream/RTCPeerConnection.cpp:
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::tryUpdatingTrackSource):
        (WebCore::LibWebRTCPeerConnectionBackend::replaceTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::enqueueReplaceTrackTask):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
        (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):

2018-09-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] LayoutContext::displayBoxForLayoutBox() should return a Display::Box&
        https://bugs.webkit.org/show_bug.cgi?id=189311

        Reviewed by Antti Koivisto.

        When the layout logic needs a Display::Box, we must have already created one for the associated Layout::Box.
        (It does not necessarily mean that evey Layout::Box has a Display::Box. For example in case of inline formatting context,
        we don't create a Display::Box for every inline box, but the formatting logic does not require such pairs.)

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
        (WebCore::Layout::FormattingContext::mapBoxToAncestor):
        (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
        (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
        (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):
        (WebCore::Layout::staticVerticalPositionForOutOfFlowPositioned):
        (WebCore::Layout::staticHorizontalPositionForOutOfFlowPositioned):
        (WebCore::Layout::FormattingContext::Geometry::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::complicatedCases):
        (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.h:
        (WebCore::Layout::LayoutContext::displayBoxForLayoutBox const):
        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin 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):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::isMarginBottomCollapsedThrough):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
        * layout/floats/FloatingState.cpp:
        (WebCore::Layout::FloatingState::append):
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::layout const):
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::outputLayoutTree):
        (WebCore::Layout::showLayoutTree):

2018-09-05  Zalan Bujtas  <zalan@apple.com>

        [LFC] Drop Display:Box from FormattingContext::compute* functions
        https://bugs.webkit.org/show_bug.cgi?id=189309

        Reviewed by Antti Koivisto.

        They are redundant and could get out of sync.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowVerticalGeometry const):
        (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
        (WebCore::Layout::FormattingContext::placeInFlowPositionedChildren const):
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/FormattingContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::computeStaticPosition const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowPositionedPosition const):
        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::computeStaticPosition const):
        (WebCore::Layout::InlineFormattingContext::computeInFlowPositionedPosition const):
        * layout/inlineformatting/InlineFormattingContext.h:

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

        Add MediaCapabilities as an Experimental Feature
        https://bugs.webkit.org/show_bug.cgi?id=189209

        Reviewed by Eric Carlson.

        Move mediaCapabilitiesEnabled out of RuntimeEnabledFeatures. It already (also) exists in Settings.

        * Modules/mediacapabilities/MediaCapabilities.idl:
        * Modules/mediacapabilities/MediaCapabilitiesInfo.idl:
        * Modules/mediacapabilities/NavigatorMediaCapabilities.idl:
        * Modules/mediacapabilities/ScreenLuminance.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setMediaCapabilitiesEnabled): Deleted.
        (WebCore::RuntimeEnabledFeatures::mediaCapabilitiesEnabled const): Deleted.

2018-09-05  Woodrow Wang  <woodrow_wang@apple.com>

        Add functionality to encode and decode a uint64_t in KeyedCoding
        https://bugs.webkit.org/show_bug.cgi?id=189216

        Reviewed by Daniel Bates.

        I've added this functionality in order to be able to encode and decode the raw uint64_t 
        representation of an OptionSet for my patch here <https://bugs.webkit.org/show_bug.cgi?id=187773>. 

        The changes in the KeyedEncoder/KeyedDecoder for Glib were made because they are derived classes
        of KeyedCoding which contains pure virtual functions that need to be implemented.

        * platform/KeyedCoding.h:
        * platform/cf/KeyedDecoderCF.cpp:
        (WebCore::KeyedDecoderCF::decodeUInt64):
        * platform/cf/KeyedDecoderCF.h:
        * platform/cf/KeyedEncoderCF.cpp:
        (WebCore::KeyedEncoderCF::encodeUInt64):
        * platform/cf/KeyedEncoderCF.h:
        * platform/glib/KeyedDecoderGlib.cpp:
        (WebCore::KeyedDecoderGlib::decodeUInt64):
        * platform/glib/KeyedDecoderGlib.h:
        * platform/glib/KeyedEncoderGlib.cpp:
        (WebCore::KeyedEncoderGlib::encodeUInt64):
        * platform/glib/KeyedEncoderGlib.h:

2018-09-05  Zan Dobersek  <zdobersek@igalia.com>

        [GTK] ASSERT(!m_nicosia.imageBacking) when starting any YouTube video
        https://bugs.webkit.org/show_bug.cgi?id=189215

        Reviewed by Carlos Garcia Campos.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
        Manually clear out any layer-side state of any image backing that is
        associated with this layer, much like we do for backing stores.

2018-09-05  Eric Carlson  <eric.carlson@apple.com>

        [MediaStream] Simplify logic when changing RealtimeMediaSource settings
        https://bugs.webkit.org/show_bug.cgi?id=189284
        <rdar://problem/44117948>

        Reviewed by Youenn Fablet.

        Remove all "apply<setting>" methods from RealtimeMediaSource and derived classes, and
        add a bitfield to settingsDidChange so classes can do setting-specific setup and
        configuration by overriding settingsDidChange.

        No new tests, no functionality changed.

        * Modules/mediastream/CanvasCaptureMediaStreamTrack.cpp:
        (WebCore::CanvasCaptureMediaStreamTrack::Source::canvasResized):
        * Modules/mediastream/CanvasCaptureMediaStreamTrack.h:
        * platform/mediastream/MediaConstraints.h:
        (WebCore::NumericConstraint::fitnessDistance const):
        (WebCore::NumericConstraint::valueForDiscreteCapabilityValues const):
        * platform/mediastream/RealtimeIncomingVideoSource.h:
        (): Deleted.
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::RealtimeMediaSource):
        (WebCore::RealtimeMediaSource::settingsDidChange):
        (WebCore::RealtimeMediaSource::fitnessDistance):
        (WebCore::applyNumericConstraint):
        (WebCore::RealtimeMediaSource::applyConstraint):
        (WebCore::RealtimeMediaSource::applyConstraints):
        (WebCore::RealtimeMediaSource::setSize):
        (WebCore::RealtimeMediaSource::setWidth):
        (WebCore::RealtimeMediaSource::setHeight):
        (WebCore::RealtimeMediaSource::setFrameRate):
        (WebCore::RealtimeMediaSource::setAspectRatio):
        (WebCore::RealtimeMediaSource::setFacingMode):
        (WebCore::RealtimeMediaSource::setVolume):
        (WebCore::RealtimeMediaSource::setSampleRate):
        (WebCore::RealtimeMediaSource::setSampleSize):
        (WebCore::RealtimeMediaSource::setEchoCancellation):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/RealtimeMediaSourceSettings.cpp:
        (WebCore::RealtimeMediaSourceSettings::diff const):
        * platform/mediastream/RealtimeMediaSourceSettings.h:
        (WebCore::RealtimeMediaSourceSettings::allFlags):
        * platform/mediastream/RealtimeVideoSource.cpp:
        (WebCore::RealtimeVideoSource::applySize): Deleted.
        (WebCore::RealtimeVideoSource::applyFrameRate): Deleted.
        * platform/mediastream/RealtimeVideoSource.h:
        * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
        (WebCore::GStreamerAudioCaptureSource::settingsDidChange):
        (WebCore::GStreamerAudioCaptureSource::applySampleRate): Deleted.
        * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.h:
        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
        (WebCore::GStreamerVideoCaptureSource::settingsDidChange):
        (WebCore::GStreamerVideoCaptureSource::applySize): Deleted.
        (WebCore::GStreamerVideoCaptureSource::applyFrameRate): Deleted.
        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::settingsDidChange):
        (WebCore::AVVideoCaptureSource::setPreset):
        (WebCore::AVVideoCaptureSource::setFrameRate):
        (WebCore::AVVideoCaptureSource::applySizeAndFrameRate):
        (WebCore::AVVideoCaptureSource::processNewFrame):
        (WebCore::AVVideoCaptureSource::applySize): Deleted.
        (WebCore::AVVideoCaptureSource::applyFrameRate): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.cpp:
        (WebCore::CoreAudioCaptureSource::settingsDidChange):
        (WebCore::CoreAudioCaptureSource::applySampleRate): Deleted.
        (WebCore::CoreAudioCaptureSource::applyEchoCancellation): Deleted.
        * platform/mediastream/mac/CoreAudioCaptureSource.h:
        * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
        (WebCore::DisplayCaptureSourceCocoa::settingsDidChange):
        (WebCore::DisplayCaptureSourceCocoa::startProducingData):
        (WebCore::DisplayCaptureSourceCocoa::applySize): Deleted.
        (WebCore::DisplayCaptureSourceCocoa::applyFrameRate): Deleted.
        * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.h:
        * platform/mediastream/mac/MockRealtimeAudioSourceMac.mm:
        (WebCore::MockRealtimeAudioSourceMac::settingsDidChange):
        (WebCore::MockRealtimeAudioSourceMac::applySampleRate): Deleted.
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.h:
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::settingsDidChange):
        (WebCore::MockRealtimeVideoSourceMac::applySize): Deleted.
        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
        (WebCore::RealtimeIncomingVideoSourceCocoa::processNewSample):
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
        (WebCore::ScreenDisplayCaptureSourceMac::settingsDidChange):
        (WebCore::ScreenDisplayCaptureSourceMac::applySize): Deleted.
        (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Deleted.
        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::settingsDidChange):
        * platform/mock/MockRealtimeAudioSource.h:
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::settingsDidChange):
        (WebCore::MockRealtimeVideoSource::applySize): Deleted.
        * platform/mock/MockRealtimeVideoSource.h:

2018-09-05  Zalan Bujtas <zalan@apple.com>

        [LFC][BFC] Move MarginCollapse class under BlockFormattingContext::Geometry
        https://bugs.webkit.org/show_bug.cgi?id=189296

        Reviewed by Antti Koivisto.

        Margin collapsing is part of geometry after all.

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::estimatedMarginTop):
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginTopFromFirstChild):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginTop):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginTop):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::computedNonCollapsedMarginBottom):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginTop):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::marginBottom):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginBottomCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::collapsedMarginBottomFromLastChild):
        (WebCore::Layout::BlockFormattingContext::Geometry::MarginCollapse::nonCollapsedMarginBottom):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginTopFromFirstChild): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginTop): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginTop): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::computedNonCollapsedMarginBottom): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginTop): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::marginBottom): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginTopCollapsedWithParentMarginBottom): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom): Deleted.
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop): Deleted.

2018-09-04  Zalan Bujtas  <zalan@apple.com>

        [LFC] Make BlockFormattingContext::Geometry a subclass of FormattingContext::Geometry
        https://bugs.webkit.org/show_bug.cgi?id=189294

        Reviewed by Antti Koivisto.

        This simplifies some of the call sites.

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowPositionedPosition):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::instrinsicWidthConstraints):

2018-09-04  Frederic Wang  <fwang@igalia.com>

        Add basic support for ScrollIntoViewOptions
        https://bugs.webkit.org/show_bug.cgi?id=189258

        Reviewed by Simon Fraser.

        This patch introduces a new ScrollIntoViewOptions parameter that can be passed into
        Element.scrollIntoView instead of a boolean. A basic support for scroll alignments is
        implemented, so that it is closer to the behavior of the CSSOMView spec while still remaining
        compatible with the current boolean-parameter implementation. Full implementation that
        takes into account orientation/direction will be handled in bug 161611. This patch is also a
        preliminary step to support the ScrollBehavior (bug 188043) for ScrollIntoView.

        Tests: web-platform-tests/css/cssom-view/scrollintoview-html
               web-platform-tests/css/cssom-view/scrollIntoView-smooth.html

        * CMakeLists.txt: Add new IDL files.
        * DerivedSources.make: Ditto.
        * Sources.txt: Add new generated cpp JS bindings.
        * WebCore.xcodeproj/project.pbxproj: Add files to build to XCode.
        * dom/Element.cpp:
        (WebCore::toScrollAlignment): Convert ScrollLogicalPosition to scroll alignment. Orientation
        and direction are not implemented yet.
        (WebCore::Element::scrollIntoView): Implement new scrollIntoView version accepting
        ScrollIntoViewOptions parameter.
        * dom/Element.h: Declare new scrollIntoView.
        * dom/Element.idl: Make scrollIntoView accept a ScrollIntoViewOptions parameter.
        * page/ScrollIntoViewOptions.h: Added.
        * page/ScrollIntoViewOptions.idl: Added.
        * page/ScrollLogicalPosition.h: Added.
        * page/ScrollLogicalPosition.idl: Added.

2018-09-04  Oriol Brufau  <obrufau@igalia.com>

        Check important flags when serializing shorthand with "initial" values
        https://bugs.webkit.org/show_bug.cgi?id=188984

        Reviewed by Antti Koivisto.

        Test: imported/w3c/web-platform-tests/css/cssom/shorthand-serialization.html

        The test still has some failures due to https://bugs.webkit.org/show_bug.cgi?id=185953
        but without this patch it would fail earlier.

        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::get4Values const):

2018-09-04  Antti Koivisto  <antti@apple.com>

        Remove pointless RenderSVGResourceMode::ApplyToDefault enum value
        https://bugs.webkit.org/show_bug.cgi?id=189260

        Reviewed by Sam Weinig.

        Default does not need a bit, it is better represented with an empty OptionSet.

        * rendering/svg/RenderSVGResource.cpp:
        (WebCore::requestPaintingResource):
        * rendering/svg/RenderSVGResource.h:
        * rendering/svg/RenderSVGResourceClipper.cpp:
        (WebCore::RenderSVGResourceClipper::applyResource):
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::applyResource):
        (WebCore::RenderSVGResourceFilter::postApplyResource):
        * rendering/svg/RenderSVGResourceGradient.cpp:
        (WebCore::RenderSVGResourceGradient::applyResource):
        * rendering/svg/RenderSVGResourceMasker.cpp:
        (WebCore::RenderSVGResourceMasker::applyResource):
        * rendering/svg/RenderSVGResourcePattern.cpp:
        (WebCore::RenderSVGResourcePattern::applyResource):
        (WebCore::RenderSVGResourcePattern::postApplyResource):
        * rendering/svg/RenderSVGResourceSolidColor.cpp:
        (WebCore::RenderSVGResourceSolidColor::applyResource):
        (WebCore::RenderSVGResourceSolidColor::postApplyResource):
        * rendering/svg/SVGInlineTextBox.cpp:
        (WebCore::SVGInlineTextBox::SVGInlineTextBox):
        (WebCore::SVGInlineTextBox::paintSelectionBackground):
        (WebCore::SVGInlineTextBox::paint):
        (WebCore::SVGInlineTextBox::acquirePaintingResource):
        (WebCore::SVGInlineTextBox::paintDecorationWithStyle):
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::SVGRenderingContext::~SVGRenderingContext):
        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):

2018-08-29  Emilio Cobos Álvarez  <emilio@crisal.io>

        Remove PseudoElementUserAgentCustom.
        https://bugs.webkit.org/show_bug.cgi?id=189089

        Reviewed by Ryosuke Niwa.

        Tests at https://github.com/web-platform-tests/wpt/pull/12743.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::pseudoId):
        (WebCore::CSSSelector::parsePseudoElementType):
        * css/CSSSelector.h:
        (WebCore::CSSSelector::isCustomPseudoElement const):
        * css/RuleSet.cpp:
        (WebCore::RuleSet::addRule):
        * css/parser/CSSParserSelector.h:
        (WebCore::CSSParserSelector::needsImplicitShadowCombinatorForMatching const):

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

        Post review Weinig fix-ups
        https://bugs.webkit.org/show_bug.cgi?id=189288

        Reviewed by Sam Weinig.

        Fix-ups from https://bugs.webkit.org/show_bug.cgi?id=189252

        * platform/MIMETypeRegistry.cpp:
        (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
        (WebCore::initializeSystemPreviewMIMETypes): Deleted.
        * rendering/RenderThemeIOS.mm:
        (WebCore::arKitBundle):
        (WebCore::loadARKitPDFPage):
        (WebCore::systemPreviewLogo):

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

        slotchange event doesn't get fired when inserting, removing, or renaming slot elements
        https://bugs.webkit.org/show_bug.cgi?id=189144
        <rdar://problem/43871061>

        Reviewed by Antti Koivisto.

        This patch implements `slotchange` event when a slot element is inserted, removed, or renamed in the DOM tree.
        Let us consider each scenario separately.

        Insertion (https://dom.spec.whatwg.org/#concept-node-insert): In this case, we must fire `slotchange` event on
        slot elements whose assigned nodes have changed in the tree order. When there is at most one slot element for
        each name, this can be done by simply checking whether each slot has assigned nodes or not. When there are more
        than one slot element, however, the newly inserted slot element may now become the first slot of a given name,
        and gain assined nodes while the previously first element loses its assigned nodes. To see if the newly inserted
        slot element is the first of its kind, we must travere the DOM tree to check the order of that and the previously
        first slot element. To do this, we resolve the slot elements before start inserting nodes in
        executeNodeInsertionWithScriptAssertion via SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval. Note that
        when the DOM tree has at most one slot element of its kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op
        and addSlotElementByName continues to operate in O(1). Becasue addSlotElementByName is called on each inserted
        slot element in the tree order, we do the tree traversal upon finding the first slot element which has more than
        one of its kind in the current tree. In this case, we resolve all other slot elements and enqueues slotchange
        event as needed to avoid doing the tree traversal more than once.

        Removal (https://dom.spec.whatwg.org/#concept-node-remove): In removal, we're concerned with removing the first
        slot element of its kind. We must fire slotchange event on the remaining slot elements which became the first of
        its kind after the removal as well as the ones which got removed from the tree if they had assigned nodes.
        Furthermore, the DOM specification mandates that we first fire slotchange events in the tree from which a node
        was removed and then in the removed subtree. Because we must only fire slotchange event on the first slot element
        of its kind which has been removed, we must resolve the first slot elements of each kind before a node removal
        in removeAllChildrenWithScriptAssertion and removeNodeWithScriptAssertion as we've done for insertion. Again,
        in the case there was at most one slot element of each kind, resolveSlotsBeforeNodeInsertionOrRemoval is a no-op
        and removeSlotElementByName would continue to operate in O(1). When there are multiple slot elements for a given
        kind, we immediately enqueue slotchange event on the slot elements which newly became the first of its kind but
        delay the enqueuing of slotchange event on the removed slot elements until removeSlotElementByName is called on
        that element so that enqueuing of slotchange events on the slot elements still remaining in the in the tree would
        happen before those which got removed as the DOM specification mandates.

        Rename (https://dom.spec.whatwg.org/#shadow-tree-slots): In the case the slot element's name content attribute
        is changed, the renamed element might have become the first of its kind or ceased to be the first of its kind.
        There could be two other slot elements appearing later in the tree order which might have gained or lost assigned
        nodes as a result. In this case, we invoke the algorithms for removing & inserting the slot with a key difference:
        we enqueue slotchange event on the renamed slot immediately if it has assigned nodes.

        To enqueue slotchange event in the tree order, this patch adds oldElement, which is a WeakPtr to a slot element,
        to SlotAssignment::Slot. This WeakPtr is set to the slot element which used to have assigned nodes prior to the
        node insertion, removal, or rename but no longer has after the mutation. This patch also adds a slot mutation
        version number, m_slotMutationVersion, which is incremented whenever a node is about to be inserted or removed,
        and slot resolution version, m_slotResolutionVersion, which is set to the current slot mutation version number
        when the full slot resolution is triggered during slot mutations. They are used to avoid redundant tree traversals
        in resolveSlotsAfterSlotMutation. This patch also makes m_needsToResolveSlotElements compiled in release builds
        to avoid resolving slot elements when there is at most one slot element of each kind.

        For insertion, oldElement is set to the slot which used to be the first of its kind before getting set to a slot
        element being inserted in resolveSlotsAfterSlotMutation. We enqueue slotchange event on the newly inserted slot
        element at that point (1). Since the slot element which used to be the first of its kind appears after the newly
        inserted slot element by definition, we're guaranteed to see this oldElement later in the tree traversal upon
        which we enqueue slotchange event. Note that if this slot element was the first of its kind, then we're simply
        hitting (1), which is O(1) and does not invoke the tree traversal.

        For removal, oldElement is set to the slot which used to be the first of its kind. Because this slot element is
        getting removed, slotchange event must be enqueud after slotchange events have been enqueued on all slot elements
        still remaining in the tree. To do this, we enqueue slotchange event immediately on the first slot element of
        its kind during the tree traversal as we encounter it (2), and set oldElement to the previosuly-first-but-removed
        slot element. slotchange event is enqueued on this slot element when removeSlotElementByName is later invoked via
        HTMLSlotElement::removedFromAncestor which traverses each removed element in the tree order. Again, if this was
        the last slot of its kind, we'd simply expedite (2) by enqueuing slotchange event during removeSlotElementByName,
        which is O(1).

        When the DOM invokes the concept to replace all children (https://dom.spec.whatwg.org/#concept-node-replace-all),
        however, this algorithm isn't sufficient because the removal of each child happens one after another. We would
        either need to resolve slots between each removal, or treat the removal of all children as a single operation.
        While the DOM specification currently specifies the former behavior, this patch implements the latter behavior
        to avoid useless work. See the DOM spec issue: https://github.com/w3c/webcomponents/issues/764

        Test: fast/shadow-dom/slotchange-for-slot-mutation.html

        * dom/ContainerNode.cpp:
        (WebCore::ContainerNode::removeAllChildrenWithScriptAssertion): Call resolveSlotsBeforeNodeInsertionOrRemoval
        before start removing children.
        (WebCore::ContainerNode::removeNodeWithScriptAssertion): Ditto.
        (WebCore::executeNodeInsertionWithScriptAssertion): Ditto before inserting children.
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::~ShadowRoot): Set m_hasBegunDeletingDetachedChildren to true. This flag is used to supress
        slotchange events during the shadow tree destruction.
        (WebCore::ShadowRoot::renameSlotElement): Added.
        (WebCore::ShadowRoot::removeSlotElementByName): Added oldParentOfRemovedTree as an argument.
        * dom/ShadowRoot.h:
        (WebCore::ShadowRoot::shouldFireSlotchangeEvent): Added.
        * dom/SlotAssignment.cpp:
        (WebCore::findSlotElement): Added.
        (WebCore::nextSlotElementSkippingSubtree): Added.
        (WebCore::SlotAssignment::hasAssignedNodes): Added. Returns true if the slot of a given name has assigned nodes.
        (WebCore::SlotAssignment::renameSlotElement): Added.
        (WebCore::SlotAssignment::addSlotElementByName): Call resolveSlotsAfterSlotMutation when slotchange event needs
        to be dispatched for the current slot and there are more than one slot elements.
        (WebCore::SlotAssignment::removeSlotElementByName): Ditto. When the slot's oldElement is set to the current slot
        element, meaning that this slot element used to have assigned nodes, then enqueue slotchange event. It also has
        a special case for oldParentOfRemovedTree is null when renaming a slot element. In this case, we want to enqueue
        slot change event immediately on the renamed slot element and any affected elements as in a node insertion since
        removeSlotElementByName would never be called on a slot element which newly become the first of its kind after
        a slot rename.
        (WebCore::SlotAssignment::resolveSlotsAfterSlotMutation): Added. This is the slot resolution algorithm invoked
        when there are more than one slot elements for a given name. It has two modes dealing with insertion & removal.
        The insertion mode is also used for renaming a slot element. The firs
        (WebCore::SlotAssignment::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Resolves all slot elements prior to
        inserting or removing nodes. In many cases, this should be a no-op since m_needsToResolveSlotElements is set to
        true only when there are more than one slot element of its kind.
        (WebCore::SlotAssignment::willRemoveAllChildren): Ditto. Also sets m_willBeRemovingAllChildren to true.
        (WebCore::SlotAssignment::didChangeSlot):
        (WebCore::SlotAssignment::resolveAllSlotElements): Use seenFirstElement instead of element to indicate whether
        we have seen a slot element of given name for consistency with resolveSlotsAfterSlotMutation.
        * dom/SlotAssignment.h:
        (WebCore::SlotAssignment::Slot): Added oldElement and seenFirstElement.
        (WebCore::SlotAssignment): Always compile m_needsToResolveSlotElements. Added m_willBeRemovingAllChildren,
        m_slotMutationVersion, and m_slotResolutionVersion.
        (WebCore::ShadowRoot::resolveSlotsBeforeNodeInsertionOrRemoval): Added. Calls the one in SlotAssignment.
        (WebCore::ShadowRoot::willRemoveAllChildren): Ditto.
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::removedFromAncestor):
        (WebCore::HTMLSlotElement::attributeChanged): Calls ShadowRoot::renameSlotElement instead of
        removeSlotElementByName and addSlotElementByName pair.

2018-09-04  Youenn Fablet  <youenn@apple.com>

        Make LibWebRTCRtpSenderBackend own its libwebrtc RTP sender backend
        https://bugs.webkit.org/show_bug.cgi?id=189270

        Reviewed by Eric Carlson.

        Previously, the libwebrtc senders were owned in LibWebRTCMediaEndpoint.
        This patch makes them be owned by LibWebRTCRtpSenderBackend.
        This simplifies the implementation of RTCRtpSender::getParameters.
        This will help simplify the implementation of RTCRtpSender::replaceTrack.

        removeTrack is also refactored so that LibWebRTCMediaEndpoint directly uses libwebrtc constructs and not WebCore libwebrtc-agnostic ones.

        No change of behavior.

        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::removeTrack):
        (WebCore::PeerConnectionBackend::notifyRemovedTrack): Deleted.
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::removeTrack):
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::getParameters):
        * Modules/mediastream/RTCRtpSender.h:
        (WebCore::RTCRtpSender::backend):
        * Modules/mediastream/RTCRtpSenderBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        (WebCore::LibWebRTCMediaEndpoint::removeTrack):
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer):
        (WebCore::LibWebRTCMediaEndpoint::stop):
        (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const): Deleted.
        (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const): Deleted.
        (WebCore::LibWebRTCMediaEndpoint::getRTCRtpSenderParameters): Deleted.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::backendFromRTPSender):
        (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::removeTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::shouldOfferAllowToReceive const):
        (WebCore::LibWebRTCPeerConnectionBackend::notifyRemovedTrack): Deleted.
        (WebCore::LibWebRTCPeerConnectionBackend::getParameters const): Deleted.
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp:
        (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h:

2018-09-04  Wenson Hsieh  <wenson_hsieh@apple.com>

        Populate "text/uri-list" with multiple URLs when the pasteboard contains multiple URLs
        https://bugs.webkit.org/show_bug.cgi?id=188890
        <rdar://problem/43648605>

        Reviewed by Tim Horton.

        Adds support for exposing a newline separated list of URLs via DataTransfer's "text/uri-list" type when pasting
        or dropping multiple items on the pasteboard that can be represented as URLs. Currently on iOS, only the URL of
        the first item (if present) is exposed, and on macOS, only the first out of all the URLs in the pasteboard is
        exposed.

        To fix this, we introduce `Pasteboard::readAllStrings`, which reads a list of pasteboard strings collected from
        all available items on the platform pasteboard. Currently, this is only used to provide a list of URL strings
        when fetching data for the "text/uri-list" type when calling `DataTransfer.getData()` and
        `DataTransferItem.getAsString()`.

        Tests:  DragAndDropTests.ExposeMultipleURLsInDataTransfer
                UIPasteboardTests.DataTransferURIListContainsMultipleURLs
                PasteMixedContent.PasteOneOrMoreURLs

        * dom/DataTransfer.cpp:
        (WebCore::readURLsFromPasteboardAsString):

        Add a helper method that reads all URL strings from the pasteboard (for the MIME type "text/uri-list", which
        corresponds to NSURLPboardType and "public.url" on macOS and iOS, respectively) and returns a single string
        containing all non-empty URLs joined by newline characters. Also takes a filtering block which may be used to
        reject URLs from being included in "text/uri-list" output.

        (WebCore::DataTransfer::getDataForItem const):
        (WebCore::DataTransfer::readStringFromPasteboard const):

        Insteading of reading a single string from the pasteboard for "text/uri-list", call the above helper function to
        read all URL strings in the pasteboard. If there are files present in the pasteboard, we also filter out URLs
        whose schemes are not in the set of schemes that are safe to expose to the page (i.e. http(s), blob, and data).

        * platform/Pasteboard.cpp:
        (WebCore::Pasteboard::readAllStrings):

        Add a default non-Cocoa implementation of readAllStrings() that returns a vector, which may contain the result
        of readString().

        * platform/Pasteboard.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:

        Add plumbing to grab a list of strings from the pasteboard for a given type.

        * platform/cocoa/PasteboardCocoa.mm:
        (WebCore::Pasteboard::readAllStrings):
        (WebCore::Pasteboard::readString):

        Implement these two methods in terms of `readPlatformValuesAsStrings`. `readAllStrings` returns the full list of
        results, while `readString` only returns the first result.

        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::readPlatformValuesAsStrings):
        (WebCore::Pasteboard::readPlatformValueAsString): Deleted.

        Refactor this Cocoa helper function to return a list of pasteboard string values for the given type, rather than
        a single string.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::allStringsForType const):

        Grab a string for each item (represented by an NSItemProvider) in the pasteboard that has data for the given
        type identifier.

        (WebCore::PlatformPasteboard::readString const):

        Return the absolute string of the NSURL, instead of WebCore::URL::string(). This is needed to handle the case
        where the NSURL is constructed from absolute and relative parts using a Plist. While -absoluteString gets us the
        full URL string, URL::string() only returns the relative portion.

        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::readPlatformValuesAsStrings):
        (WebCore::Pasteboard::readPlatformValueAsString): Deleted.

        Also refactor this to retrieve a list of pasteboard strings, rather than a single result.

        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::typeIdentifierForPasteboardType):
        (WebCore::PlatformPasteboard::allStringsForType const):

        Add an implementation for `allStringsForType` on macOS. Unlike iOS, it's much trickier to get this right since
        we need to maintain compatibility with legacy "NS*Pboard" types, and `NSPasteboardItem` can only provide data
        for `NSPasteboardType`s (i.e. UTIs), so there's no way to just iterate through each pasteboard item and ask it
        for data that matches the given type, if the types are not UTIs. However, in the case where we have multiple
        items, the client must have used NSPasteboardWriting-conformant objects and/or NSPasteboardItem itself to write
        data to the pasteboard. Since NSPasteboardWriting-conformant objects register modern pasteboard types when
        writing to the pasteboard, we can simply iterate over these pasteboard items and ask for property lists using
        type identifiers instead of having to worry about legacy pasteboard types. Furthermore, in the case where there
        is only a single item in the pasteboard and we do need to handle legacy pasteboard types, using `-[NSPasteboard
        stringForType:]` in the same way we do currently should yield the correct result.

        As such, in the case where there is a single pasteboard item, we use `-[NSPasteboard stringForType:]` with the
        original legacy type, and in the case where there are multiple items on the pasteboard, we iterate over each of
        the pasteboard items and call `-[NSPasteboardItem propertyListForType:]` with the modern pasteboard type
        corresponding to the given legacy pasteboard type.

        The different corner cases in this logic are tested by the new API test, PasteMixedContent.PasteOneOrMoreURLs,
        which exercises several different ways of writing one or more URLs to the pasteboard on macOS, which each result
        in different legacy and modern pasteboard types being written to the pasteboard; our implementation of
        `PlatformPasteboard::allStringsForType` on macOS handles all cases correctly.

2018-09-04  Simon Fraser  <simon.fraser@apple.com>

        CSS reference filter that references a tiled feTurbulence is blank
        https://bugs.webkit.org/show_bug.cgi?id=188950

        Reviewed by Dean Jackson.
        
        We need to run the code that was in RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion()
        for CSS reference filters, to set up the various rects in the filter effects.
        
        Do this by moving the code to FilterEffect::determineFilterPrimitiveSubregion(), which makes sense
        because it recurses on the FilterEffect input chain. To make it CSS/SVGFilter agnostic, we move filterRegionInUserSpace()
        to the Filter base class (for CSSFilter, it just returns m_filterRegion).

        Test: css3/filters/reference-filter-set-filter-regions.html

        * platform/graphics/filters/Filter.h:
        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::determineFilterPrimitiveSubregion):
        * platform/graphics/filters/FilterEffect.h:
        * rendering/CSSFilter.cpp:
        (WebCore::CSSFilter::determineFilterPrimitiveSubregion):
        * rendering/CSSFilter.h:
        * rendering/RenderLayerFilters.cpp:
        (WebCore::RenderLayerFilters::beginFilterEffect):
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::applyResource):
        * rendering/svg/RenderSVGResourceFilterPrimitive.cpp:
        (WebCore::RenderSVGResourceFilterPrimitive::determineFilterPrimitiveSubregion): Deleted.
        * rendering/svg/RenderSVGResourceFilterPrimitive.h:
        * svg/graphics/filters/SVGFilter.h:

2018-09-04  Zalan Bujtas  <zalan@apple.com>

        [LFC] Rename LayoutPair to BoxPair
        https://bugs.webkit.org/show_bug.cgi?id=189276

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):

2018-09-04  Youenn Fablet  <youenn@apple.com>

        Disable WebRTC unified plan runtime flag by default
        https://bugs.webkit.org/show_bug.cgi?id=189264

        Reviewed by Jer Noble.

        Covered by existing tests.

        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        Activate unified plan for testing.

2018-09-04  Zalan Bujtas  <zalan@apple.com>

        [LFC][BFC] Merge computeInFlowWidth(Height)AndMargin and computeFloatingWidth(Height)AndMargin.
        https://bugs.webkit.org/show_bug.cgi?id=189271

        Reviewed by Antti Koivisto.

        This is in preparation for adding min/max-widht(height).

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingHeightAndMargin const): Deleted.
        (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const): Deleted.
        * layout/FormattingContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeWidthAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeHeightAndMargin const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const): Deleted.
        (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const): Deleted.
        * layout/blockformatting/BlockFormattingContext.h:

2018-09-04  Rob Buis  <rbuis@igalia.com>

        Adjust XMLHttpRequest username/password precedence rules
        https://bugs.webkit.org/show_bug.cgi?id=184910

        Reviewed by Chris Dumez.

        Steps 9.1 and 9.2 in the XMLHTTPRequest::open [1] algorithm
        specify that non null user or non null password ought
        to be set on the URL, so implement this.

        Behavior matches Firefox and Chrome.

        [1] https://xhr.spec.whatwg.org/#dom-xmlhttprequest-open

        Test: xhr/send-authentication-competing-names-passwords.htm

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::open):

2018-09-04  Simon Fraser  <simon.fraser@apple.com>

        Simplify RenderLayer filter code
        https://bugs.webkit.org/show_bug.cgi?id=189248

        Reviewed by Dean Jackson.
        
        Painting filters in RenderLayer involved the confusingly named RenderLayer::FilterInfo,
        and FilterEffectRenderer/FilterEffectRendererHelper. Reduce confusion by just collapsing
        these together into RenderLayerFilters. RenderLayerFilters stores a reference to the
        CSSFilter, and knows how to set it up, and vend a GraphicsContext* for painting the content
        to be filtered.
        
        It's also simpler to just give RenderLayer a member variable for RenderLayerFilters, rather
        than using a side hash (we can recoup the space in other ways layer).

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSFilterImageValue.cpp:
        * rendering/CSSFilter.h:
        * rendering/FilterEffectRenderer.cpp: Removed.
        * rendering/FilterEffectRenderer.h: Removed.
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        (WebCore::RenderLayer::~RenderLayer):
        (WebCore::RenderLayer::paintsWithFilters const):
        (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
        (WebCore::RenderLayer::setFilterBackendNeedsRepaintingInRect):
        (WebCore::RenderLayer::filtersForPainting const):
        (WebCore::RenderLayer::setupFilters):
        (WebCore::RenderLayer::applyFilters):
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::calculateClipRects const):
        (WebCore::RenderLayer::filter const): Deleted.
        (WebCore::RenderLayer::filterPainter const): Deleted.
        (WebCore::RenderLayer::hasFilterThatIsPainting const): Deleted.
        * rendering/RenderLayer.h:
        * rendering/RenderLayerFilterInfo.cpp: Removed.
        * rendering/RenderLayerFilters.cpp: Added.
        (WebCore::RenderLayerFilters::RenderLayerFilters):
        (WebCore::RenderLayerFilters::~RenderLayerFilters):
        (WebCore::RenderLayerFilters::setFilter):
        (WebCore::RenderLayerFilters::hasFilterThatMovesPixels const):
        (WebCore::RenderLayerFilters::hasFilterThatShouldBeRestrictedBySecurityOrigin const):
        (WebCore::RenderLayerFilters::notifyFinished):
        (WebCore::RenderLayerFilters::updateReferenceFilterClients):
        (WebCore::RenderLayerFilters::removeReferenceFilterClients):
        (WebCore::RenderLayerFilters::buildFilter):
        (WebCore::RenderLayerFilters::beginFilterEffect):
        (WebCore::RenderLayerFilters::applyFilterEffect):
        * rendering/RenderLayerFilters.h: Renamed from Source/WebCore/rendering/RenderLayerFilterInfo.h.

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

        Build fix.

        * testing/Internals.cpp:

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

        Move SystemPreview code from WebKitAdditions to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=189252
        <rdar://problem/44080245>

        Reviewed by Wenson Hsieh.

        Move the WebKitAdditions code into WebKit/WebCore.

        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::relList const): Look for "ar".
        (WebCore::HTMLAnchorElement::isSystemPreviewLink const): Ditto.

        * platform/MIMETypeRegistry.cpp: Add a couple of new static methods
        for System Preview MIME types.
        (WebCore::initializeSystemPreviewMIMETypes):
        (WebCore::MIMETypeRegistry::getSystemPreviewMIMETypes):
        (WebCore::MIMETypeRegistry::isSystemPreviewMIMEType):
        * platform/MIMETypeRegistry.h:

        * rendering/RenderThemeIOS.mm: Load the ARKit artwork from the framework.
        (WebCore::arKitBundle):
        (WebCore::loadARKitPDFPage):
        (WebCore::systemPreviewLogo):
        (WebCore::RenderThemeIOS::paintSystemPreviewBadge):

        * testing/Internals.cpp: Remove internal helper.
        (WebCore::Internals::systemPreviewRelType): Deleted.
        * testing/Internals.h:
        * testing/Internals.idl:

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

        [Payment Request] PaymentResponse should have an onpayerdetailchange event handler
        https://bugs.webkit.org/show_bug.cgi?id=189249

        Reviewed by Alex Christensen.

        Implemented the onpayerdetailchange event handler as defined in the Payment Request API W3C Editor's Draft of 30 August 2018.

        The "payer detail changed" algorithm will be implemented in a follow-up patch.

        Covered by existing web platform tests.

        * Modules/paymentrequest/PaymentResponse.cpp:
        (WebCore::PaymentResponse::scriptExecutionContext const):
        * Modules/paymentrequest/PaymentResponse.h:
        * Modules/paymentrequest/PaymentResponse.idl:
        * dom/EventNames.h:
        * dom/EventTargetFactory.in:

2018-09-04  Youenn Fablet  <youenn@apple.com>

        Introduce LibWebRTC backends for sender and receiver
        https://bugs.webkit.org/show_bug.cgi?id=189171

        Reviewed by Alejandro G. Castro.

        Rename RTCRtpSender::Backend to RTCRtpSenderBackend, ditto for RTCRtpReceiver::Backend.
        Make RTCRtpSender/RTCRtpReceiver own their backend.
        This will allow the backends to own a libwebrtc sender/receiver ref counted object
        and might allow us to cleanly separate code from unified plan vs plan B.

        Update code so that libwebrtc code specific code is now creating senders and receivers.
        This moves code from RTCPeerConnection down to LibWebRTCPeerConnectionBackend, in particular for
        addTrack and addTransceiver methods.

        Moved some code from LibWebRTCMediaEndpoint to LibWebRTCUtils to ease readability.

        A future patch will allow to tie the libwebrtc sender/receiver to WebKit DOM sender/receiver.

        Covered by existing tests.

        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::addTrack):
        (WebCore::PeerConnectionBackend::addTransceiver):
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::addTransceiver):
        (WebCore::RTCPeerConnection::enqueueReplaceTrackTask):
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/RTCRtpReceiver.cpp:
        (WebCore::RTCRtpReceiver::RTCRtpReceiver):
        * Modules/mediastream/RTCRtpReceiver.h:
        (WebCore::RTCRtpReceiver::create):
        (WebCore::RTCRtpReceiver::setBackend):
        * Modules/mediastream/RTCRtpReceiverBackend.h: Added.
        (WebCore::RTCRtpReceiverBackend::getParameters):
        * Modules/mediastream/RTCRtpSender.cpp:
        (WebCore::RTCRtpSender::create):
        (WebCore::RTCRtpSender::RTCRtpSender):
        * Modules/mediastream/RTCRtpSender.h:
        * Modules/mediastream/RTCRtpSenderBackend.h: Added.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::videoReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::audioReceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::addTrack):
        (WebCore::LibWebRTCPeerConnectionBackend::addTransceiver):
        (WebCore::LibWebRTCPeerConnectionBackend::completeAddTransceiver):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.cpp: Added.
        (WebCore::LibWebRTCRtpReceiverBackend::getParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpReceiverBackend.h: Added.
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.cpp: Added.
        (WebCore::LibWebRTCRtpSenderBackend::replaceTrack):
        (WebCore::LibWebRTCRtpSenderBackend::getParameters const):
        * Modules/mediastream/libwebrtc/LibWebRTCRtpSenderBackend.h: Added.
        * Modules/mediastream/libwebrtc/LibWebRTCUtils.cpp: Added.
        (WebCore::fillEncodingParameters):
        (WebCore::fillHeaderExtensionParameters):
        (WebCore::fillCodecParameters):
        (WebCore::fillRtpParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCUtils.h: Added.
        (WebCore::fromStdString):
        * WebCore.xcodeproj/project.pbxproj:

2018-09-04  Antoine Quint  <graouts@apple.com>

        [Modern Media Controls] Disabling both fullscreen and picture-in-picture shows an empty top left container
        https://bugs.webkit.org/show_bug.cgi?id=189259
        <rdar://problem/42026625>

        Reviewed by Dean Jackson.

        Test: media/modern-media-controls/macos-inline-media-controls/macos-inline-media-controls-disabled-fullscreen-and-pip.html

        Ensure the top left controls bar is hidden when none of its children are visible.

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

2018-09-04  Daniel Bates  <dabates@apple.com>

        Attempt to fix failing tests following r235615 (https://bugs.webkit.org/show_bug.cgi?id=187925)

        An inline text box that does not have combined text and contains a single character
        should be considered as having text content.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::hasTextContent const):

2018-09-04  Per Arne Vollan  <pvollan@apple.com>

        Add test for fix in https://bugs.webkit.org/show_bug.cgi?id=187922
        https://bugs.webkit.org/show_bug.cgi?id=187925

        Reviewed by Simon Fraser.

        This will test that the function primaryScreenDisplayID() returns a valid display ID.

        Test: fast/misc/valid-primary-screen-displayID.html

        * platform/PlatformScreen.h:
        * platform/mac/PlatformScreenMac.mm:
        (WebCore::primaryScreenDisplayID):
        * testing/Internals.cpp:
        (WebCore::Internals::primaryScreenDisplayID):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-09-04  Daniel Bates  <dabates@apple.com>

        Add helper function to create a potential CORS request
        https://bugs.webkit.org/show_bug.cgi?id=189251

        Reviewed by Andy Estes.

        Add a new function, createPotentialAccessControlRequest, that we will use to implement the algorithm Create a potential-
        CORS request from the HTML standard: <https://html.spec.whatwg.org/multipage/urls-and-fetching.html#create-a-potential-cors-request> (31 August 2018).
        This function replaces CachedResourceRequest::setAsPotentiallyCrossOrigin() and is the first step towards separating
        the concepts of CORS settings states and module script credentials mode as well as implementing the aforementioned
        algorithm. Rename CachedResourceRequest::setAsPotentiallyCrossOrigin() to deprecatedSetAsPotentiallyCrossOrigin()
        and switch existing callers to use createPotentialAccessControlRequest(). For now, createPotentialAccessControlRequest()
        is implemented in terms of deprecatedSetAsPotentiallyCrossOrigin().

        No functionality changed. So, no new tests.

        * bindings/js/CachedScriptFetcher.cpp:
        (WebCore::CachedScriptFetcher::requestScriptWithCache const): Write in terms of WebCore::createPotentialAccessControlRequest().
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::process): Ditto.
        * html/parser/HTMLResourcePreloader.cpp:
        (WebCore::PreloadRequest::resourceRequest): Ditto.
        * loader/CrossOriginAccessControl.cpp:
        (WebCore::createPotentialAccessControlRequest): For now, implemented in terms of CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin().
        * loader/CrossOriginAccessControl.h:
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::updateFromElement): Write in terms of WebCore::createPotentialAccessControlRequest().
        * loader/LinkLoader.cpp:
        (WebCore::LinkLoader::preloadIfNeeded): Ditto.
        * loader/MediaResourceLoader.cpp:
        (WebCore::MediaResourceLoader::requestResource): Ditto. Also renamed local variable cacheRequest to cachedRequest.
        * loader/TextTrackLoader.cpp:
        (WebCore::TextTrackLoader::load): Write in terms of WebCore::createPotentialAccessControlRequest(). Also change local variable
        document from a pointer to a reference since this function asserts that the script execution context is a non-null Document.
        * loader/cache/CachedResourceRequest.cpp:
        (WebCore::CachedResourceRequest::deprecatedSetAsPotentiallyCrossOrigin): Renamed; formerly named setAsPotentiallyCrossOrigin.
        (WebCore::CachedResourceRequest::setAsPotentiallyCrossOrigin): Deleted.
        * loader/cache/CachedResourceRequest.h:
        (WebCore::CachedResourceRequest::setPriority): Added.

2018-09-04  Daniel Bates  <dabates@apple.com>

        Remove redundant inline text boxes for empty combined text
        https://bugs.webkit.org/show_bug.cgi?id=189119

        Reviewed by Zalan Bujtas.

        We should consider inline text boxes that have a combined text renderer (RenderCombineText)
        whose composed string is empty as "redundant" just as we do for inline text boxes that have
        a non-combined text renderer that have zero length so that we remove them. Such boxes are
        visibly empty and do not take up space visually. By removing them we reduce memory and make
        it easier to reason about the line box tree.

        Currently RenderBlockFlow::computeBlockDirectionPositionsForLine() tests if an inline text
        box is empty by checking if it has a zero length (InlineTextBox::len()). However an inline
        text box associated with a RenderCombineText always has length 1 regardless of whether the
        composed string it represents is the empty string. Instead we should expose a way to check
        if an inline text box is visually empty and have RenderBlockFlow::computeBlockDirectionPositionsForLine()
        query the inline text box for this answer.

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::hasTextContent const): Added. Returns whether an inline text box
        has text content. We do not need to consider hypenation since hypens are an embellishment (i.e.
        they are not part of the markup of the page).
        (WebCore::InlineTextBox::paint): Write in terms of hasTextContent().
        (WebCore::InlineTextBox::subdivideAndResolveStyle): Assert that WebCore::subdivide() always
        returns a non-empty list of subdivisions. A non-empty text box should always have at least
        one subdivision, say for the unmarked text. I left the existing conditonal (though marked
        it as UNLIKELY()) so as to be forgiving and avoid a bad user experience should WebCore::subdivide()
        return an empty vector in a non-debug build.
        * rendering/InlineTextBox.h:
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::RenderBlockFlow::computeBlockDirectionPositionsForLine): Write in terms of InlineTextBox::hasTextContent()
        so that we remove empty inline text boxes associated with combined text.
        * rendering/RenderText.cpp:
        (WebCore::RenderText::positionLineBox): Write in terms of InlineTextBox::hasTextContent().

2018-09-04  Zan Dobersek  <zdobersek@igalia.com> and Ms2ger  <Ms2ger@igalia.com>

        Implement support for passing ImageBitmap to texImage2D/texSubImage2D
        https://bugs.webkit.org/show_bug.cgi?id=187584

        Reviewed by Dean Jackson.

        Test: fast/canvas/webgl/gl-teximage-imagebitmap.html

        * html/canvas/WebGL2RenderingContext.h: Update union type definition.
        * html/canvas/WebGL2RenderingContext.idl: Update union type definition.
        * html/canvas/WebGLRenderingContext.idl: Update union type definition.
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::texSubImage2D): implement.
        (WebCore::WebGLRenderingContextBase::texImage2D): implement.
        * html/canvas/WebGLRenderingContextBase.h: Update union type definition; add to TexFuncValidationSourceType.
        * html/canvas/WebGLRenderingContextBase.idl: Remove unused union type definition.

2018-09-04  Yacine Bandou  <yacine.bandou_ext@softathome.com>

        [EME] Add the WebM initData support in ClearKey CDM
        https://bugs.webkit.org/show_bug.cgi?id=189240

        Reviewed by Xabier Rodriguez-Calvar.

        Add the "webm" initDataType support in ClearKey CDM.
        Read the WebM initData by following the W3C spec https://www.w3.org/TR/eme-initdata-webm/#common-system,
        and put it in JSON object format like is specified in https://www.w3.org/TR/encrypted-media/#clear-key-request-format.

        Tests: media/encrypted-media/clearKey/clearKey-encrypted-webm-event-mse.html
               media/encrypted-media/clearKey/clearKey-webm-video-playback-mse.html

        * platform/encryptedmedia/clearkey/CDMClearKey.cpp:
        (WebCore::extractKeyIdFromWebMInitData):
        (WebCore::CDMPrivateClearKey::supportsInitDataType const):
        (WebCore::CDMPrivateClearKey::supportsInitData const):
        (WebCore::CDMInstanceClearKey::requestLicense):

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

        [Payment Request] Remove PaymentAddress.languageCode
        https://bugs.webkit.org/show_bug.cgi?id=189254

        Reviewed by Sam Weinig.

        PaymentAddress.languageCode is marked as "at risk" in the latest Payment Request Editor's
        Draft (30 August 2018). Firefox has already removed it, and Chrome is considering it.

        There is some compatibility risk in removing this attribute, but considering we never
        populated it with a meaningful value, the risk seems very low. If we learn about
        compatibility problems, we can address them by evangelising or even reverting this change.

        Updated existing tests.

        * Modules/applepay/paymentrequest/ApplePayPaymentHandler.cpp:
        (WebCore::convert):
        * Modules/paymentrequest/PaymentAddress.cpp:
        (WebCore::PaymentAddress::PaymentAddress):
        * Modules/paymentrequest/PaymentAddress.h:
        * Modules/paymentrequest/PaymentAddress.idl:

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

        [Payment Request] Add a stub for PaymentResponse.retry
        https://bugs.webkit.org/show_bug.cgi?id=189253

        Reviewed by Sam Weinig.

        Implemented the AddressErrors, PayerErrorFields, and PaymentValidationErrors dictionaries as
        defined in the Payment Request API W3C Editor's Draft of 30 August 2018.

        Also added a stub implementation of PaymentResponse.retry. This method will be implemented
        with tests in a follow-up patch.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/paymentrequest/AddressErrors.h: Added.
        * Modules/paymentrequest/AddressErrors.idl: Added.
        * Modules/paymentrequest/PayerErrorFields.h: Added.
        * Modules/paymentrequest/PayerErrorFields.idl: Added.
        * Modules/paymentrequest/PaymentResponse.cpp:
        (WebCore::PaymentResponse::retry):
        * Modules/paymentrequest/PaymentResponse.h:
        * Modules/paymentrequest/PaymentResponse.idl:
        * Modules/paymentrequest/PaymentValidationErrors.h: Added.
        * Modules/paymentrequest/PaymentValidationErrors.idl: Added.
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:

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

        [Payment Request] MerchantValidationEvent should be enabled by the PaymentRequest setting
        https://bugs.webkit.org/show_bug.cgi?id=189250

        Reviewed by Daniel Bates.

        * Modules/paymentrequest/MerchantValidationEvent.idl:

2018-09-03  Youenn Fablet  <youenn@apple.com>

        REGRESSION: Layout Test http/tests/security/bypassing-cors-checks-for-extension-urls.html is Flaky
        https://bugs.webkit.org/show_bug.cgi?id=187658
        <rdar://problem/42306442>

        Reviewed by Alexey Proskuryakov.

        Test is flaky as a previous test was setting the isRunningUserScripts state on the Page and it was never reset.
        This patch moves this state to the topDocument so that it will be reset for every navigation.
        Covered by existing test being no longer flaky.

        * dom/Document.h:
        (WebCore::Document::setAsRunningUserScripts):
        (WebCore::Document::isRunningUserScripts const):
        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::DocumentThreadableLoader):
        * page/Frame.cpp:
        (WebCore::Frame::injectUserScriptImmediately):
        * page/Page.h:
        (WebCore::Page::setAsRunningUserScripts): Deleted.
        (WebCore::Page::isRunningUserScripts const): Deleted.
        * testing/Internals.cpp:
        (WebCore::Internals::setAsRunningUserScripts):

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

        [Payment Request] Implement the MerchantValidationEvent constructor
        https://bugs.webkit.org/show_bug.cgi?id=189235

        Reviewed by Daniel Bates.

        Implemented the constructor for MerchantValidationEvent as defined in the Payment Request API W3C Editor's Draft of 30 August 2018.

        Updated the payment-request web platform tests to include MerchantValidationEvent tests.

        Tests: imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.http.html
               imported/w3c/web-platform-tests/payment-request/MerchantValidationEvent/constructor.https.html
               imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.http.html
               imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/constructor.https.html
               imported/w3c/web-platform-tests/payment-request/PaymentRequestUpdateEvent/updatewith-method.https.html
               imported/w3c/web-platform-tests/payment-request/onmerchantvalidation-attribute.https.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/paymentrequest/MerchantValidationEvent.cpp:
        (WebCore::MerchantValidationEvent::create):
        (WebCore::MerchantValidationEvent::MerchantValidationEvent):
        (WebCore::MerchantValidationEvent::complete):
        * Modules/paymentrequest/MerchantValidationEvent.h:
        * Modules/paymentrequest/MerchantValidationEvent.idl:
        * Modules/paymentrequest/MerchantValidationEventInit.h: Added.
        * Modules/paymentrequest/MerchantValidationEventInit.idl: Added.
        * Modules/paymentrequest/PaymentRequest.idl:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:

2018-09-03  Philippe Normand  <pnormand@igalia.com>

        [GStreamer] elements registration clean-ups
        https://bugs.webkit.org/show_bug.cgi?id=189192

        Reviewed by Xabier Rodriguez-Calvar.

        Register all our elements from the base player class. This
        simplifies the MSE player by removing duplicated code.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::initializeGStreamerAndRegisterWebKitElements):
        (WebCore::registerWebKitGStreamerElements): Deleted.
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::registerMediaEngine):
        (WebCore::MediaPlayerPrivateGStreamerMSE::load):
        (WebCore::mimeTypeCache):
        (WebCore::initializeGStreamerAndRegisterWebKitMSEElement): Deleted.
        (WebCore::MediaPlayerPrivateGStreamerMSE::isAvailable): Deleted.
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.h:

2018-09-02  Zalan Bujtas  <zalan@apple.com>

        REGRESSION (r191336): RenderFlexibleBox::adjustChildSizeForMinAndMax crashes in std::optional<>::value()
        https://bugs.webkit.org/show_bug.cgi?id=189232
        <rdar://problem/43886373>

        Reviewed by Brent Fulgham.

        It's not guaranteed that RenderFlexibleBox::computeMainAxisExtentForChild() always returns with a valid value.

        Test: fast/flexbox/crash-when-min-max-content-is-not-computed.html

        * rendering/RenderFlexibleBox.cpp:
        (WebCore::RenderFlexibleBox::adjustChildSizeForMinAndMax):

2018-09-01  Simon Fraser  <simon.fraser@apple.com>

        Rename FilterEffectRenderer to CSSFilter
        https://bugs.webkit.org/show_bug.cgi?id=189223

        Reviewed by Sam Weinig.

        Filter was subclassed by SVGFilter for SVG, and FilterEffectRenderer for CSS,
        which was very confusing, especially when the code uses renderer() to get it.
        
        Rename FilterEffectRenderer to CSSFilter, and access via filter().
        
        Future cleanup will deal with FilterEffectRendererHelper.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSFilterImageValue.cpp:
        (WebCore::CSSFilterImageValue::image):
        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
        * platform/graphics/filters/Filter.h:
        (WebCore::Filter::isCSSFilter const):
        * rendering/CSSFilter.cpp: Copied from Source/WebCore/rendering/FilterEffectRenderer.cpp.
        (WebCore::endMatrixRow):
        (WebCore::lastMatrixRow):
        (WebCore::CSSFilter::create):
        (WebCore::CSSFilter::CSSFilter):
        (WebCore::m_sourceGraphic):
        (WebCore::CSSFilter::inputContext):
        (WebCore::CSSFilter::buildReferenceFilter):
        (WebCore::CSSFilter::build):
        (WebCore::CSSFilter::updateBackingStoreRect):
        (WebCore::CSSFilter::allocateBackingStoreIfNeeded):
        (WebCore::CSSFilter::clearIntermediateResults):
        (WebCore::CSSFilter::apply):
        (WebCore::CSSFilter::computeSourceImageRectForDirtyRect):
        (WebCore::CSSFilter::output const):
        (WebCore::CSSFilter::setSourceImageRect):
        (WebCore::CSSFilter::setMaxEffectRects):
        (WebCore::CSSFilter::outputRect const):
        * rendering/CSSFilter.h: Copied from Source/WebCore/rendering/FilterEffectRenderer.h.
        (isType):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRendererHelper::prepareFilterEffect):
        (WebCore::FilterEffectRendererHelper::filterContext const):
        (WebCore::FilterEffectRendererHelper::beginFilterEffect):
        (WebCore::FilterEffectRendererHelper::applyFilterEffect):
        (WebCore::endMatrixRow): Deleted.
        (WebCore::lastMatrixRow): Deleted.
        (WebCore::FilterEffectRenderer::FilterEffectRenderer): Deleted.
        (WebCore::m_sourceGraphic): Deleted.
        (WebCore::FilterEffectRenderer::create): Deleted.
        (WebCore::FilterEffectRenderer::inputContext): Deleted.
        (WebCore::FilterEffectRenderer::buildReferenceFilter): Deleted.
        (WebCore::FilterEffectRenderer::build): Deleted.
        (WebCore::FilterEffectRenderer::updateBackingStoreRect): Deleted.
        (WebCore::FilterEffectRenderer::allocateBackingStoreIfNeeded): Deleted.
        (WebCore::FilterEffectRenderer::clearIntermediateResults): Deleted.
        (WebCore::FilterEffectRenderer::apply): Deleted.
        (WebCore::FilterEffectRenderer::computeSourceImageRectForDirtyRect): Deleted.
        (WebCore::FilterEffectRenderer::output const): Deleted.
        (WebCore::FilterEffectRenderer::setMaxEffectRects): Deleted.
        (WebCore::FilterEffectRenderer::outputRect const): Deleted.
        * rendering/FilterEffectRenderer.h:
        (WebCore::FilterEffectRendererHelper::FilterEffectRendererHelper):
        (WebCore::FilterEffectRenderer::setSourceImageRect): Deleted.
        * rendering/RenderBlockFlow.cpp:
        * rendering/RenderFrame.cpp:
        * rendering/RenderImage.cpp:
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::requiresFullLayerImageForFilters const):
        (WebCore::RenderLayer::filter const):
        (WebCore::RenderLayer::filterPainter const):
        (WebCore::RenderLayer::setupFilters):
        (WebCore::RenderLayer::calculateClipRects const):
        (WebCore::RenderLayer::filterRenderer const): Deleted.
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        * rendering/RenderLayerFilterInfo.cpp:
        (WebCore::RenderLayer::FilterInfo::setFilter):
        (WebCore::RenderLayer::FilterInfo::updateReferenceFilterClients):
        (WebCore::RenderLayer::FilterInfo::removeReferenceFilterClients):
        (WebCore::RenderLayer::FilterInfo::setRenderer): Deleted.
        * rendering/RenderLayerFilterInfo.h:
        * rendering/updating/RenderTreeBuilderBlock.cpp:

2018-09-01  Darin Adler  <darin@apple.com>

        [CFNetwork] Update CFNetwork SPI use to use CFNetworkSPI.h more consistently
        https://bugs.webkit.org/show_bug.cgi?id=189072

        Reviewed by Dan Bernstein.

        * platform/mac/WebCoreNSURLExtras.mm: Include CFNetworkSPI.h and remove a
        declaration of +[NSURLProtocol _protocolClassForRequest:].

        * platform/network/mac/ResourceHandleMac.mm: Remove a declaration of
        -[NSURLConnection _initWithRequest:delegate:usesCache:maxContentLength:startImmediately:connectionProperties:].
        (WebCore::ResourceHandle::createNSURLConnection): Add ignore of
        "-Wdeprecated-declarations" around use of the above method, since it
        is deprecated.

2018-09-01  Simon Fraser  <simon.fraser@apple.com>

        Add some more filter logging
        https://bugs.webkit.org/show_bug.cgi?id=189221

        Reviewed by Anders Carlsson.

        Add logging in FilterEffect::apply() that shows all the filter rects, and logging
        that brackets the application of a whole filter chain, for both SVG and CSS filters.

        * platform/graphics/filters/FilterEffect.cpp:
        (WebCore::FilterEffect::apply):
        * rendering/FilterEffectRenderer.cpp:
        (WebCore::FilterEffectRendererHelper::applyFilterEffect):
        * rendering/svg/RenderSVGResourceFilter.cpp:
        (WebCore::RenderSVGResourceFilter::postApplyResource):

2018-08-31  Youenn Fablet  <youenn@apple.com>

        Move stats gathering out of LibWebRTCMediaEndpoint
        https://bugs.webkit.org/show_bug.cgi?id=189180

        Reviewed by Alejandro G. Castro.

        Move stats gathering in LibWebRTCStatsCollector.
        Make sure that the lambda given to the collector is always called and destroyed from the main thread.
        This allows capturing the promise here instead of storing it into the peer connection backend.
        No change of behavior.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::getStats):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::getStats):
        (WebCore::LibWebRTCPeerConnectionBackend::doStop):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.cpp: Added.
        (WebCore::LibWebRTCStatsCollector::LibWebRTCStatsCollector):
        (WebCore::LibWebRTCStatsCollector::~LibWebRTCStatsCollector):
        (WebCore::fromStdString):
        (WebCore::fillRTCStats):
        (WebCore::fillRTCRTPStreamStats):
        (WebCore::fillInboundRTPStreamStats):
        (WebCore::fillOutboundRTPStreamStats):
        (WebCore::fillRTCMediaStreamTrackStats):
        (WebCore::fillRTCDataChannelStats):
        (WebCore::iceCandidatePairState):
        (WebCore::fillRTCIceCandidatePairStats):
        (WebCore::fillRTCCertificateStats):
        (WebCore::LibWebRTCStatsCollector::OnStatsDelivered):
        * Modules/mediastream/libwebrtc/LibWebRTCStatsCollector.h: Added.
        (WebCore::LibWebRTCStatsCollector::create):
        * WebCore.xcodeproj/project.pbxproj:

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

        Compile error in RealtimeOutgoingVideoSource.cpp; unused parameter in libwebrtc header
        https://bugs.webkit.org/show_bug.cgi?id=189203

        Reviewed by Youenn Fablet.

        If RealtimeOutgoingVideoSource.cpp is compiled alone (non-unified) or if it is the first file compiled in
        a unified build, there is no pragma set to ignore unused parameter warnings in place.

        * platform/mediastream/RealtimeOutgoingVideoSource.cpp:

2018-08-31  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
        https://bugs.webkit.org/show_bug.cgi?id=189054
        <rdar://problem/43819779>

        Reviewed by Tim Horton.

        Remove redundant and unnecessary logic for reading from the pasteboard on iOS.

        * platform/PlatformPasteboard.h:
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::stringForType const):

        This currently grabs a string corresponding to the given type from the first item in the pasteboard. Make
        stringForType instead call readString with pasteboard item index 0.

        (WebCore::PlatformPasteboard::count const):
        (WebCore::PlatformPasteboard::readBuffer const):
        (WebCore::PlatformPasteboard::readString const):

        Make readString with "public.url" call readURL.

        (WebCore::PlatformPasteboard::readURL const):

        Remove logic for reading URLs from the pasteboard as property lists deserialized from properly lists. This was
        added in r223195 due to fix a case "when UIPasteboard serializes NSURL as a plist" when grabbing pasteboard data
        using -valuesForPasteboardType:inItemSet:. However, this case only arises in non-UI applications (i.e. when
        UIApplicationInitialize() has not been invoked); this is currently exercised by the test CopyURL.ValidURL, but
        doesn't really correspond to a real-world use case, since all UI applications where a user would be able to
        paste in a web view already invoke UIApplicationInitialize().

        Instead of handling the case where the pasteboard contains a property list that has not been coerced to an
        NSURL, simply remove the code from PlatformPasteboard::readURL and allow UIKit to perform the coercion when
        running the test.

        (WebCore::PlatformPasteboard::count): Deleted.
        (WebCore::PlatformPasteboard::readBuffer): Deleted.
        (WebCore::PlatformPasteboard::readString): Deleted.
        (WebCore::PlatformPasteboard::readURL): Deleted.

        Mark these functions as `const`.

        * platform/wpe/PlatformPasteboardWPE.cpp:
        (WebCore::PlatformPasteboard::readString const):
        (WebCore::PlatformPasteboard::readString): Deleted.

        Mark this function as const.

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

        Compilation error in FormData.cpp: incomplete type 'WebCore::SharedBuffer'
        https://bugs.webkit.org/show_bug.cgi?id=189207

        Reviewed by Youenn Fablet.

        If FormData.cpp is compiled alone (non-unified) or if it is the first file compiled in
        a unified build, SharedBuffer.h is not included.

        * platform/network/FormData.cpp:

2018-08-31  Chris Dumez  <cdumez@apple.com>

        [ WK2 ] http/tests/workers/service/client-*-page-cache.html LayoutTests are flaky
        https://bugs.webkit.org/show_bug.cgi?id=183705
        <rdar://problem/42440606>

        Reviewed by Youenn Fablet.

        Add internals.serviceWorkerClientIdentifier() utility function so that a layout test can get the
        service worker client identifier of a document.

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

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-08-31  Youenn Fablet  <youenn@apple.com>

        WebAudioBufferList.cpp/.h is named as cocoa/WebAudioBufferList.cpp/.h
        https://bugs.webkit.org/show_bug.cgi?id=189160

        Reviewed by Jer Noble.

        Add WebAudioBufferList.cpp to unified build.
        Update XCode project so that the file names are right.
        No change of behavior.

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

2018-08-31  Chris Dumez  <cdumez@apple.com>

        Assertion hit in ~CompletionHandler() from ~WebFrame()
        https://bugs.webkit.org/show_bug.cgi?id=189199
        <rdar://problem/42657233>

        Reviewed by Youenn Fablet.

        The issue was caused by WebFrame::m_willSubmitFormCompletionHandlers implicitly containing
        CompletionHandlers (wrapped in WTF::Functions) and not calling them upon WebFrame
        destruction.

        No new tests, covered by fast/frames/iframe-target.html.

        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::dispatchWillSubmitForm):
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoaderClient.h:

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

        [LFC] Add margin box verification back now that Display::Box has non-computed horizontal margin.
        https://bugs.webkit.org/show_bug.cgi?id=189193

        Reviewed by Antti Koivisto.

        Use the non-computed margin values to verify correctness.
        This patch also fixes a margin collapsing issue when the inflow box has a float sibling. The float
        sibling does not prevent collapsing with the parent's top/bottom margin.

        Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin-with-no-border.html

        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):

2018-08-31  Antti Koivisto  <antti@apple.com>

        Replace OptionSet |= and -= operators with add() and remove() functions
        https://bugs.webkit.org/show_bug.cgi?id=189169

        Reviewed by Anders Carlsson.

        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::rangeOfStringClosestToRangeInDirection const):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertTextDecoration):
        (WebCore::StyleBuilderConverter::convertTextEmphasisPosition):
        (WebCore::StyleBuilderConverter::convertTextUnderlinePosition):
        (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
        (WebCore::StyleBuilderConverter::convertSpeakAs):
        (WebCore::StyleBuilderConverter::convertHangingPunctuation):
        * css/parser/CSSParser.cpp:
        (WebCore::CSSParser::parseSystemColor):
        * dom/Document.cpp:
        (WebCore::Document::styleColorOptions const):
        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::addMarker):
        (WebCore::DocumentMarkerController::removeMarkers):
        * dom/ScriptedAnimationController.cpp:
        (WebCore::ScriptedAnimationController::addThrottlingReason):
        (WebCore::ScriptedAnimationController::removeThrottlingReason):
        * dom/SecurityContext.h:
        (WebCore::SecurityContext::setFoundMixedContent):
        * dom/UIEventWithKeyState.cpp:
        (WebCore::UIEventWithKeyState::modifiersFromInitializer):
        (WebCore::UIEventWithKeyState::setModifierKeys):
        * dom/UserActionElementSet.cpp:
        (WebCore::UserActionElementSet::setFlags):
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::moveParagraphs):
        * editing/Editor.cpp:
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::appliedEditing):
        (WebCore::Editor::markMisspellingsAfterTypingToWord):
        (WebCore::Editor::markMisspellingsAndBadGrammar):
        (WebCore::Editor::resolveTextCheckingTypeMask):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::moveWithoutValidationTo):
        (WebCore::FrameSelection::setSelectedRange):
        * editing/FrameSelection.h:
        (WebCore::FrameSelection::defaultSetSelectionOptions):
        * editing/MoveSelectionCommand.cpp:
        (WebCore::MoveSelectionCommand::doApply):
        * editing/SpellChecker.cpp:
        (WebCore::SpellChecker::didCheckSucceed):
        * editing/TextCheckingHelper.cpp:
        (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
        (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
        * editing/TextIterator.cpp:
        (WebCore::SearchBuffer::SearchBuffer):
        * html/HTMLAnchorElement.cpp:
        (WebCore::HTMLAnchorElement::parseAttribute):
        * inspector/agents/InspectorPageAgent.cpp:
        (WebCore::InspectorPageAgent::reload):
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::find const):
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag):
        * page/FrameSnapshotting.cpp:
        (WebCore::snapshotFrameRectWithClip):
        * page/FrameView.cpp:
        (WebCore::updateLayerPositionFlags):
        (WebCore::FrameView::willPaintContents):
        * page/Page.cpp:
        (WebCore::Page::setIsVisible):
        * page/PerformanceObserver.cpp:
        (WebCore::PerformanceObserver::observe):
        * page/TextIndicator.cpp:
        (WebCore::TextIndicator::createWithRange):
        * page/WindowFeatures.cpp:
        (WebCore::parseDisabledAdaptations):
        * page/csp/ContentSecurityPolicy.h:
        (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineScripts):
        (WebCore::ContentSecurityPolicy::addHashAlgorithmsForInlineStylesheets):
        * page/csp/ContentSecurityPolicySourceList.cpp:
        (WebCore::ContentSecurityPolicySourceList::parseHashSource):
        * platform/PlatformEvent.h:
        (WebCore::PlatformEvent::PlatformEvent):
        * platform/ios/PlatformEventFactoryIOS.mm:
        (WebCore::modifiersForEvent):
        * platform/mac/PlatformEventFactoryMac.mm:
        (WebCore::modifiersForEvent):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::paintLayerContentsAndReflection):
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintForegroundForFragments):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintIntoLayer):
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::reasonsForCompositing const):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
        * rendering/TextDecorationPainter.cpp:
        (WebCore::collectStylesForRenderer):
        * rendering/TextPaintStyle.cpp:
        (WebCore::computeTextPaintStyle):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::changeRequiresLayout const):
        (WebCore::RenderStyle::changeRequiresLayerRepaint const):
        (WebCore::RenderStyle::changeRequiresRepaint const):
        * testing/Internals.cpp:
        (WebCore::parseFindOptions):
        (WebCore::Internals::forceReload):
        (WebCore::Internals::setPageVisibility):
        (WebCore::Internals::setPageIsFocusedAndActive):

2018-08-31  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][iOS] Add suggestions UI for TextFieldInputTypes
        https://bugs.webkit.org/show_bug.cgi?id=186714

        Reviewed by Wenson Hsieh.

        On iOS, the datalist button should appear as a downward triangle. Furthermore, the
        button should only be displayed if the input has focus and there are suggested
        values.

        * css/html.css:
        (input::-webkit-list-button): Draw the triangle using an SVG.
        * html/DataListSuggestionInformation.h:
        * html/HTMLInputElement.h:
        * html/TextFieldInputType.cpp: Added logic to show and hide the datalist button as necessary.
        (WebCore::TextFieldInputType::handleFocusEvent):
        (WebCore::TextFieldInputType::handleBlurEvent):
        (WebCore::TextFieldInputType::didSetValueByUserEdit):
        (WebCore::TextFieldInputType::listAttributeTargetChanged):
        (WebCore::TextFieldInputType::displaySuggestions):

2018-08-31  Youenn Fablet  <youenn@apple.com>

        Move LibWebRTCMediaEndpoint data channel code to LibWebRTCDataChannelHandler
        https://bugs.webkit.org/show_bug.cgi?id=189182

        Reviewed by Alejandro G. Castro.

        Moving data channel code outside of LibWebRTCMediaEndpoint.
        This will allow future development to support unified plan.
        No change of behavior.

        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.cpp:
        (WebCore::LibWebRTCDataChannelHandler::fromRTCDataChannelInit):
        (WebCore::LibWebRTCDataChannelHandler::channelEvent):
        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::createDataChannel):
        (WebCore::LibWebRTCMediaEndpoint::OnDataChannel):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:

2018-08-31  Youenn Fablet  <youenn@apple.com>

        Move session observers outside LibWebRTCMediaEndpoint
        https://bugs.webkit.org/show_bug.cgi?id=189181

        Reviewed by Alejandro G. Castro.

        Move classes of LibWebRTCMediaEndpoint to a separate file.
        No change of behavior.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCObservers.h: Added.
        * WebCore.xcodeproj/project.pbxproj:

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

        [MediaStream] Remove AVMediaCaptureSource
        https://bugs.webkit.org/show_bug.cgi?id=189159

        Reviewed by Youenn Fablet.

        No new tests, no change in functionality.

        Refactor video capture to get rid of a base class we don't 
        need any more.

        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/mac/AVMediaCaptureSource.h: Removed.
        * platform/mediastream/mac/AVMediaCaptureSource.mm: Removed.
        * platform/mediastream/mac/AVVideoCaptureSource.h:
        (WebCore::AVVideoCaptureSource::session const):
        (WebCore::AVVideoCaptureSource::device const):
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::globaVideoCaptureSerialQueue):
        (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
        (WebCore::AVVideoCaptureSource::~AVVideoCaptureSource):
        (WebCore::AVVideoCaptureSource::startProducingData):
        (WebCore::AVVideoCaptureSource::stopProducingData):
        (WebCore::AVVideoCaptureSource::beginConfiguration):
        (WebCore::AVVideoCaptureSource::commitConfiguration):
        (WebCore::AVVideoCaptureSource::settingsDidChange):
        (WebCore::AVVideoCaptureSource::settings const):
        (WebCore::AVVideoCaptureSource::capabilities const):
        (WebCore::AVVideoCaptureSource::setPreset):
        (WebCore::AVVideoCaptureSource::setupSession):
        (WebCore::AVVideoCaptureSource::setupCaptureSession):
        (WebCore::AVVideoCaptureSource::captureSessionIsRunningDidChange):
        (WebCore::AVVideoCaptureSource::interrupted const):
        (WebCore::AVVideoCaptureSource::captureSessionRuntimeError):
        (WebCore::AVVideoCaptureSource::captureSessionBeginInterruption):
        (WebCore::AVVideoCaptureSource::captureSessionEndInterruption):
        (-[WebCoreAVVideoCaptureSourceObserver initWithCallback:]):
        (-[WebCoreAVVideoCaptureSourceObserver disconnect]):
        (-[WebCoreAVVideoCaptureSourceObserver addNotificationObservers]):
        (-[WebCoreAVVideoCaptureSourceObserver removeNotificationObservers]):
        (-[WebCoreAVVideoCaptureSourceObserver captureOutput:didOutputSampleBuffer:fromConnection:]):
        (-[WebCoreAVVideoCaptureSourceObserver observeValueForKeyPath:ofObject:change:context:]):
        (-[WebCoreAVVideoCaptureSourceObserver sessionRuntimeError:]):
        (-[WebCoreAVVideoCaptureSourceObserver beginSessionInterrupted:]):
        (-[WebCoreAVVideoCaptureSourceObserver endSessionInterrupted:]):
        (WebCore::AVVideoCaptureSource::initializeCapabilities): Deleted.
        (WebCore::AVVideoCaptureSource::initializeSupportedConstraints): Deleted.
        (WebCore::AVVideoCaptureSource::updateSettings): Deleted.

2018-08-31  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, GTK Ubuntu LTS build fix after r235543.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:

2018-08-31  Philippe Normand  <pnormand@igalia.com>

        Unreviewed, fix compilation warning in EME GStreamer backend.

        Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:1293:19:
        warning: format ‘%lu’ expects argument of type ‘long unsigned
        int’, but argument 9 has type ‘unsigned int’ [-Wformat=]

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::initializationDataEncountered):

2018-08-31  Philippe Normand  <philn@igalia.com>

        [GStreamer][GL] useless ifdef in pushTextureToCompositor
        https://bugs.webkit.org/show_bug.cgi?id=188552

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        There's no need for an ifdef because the frame holder already
        ensures a valid texture ID will be set if it maps a GL video frame.

2018-08-31  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r235190): Fix name of WebAudioBufferList.{cpp,h} in Xcode project

        * WebCore.xcodeproj/project.pbxproj:
        - Add the 'name' parameter to the file references, then fix the
          visual name everywhere else, so these files don't appear as
          "cocoa/WebAudioBufferList.{cpp,h}" in the project.

2018-08-31  Frederic Wang  <fwang@igalia.com>

        Bug 182053 - [CSSOM View] Implement standard behavior for scrollingElement
        https://bugs.webkit.org/show_bug.cgi?id=182053

        Reviewed by Simon Fraser.

        This commit introduces a new CSSOMViewScrollingAPIEnabled flag that will be used to implement
        the standard behavior of DOM scroll* API as specified by the CSSOM View spec (see bug 5991).
        It changes the behavior of document.scrollingElement so that it follows the spec when the
        flag is enabled. This will allow to pass the WPT test cssom-view/scrollingElement.html when
        it becomes the default behavior. WPT tests cssom-view/scrollingElement-quirks-dynamic*.html
        still fail; comparing with Chromium's code, we might need to propagate the style of <html>
        and <body> to the viewport element. Behaviors for other scrolling attributes will be changed
        in follow-up bugs.

        Tests: fast/dom/Document/scrollingElement-quirks-mode.html
               fast/dom/Document/scrollingElement-standard-mode.html

        * dom/Document.cpp:
        (WebCore::Document::isBodyPotentiallyScrollable): Helper function to verify whether the body
        is potentially scrollable, as defined by the CSSOM View spec. It seems that
        RenderObject::hasOverflowClip() may return incorrect value at this point and we might need
        to do something similar to Chromium's style propagation to make it work. For now, we just
        use the computed style. See bug 182292.
        (WebCore::Document::scrollingElement): When CSSOMViewScrollingAPIEnabled is enabled, we
        implement the algorithm of the CSSOM View spec.
        (WebCore::Document::body const): Verify that the root is actually a <html> element or
        otherwise return null. This is required by the CSSOM View spec and for WPT test
        scrollingElement.html. It is consistent  with bodyOrFrameset().
        * dom/Document.h: Add spec references for body() and bodyOrFrameset() and declare
        isBodyPotentiallyScrollable().
        * page/Settings.yaml: Add developer option for enabling the CSSOM View behavior.
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::isOverflowVisible const): Add helper function to check whether the
        style implies visible overflow.

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-08-30  Ross Kirsling  <ross.kirsling@sony.com>

        Speculative build fix for WPE after r235531.

        * platform/graphics/filters/PointLightSource.cpp:
        Add missing include.

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

        Add assignedElements to HTMLSlotElement
        https://bugs.webkit.org/show_bug.cgi?id=189146

        Reviewed by Darin Adler.

        Added assignedElements to HTMLSlotElement. For now, we simply filter the results returned by assignedNodes.

        Also fixed a bug that assignedNodes was returning the fallback content when the slot is not in a shadow tree,
        which is specified in step 2 of the concept to find flattened slotables for a slot.

        Spec: https://html.spec.whatwg.org/multipage/scripting.html#dom-slot-assignedelements
              https://dom.spec.whatwg.org/#find-flattened-slotables

        Tests: imported/w3c/web-platform-tests/shadow-dom/slots.html
               imported/w3c/web-platform-tests/shadow-dom/slots-fallback.html

        * html/HTMLSlotElement.cpp:
        (WebCore::flattenAssignedNodes): Updated to take Vector<Ref<Node>> for consistency.
        (WebCore::HTMLSlotElement::assignedNodes const): Ditto.
        (WebCore::HTMLSlotElement::assignedElements const):
        * html/HTMLSlotElement.h:
        * html/HTMLSlotElement.idl:

2018-08-30  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Replace AVFoundationSupport.py using CMake
        https://bugs.webkit.org/show_bug.cgi?id=182891

        Reviewed by Per Arne Vollan.

        No new tests. No change in behavior.

        Remove refernces to PAL derived sources.

        * PlatformWin.cmake:
        * config.h:

2018-08-30  Olivia Barnett  <obarnett@apple.com>

        REGRESSION(r235489): fast/dom/navigator-detached-no-crash.html crashes under Navigator::share
        https://bugs.webkit.org/show_bug.cgi?id=189170

        Reviewed by Tim Horton.

        No new tests; fixing a failing existing test.

        * page/Navigator.cpp:
        (WebCore::Navigator::share):
        Added null check for frame.

2018-08-30  Truitt Savell  <tsavell@apple.com>

        Unreviewed, rolling out r235516.

        Caused 50 Crashes on Sierra

        Reverted changeset:

        "The width of a nullptr TextRun should be zero"
        https://bugs.webkit.org/show_bug.cgi?id=189154
        https://trac.webkit.org/changeset/235516

2018-08-30  Tim Horton  <timothy_horton@apple.com>

        Bundle unified sources more tightly in projects with deep directory structures
        https://bugs.webkit.org/show_bug.cgi?id=189009

        Reviewed by Simon Fraser.

        Fix a variety of unification errors due to reshuffling the bundles.

        * Modules/mediastream/RTCController.cpp:
        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * crypto/algorithms/CryptoAlgorithmECDSA.cpp:
        (WebCore::CryptoAlgorithmECDSA::importKey):
        * dom/Document.h:
        * html/parser/HTMLTreeBuilder.cpp:
        * loader/appcache/ApplicationCacheResourceLoader.h:
        * page/AlternativeTextClient.h:
        * platform/Pasteboard.h:
        * platform/graphics/DisplayRefreshMonitor.cpp:
        * platform/graphics/FontFamilySpecificationNull.cpp:
        * platform/graphics/cocoa/WebGLLayer.mm:
        (-[WebGLLayer initWithGraphicsContext3D:]):
        (-[WebGLLayer copyImageSnapshotWithColorSpace:]):
        (-[WebGLLayer display]):
        (-[WebGLLayer allocateIOSurfaceBackingStoreWithSize:usingAlpha:]):
        * platform/graphics/cocoa/WebGPULayer.mm:
        (-[WebGPULayer initWithGPUDevice:]):
        * platform/graphics/metal/GPUCommandQueueMetal.mm:
        * platform/mac/PasteboardMac.mm:
        * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
        * platform/network/ResourceRequestBase.cpp:
        * rendering/updating/RenderTreeBuilderBlockFlow.cpp:
        * rendering/updating/RenderTreeBuilderInline.cpp:

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

        [Payment Request] Implement the PaymentMethodChangeEvent and PaymentMethodChangeEventInit interfaces
        https://bugs.webkit.org/show_bug.cgi?id=189100

        Reviewed by Daniel Bates.

        Implement the PaymentMethodChangeEvent interface and PaymentMethodChangeEventInit dictionary
        defined in the Payment Request API W3C Editor's Draft of 30 August 2018.

        <https://w3c.github.io/payment-request/#paymentmethodchangeevent-interface>

        The "payment method changed" algorithm will be implemented in a follow-up.

        Covered by existing web platform tests.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/paymentrequest/PaymentMethodChangeEvent.cpp: Added.
        (WebCore::PaymentMethodChangeEvent::eventInterface const):
        (WebCore::PaymentMethodChangeEvent::PaymentMethodChangeEvent):
        * Modules/paymentrequest/PaymentMethodChangeEvent.h: Added.
        * Modules/paymentrequest/PaymentMethodChangeEvent.idl: Added.
        * Modules/paymentrequest/PaymentMethodChangeEventInit.h: Added.
        * Modules/paymentrequest/PaymentMethodChangeEventInit.idl: Added.
        * Modules/paymentrequest/PaymentRequest.idl:
        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
        (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
        * Modules/paymentrequest/PaymentRequestUpdateEvent.h:
        * Modules/paymentrequest/PaymentRequestUpdateEventInit.h:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventNames.h:
        * dom/EventNames.in:

2018-08-30  Brent Fulgham  <bfulgham@apple.com>

        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.

        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.

        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.
        (WebCore::FontCascade::codePath const): ASSERT that the TextRun is non-empty.

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

        Mock video devices should only support discrete sizes
        https://bugs.webkit.org/show_bug.cgi?id=189000
        <rdar://problem/43766551>

        Reviewed by Youenn Fablet.
        
        While many/most video capture devices only support a finite number of discrete width/height
        pairs, our mock video capture devices supported arbitrary width and height combinations which
        made it difficult to write realistic tests using them. Change the mock devices to support
        finite "presets" like those supported by AVFoundation. Create a RealtimeVideoSource base
        class with support for these presets, so the same code will eventually be used by the mock
        and real capture devices.

        No new tests, existing tests updated for these changes.

        * Sources.txt: Add RealtimeVideoSource.cpp, remove MockRealtimeMediaSource.cpp.

        * WebCore.xcodeproj/project.pbxproj: Ditto.

        * platform/mediastream/MediaConstraints.h: Deal with min constraint less than the supported minimum
        and max larger than the supported maximum when there is no ideal.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::selectSettings): Use supportsSizeAndFrameRate for widths,
        heights, and framerates in advanced constraints so a width and height that are supported but
        in the same preset are filtered out.
        (WebCore::RealtimeMediaSource::setSize): New.
        * platform/mediastream/RealtimeMediaSource.h:

        * platform/mediastream/RealtimeMediaSourceSettings.h: Remove an unneeded include.

        * platform/mediastream/RealtimeVideoSource.cpp: Added.
        (WebCore::RealtimeVideoSource::RealtimeVideoSource):
        (WebCore::RealtimeVideoSource::~RealtimeVideoSource):
        (WebCore::RealtimeVideoSource::startProducingData):
        (WebCore::RealtimeVideoSource::setSupportedFrameRates):
        (WebCore::RealtimeVideoSource::addSupportedCapabilities const):
        (WebCore::RealtimeVideoSource::supportsSizeAndFrameRate):
        (WebCore::RealtimeVideoSource::bestSupportedCaptureSizeForWidthAndHeight):
        (WebCore::RealtimeVideoSource::applySize):
        (WebCore::RealtimeVideoSource::applySizeAndFrameRate):
        (WebCore::RealtimeVideoSource::videoSampleAvailable):
        (WebCore::RealtimeVideoSource::applyFrameRate):
        (WebCore::RealtimeVideoSource::supportsFrameRate):

        * platform/mediastream/RealtimeVideoSource.h: Copied from Source/WebCore/platform/mock/MockRealtimeAudioSource.h.
        (WebCore::RealtimeVideoSource::setSupportedCaptureSizes):
        (WebCore::RealtimeVideoSource::setDefaultSize):
        (WebCore::RealtimeVideoSource::observedFrameRate const):

        * platform/mediastream/mac/AVMediaCaptureSource.mm:
        (WebCore::AVMediaCaptureSource::initializeSettings): Don't set label, it isn't used.

        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::applySize): Call the base class.

        * platform/mock/MockMediaDevice.h:
        (WebCore::MockCameraProperties::encode const): Add frame rates, sizes, and facing mode.
        (WebCore::MockCameraProperties::decode): Ditto.

        * platform/mock/MockRealtimeAudioSource.cpp:
        (WebCore::MockRealtimeAudioSource::MockRealtimeAudioSource): No more MockRealtimeMediaSource.
        (WebCore::MockRealtimeAudioSource::settings const): Clean up.
        (WebCore::MockRealtimeAudioSource::capabilities const): Ditto.
        (WebCore::MockRealtimeAudioSource::settingsDidChange): Ditto.
        (WebCore::MockRealtimeAudioSource::stopProducingData): m_elapsedTime isn't used, delete it.
        (WebCore::MockRealtimeAudioSource::updateSettings): Deleted.
        (WebCore::MockRealtimeAudioSource::initializeCapabilities): Deleted.
        (WebCore::MockRealtimeAudioSource::initializeSupportedConstraints): Deleted.
        (WebCore::MockRealtimeAudioSource::elapsedTime): Deleted.
        * platform/mock/MockRealtimeAudioSource.h:

        * platform/mock/MockRealtimeMediaSourceCenter.cpp: Moved all of the mock device management
        code from MockRealtimeMediaSource.cpp here.
        (WebCore::defaultDevices):
        (WebCore::devices):
        (WebCore::deviceMap):
        (WebCore::deviceListForDevice):
        (WebCore::createCaptureDevice):
        (WebCore::MockRealtimeMediaSourceCenter::resetDevices):
        (WebCore::MockRealtimeMediaSourceCenter::setDevices):
        (WebCore::MockRealtimeMediaSourceCenter::addDevice):
        (WebCore::MockRealtimeMediaSourceCenter::removeDevice):
        (WebCore::MockRealtimeMediaSourceCenter::mockDeviceWithPersistentID):
        (WebCore::MockRealtimeMediaSourceCenter::captureDeviceWithPersistentID):
        (WebCore::MockRealtimeMediaSourceCenter::audioDevices):
        (WebCore::MockRealtimeMediaSourceCenter::videoDevices):
        (WebCore::MockRealtimeMediaSourceCenter::displayDevices):

        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::MockRealtimeVideoSource): Use RealtimeVideoSource, no
        more MockRealtimeMediaSource.
        (WebCore::MockRealtimeVideoSource::capabilities const): Ditto, cleanup.
        (WebCore::MockRealtimeVideoSource::settings const): Ditto.
        (WebCore::MockRealtimeVideoSource::settingsDidChange): Ditto.
        (WebCore::MockRealtimeVideoSource::startCaptureTimer): Ditto.
        (WebCore::MockRealtimeVideoSource::startProducingData): Ditto.
        (WebCore::MockRealtimeVideoSource::stopProducingData): Ditto.
        (WebCore::MockRealtimeVideoSource::elapsedTime): Ditto.
        (WebCore::MockRealtimeVideoSource::applySize): Ditto.
        (WebCore::MockRealtimeVideoSource::drawText): Render the actual frame rate.
        (WebCore::MockRealtimeVideoSource::generateFrame): Use m_fillColor.
        (WebCore::MockRealtimeVideoSource::~MockRealtimeVideoSource): Deleted.
        (WebCore::MockRealtimeVideoSource::updateSettings): Deleted.
        (WebCore::MockRealtimeVideoSource::initializeCapabilities): Deleted.
        (WebCore::MockRealtimeVideoSource::initializeSupportedConstraints): Deleted.
        (WebCore::MockRealtimeVideoSource::applyFrameRate): Deleted.
        * platform/mock/MockRealtimeVideoSource.h:
        (WebCore::MockRealtimeVideoSource::updateSampleBuffer): Deleted.

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

        [LFC][Floating] Block formatting context roots avoid floats.
        https://bugs.webkit.org/show_bug.cgi?id=189150

        Reviewed by Antti Koivisto.

        This patch implements the float avoiding behaviour for block formatting context roots.

        When a box establishes a block formatting context, floats from outside of the context can't interfere with content inside. In order
        to achive this, such formatting root boxes need to be positioned so that they don't overlap with floats (floats that share the same
        context with the formatting root). In ltr block direction, roots start with avoiding floats on the left, while in rtl on the right.

        Tests: fast/block/block-only/float-avoider-multiple-roots.html
               fast/block/block-only/float-avoider-simple-left.html
               fast/block/block-only/float-avoider-simple-right.html
               fast/block/block-only/float-avoider-with-margins.html

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
        (WebCore::Layout::BlockFormattingContext::computePositionToAvoidFloats const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/floats/FloatAvoider.cpp:
        (WebCore::Layout::FloatAvoider::FloatAvoider):
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::positionForFloatAvoiding const):
        * layout/floats/FloatingContext.h:

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

        [LFC][Floating] Move containing block constraint logic from FloatAvoider to FloatingContext
        https://bugs.webkit.org/show_bug.cgi?id=189145

        Reviewed by Antti Koivisto.

        When the float avoider is constrained horizontally, simply align it with the left/right edge of its containing block (with the combination of the constraints)
        and check the overflow as part of the FloatingContext::floatingPosition() logic. It simplifies the constraint logic/helps implementing the non-float avoider
        case.

        * layout/floats/FloatAvoider.cpp:
        (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
        (WebCore::Layout::FloatAvoider::overflowsContainingBlock const):
        * layout/floats/FloatAvoider.h:
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::floatingPosition const):

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

        [LFC][Floating] Use non-computed horizontal margins when intersecting floats with float avoiders.
        https://bugs.webkit.org/show_bug.cgi?id=189143

        Reviewed by Antti Koivisto.

        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/floats/FloatAvoider.cpp:
        (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
        (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
        * layout/floats/FloatAvoider.h:
        (WebCore::Layout::FloatAvoider::marginTop const):
        (WebCore::Layout::FloatAvoider::marginBottom const):
        (WebCore::Layout::FloatAvoider::marginLeft const):
        (WebCore::Layout::FloatAvoider::marginRight const):
        (WebCore::Layout::FloatAvoider::marginBoxWidth const):
        * layout/floats/FloatBox.cpp:
        (WebCore::Layout::FloatBox::rect const):
        (WebCore::Layout::FloatBox::horizontalPositionCandidate):
        (WebCore::Layout::FloatBox::verticalPositionCandidate):
        (WebCore::Layout::FloatBox::initialVerticalPosition const):
        * layout/floats/FloatBox.h:

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

        [LFC][Margins] Add non-computed horizontal margins to DisplayBox
        https://bugs.webkit.org/show_bug.cgi?id=189141

        Reviewed by Antti Koivisto.

        Inflow block boxes' horizontal margins extend all the way to the left/right edge of their containing block.
        See https://www.w3.org/TR/CSS22/visudet.html#blockwidth for example
        "...
        10.3.3 Block-level, non-replaced elements in normal flow
        'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block
        ..."

        In certain cases (float avoiding) we need to know the original (non-extended) horiztonal margin values.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeFloatingWidthAndMargin const):
        (WebCore::Layout::FormattingContext::computeOutOfFlowHorizontalGeometry const):
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowNonReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowReplacedHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::initializeRoot):
        * layout/LayoutUnits.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::computeInFlowWidthAndMargin const):
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowReplacedWidthAndMargin):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::setHasValidHorizontalNonComputedMargin):
        (WebCore::Display::Box::setHorizontalNonComputedMargin):
        (WebCore::Display::Box::nonComputedMarginLeft const):
        (WebCore::Display::Box::nonComputedMarginRight const):

2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Unreviewed, add comments about enum names to bitfields
        https://bugs.webkit.org/show_bug.cgi?id=188944

        * xml/XMLHttpRequest.h:

2018-08-30  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Unreviewed, add comments about enum names to bitfields
        https://bugs.webkit.org/show_bug.cgi?id=188945

        * html/HTMLCollection.h:

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

        Addressed additional review feedback after r235342.

        * Modules/applepay/ApplePayRequestBase.cpp:
        (WebCore::convertAndValidate):

        Used '"' instead of "\"" with makeString().

2018-08-29  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist] Display prefix-matched suggestions first
        https://bugs.webkit.org/show_bug.cgi?id=189106

        Reviewed by Tim Horton.

        In order to increase suggestion relevancy, we should display suggestions that have
        the same prefix as the input value first. In order to achieve this, we can place
        the suggestions into two buckets, one that contains prefix-matched values and
        another that contains only substring-matched values.

        TextFieldInputType::suggestions() can be called up to three times before we
        display the values. In order to avoid generating the same suggestions multiple
        times, the most recent values can be stored and reused. We clear the cached values
        whenever the datalist element is modified or when the suggestions view is hidden.

        Finally, removed logic to de-duplicate the list of suggested values. This behavior
        is not a part of the specification and leads to unnecessary slowdown when
        populating the suggestions view.

        Test: fast/forms/datalist/datalist-textinput-suggestions-order.html

        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::listAttributeTargetChanged):
        (WebCore::TextFieldInputType::suggestions):
        (WebCore::TextFieldInputType::didCloseSuggestions):
        * html/TextFieldInputType.h:
        * platform/DataListSuggestionsClient.h:

2018-08-29  Olivia Barnett  <obarnett@apple.com>

        Implement the Web Share API
        https://bugs.webkit.org/show_bug.cgi?id=171100
        <rdar://problem/31751734>

        Reviewed by Tim Horton.

        Added one test in fast/events/ios called share.html; adjusted expectations for existing tests.

        * DerivedSources.make:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * features.json:
        * loader/EmptyClients.cpp:
        (WebCore::EmptyChromeClient::showShareSheet):
        * loader/EmptyClients.h:
        Added empty showShareSheet function.

        * page/Chrome.cpp:
        (WebCore::Chrome::showShareSheet):
        * page/Chrome.h:
        Added call to showShareSheet on client.

        * page/ChromeClient.h:
        Virtual showShareSheet function.

        * page/Navigator.cpp:
        (WebCore::Navigator::share):
        * page/Navigator.h:
        Share function that returns a promise and invokes the share sheet.

        * page/Navigator.idl:
        Implements NavigatorShare

        * page/NavigatorShare.idl: Added.
        Added definition of share function returning a promise.

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setWebShareEnabled):
        (WebCore::RuntimeEnabledFeatures::webShareEnabled const):
        Added RuntimeEnabledFeature switch.

        * page/ShareData.h: Added.
        * page/ShareData.idl: Added.
        Definition of ShareData struct.

2018-08-29  Daniel Bates  <dabates@apple.com>

        REGRESSION (r226138): WebCore::subdivide() may return an empty vector; Web process can crash when performing find in Epiphany
        https://bugs.webkit.org/show_bug.cgi?id=184390
        <rdar://problem/41804994>
        And
        <rdar://problem/39771867>

        Reviewed by Simon Fraser.

        Speculative fix for Epiphany.

        In theory, WebCore::subdivide() should never return an empty vector - no subdivisions - as such a
        result represents a programmer error. In practice, InlineTextBox can invoke WebCore::subdivide()
        such that it returns an empty vector. One way this can happen is when subdividing an empty inline
        text box associated with combined text (RenderCombineText). For now we add a check to bail out of
        resolving the style of subdivisions when WebCore::subdivide() returns no subdivisions. In a
        subsequent patch we will look to assert that WebCore::subdivide() always returns subdivisions.

        Test: fast/text/text-combine-surroundContents-crash.html

        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::subdivideAndResolveStyle):

2018-08-29  Youenn Fablet  <youenn@apple.com>

        Remove WebRTC legacy API implementation
        https://bugs.webkit.org/show_bug.cgi?id=189040

        Reviewed by Eric Carlson.

        This API is no longer needed as the runtime flag is off by default.
        Removing this option allows removing some code and will ease future WebRTC improvements.
        Covered by existing tests.

        * CMakeLists.txt:
        * DerivedSources.make:
        * Modules/mediastream/MediaStreamEvent.cpp: Removed.
        * Modules/mediastream/MediaStreamEvent.h: Removed.
        * Modules/mediastream/MediaStreamEvent.idl: Removed.
        * Modules/mediastream/NavigatorUserMedia.idl: Removed.
        * Modules/mediastream/NavigatorUserMedia.js: Removed.
        * Modules/mediastream/PeerConnectionBackend.cpp:
        * Modules/mediastream/PeerConnectionBackend.h:
        * Modules/mediastream/RTCPeerConnection.h:
        * Modules/mediastream/RTCPeerConnection.idl:
        * Modules/mediastream/RTCPeerConnection.js:
        (initializeRTCPeerConnection):
        (createOffer):
        (createAnswer):
        (setLocalDescription):
        (setRemoteDescription):
        (addIceCandidate):
        (getLocalStreams): Deleted.
        (getStreamById): Deleted.
        (addStream): Deleted.
        (): Deleted.
        * Modules/mediastream/RTCPeerConnectionInternals.js:
        (callbacksAndDictionaryOverload):
        (if): Deleted.
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
        (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
        (WebCore::LibWebRTCMediaEndpoint::removeRemoteStream):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::doStop):
        (WebCore::LibWebRTCPeerConnectionBackend::removeRemoteStream): Deleted.
        (WebCore::LibWebRTCPeerConnectionBackend::addRemoteStream): Deleted.
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::addBuiltinGlobals):
        (WebCore::isWebRTCLegacyAPIEnabled): Deleted.
        * bindings/js/WebCoreBuiltinNames.h:
        * dom/EventNames.in:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setPeerConnectionEnabled):
        (WebCore::RuntimeEnabledFeatures::webRTCLegacyAPIEnabled const): Deleted.
        (WebCore::RuntimeEnabledFeatures::setWebRTCLegacyAPIEnabled): Deleted.

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

        Modernize SlotAssignment
        https://bugs.webkit.org/show_bug.cgi?id=189075

        Reviewed by Antti Koivisto.

        Modernized the code related to SlotAssignment. Namely, use HashMap<>::get instead of HashMap<>::find,
        and use HashMap<>::ensure instead of HashMap<>::add. Also use WeakPtr to keep track of HTMLSlotElement
        instead of a raw pointer.

        * dom/SlotAssignment.cpp:
        (WebCore::SlotAssignment::findAssignedSlot):
        (WebCore::SlotAssignment::addSlotElementByName):
        (WebCore::SlotAssignment::removeSlotElementByName):
        (WebCore::SlotAssignment::didChangeSlot):
        (WebCore::SlotAssignment::findFirstSlotElement):
        (WebCore::SlotAssignment::resolveAllSlotElements):
        (WebCore::SlotAssignment::assignToSlot):
        * dom/SlotAssignment.h:
        (WebCore::SlotAssignment::Slot::Slot): Renamed from SlotInfo since "Info" doesn't add any value.
        * html/HTMLSlotElement.h:

2018-08-29  Chris Dumez  <cdumez@apple.com>

        [PSON] We should only process-swap when eTLD+1 changes on navigation
        https://bugs.webkit.org/show_bug.cgi?id=189090
        <rdar://problem/43799225>

        Reviewed by Geoffrey Garen.

        Add toRegistrableDomain() utility function to get the eTLD+1 (aka "registrable
        domain") from an URL.

        * platform/network/ResourceRequestBase.h:
        (WebCore::toRegistrableDomain):
        (WebCore::registrableDomainsAreEqual):

2018-08-29  Youenn Fablet  <youenn@apple.com>

        Add a runtime flag for WebRTC unified plan
        https://bugs.webkit.org/show_bug.cgi?id=189068

        Reviewed by Eric Carlson.

        Covered by existing updated tests.
        Main change is to call addTrack with a stream parameter so that on the other side, the track will be tied to a stream.
        Receive-only case in unified plan is not yet supported.
        This will be supported in follow-up patches.

        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::setConfiguration): Activate unified plan based on runtime flag.
        (WebCore::LibWebRTCMediaEndpoint::addTrack): Do not use AddStream in case of unified plan.
        (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveAudio const):
        (WebCore::LibWebRTCMediaEndpoint::shouldOfferAllowToReceiveVideo const):
        (WebCore::LibWebRTCMediaEndpoint::doCreateOffer): Use legacy webrtc option for receive only cases only in plan B case.
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::webRTCUnifiedPlanEnabled const):
        (WebCore::RuntimeEnabledFeatures::setWebRTCUnifiedPlanEnabled):

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

        Fix crash when reflections and backdrop filter are combined
        https://bugs.webkit.org/show_bug.cgi?id=188504
        rdar://problem/43225590

        Reviewed by Dan Bates.
        
        GraphicsLayerCA::updateBackdropFiltersRect() was confused about which hash map to modify
        when changes to the clipping rect affect whether we make backdrop clipping layers;
        we need to add/remove from backdropClippingLayerClones, not backdropLayerClones.

        Test: compositing/filters/backdrop-filter-update-rect.html

        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):

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

        Muted elements do not have their Now Playing status updated when unmuted.
        https://bugs.webkit.org/show_bug.cgi?id=189069

        Reviewed by Eric Carlson.

        Schedule an updateNowPlayingInfo() when an element becomes unmuted.

        * platform/audio/PlatformMediaSessionManager.h:
        * platform/audio/mac/MediaSessionManagerMac.h:
        * platform/audio/mac/MediaSessionManagerMac.mm:
        (WebCore::MediaSessionManagerMac::sessionCanProduceAudioChanged):

2018-08-29  Wenson Hsieh  <wenson_hsieh@apple.com>

        Use the null string instead of std::nullopt for missing attachment file names and content types
        https://bugs.webkit.org/show_bug.cgi?id=189080

        Reviewed by Tim Horton.

        Replace instances of std::optional<String> with just String instead, and use the null string to represent a
        missing value instead of std::nullopt. No change in behavior.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::updateAttributes):
        * html/HTMLAttachmentElement.h:

2018-08-29  David Kilzer  <ddkilzer@apple.com>

        Remove empty directories from from svn.webkit.org repository
        <https://webkit.org/b/189081>

        * Modules/proximity: Removed.

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

        [LFC][Floating] Introduce FloatBox, a FloatAvoider subclass.
        https://bugs.webkit.org/show_bug.cgi?id=189074

        Reviewed by Antti Koivisto.

        FloatBox is a float avoider and a float positioned box as well.
        This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * layout/displaytree/DisplayBox.h:
        * layout/floats/FloatAvoider.cpp:
        (WebCore::Layout::FloatAvoider::FloatAvoider):
        (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
        (WebCore::Layout::FloatAvoider::setVerticalConstraint):
        (WebCore::Layout::FloatAvoider::horizontalPositionCandidate):
        (WebCore::Layout::FloatAvoider::verticalPositionCandidate):
        (WebCore::Layout::FloatAvoider::resetPosition):
        (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
        (WebCore::Layout::FloatAvoider::initializePosition): Deleted.
        (WebCore::Layout::FloatAvoider::isLeftAligned const): Deleted.
        (WebCore::Layout::FloatAvoider::rect const): Deleted.
        (WebCore::Layout::FloatAvoider::resetHorizontalConstraints): Deleted.
        (WebCore::Layout::FloatAvoider::initialVerticalPosition const): Deleted.
        * layout/floats/FloatAvoider.h:
        (WebCore::Layout::FloatAvoider::rect const):
        (WebCore::Layout::FloatAvoider::isLeftAligned const):
        (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
        (WebCore::Layout::FloatAvoider::floatingState const):
        (WebCore::Layout::FloatAvoider::layoutBox const):
        (WebCore::Layout::FloatAvoider::displayBox const):
        * layout/floats/FloatBox.cpp: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
        (WebCore::Layout::FloatBox::FloatBox):
        (WebCore::Layout::FloatBox::horizontalPositionCandidate):
        (WebCore::Layout::FloatBox::verticalPositionCandidate):
        (WebCore::Layout::FloatBox::initialVerticalPosition const):
        * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatAvoider.h.
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::floatingPosition const):

2018-08-29  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver]  Implement intersection logic for the same-document implicit root case
        https://bugs.webkit.org/show_bug.cgi?id=189055

        Reviewed by Simon Fraser.

        Extend the intersection logic to handle computing the intersection of the target and the
        viewport, for the case where the target is in the main frame.

        Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.

        * dom/Document.cpp:
        (WebCore::computeIntersectionRects):
        (WebCore::Document::updateIntersectionObservations):

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

        Changes to slot children should trigger slotchange
        https://bugs.webkit.org/show_bug.cgi?id=169718
        <rdar://problem/43317496>

        Reviewed by Darin Adler.

        Fix the bug that slotchange event is not fired when a slot's fallback content is updated now that slotchange event
        is more formally specified.

        This particular behavior corresponds to step 7.5. of the concept *to insert a node* where it says:
        "[I]f parent’s root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal
        a slot change for parent."

        See https://dom.spec.whatwg.org/#concept-node-insert

        Tests: fast/shadow-dom/slotchange-in-fallback.html
               imported/w3c/web-platform-tests/shadow-dom/slotchange.html 

        * dom/Element.cpp:
        (WebCore::Element::childrenChanged): Updated the comment.
        * dom/ShadowRoot.cpp:
        (WebCore::ShadowRoot::addSlotElementByName): Added an assertion.
        (WebCore::ShadowRoot::slotFallbackDidChange): Added.
        * dom/ShadowRoot.h:
        * dom/SlotAssignment.cpp:
        (WebCore::SlotAssignment::slotFallbackDidChange): Added. When the assigned nodes is empty, we enqueue a slotchange.
        Because assignedNodesForSlot invokes assignSlots, this can be O(n) but we don't expect mutating slot's fallback
        contents and shadow host's children in turn to be a common scenario so this shouldn't be an issue in practice.
        * dom/SlotAssignment.h:
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::insertedIntoAncestor): Be explicit about auto* being used here.
        (WebCore::HTMLSlotElement::childrenChanged): Added. Invokes slotFallbackDidChange whenver child node is muated.
        * html/HTMLSlotElement.h:

2018-08-28  Don Olmstead  <don.olmstead@sony.com>

        Check for null renderer in canBeScrolledIntoView
        https://bugs.webkit.org/show_bug.cgi?id=188935

        Reviewed by Simon Fraser.

        Test: fast/spatial-navigation/snav-display-contents-crash.html

        * page/SpatialNavigation.cpp:
        (WebCore::canBeScrolledIntoView):

2018-08-28  Youenn Fablet  <youenn@apple.com>

        IDBDatabase should not return true to hasPendingActivity after being stopped
        https://bugs.webkit.org/show_bug.cgi?id=189073

        Reviewed by Darin Adler.

        There is a chance that IDBDatabase::hasPendingActivity returns true.
        The case that might happen is when stop() is called but there are still some active/being committed transactions.
        In that case, hasPendingActivity will return true until these transactions get finalized.
        While these transactions will probably be finalized at some point, it delays GC for no good reason.
        And we might want in a follow-up patch to assert that ActiveDOMObject are GC-able whenever their context is stopped.
        For that purpose, make sure hasPendingActivity returns false when context is stopped.

        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::hasPendingActivity const):

2018-08-28  Don Olmstead  <don.olmstead@sony.com>

        [CMake] Use CMake's FindFreetype
        https://bugs.webkit.org/show_bug.cgi?id=189071

        Reviewed by Michael Catanzaro.

        No new tests. No change in behavior.

        * platform/FreeType.cmake:

2018-08-28  Wenson Hsieh  <wenson_hsieh@apple.com>

        Work towards: [iOS] Consolidate the implementations of readString, stringForType, and readURL in PlatformPasteboardIOS.mm
        https://bugs.webkit.org/show_bug.cgi?id=189054

        Reviewed by Andy Estes.

        Remove the pasteboard type argument from PlatformPasteboard::readURL(). Currently, we only ever pass it
        "public.url" anyways; for reading other types of strings, readString() already exists, which takes an arbitrary
        pasteboard type.

        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::readPasteboardWebContentDataForType):
        (WebCore::Pasteboard::readPlatformValueAsString):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::readURL):

2018-08-28  Youenn Fablet  <youenn@apple.com>

        MediaDevices should be collectable as soon as its document is stopped
        https://bugs.webkit.org/show_bug.cgi?id=189021

        Reviewed by Eric Carlson.

        Introduce ActiveDOMObject::isContextStopped to check whether the context is stopped.
        Use this check in MediaDevices::hasPendingActivity so that it returns false as soon as active dom objects are stopped.

        Test: http/tests/media/collect-media-devices.https.html

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::hasPendingActivity const):
        * dom/ActiveDOMObject.cpp:
        (WebCore::ActiveDOMObject::hasPendingActivity const):
        (WebCore::ActiveDOMObject::isContextStopped const):
        * dom/ActiveDOMObject.h:

2018-08-28  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Fix issue that extra cookie is added when redirect happens.
        https://bugs.webkit.org/show_bug.cgi?id=187874

        Reviewed by Alex Christensen.

        When initial request has cookie set and redirect happens, it add extra Cookie header to that
        abd request was broken. Just stop modifying the original request by passing a value.

        Test: http/tests/cookies/multiple-redirect-and-set-cookie.php

        * platform/network/ResourceHandle.h:
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::createCurlRequest):

2018-08-28  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Color wells should appear rounded and textured
        https://bugs.webkit.org/show_bug.cgi?id=189039

        Reviewed by Tim Horton.

        Color wells should have a rounded and textured appearance on macOS. We can use
        NSBezelStyleTexturedSquare to achieve this appearance.

        Also updated the user-agent stylesheet to match the system appearance.

        Rebaselined existing test: fast/forms/color/input-appearance-color.html

        * css/html.css:
        (input[type="color"]::-webkit-color-swatch-wrapper):
        (input[type="color"]::-webkit-color-swatch):
        * platform/mac/ThemeMac.mm:
        (WebCore::setUpButtonCell):
        * rendering/RenderThemeMac.h: Build fix.

2018-08-28  Youenn Fablet  <youenn@apple.com>

        WebKitMediaSession should be GC collectable when its document is being stopped
        https://bugs.webkit.org/show_bug.cgi?id=189016

        Reviewed by Eric Carlson.

        Make sure WebKitMediaSession is  collectable after its document is stopped.
        This is done by nullifying m_session when calling close.
        This way hasPendingActivity() returns false when stop() is called.

        Test: http/tests/media/clearkey/collect-webkit-media-session.html

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::WebKitMediaKeySession):
        (WebCore::WebKitMediaKeySession::close):
        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:

2018-08-28  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Fix build after r235424
        https://bugs.webkit.org/show_bug.cgi?id=189051

        Rubber-stamped by Simon Fraser.

        Fix unused variable warning by using the variable.

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

2018-08-28  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Support inputmode=none
        https://bugs.webkit.org/show_bug.cgi?id=188896

        Reviewed by Tim Horton.

        Updated InputMode.cpp to ensure that "none" is recognized as a valid value for the
        inputmode attribute. This keyword is useful for content that renders its own
        keyboard control.

        Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities%3A-the-inputmode-attribute

        Test: fast/forms/ios/inputmode-none.html

        * html/InputMode.cpp:
        (WebCore::inputModeForAttributeValue):
        (WebCore::stringForInputMode):
        (WebCore::InputModeNames::none):
        * html/InputMode.h:

2018-08-28  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Schedule intersection observation updates
        https://bugs.webkit.org/show_bug.cgi?id=189007

        Reviewed by Simon Fraser.

        Schedule intersection observation updates in the following situations:
        1) A new observation target is added.
        2) FrameView::viewportContentsChanged -- this covers changes to layout and
           to scroll positions for same-document observation. Scheduling for
           cross-document observation will be handled in a future patch.
        3) Style is resolved without triggering layout -- this handles updates that
           were deferred because of a pending style recalculation.

        Tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.

        * dom/Document.cpp:
        (WebCore::Document::resolveStyle):
        (WebCore::Document::updateIntersectionObservations):
        (WebCore::Document::scheduleIntersectionObservationUpdate):
        * dom/Document.h:
        * page/FrameView.cpp:
        (WebCore::FrameView::viewportContentsChanged):
        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::observe):

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

        [LFC][Floating] Remove redundant FloatAvoider functions.
        https://bugs.webkit.org/show_bug.cgi?id=189035

        Reviewed by Antti Koivisto.

        and move some code from FloatContext to FloatAvoider.

        * layout/floats/FloatAvoider.cpp:
        (WebCore::Layout::FloatAvoider::initializePosition):
        (WebCore::Layout::FloatAvoider::rect const):
        (WebCore::Layout::FloatAvoider::setVerticalConstraint):
        (WebCore::Layout::FloatAvoider::setHorizontalConstraints):
        (WebCore::Layout::FloatAvoider::resetHorizontalConstraint):
        (WebCore::Layout::FloatAvoider::initialVerticalPosition const):
        (WebCore::Layout::FloatAvoider::initialHorizontalPosition const):
        (WebCore::Layout::FloatAvoider::rectInContainingBlock const):
        (WebCore::Layout::FloatAvoider::setLeft): Deleted.
        (WebCore::Layout::FloatAvoider::setTopLeft): Deleted.
        (WebCore::Layout::FloatAvoider::resetVertically): Deleted.
        (WebCore::Layout::FloatAvoider::resetHorizontally): Deleted.
        (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const): Deleted.
        * layout/floats/FloatAvoider.h:
        (WebCore::Layout::FloatAvoider::top const): Deleted.
        (WebCore::Layout::FloatAvoider::left const): Deleted.
        (WebCore::Layout::FloatAvoider::marginTop const): Deleted.
        (WebCore::Layout::FloatAvoider::marginLeft const): Deleted.
        (WebCore::Layout::FloatAvoider::marginBottom const): Deleted.
        (WebCore::Layout::FloatAvoider::marginRight const): Deleted.
        (WebCore::Layout::FloatAvoider::rectWithMargin const): Deleted.
        (WebCore::Layout::FloatAvoider::setTop): Deleted.
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingPair::horizontalConstraints const):
        (WebCore::Layout::FloatingPair::horiztonalPosition const): Deleted.

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

        Revert changes to RealtimeMediaSource.cpp made in r235086
        https://bugs.webkit.org/show_bug.cgi?id=189046
        <rdar://problem/43794875>

        Unreviewed, reverting an accidental change.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate): 

2018-08-28  Alejandro G. Castro  <alex@igalia.com>

        Fix gcc compilation warnings after r235230
        https://bugs.webkit.org/show_bug.cgi?id=188981

        Reviewed by Eric Carlson.

        Replace the pragma clang with pragma GCC, it is understood by
        clang and gcc.

        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * platform/mediastream/RealtimeIncomingAudioSource.h:
        * platform/mediastream/RealtimeIncomingVideoSource.h:
        * platform/mediastream/RealtimeOutgoingAudioSource.h:
        * platform/mediastream/RealtimeOutgoingVideoSource.h:
        * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
        * testing/MockLibWebRTCPeerConnection.h:

2018-08-27  Justin Fan  <justin_fan@apple.com>

        WebGL 2 conformance: framebuffer-test
        https://bugs.webkit.org/show_bug.cgi?id=188812

        Reviewed by Jon Lee.

        Update WebGL 2 implementation to handle READ_FRAMEBUFFER and default framebuffer conformance. Also taking this
        chance to fix memory leak in PlatformScreenMac/gpuIDForDisplayMask().

        Covered by existing WebGL tests as well as newly-enabled webgl/2.0.0/conformance2/renderbuffers/framebuffer-test.html.

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::blitFramebuffer):
        (WebCore::WebGL2RenderingContext::framebufferTextureLayer):
        (WebCore::validateDefaultFramebufferAttachment):
        (WebCore::WebGL2RenderingContext::getFramebufferAttachmentParameter):
        (WebCore::WebGL2RenderingContext::validateFramebufferFuncParameters):
        (WebCore::WebGL2RenderingContext::validateFramebufferTarget):
        (WebCore::WebGL2RenderingContext::validateNonDefaultFramebufferAttachment):
        (WebCore::WebGL2RenderingContext::getParameter):
        * html/canvas/WebGL2RenderingContext.h:
        * html/canvas/WebGLFramebuffer.cpp:
        (WebCore::WebGLFramebuffer::isBound const):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::initializeNewContext):
        (WebCore::WebGLRenderingContextBase::~WebGLRenderingContextBase):
        (WebCore::WebGLRenderingContextBase::bindFramebuffer):
        (WebCore::WebGLRenderingContextBase::checkFramebufferStatus):
        (WebCore::WebGLRenderingContextBase::deleteFramebuffer):
        (WebCore::WebGLRenderingContextBase::framebufferRenderbuffer):
        (WebCore::WebGLRenderingContextBase::framebufferTexture2D):
        * html/canvas/WebGLRenderingContextBase.h:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::blitFramebuffer):
        * platform/mac/PlatformScreenMac.mm:
        (WebCore::gpuIDForDisplayMask):

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

        Null pointer deref in WidthIterator
        https://bugs.webkit.org/show_bug.cgi?id=188993

        Reviewed by Brent Fulgham.

        Test: fast/text/rtl-justification.html

        We simply need to guard glyphBuffer like we do in the rest of the function.

        * platform/graphics/WidthIterator.cpp:
        (WebCore::WidthIterator::advanceInternal):

2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Remove WebCore::AttachmentDisplayOptions and friends
        https://bugs.webkit.org/show_bug.cgi?id=189004

        Reviewed by Dan Bernstein.

        No new tests, since there is no change in behavior.

        * WebCore.xcodeproj/project.pbxproj:
        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachment):
        * editing/Editor.h:
        * html/AttachmentTypes.h: Removed.
        * html/HTMLAttachmentElement.h:

2018-08-27  Keith Rollin  <krollin@apple.com>

        Unreviewed build fix -- disable LTO for production builds

        * Configurations/Base.xcconfig:

2018-08-27  Youenn Fablet  <youenn@apple.com>

        Various IndexDB tests abandon documents
        https://bugs.webkit.org/show_bug.cgi?id=188728
        <rdar://problem/43651095>

        Reviewed by Alex Christensen.

        Some IDB objects implement hasPendingActivity but there are some possibilities that they continue returning true after being stopped.
        This is the case for requests that get stopped while still waiting for some pending activity.
        This is also the case for requests that emits upgradeneeded or blocked events.

        Enforce that these objects return false to hasPendingActivity once being stopped.
        This ensures that they can be garbage collected once their context is preparing for destruction like in Document::prepareForDestruction.

        Test: http/tests/IndexedDB/collect-IDB-objects.https.html

        * Modules/indexeddb/IDBIndex.cpp:
        (WebCore::IDBIndex::hasPendingActivity const):
        * Modules/indexeddb/IDBObjectStore.cpp:
        (WebCore::IDBObjectStore::hasPendingActivity const):
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::hasPendingActivity const):
        (WebCore::IDBRequest::enqueueEvent):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::notifyDidAbort):
        In case the context is stopped, IDBTransaction should not ask IDBRequest to fire an event.

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

        Teach WebKitTestRunner and DumpRenderTree about detecting world leaks
        https://bugs.webkit.org/show_bug.cgi?id=188994

        Reviewed by Tim Horton.

        Export Document::postTask() for use by WTR's injected bundle.

        * dom/Document.h:

2018-08-27  Aditya Keerthi  <akeerthi@apple.com>

        Consolidate ENABLE_INPUT_TYPE_COLOR and ENABLE_INPUT_TYPE_COLOR_POPOVER
        https://bugs.webkit.org/show_bug.cgi?id=188931

        Reviewed by Wenson Hsieh.

        * Configurations/FeatureDefines.xcconfig: Removed ENABLE_INPUT_TYPE_COLOR_POPOVER.

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

        Improve the showAllDocuments logging
        https://bugs.webkit.org/show_bug.cgi?id=188990

        Reviewed by Tim Horton.
        
        Improve the output triggered by "notifyutil -p com.apple.WebKit.showAllDocuments" to denote
        SVG documents (which often have no URL), and to show the refCount and referencingNodeCount,
        which helps with leak debugging.
        
        Sample output:

        2 live documents:
        Document 0x1236f1200 3 (refCount 6, referencingNodeCount 580) https://webkit.org/
        SVGDocument 0x134b60000 13 (refCount 1, referencingNodeCount 197) 

        * page/mac/PageMac.mm:
        (WebCore::Page::platformInitialize):

2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Cocoa] Exception (fileType 'dyn.agq8u' is not a valid UTI) raised when dragging an attachment whose file wrapper is a directory
        https://bugs.webkit.org/show_bug.cgi?id=188903
        <rdar://problem/43702993>

        Reviewed by Tim Horton.

        Fixes the exception for attachments that are created when dropping files with extensions that don't map to any
        known UTIs, and when dropping folders. See below for more detail.

        Tests:  WKAttachmentTests.InsertFolderAndFileWithUnknownExtension
                WKAttachmentTests.DropFolderAsAttachmentAndMoveByDragging
                WKAttachmentTests.ChangeAttachmentDataAndFileInformation

        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachment):
        * editing/Editor.h:
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::WebContentReader::readFilePaths):

        When creating an attachment by dropping or pasting a file backed by a file path, handle the cases where…
        (1)     the dropped path is a directory, by setting the UTI to "public.directory". This allows us to show a
                folder icon for the dropped attachment element on macOS.
        (2)     the dropped path is a file whose UTI is unknown, by defaulting to "public.data".

        By ensuring that the UTI of a dropped file-backed attachment is set to a concrete type in any case, we avoid an
        exception when dragging the attachment on macOS, and on iOS, avoid silently failing to drag an attachment.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::updateAttributes):

        Change this method to take an optional file size (the subtitle attribute will only be set if the file size is
        not `std::nullopt`). Furthermore, allow callers of this method to clear attributes on the attachment element by
        passing in `std::nullopt` for any of the three arguments. This allows us to handle the case where an
        attachment's file wrapper is changed from a regular file to a folder whose total size is currently unknown.
        Instead of showing "0 bytes", we'll simply refrain from showing a subtitle at all (in the future, this should
        be improved by implementing a way to estimate the size of the files in the folder, or perhaps show the number of
        items in the folder as the subtitle).

        * html/HTMLAttachmentElement.h:

2018-08-27  Devin Rousso  <drousso@apple.com>

        Web Inspector: provide autocompletion for event breakpoints
        https://bugs.webkit.org/show_bug.cgi?id=188717

        Reviewed by Brian Burg.

        Test: inspector/dom/getSupportedEventNames.html

        * inspector/agents/InspectorDOMAgent.h:
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::getSupportedEventNames): Added.

2018-08-27  Keith Rollin  <krollin@apple.com>

        Build system support for LTO
        https://bugs.webkit.org/show_bug.cgi?id=187785
        <rdar://problem/42353132>

        Reviewed by Dan Bernstein.

        Update Base.xcconfig and DebugRelease.xcconfig to optionally enable
        LTO.

        No new tests -- no new WebKit functionality.

        * Configurations/Base.xcconfig:
        * Configurations/DebugRelease.xcconfig:

2018-08-27  Daniel Bates  <dabates@apple.com>

        [iOS] Make color of spelling dots match UIKit
        https://bugs.webkit.org/show_bug.cgi?id=188861

        Reviewed by Simon Fraser.

        * rendering/RenderThemeCocoa.h:
        * rendering/RenderThemeCocoa.mm:
        (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Modified to call colorForMarkerLineStyle()
        for the color to use for the line style.
        (WebCore::colorForStyle): Deleted.
        * rendering/RenderThemeIOS.h:
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::colorForMarkerLineStyle): Added.
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::colorForMarkerLineStyle): Added.

2018-08-27  Daniel Bates  <dabates@apple.com>

        Spelling dots do not scale with page on iOS; share spelling dot painting code between Mac and iOS
        https://bugs.webkit.org/show_bug.cgi?id=188828
        <rdar://problem/15966403>

        Reviewed by Simon Fraser.

        The look of the spelling dots on Mac and iOS are identical up to color. Towards making the
        spelling dots in WebKit on iOS more closely match the look of the spelling dots in UIKit-
        apps, standardize on using the same painting code for both Mac and iOS.

        Currently iOS uses bitmaps to render the spelling dots and does not account for user/CSS
        zooming. As a result, the spelling dots on iOS render with artifacts (e.g. truncated dots).
        A side benefit of having iOS share the same painting code as Mac is that iOS will now paint
        the dots programmatically and we avoid both the need to use bitmaps and fix the bugs in
        the painting of the bitmap dots with respect to zooming.

        * Resources/DictationPhraseWithAlternativesDot.png: Removed.
        * Resources/DictationPhraseWithAlternativesDot@2x.png: Removed.
        * Resources/SpellingDot.png: Removed.
        * Resources/SpellingDot@2x.png: Removed.
        * Resources/SpellingDot@3x.png: Removed.
        * WebCore.xcodeproj/project.pbxproj:
        * page/Page.cpp:
        (WebCore::Page::setDeviceScaleFactor):
        * platform/graphics/GraphicsContext.h:
        * platform/graphics/cairo/GraphicsContextCairo.cpp:
        (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
        * platform/graphics/cocoa/GraphicsContextCocoa.mm:
        (WebCore::GraphicsContext::drawLineForDocumentMarker):
        (WebCore::findImage): Deleted.
        (WebCore::createDotPattern): Deleted.
        (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
        * platform/graphics/win/GraphicsContextCGWin.cpp:
        (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
        * platform/graphics/win/GraphicsContextDirect2D.cpp:
        (WebCore::GraphicsContext::updateDocumentMarkerResources): Deleted.
        * platform/ios/wak/WKGraphics.mm:
        (WKRectFill): Incorporated the logic from _FillRectUsingOperation().
        (_FillRectUsingOperation): Deleted; moved the logic into WKRectFill() since WKRectFill()
        is now the only caller of this function.
        (WKRectFillUsingOperation): Deleted.
        (imageResourcePath): Deleted.
        (WKGraphicsCreateImageFromBundleWithName): Deleted.
        (WKDrawPatternBitmap): Deleted.
        (WKReleasePatternBitmap): Deleted.
        (WKSetPattern): Deleted.
        * platform/ios/wak/WKGraphicsInternal.h: Removed.
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paintPlatformDocumentMarker):
        * rendering/RenderThemeCocoa.h: Add headers RenderText.h and GraphicsContextCG.h. Fix some style nits while I am here;
        substitute #import for #include and remove some unnecessary headers TranslateTransformOperation.h, RenderStyle.h, and
        RenderElement.h.
        * rendering/RenderThemeCocoa.mm:
        (WebCore::colorForStyle):
        (WebCore::RenderThemeCocoa::drawLineForDocumentMarker): Moved from RenderThemeMac. I renamed
        the local variable ctx to context and fixed a type in a comment while moving this code.
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::colorForStyle): Deleted; moved to class RenderThemeCocoa.
        (WebCore::RenderThemeMac::drawLineForDocumentMarker): Deleted; moved to class RenderThemeCocoa.

2018-08-27  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] [WK2] Images copied from Mail message view paste with the wrong file name in compose
        https://bugs.webkit.org/show_bug.cgi?id=188957
        <rdar://problem/43737715>

        Reviewed by Darin Adler.

        Allow the alt attribute of a pasted image element to determine the name of an image attachment, rather than
        using the source URL's last path component first. This is because in some clients, such as Mail, the source of
        the image element is some nondescript UUID, and the alt text contains the real name of the image.

        Test: WKAttachmentTests.PasteWebArchiveContainingImages

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::replaceRichContentWithAttachments):

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

        Fix IOSMAC build
        https://bugs.webkit.org/show_bug.cgi?id=188934
        <rdar://problem/43694979>

        Reviewed by Darin Adler.

        * platform/network/cf/FormDataStreamCFNet.cpp:

2018-08-27  Rob Buis  <rbuis@igalia.com>

        XMLHTTPRequest.send for Document should have same Content-Type processing rules as String
        https://bugs.webkit.org/show_bug.cgi?id=188953

        Reviewed by Darin Adler.

        Processing rules for Content-Type have been implemented for send with String as parameter, but
        not for Document, but both should be treated the same according to the spec [1]. This patch
        implements this.

        Behavior matches Firefox.

        [1] https://xhr.spec.whatwg.org/#the-send()-method

        Test: web-platform-tests/XMLHttpRequest/setrequestheader-content-type.htm

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::send):

2018-08-27  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Implement intersection logic for the explicit root case
        https://bugs.webkit.org/show_bug.cgi?id=188809

        Reviewed by Simon Fraser.

        Add logic to Document::updateIntersectionObservations to compute the intersection
        between the target and root elements, for the case where an IntersectionObserver
        has a root element.

        There are no changes to the scheduling of intersection observations in this patch,
        so observations are still only computed once for each observer.

        * dom/Document.cpp:
        (WebCore::computeIntersectionRects):
        (WebCore::Document::updateIntersectionObservations):
        * page/FrameView.cpp:
        (WebCore::FrameView::absoluteToClientRect const):
        * page/FrameView.h:
        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::IntersectionObserver):
        (WebCore::IntersectionObserver::createTimestamp const):
        * page/IntersectionObserver.h:
        * platform/graphics/FloatRect.h:
        (WebCore::FloatRect::area const):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::isContainingBlockAncestorFor const):
        * rendering/RenderBlock.h:

2018-08-25  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Shrink size of HTMLCollection
        https://bugs.webkit.org/show_bug.cgi?id=188945

        Reviewed by Darin Adler.

        Shrink the size of HTMLCollection by reordering members.

        No behavior change.

        * html/HTMLCollection.cpp:
        (WebCore::HTMLCollection::HTMLCollection):
        * html/HTMLCollection.h:

2018-08-25  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Shrink size of XMLHttpRequest
        https://bugs.webkit.org/show_bug.cgi?id=188944

        Reviewed by Saam Barati.

        Shrink the size of XMLHttpRequest by packing bits and reordering members.
        It reduces the size from 1248 to 1176.

        No behavior change.

        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::XMLHttpRequest):
        (WebCore::XMLHttpRequest::responseText):
        (WebCore::XMLHttpRequest::createResponseBlob):
        (WebCore::XMLHttpRequest::createResponseArrayBuffer):
        (WebCore::XMLHttpRequest::setResponseType):
        (WebCore::XMLHttpRequest::changeState):
        (WebCore::XMLHttpRequest::callReadyStateChangeListener):
        (WebCore::XMLHttpRequest::setWithCredentials):
        (WebCore::XMLHttpRequest::open):
        (WebCore::XMLHttpRequest::prepareToSend):
        (WebCore::XMLHttpRequest::createRequest):
        (WebCore::XMLHttpRequest::abort):
        (WebCore::XMLHttpRequest::overrideMimeType):
        (WebCore::XMLHttpRequest::setRequestHeader):
        (WebCore::XMLHttpRequest::getAllResponseHeaders const):
        (WebCore::XMLHttpRequest::getResponseHeader const):
        (WebCore::XMLHttpRequest::status const):
        (WebCore::XMLHttpRequest::statusText const):
        (WebCore::XMLHttpRequest::didFinishLoading):
        (WebCore::XMLHttpRequest::createDecoder const):
        (WebCore::XMLHttpRequest::didReceiveData):
        (WebCore::XMLHttpRequest::didReachTimeout):
        (WebCore::XMLHttpRequest::readyState const): Deleted.
        * xml/XMLHttpRequest.h:
        (WebCore::XMLHttpRequest::responseType const):
        (WebCore::XMLHttpRequest::readyState const):
        * xml/XMLHttpRequestProgressEventThrottle.cpp:
        (WebCore::XMLHttpRequestProgressEventThrottle::XMLHttpRequestProgressEventThrottle):
        * xml/XMLHttpRequestProgressEventThrottle.h:

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

        [LFC][Floating] FloatBox -> FloatAvoider
        https://bugs.webkit.org/show_bug.cgi?id=188941

        Reviewed by Antti Koivisto.

        This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * layout/displaytree/DisplayBox.h:
        * layout/floats/FloatAvoider.cpp: Renamed from Source/WebCore/layout/floats/FloatBox.cpp.
        (WebCore::Layout::FloatAvoider::FloatAvoider):
        (WebCore::Layout::FloatAvoider::initializePosition):
        (WebCore::Layout::FloatAvoider::isLeftAligned const):
        (WebCore::Layout::FloatAvoider::setLeft):
        (WebCore::Layout::FloatAvoider::setTopLeft):
        (WebCore::Layout::FloatAvoider::resetVertically):
        (WebCore::Layout::FloatAvoider::resetHorizontally):
        (WebCore::Layout::FloatAvoider::topLeftInContainingBlock const):
        * layout/floats/FloatAvoider.h: Renamed from Source/WebCore/layout/floats/FloatBox.h.
        (WebCore::Layout::FloatAvoider::top const):
        (WebCore::Layout::FloatAvoider::left const):
        (WebCore::Layout::FloatAvoider::marginTop const):
        (WebCore::Layout::FloatAvoider::marginLeft const):
        (WebCore::Layout::FloatAvoider::marginBottom const):
        (WebCore::Layout::FloatAvoider::marginRight const):
        (WebCore::Layout::FloatAvoider::rectWithMargin const):
        (WebCore::Layout::FloatAvoider::setTop):
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        * layout/floats/FloatingContext.h:

2018-08-26  Christopher Reid  <chris.reid@sony.com>

        [Curl] Implement deleteCookie()
        https://bugs.webkit.org/show_bug.cgi?id=188908

        Reviewed by Fujii Hironori.

        Support deleting cookies from the web inspector

        Tested from the web inspector.

        * platform/network/curl/CookieJarCurlDatabase.cpp:
        (WebCore::CookieJarCurlDatabase::deleteCookie const):

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

        [LFC][Floating] Simplify FloatingState::FloatItem class
        https://bugs.webkit.org/show_bug.cgi?id=188912

        Reviewed by Antti Koivisto.

        Let's remove some redundant code now that FloatingState::FloatItem is not used for incoming floats anymore.

        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/floats/FloatBox.cpp:
        (WebCore::Layout::FloatBox::resetVertically):
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingPair::left const):
        (WebCore::Layout::FloatingPair::right const):
        (WebCore::Layout::FloatingPair::intersects const):
        (WebCore::Layout::previousFloatingIndex):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):
        * layout/floats/FloatingState.cpp:
        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
        (WebCore::Layout::FloatingState::remove):
        (WebCore::Layout::FloatingState::bottom const):
        * layout/floats/FloatingState.h:
        (WebCore::Layout::FloatingState::FloatItem::operator== const):
        (WebCore::Layout::FloatingState::FloatItem::isLeftPositioned const):
        (WebCore::Layout::FloatingState::FloatItem::rectWithMargin const):
        (WebCore::Layout::FloatingState::FloatItem::bottom const):
        (WebCore::Layout::FloatingState::leftBottom const):
        (WebCore::Layout::FloatingState::rightBottom const):
        (WebCore::Layout::FloatingState::bottom const):
        (WebCore::Layout::FloatingState::FloatItem::inFormattingContext const):
        (WebCore::Layout::FloatingState::FloatItem::layoutBox const): Deleted.
        (WebCore::Layout::FloatingState::FloatItem::containingBlock const): Deleted.
        (WebCore::Layout::FloatingState::FloatItem::displayBox const): Deleted.
        (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const): Deleted.

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-08-26  Youenn Fablet  <youenn@apple.com>

        Make IDBCursor::m_request a WeakPtr
        https://bugs.webkit.org/show_bug.cgi?id=188938

        Reviewed by Alex Christensen.

        Make m_request a WeakPtr so that if m_request is destroyed, the related cursor will not use the invalid pointer.

        Covered by existing tests.

        * Modules/indexeddb/IDBCursor.cpp:
        (WebCore::IDBCursor::continuePrimaryKey): Other continue and advance methods that are calling uncheckedIterateCursor do check for m_request.
        Apply the same check for continuePrimaryKey.
        (WebCore::IDBCursor::uncheckedIterateCursor):
        * Modules/indexeddb/IDBCursor.h:
        (WebCore::IDBCursor::setRequest):
        (WebCore::IDBCursor::clearRequest):
        (WebCore::IDBCursor::request):
        * Modules/indexeddb/IDBRequest.h:

2018-08-26  Youenn Fablet  <youenn@apple.com>

        IDBCursor does not need to be an ActiveDOMObject
        https://bugs.webkit.org/show_bug.cgi?id=188937

        Reviewed by Alex Christensen.

        Remove ActiveDOMObject from IDBCursor IDL.
        Update constructors and call sites accordingly.
        This allows removing m_outstandingRequestCount and related code in IDBRequest.

        Covered by existing tests.

        * Modules/indexeddb/IDBCursor.cpp:
        (WebCore::IDBCursor::create):
        (WebCore::IDBCursor::IDBCursor):
        (WebCore::IDBCursor::update):
        (WebCore::IDBCursor::uncheckedIterateCursor):
        (WebCore::IDBCursor::deleteFunction):
        (WebCore::IDBCursor::activeDOMObjectName const): Deleted.
        (WebCore::IDBCursor::canSuspendForDocumentSuspension const): Deleted.
        (WebCore::IDBCursor::hasPendingActivity const): Deleted.
        (WebCore::IDBCursor::decrementOutstandingRequestCount): Deleted.
        * Modules/indexeddb/IDBCursor.h:
        * Modules/indexeddb/IDBCursor.idl:
        * Modules/indexeddb/IDBCursorWithValue.cpp:
        (WebCore::IDBCursorWithValue::create):
        (WebCore::IDBCursorWithValue::IDBCursorWithValue):
        * Modules/indexeddb/IDBCursorWithValue.h:
        * Modules/indexeddb/IDBCursorWithValue.idl:
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::setSource):
        (WebCore::IDBRequest::dispatchEvent):
        (WebCore::IDBRequest::willIterateCursor):
        (WebCore::IDBRequest::didOpenOrIterateCursor):
        * Modules/indexeddb/IDBRequest.h:
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::requestOpenCursor):
        * WebCore.xcodeproj/project.pbxproj:

2018-08-26  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Dropping and pasting images should insert inline image elements with _WKAttachments
        https://bugs.webkit.org/show_bug.cgi?id=188933
        <rdar://problem/43699724>

        Reviewed by Darin Adler.

        Support the ability to drop and paste images as image elements, with attachment elements, only if attachment
        elements are enabled. See changes below for more detail.

        Tests:  WKAttachmentTests.CutAndPastePastedImage
                WKAttachmentTests.MovePastedImageByDragging
                WKAttachmentTests.RemoveNewlinesBeforePastedImage

        * editing/Editor.h:
        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::getPasteboardTypesAndDataForAttachment):

        Adjust this helper to take an Element& rather than an HTMLAttachmentElement&, and address a FIXME by writing the
        document origin identifier to the pasteboard via custom pasteboard data when dragging an attachment. This allows
        us to avoid creating extra image and attachment elements when dragging an image backed by an attachment within
        the same document.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::contentTypeIsSuitableForInlineImageRepresentation):

        Add a helper to determine whether a content type (UTI or MIME type) should be read as an inline image.

        (WebCore::createFragmentForImageAttachment):
        (WebCore::replaceRichContentWithAttachments):
        (WebCore::WebContentReader::readFilePaths):

        Teach codepaths where we currently create attachment elements to instead create image elements if the MIME type,
        is something suitable for display via an inline image element; add the attachment element under the shadow root
        of the image element.

        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendCustomAttributes):
        (WebCore::restoreAttachmentElementsInFragment):

        When dragging or copying an image element, we need to make sure that any attachment element backing the image
        is preserved in the pasted or dropped fragment. To do this, we use a technique similar to what was done for
        r180785 and r224593 and write a temporary "webkitattachmentid" attribute to the serialized markup on copy. Upon
        deserializing the markup back to a fragment, we then create an attachment element with the same identifier under
        the image.

        (WebCore::createFragmentFromMarkup):
        * html/HTMLAttachmentElement.h:
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::setAttachmentElement):
        (WebCore::HTMLImageElement::attachmentElement const):

        Helper methods to get and set an attachment element under an image element. Setting an image's attachment
        element puts that attachment element under the shadow root of the image, and also hides the attachment element.

        (WebCore::HTMLImageElement::attachmentIdentifier const):

        Returns the identifier of an attachment element associated with the image element, or null.

        * html/HTMLImageElement.h:
        * html/HTMLImageElement.idl:

        Add HTMLImageElement.webkitAttachmentIdentifier, a readonly attribute guarded by runtime-enabled attachment
        element feature.

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):

        In the case of dragging an image, if that image element is backed by an attachment element, don't bother writing
        the image data to the clipboard; instead, write the attachment data as a promise.

        (WebCore::DragController::doImageDrag):

        Plumb promised attachment information to DragController::doSystemDrag.

        (WebCore::DragController::promisedAttachmentInfo):

        Teach this to handle attachment elements as well as image elements that are backed by attachment elements.

        * page/DragController.h:
        * platform/PromisedAttachmentInfo.h:
        (WebCore::PromisedAttachmentInfo::operator bool const):

        A valid PromisedAttachmentInfo no longer requires a contentType to be set; instead, an attachment identifier
        alone is sufficient, since an up-to-date content type can be requested in the UI process from the API attachment
        object.

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

        [Apple Pay] PaymentRequest.show() should reject when an unsupported ApplePayRequest version is specified
        https://bugs.webkit.org/show_bug.cgi?id=188954

        Reviewed by Darin Adler.

        In Apple Pay JS, calling the ApplePaySession constructor with an unsupported version results
        in an exception being thrown. We need to do something similar for Payment Request.

        This patch moves the logic for validating the version from ApplePaySession to a common
        routine in ApplePayRequestBase that both APIs call to convert requests into a common format.

        In Apple Pay JS, an exception will still be thrown when constructing an ApplePaySession. In
        Payment Request, the promise returned by show() will be rejected.

        Added test cases to http/tests/ssl/applepay/PaymentRequest.https.html.

        * Modules/applepay/ApplePayRequestBase.cpp:
        (WebCore::convertAndValidate):
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::create):

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

        Click event from click() is not composed
        https://bugs.webkit.org/show_bug.cgi?id=170211

        Reviewed by Wenson Hsieh.

        Fixed the bug. All simulated clicks should be composed regardless of whether it's trusted or not.
        See: https://html.spec.whatwg.org/multipage/interaction.html#dom-click
             https://html.spec.whatwg.org/multipage/webappapis.html#fire-a-synthetic-mouse-event

        * dom/SimulatedClick.cpp:

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

        Avoid calling setUntrusted in SimulatedMouseEvent
        https://bugs.webkit.org/show_bug.cgi?id=188929

        Reviewed by Simon Fraser.

        Added IsTrusted flag to Event constructors instead of creating a trusted event
        and making it untrusted in the constructor of SimulatedMouseEvent.

        This makes EventTarget::dispatchEventForBindings the only caller of setUntrusted().

        * dom/Event.cpp:
        (WebCore::Event::Event):
        * dom/Event.h:
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::KeyboardEvent):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create):
        (WebCore::MouseEvent::MouseEvent):
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
        * dom/MouseRelatedEvent.h:
        * dom/SimulatedClick.cpp:
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::UIEvent):
        * dom/UIEvent.h:
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::WheelEvent):

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

        Using Touch Bar to scrub video on Youtube results in video playback freeze
        https://bugs.webkit.org/show_bug.cgi?id=188926

        Reviewed by Eric Carlson.

        Test: media/media-source/media-source-seek-twice.html

        When converting from a double-precision float to a MediaTime, a certain amount of precision is lost. If that
        results in a round-trip between `float in -> MediaTime -> float out` where in != out, we will wait forever for
        the time jump observer to fire. Break the cycle by comparing m_lastSeekTime to the synchronizerTime only after
        m_lastSeekTime has been normalized into a rational-time value.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::seekInternal):

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

        Pass in IsComposed flag to Event constructors
        https://bugs.webkit.org/show_bug.cgi?id=188720
        <rdar://problem/43580387>

        Reviewed by Simon Fraser.

        This patch replaces the logic in Event::isComposed to decide whether an event is composed or not by
        explicitly passing IsComposed flag to Event constructor. This decouples being composed from whether
        an event is trusted and of a partciular event type, paving our way to make synthetic click event
        dispatched by an author script composable in webkit.org/b/170211.

        This patch also removes IsTrusted from the argument list of event constructors and create functions
        to systematically eliminate the possibility of this patch making an event uncomposed by not setting
        IsComposed flag.

        No new tests since there should be no behavioral change.

        * dom/ClipboardEvent.cpp:
        (WebCore::ClipboardEvent::ClipboardEvent): A trusted ClipboardEvent is composed.
        * dom/ClipboardEvent.h:
        (WebCore::ClipboardEvent::ClipboardEvent): Removed IsTrusted from the variant which takes Init object
        to make sure this refactoring is correct.
        (WebCore::ClipboardEvent::create): Ditto.
        * dom/CompositionEvent.cpp:
        (WebCore::CompositionEvent::CompositionEvent): A trusted CompositionEvent is composed.
        * dom/CompositionEvent.h:
        * dom/Element.cpp:
        (WebCore::Element::dispatchMouseEvent): A trusted dblclick event is composed (this is a non-standard
        event but virtually every mouse event is composed so it makes sense to make this composed).
        * dom/Event.cpp:
        (WebCore::Event::Event):
        (WebCore::Event::create):
        (WebCore::Event::composed const): Deleted. The trival implementation moved to the header file.
        * dom/Event.h:
        (WebCore::Event::composed const):
        * dom/FocusEvent.cpp:
        (WebCore::FocusEvent::FocusEvent): A trusted Focus event is composed.
        * dom/FocusEvent.h:
        (WebCore::FocusEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
        (WebCore::FocusEvent::FocusEvent): Ditto.
        * dom/InputEvent.cpp:
        (WebCore::InputEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
        (WebCore::InputEvent::InputEvent): A trsuted InputEvent is composed.
        * dom/InputEvent.h:
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::KeyboardEvent): A trsuted KeyboardEvent is composed.
        (WebCore::KeyboardEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
        * dom/KeyboardEvent.h:
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
        (WebCore::MouseEvent::MouseEvent): Explicitly take IsComposed flag from subclasses since simulated click
        does not currently compose.
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent): A trusted touch event is composed.
        * dom/MouseRelatedEvent.h:
        * dom/Node.cpp:
        (WebCore::Node::dispatchDOMActivateEvent): A trusted DOMActivateEvent event is composed.
        (WebCore::Node::dispatchInputEvent): A trusted input event is composed.
        * dom/SimulatedClick.cpp:
        (SimulatedMouseEvent::SimulatedMouseEvent): A simulated click is composed if it's a trusted event for now.
        This is the bug to be fixed in webkit.org/b/170211.
        * dom/TextEvent.cpp:
        (WebCore::TextEvent::TextEvent): A trsuted textInput event is composed.
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::UIEvent): Added IsComposed as an argument to the variant which creates a trusted event,
        and removed IsTrusted from Init variant for the correctness guarantee.
        * dom/UIEvent.h:
        (WebCore::UIEvent::create): Ditto.
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::UIEventWithKeyState): Ditto.
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::WheelEvent): A trusted Wheel event, which is a subclass of MouseEvent, is composed.
        (WebCore::WheelEvent::create): Removed IsTrusted from Init variant for the correctness guarantee.
        * dom/WheelEvent.h:
        * editing/Editor.cpp:
        (WebCore::dispatchBeforeInputEvent):
        (WebCore::dispatchInputEvent):
        (WebCore::dispatchClipboardEvent): Call the newly added variant which takes DataTransfer directly so that
        we can remove IsTrusted from the variant which takes Init for the correctness guarantee.
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchDragEvent): A trusted mouse event is composed.

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

        Add getModifierState to MouseEvent
        https://bugs.webkit.org/show_bug.cgi?id=188913
        <rdar://problem/43668772>

        Reviewed by Simon Fraser.

        Moved getModifierState from KeyboardEvent to UIEventWithKeyState and exposed it in MouseEvent.
        See https://www.w3.org/TR/2016/WD-uievents-20160804/#mouseevent

        This patch also fixes the bug that initMouseEvent was not clearing AltGraph and CapsLock states,
        which was preserved in the refactoring done in r235158.

        Tests: fast/events/constructors/mouse-event-getModifierState.html
               fast/events/dblclick-event-getModifierState.html

        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::getModifierState const): Moved to UIEventWithKeyState.
        * dom/KeyboardEvent.h:
        * dom/KeyboardEvent.idl: Insert a blank line to match the spec's IDL.
        * dom/MouseEvent.idl: Added getModifierState. 
        * dom/UIEventWithKeyState.cpp:
        (WebCore::UIEventWithKeyState::modifiersFromInitializer): Moved from the header file.
        (WebCore::UIEventWithKeyState::getModifierState const):
        (WebCore::UIEventWithKeyState::setModifierKeys): Moved from the header file.
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::modifierKeys const):
        (WebCore::UIEventWithKeyState::setModifierKeys): Deleted the variant which didn't take altGraphKey
        since that variant behaves same as the one which takes altGraphKey.

2018-08-24  Youenn Fablet  <youenn@apple.com>

        libwebrtc PeerConnection::AddTrack sometimes fail
        https://bugs.webkit.org/show_bug.cgi?id=188914

        Reviewed by Eric Carlson.

        AddTrack may fail so test the result and if not successful, make JS addTrack to throw an exception.
        This makes some tests to fail now.
        These tests should pass again when unified plan will be enabled.
        Covered by rebased tests.

        * Modules/mediastream/PeerConnectionBackend.h:
        (WebCore::PeerConnectionBackend::notifyAddedTrack):
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::addTrack):
        (WebCore::RTCPeerConnection::addTransceiver):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.cpp:
        (WebCore::LibWebRTCPeerConnectionBackend::notifyAddedTrack):
        * Modules/mediastream/libwebrtc/LibWebRTCPeerConnectionBackend.h:

2018-08-24  Adrian Perez de Castro  <aperez@igalia.com>

        [FreeType] Do not cast through GLib types in FontCustomPlatformDataFreeType.cpp
        https://bugs.webkit.org/show_bug.cgi?id=188919

        Reviewed by Michael Catanzaro.

        No new tests needed.

        * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
        (WebCore::FontCustomPlatformData::FontCustomPlatformData): Cast
        through "void (*)(void)" instead of GCallback to avoid the warning
        produced by -Wcast-function-type.

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-08-24  Frederic Wang  <fwang@igalia.com>

        Remove ScrollByPrecisePixel granularity
        https://bugs.webkit.org/show_bug.cgi?id=188915

        Reviewed by Carlos Garcia Campos.

        ScrollByPrecisePixel was introduced in bug 87535 and bug 91020 for Chromium Linux/Windows but
        it is no longer used.

        No new tests, behavior unchanged.

        * platform/ScrollAnimatorSmooth.cpp:
        (WebCore::ScrollAnimatorSmooth::scroll): Remove special handling for ScrollByPrecisePixel.
        * platform/ScrollTypes.h: Remove ScrollByPrecisePixel, it is never used.
        * platform/ScrollableArea.cpp:
        (WebCore::ScrollableArea::scroll): Remove special handling for ScrollByPrecisePixel.
        * platform/gtk/ScrollAnimatorGtk.cpp:
        (WebCore::ScrollAnimatorGtk::scroll): Remove special handling for ScrollByPrecisePixel.

2018-08-24  Antti Koivisto  <antti@apple.com>

        Allow creating WeakPtrs to const objects
        https://bugs.webkit.org/show_bug.cgi?id=188785

        Reviewed by Geoff Garen.

        Remove some unneeded const_casts.

        * css/MediaQueryEvaluator.cpp:
        (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
        (WebCore::MediaQueryEvaluator::evaluate const):
        * css/MediaQueryEvaluator.h:
        * rendering/FloatingObjects.cpp:
        (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
        (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
        (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
        (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
        (WebCore::FloatingObjects::FloatingObjects):
        * rendering/FloatingObjects.h:
        (WebCore::FloatingObjects::renderer const):

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

        [CoordGraphics] Move inline methods on CoordinatedGraphicsLayer out-of-line
        https://bugs.webkit.org/show_bug.cgi?id=188916

        Reviewed by Carlos Garcia Campos.

        Style checker produced complaints that CoordinatedGraphicsLayer class is
        using inline-defined methods despite the WEBCORE_EXPORT macro being used
        for the whole class. Keep the macro where it is but instead move the
        method definitions out-of-line.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::isCoordinatedGraphicsLayer const):
        (WebCore::CoordinatedGraphicsLayer::id const):
        (WebCore::CoordinatedGraphicsLayer::primaryLayerID const):
        (WebCore::CoordinatedGraphicsLayer::usesContentsLayer const):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2018-08-24  Antti Koivisto  <antti@apple.com>

        Use OptionSet::containsAny and containsAll in some more places
        https://bugs.webkit.org/show_bug.cgi?id=188885

        Reviewed by Sam Weinig.

        * page/PerformanceMonitor.cpp:
        (WebCore::PerformanceMonitor::activityStateChanged):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::~RenderLayerBacking):

2018-08-23  Simon Fraser  <simon.fraser@apple.com>

        Add support for dumping GC heap snapshots, and a viewer
        https://bugs.webkit.org/show_bug.cgi?id=186416

        Reviewed by Joseph Pecoraro.

        Make a way to dump information about the GC heap that is useful for looking for leaked
        or abandoned objects. This dump is obtained (on Apple platforms) via:
            notifyutil -p com.apple.WebKit.dumpGCHeap
        which writes a JSON file to /tmp which can then be loaded into the viewer in Tools/GCHeapInspector.

        This leverages the heap snapshot used by Web Inspector, adding an alternate format for
        the snapshot JSON that adds additional data about objects and why they are GC roots.
        
        The generated bindings code is changed to include the output root reason from isReachableFromOpaqueRoots(),
        and to implement heapSnapshot() which provides the address of the wrapped object. A new IDL attribute,
        CustomHeapSnapshot, is used to allow custom heapSnapshot() implementations for classes like JSDocument
        that need to decorate the heap snapshot cell data with things like the document URL.

        GCController registers a notifyutil callback which gathers the debug heap snapshot, and dumps it
        to a file in /tmp. The file path is printed out to the system log.

        * bindings/js/DOMGCOutputConstraint.cpp:
        (WebCore::DOMGCOutputConstraint::executeImpl):
        * bindings/js/GCController.cpp:
        (WebCore::GCController::GCController):
        (WebCore::GCController::dumpHeap):
        * bindings/js/GCController.h:
        * bindings/js/JSCSSRuleListCustom.cpp:
        (WebCore::JSCSSRuleListOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSCallbackData.cpp:
        (WebCore::JSCallbackDataWeak::WeakOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSCallbackData.h:
        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
        (WebCore::JSCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::getOwnPropertySlot):
        (WebCore::JSDOMWindow::heapSnapshot):
        * bindings/js/JSDeprecatedCSSOMValueCustom.cpp:
        (WebCore::JSDeprecatedCSSOMValueOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSDocumentCustom.cpp:
        (WebCore::JSDocument::heapSnapshot):
        * bindings/js/JSMicrotaskCallback.h:
        (WebCore::JSMicrotaskCallback::call):
        * bindings/js/JSMutationObserverCustom.cpp:
        (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSNavigatorCustom.cpp:
        (WebCore::JSNavigator::visitAdditionalChildren):
        * bindings/js/JSNodeCustom.cpp:
        (WebCore::isReachableFromDOM):
        (WebCore::JSNodeOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSNodeListCustom.cpp:
        (WebCore::JSNodeListOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSOffscreenCanvasRenderingContext2DCustom.cpp:
        (WebCore::JSOffscreenCanvasRenderingContext2DOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSPerformanceObserverCustom.cpp:
        (WebCore::JSPerformanceObserverOwner::isReachableFromOpaqueRoots):
        * bindings/js/JSPopStateEventCustom.cpp:
        * bindings/js/JSTextTrackCueCustom.cpp:
        (WebCore::JSTextTrackCueOwner::isReachableFromOpaqueRoots):
        * bindings/js/WebCoreTypedArrayController.cpp:
        (WebCore::WebCoreTypedArrayController::JSArrayBufferOwner::isReachableFromOpaqueRoots):
        * bindings/js/WebCoreTypedArrayController.h:
        * bindings/scripts/CodeGeneratorJS.pm:
        (GenerateHeader):
        (GenerateImplementation):
        * bindings/scripts/IDLAttributes.json:
        * bindings/scripts/test/JS/JSInterfaceName.cpp:
        (WebCore::JSInterfaceName::heapSnapshot):
        (WebCore::JSInterfaceNameOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSInterfaceName.h:
        * bindings/scripts/test/JS/JSMapLike.cpp:
        (WebCore::JSMapLike::heapSnapshot):
        (WebCore::JSMapLikeOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSMapLike.h:
        * bindings/scripts/test/JS/JSReadOnlyMapLike.cpp:
        (WebCore::JSReadOnlyMapLike::heapSnapshot):
        (WebCore::JSReadOnlyMapLikeOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSReadOnlyMapLike.h:
        * bindings/scripts/test/JS/JSTestActiveDOMObject.cpp:
        (WebCore::JSTestActiveDOMObject::heapSnapshot):
        (WebCore::JSTestActiveDOMObjectOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestActiveDOMObject.h:
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        (WebCore::JSTestCEReactions::heapSnapshot):
        (WebCore::JSTestCEReactionsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestCEReactions.h:
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        (WebCore::JSTestCEReactionsStringifier::heapSnapshot):
        (WebCore::JSTestCEReactionsStringifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.h:
        * bindings/scripts/test/JS/JSTestCallTracer.cpp:
        (WebCore::JSTestCallTracer::heapSnapshot):
        (WebCore::JSTestCallTracerOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestCallTracer.h:
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.cpp:
        (WebCore::JSTestClassWithJSBuiltinConstructor::heapSnapshot):
        (WebCore::JSTestClassWithJSBuiltinConstructorOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestClassWithJSBuiltinConstructor.h:
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
        (WebCore::JSTestCustomConstructorWithNoInterfaceObject::heapSnapshot):
        (WebCore::JSTestCustomConstructorWithNoInterfaceObjectOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
        * bindings/scripts/test/JS/JSTestDOMJIT.cpp:
        (WebCore::JSTestDOMJIT::heapSnapshot):
        * bindings/scripts/test/JS/JSTestDOMJIT.h:
        * bindings/scripts/test/JS/JSTestEnabledBySetting.cpp:
        (WebCore::JSTestEnabledBySetting::heapSnapshot):
        (WebCore::JSTestEnabledBySettingOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestEnabledBySetting.h:
        * bindings/scripts/test/JS/JSTestEventConstructor.cpp:
        (WebCore::JSTestEventConstructor::heapSnapshot):
        * bindings/scripts/test/JS/JSTestEventConstructor.h:
        * bindings/scripts/test/JS/JSTestEventTarget.cpp:
        (WebCore::JSTestEventTarget::heapSnapshot):
        * bindings/scripts/test/JS/JSTestEventTarget.h:
        * bindings/scripts/test/JS/JSTestException.cpp:
        (WebCore::JSTestException::heapSnapshot):
        (WebCore::JSTestExceptionOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestException.h:
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.cpp:
        (WebCore::JSTestGenerateIsReachable::heapSnapshot):
        (WebCore::JSTestGenerateIsReachableOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestGenerateIsReachable.h:
        * bindings/scripts/test/JS/JSTestGlobalObject.cpp:
        (WebCore::JSTestGlobalObject::heapSnapshot):
        (WebCore::JSTestGlobalObjectOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestGlobalObject.h:
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestIndexedSetterNoIdentifier::heapSnapshot):
        (WebCore::JSTestIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestIndexedSetterNoIdentifier.h:
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.cpp:
        (WebCore::JSTestIndexedSetterThrowingException::heapSnapshot):
        (WebCore::JSTestIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestIndexedSetterThrowingException.h:
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestIndexedSetterWithIdentifier::heapSnapshot):
        (WebCore::JSTestIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestIndexedSetterWithIdentifier.h:
        * bindings/scripts/test/JS/JSTestInterface.cpp:
        (WebCore::JSTestInterface::heapSnapshot):
        (WebCore::JSTestInterfaceOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestInterface.h:
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.cpp:
        (WebCore::JSTestInterfaceLeadingUnderscore::heapSnapshot):
        (WebCore::JSTestInterfaceLeadingUnderscoreOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestInterfaceLeadingUnderscore.h:
        * bindings/scripts/test/JS/JSTestIterable.cpp:
        (WebCore::JSTestIterable::heapSnapshot):
        (WebCore::JSTestIterableOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestIterable.h:
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.cpp:
        (WebCore::JSTestMediaQueryListListener::heapSnapshot):
        (WebCore::JSTestMediaQueryListListenerOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestMediaQueryListListener.h:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifier::heapSnapshot):
        (WebCore::JSTestNamedAndIndexedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterNoIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.cpp:
        (WebCore::JSTestNamedAndIndexedSetterThrowingException::heapSnapshot):
        (WebCore::JSTestNamedAndIndexedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterThrowingException.h:
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifier::heapSnapshot):
        (WebCore::JSTestNamedAndIndexedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedAndIndexedSetterWithIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedConstructor.cpp:
        (WebCore::JSTestNamedConstructor::heapSnapshot):
        (WebCore::JSTestNamedConstructorOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedConstructor.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.cpp:
        (WebCore::JSTestNamedDeleterNoIdentifier::heapSnapshot):
        (WebCore::JSTestNamedDeleterNoIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedDeleterNoIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.cpp:
        (WebCore::JSTestNamedDeleterThrowingException::heapSnapshot):
        (WebCore::JSTestNamedDeleterThrowingExceptionOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedDeleterThrowingException.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.cpp:
        (WebCore::JSTestNamedDeleterWithIdentifier::heapSnapshot):
        (WebCore::JSTestNamedDeleterWithIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedDeleterWithIndexedGetter::heapSnapshot):
        (WebCore::JSTestNamedDeleterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedDeleterWithIndexedGetter.h:
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.cpp:
        (WebCore::JSTestNamedGetterCallWith::heapSnapshot):
        (WebCore::JSTestNamedGetterCallWithOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedGetterCallWith.h:
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.cpp:
        (WebCore::JSTestNamedGetterNoIdentifier::heapSnapshot):
        (WebCore::JSTestNamedGetterNoIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedGetterNoIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.cpp:
        (WebCore::JSTestNamedGetterWithIdentifier::heapSnapshot):
        (WebCore::JSTestNamedGetterWithIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedGetterWithIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.cpp:
        (WebCore::JSTestNamedSetterNoIdentifier::heapSnapshot):
        (WebCore::JSTestNamedSetterNoIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterNoIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.cpp:
        (WebCore::JSTestNamedSetterThrowingException::heapSnapshot):
        (WebCore::JSTestNamedSetterThrowingExceptionOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterThrowingException.h:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.cpp:
        (WebCore::JSTestNamedSetterWithIdentifier::heapSnapshot):
        (WebCore::JSTestNamedSetterWithIdentifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIdentifier.h:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetter::heapSnapshot):
        (WebCore::JSTestNamedSetterWithIndexedGetterOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetter.h:
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.cpp:
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetter::heapSnapshot):
        (WebCore::JSTestNamedSetterWithIndexedGetterAndSetterOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterWithIndexedGetterAndSetter.h:
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithOverrideBuiltins::heapSnapshot):
        (WebCore::JSTestNamedSetterWithOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterWithOverrideBuiltins.h:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.cpp:
        (WebCore::JSTestNamedSetterWithUnforgableProperties::heapSnapshot):
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgableProperties.h:
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.cpp:
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins::heapSnapshot):
        (WebCore::JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestNamedSetterWithUnforgablePropertiesAndOverrideBuiltins.h:
        * bindings/scripts/test/JS/JSTestNode.cpp:
        (WebCore::JSTestNode::heapSnapshot):
        * bindings/scripts/test/JS/JSTestNode.h:
        * bindings/scripts/test/JS/JSTestObj.cpp:
        (WebCore::JSTestObj::heapSnapshot):
        (WebCore::JSTestObjOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestObj.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.cpp:
        (WebCore::JSTestOverloadedConstructors::heapSnapshot):
        (WebCore::JSTestOverloadedConstructorsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestOverloadedConstructors.h:
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.cpp:
        (WebCore::JSTestOverloadedConstructorsWithSequence::heapSnapshot):
        (WebCore::JSTestOverloadedConstructorsWithSequenceOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestOverloadedConstructorsWithSequence.h:
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.cpp:
        (WebCore::JSTestOverrideBuiltins::heapSnapshot):
        (WebCore::JSTestOverrideBuiltinsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestOverrideBuiltins.h:
        * bindings/scripts/test/JS/JSTestPluginInterface.cpp:
        (WebCore::JSTestPluginInterface::heapSnapshot):
        (WebCore::JSTestPluginInterfaceOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestPluginInterface.h:
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.cpp:
        (WebCore::JSTestPromiseRejectionEvent::heapSnapshot):
        * bindings/scripts/test/JS/JSTestPromiseRejectionEvent.h:
        * bindings/scripts/test/JS/JSTestSerialization.cpp:
        (WebCore::JSTestSerialization::heapSnapshot):
        (WebCore::JSTestSerializationOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestSerialization.h:
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.cpp:
        (WebCore::JSTestSerializationIndirectInheritance::heapSnapshot):
        * bindings/scripts/test/JS/JSTestSerializationIndirectInheritance.h:
        * bindings/scripts/test/JS/JSTestSerializationInherit.cpp:
        (WebCore::JSTestSerializationInherit::heapSnapshot):
        * bindings/scripts/test/JS/JSTestSerializationInherit.h:
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.cpp:
        (WebCore::JSTestSerializationInheritFinal::heapSnapshot):
        * bindings/scripts/test/JS/JSTestSerializationInheritFinal.h:
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.cpp:
        (WebCore::JSTestSerializedScriptValueInterface::heapSnapshot):
        (WebCore::JSTestSerializedScriptValueInterfaceOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestSerializedScriptValueInterface.h:
        * bindings/scripts/test/JS/JSTestStringifier.cpp:
        (WebCore::JSTestStringifier::heapSnapshot):
        (WebCore::JSTestStringifierOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifier.h:
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.cpp:
        (WebCore::JSTestStringifierAnonymousOperation::heapSnapshot):
        (WebCore::JSTestStringifierAnonymousOperationOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifierAnonymousOperation.h:
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.cpp:
        (WebCore::JSTestStringifierNamedOperation::heapSnapshot):
        (WebCore::JSTestStringifierNamedOperationOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifierNamedOperation.h:
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.cpp:
        (WebCore::JSTestStringifierOperationImplementedAs::heapSnapshot):
        (WebCore::JSTestStringifierOperationImplementedAsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifierOperationImplementedAs.h:
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.cpp:
        (WebCore::JSTestStringifierOperationNamedToString::heapSnapshot):
        (WebCore::JSTestStringifierOperationNamedToStringOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifierOperationNamedToString.h:
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.cpp:
        (WebCore::JSTestStringifierReadOnlyAttribute::heapSnapshot):
        (WebCore::JSTestStringifierReadOnlyAttributeOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifierReadOnlyAttribute.h:
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.cpp:
        (WebCore::JSTestStringifierReadWriteAttribute::heapSnapshot):
        (WebCore::JSTestStringifierReadWriteAttributeOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestStringifierReadWriteAttribute.h:
        * bindings/scripts/test/JS/JSTestTypedefs.cpp:
        (WebCore::JSTestTypedefs::heapSnapshot):
        (WebCore::JSTestTypedefsOwner::isReachableFromOpaqueRoots):
        * bindings/scripts/test/JS/JSTestTypedefs.h:
        * dom/Document.idl:
        * page/DOMWindow.idl:

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

        initKeyboardEvent doesn't clear CapsLock state
        https://bugs.webkit.org/show_bug.cgi?id=188909

        Reviewed by Wenson Hsieh.

        Fixed the bug by not preserving CapsLock state in setModifierKeys variant which takes boolean
        for altGraphKey, which is only called by KeyboardEvent::initKeyboardEvent.

        Test: fast/events/init-event-clears-capslock.html

        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::setModifierKeys):

2018-08-23  Aditya Keerthi  <akeerthi@apple.com>

        Unreviewed, fix the Windows build after r235245.

        * html/InputMode.cpp:
        (WebCore::stringForInputMode):

2018-08-23  Saam barati  <sbarati@apple.com>

        JSRunLoopTimer may run part of a member function after it's destroyed
        https://bugs.webkit.org/show_bug.cgi?id=188426

        Reviewed by Mark Lam.

        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::ResourceUsageThread::platformThreadBody):
        * page/linux/ResourceUsageThreadLinux.cpp:
        (WebCore::ResourceUsageThread::platformThreadBody):

2018-08-23  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r235129.

        broke internal builds

        Reverted changeset:

        "Allow creating WeakPtrs to const objects"
        https://bugs.webkit.org/show_bug.cgi?id=188785
        https://trac.webkit.org/changeset/235129

2018-08-23  Daniel Bates  <dabates@apple.com>

        [iOS] Test editing/undo/replace-text-in-node-preserving-markers-crash.html crashes
        https://bugs.webkit.org/show_bug.cgi?id=188898

        Reviewed by Simon Fraser.

        Not all document markers may have a dictation metadata on iOS.

        Currently we assume that every marker has dictation alternatives (i.e. DocumentMarker::alternatives()
        can be called) when deleting a selection preserving document markers on iOS. However, only markers
        for dictation may have dictation alternatives. For example, document markers for misspelled words do
        not have dictation metadata by definition. Instead of assuming every marker has dictation alternatives
        on iOS we need to check the marker type to determine whether it has associated dictation metadata and
        invoke the appropriate DocumentMarkerController::addMarker() overload.

        * dom/DocumentMarker.h:
        (WebCore::DocumentMarker::isDictation const): Added.
        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::replaceTextInNodePreservingMarkers): Only access DocumentMarker::alternatives()
        and add a dictation marker on iOS if the marker is a dictation marker.

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-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-08-23  Devin Rousso  <drousso@apple.com>

        Web Inspector: support breakpoints for timers and animation-frame events
        https://bugs.webkit.org/show_bug.cgi?id=188778

        Reviewed by Brian Burg.

        The original implementation of "instrumentation" breakpoints relied upon the frontend
        sending somewhat arbitrary strings when enabling breakpoints for specific events. As an
        example, setting a breakpoint for `requestAnimationFrame` expects `"animationFrameFired"`
        as the string, which doesn't make much sense. This patch removes the usage of these strings
        and instead expects the agent to implement a method that matches what is happening.

        Tests: inspector/dom-debugger/event-animation-frame-breakpoints.html
               inspector/dom-debugger/event-listener-breakpoints.html
               inspector/dom-debugger/event-timer-breakpoints.html

        * inspector/InspectorInstrumentation.h:
        (WebCore::InspectorInstrumentation::willFireTimer):
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
        (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
        (WebCore::InspectorInstrumentation::willFireTimerImpl):
        (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded): Deleted.

        * inspector/agents/InspectorDOMDebuggerAgent.h:
        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::setEventBreakpoint): Added.
        (WebCore::InspectorDOMDebuggerAgent::removeEventBreakpoint): Added.
        (WebCore::InspectorDOMDebuggerAgent::willHandleEvent):
        (WebCore::InspectorDOMDebuggerAgent::willFireTimer): Added.
        (WebCore::InspectorDOMDebuggerAgent::willFireAnimationFrame): Added.
        (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint): Deleted.
        (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint): Deleted.
        (WebCore::InspectorDOMDebuggerAgent::setBreakpoint): Deleted.
        (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint): Deleted.
        (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint): Deleted.
        (WebCore::InspectorDOMDebuggerAgent::removeBreakpoint): Deleted.
        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded): Deleted.
        Unify the event listener and instrumentation breakpoint commands into a single method,
        `setEventBreakpoint`, that takes in both an `EventBreakpointType` and `eventName`.

        * page/DOMTimer.cpp:
        (WebCore::DOMTimer::fired):

2018-08-23  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Support the inputmode attribute on contenteditable elements
        https://bugs.webkit.org/show_bug.cgi?id=188878

        Reviewed by Ryosuke Niwa.

        The inputmode attribute should apply to contenteditable elements, in addition to
        textfield inputs and textareas.

        Moved the inputmode attribute from HTMLInputElement.idl and
        HTMLTextAreaElement.idl to HTMLElement.idl to reflect the specification.

        Also moved all logic to convert between the InputMode enum and string values
        into InputMode.cpp to avoid exposing unnecessary details to WebKit. Furthermore,
        InputMode::Auto was renamed to InputMode::Unspecified to avoid confusion with the
        specification.

        Spec: https://html.spec.whatwg.org/multipage/interaction.html#input-modalities:-the-inputmode-attribute

        Tests: fast/forms/inputmode-attribute-contenteditable.html
               fast/forms/inputmode-attribute-input.html
               fast/forms/inputmode-attribute-textarea.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::canonicalInputMode const):
        (WebCore::HTMLElement::inputMode const):
        (WebCore::HTMLElement::setInputMode):
        * html/HTMLElement.h:
        * html/HTMLElement.idl:
        * html/HTMLInputElement.idl:
        * html/HTMLTextAreaElement.idl:
        * html/HTMLTextFormControlElement.cpp:
        * html/HTMLTextFormControlElement.h:
        * html/InputMode.cpp: Renamed from Source/WebCore/html/InputModeNames.cpp.
        (WebCore::inputModeForAttributeValue):
        (WebCore::stringForInputMode):
        * html/InputMode.h: Renamed from Source/WebCore/html/InputModeNames.h.

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

        [MediaStream] Store video preset sizes in a map
        https://bugs.webkit.org/show_bug.cgi?id=188866
        <rdar://problem/43622643>

        Reviewed by Youenn Fablet.

        No new tests, tested manually.

        * platform/mediastream/mac/AVVideoCaptureSource.h:
        * platform/mediastream/mac/AVVideoCaptureSource.mm:
        (WebCore::AVVideoCaptureSource::AVVideoCaptureSource):
        (WebCore::AVVideoCaptureSource::initializeCapabilities):
        (WebCore::AVVideoCaptureSource::sizeForPreset):
        (WebCore::AVVideoCaptureSource::setPreset):
        (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions):
        (WebCore::sizeForPreset): Deleted.
        (WebCore::AVVideoCaptureSource::bestSessionPresetForVideoDimensions const): Deleted.

2018-08-23  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, attempt to fix the build after r235230.

        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:

2018-08-23  Youenn Fablet  <youenn@apple.com>

        Update libwebrtc up to 984f1a80c0
        https://bugs.webkit.org/show_bug.cgi?id=188745
        <rdar://problem/43539177>

        Reviewed by Eric Carlson.

        Updated implementation according new webrtc backend.
        Instead of modifying libwebrtc header files, we disable unused parameter warning for such headers included in WebCore.
        WebCore implementation is updated according new webrtc API, mostly AddRef/Release.
        RealtimeOutgoingVideoSource now uses a pixel convolver to convert RGB pixel buffers as I420.

        Covered by existing tests.

        * CMakeLists.txt:
        * Modules/mediastream/libwebrtc/LibWebRTCDataChannelHandler.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addTrack):
        (WebCore::LibWebRTCMediaEndpoint::mediaStreamFromRTCStream):
        (WebCore::fillEncodingParameters):
        (WebCore::fillRtpParameters):
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.h:
        (WebCore::LibWebRTCMediaEndpoint::Release const):
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediastream/RealtimeIncomingAudioSource.h:
        * platform/mediastream/RealtimeIncomingVideoSource.h:
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
        (WebCore::RealtimeMediaSource::supportsConstraint const):
        (WebCore::RealtimeMediaSource::supportsConstraints):
        * platform/mediastream/RealtimeOutgoingAudioSource.h:
        * platform/mediastream/RealtimeOutgoingVideoSource.h:
        * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp:
        (WebCore::GStreamerVideoDecoder::newSampleCallback):
        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
        (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
        (WebCore::GStreamerVideoEncoder::newSampleCallback):
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
        * platform/mediastream/libwebrtc/LibWebRTCAudioModule.h:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.cpp:
        * platform/mediastream/libwebrtc/LibWebRTCProvider.h:
        * platform/mediastream/mac/MockRealtimeVideoSourceMac.mm:
        (WebCore::MockRealtimeVideoSourceMac::CMSampleBufferFromPixelBuffer):
        * platform/mediastream/mac/RealtimeIncomingVideoSourceCocoa.mm:
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.cpp:
        (WebCore::ConvertToI420):
        (WebCore::RealtimeOutgoingVideoSourceCocoa::sampleBufferUpdated):
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.h:
        * platform/mediastream/mac/RealtimeOutgoingVideoSourceCocoa.mm: Added.
        (WebCore::RealtimeOutgoingVideoSourceCocoa::convertToYUV):
        * testing/MockLibWebRTCPeerConnection.cpp:
        (WebCore::MockLibWebRTCPeerConnection::AddTrack):
        * testing/MockLibWebRTCPeerConnection.h:
        (WebCore::MockRtpSender::GetParameters):
        (WebCore::MockRtpSender::SetParameters):

2018-08-23  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Attachment elements don't appear in drag images on macOS
        https://bugs.webkit.org/show_bug.cgi?id=188823
        <rdar://problem/43616378>

        Reviewed by Tim Horton.

        Currently, attachment elements don't show up in the drag image snapshot on macOS. This is because only the
        "Selection" phase is painted when generating a drag image on macOS, and many replaced renderers (with some
        exceptions, such as RenderImage) only paint visible content during the "Foreground" phase. To fix this, we
        override RenderAttachment::paintReplaced to paint the attachment in the case where the Selection phase is being
        painted.

        Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
                WKAttachmentTests.MoveAttachmentElementAsIconByDragging

        * rendering/RenderAttachment.cpp:
        (WebCore::RenderAttachment::paintReplaced):
        * rendering/RenderAttachment.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::titleTextColorForAttachment):
        (WebCore::AttachmentLayout::layOutTitle):

        Plumb an AttachmentLayoutStyle (i.e. NonSelected or Selected) to AttachmentLayout, and use this bit when
        determining the title text color, as well whether to paint backgrounds for the icon and title.

        (WebCore::AttachmentLayout::AttachmentLayout):
        (WebCore::RenderThemeMac::attachmentIntrinsicSize const):
        (WebCore::RenderThemeMac::attachmentBaseline const):
        (WebCore::paintAttachmentIconBackground):
        (WebCore::paintAttachmentTitleBackground):

        Bail from painting backgrounds if a selected style is used for the attachment.

        (WebCore::RenderThemeMac::paintAttachment):

        Rather than check the RenderAttachment's selection state when determining whether to paint with a non-selected
        or selected style, only use selected style if the RenderAttachment has a selection _and_ the painting phase is
        not "Selection". While this sounds extremely counter-intuitive, the "Selection" painting phase refers to
        painting the selected foreground content _without_ including any part of the selection highlight.

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

        [LFC][Floating] Decouple the incoming floats and floats already placed in the list
        https://bugs.webkit.org/show_bug.cgi?id=188886

        Reviewed by Antti Koivisto.

        This is in preparation for the float avoidance feature where formatting context root boxes avoid existing floats.

        1. Introduce FloatBox class for the incoming floats (This will need to be renamed when adding support for avoidance -incoming box is actually not a float).
        2. Use the existing FloatState::FloatItem class for placed floats.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * layout/LayoutUnits.h:
        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/displaytree/DisplayBox.h:
        * layout/floats/FloatBox.cpp: Added.
        (WebCore::Layout::FloatBox::FloatBox):
        (WebCore::Layout::FloatBox::initializePosition):
        (WebCore::Layout::FloatBox::isLeftAligned const):
        (WebCore::Layout::FloatBox::setLeft):
        (WebCore::Layout::FloatBox::setTopLeft):
        (WebCore::Layout::FloatBox::resetVertically):
        (WebCore::Layout::FloatBox::resetHorizontally):
        (WebCore::Layout::FloatBox::topLeftInContainingBlock const):
        * layout/floats/FloatBox.h: Copied from Source/WebCore/layout/floats/FloatingContext.h.
        (WebCore::Layout::FloatBox::top const):
        (WebCore::Layout::FloatBox::left const):
        (WebCore::Layout::FloatBox::marginTop const):
        (WebCore::Layout::FloatBox::marginLeft const):
        (WebCore::Layout::FloatBox::marginBottom const):
        (WebCore::Layout::FloatBox::marginRight const):
        (WebCore::Layout::FloatBox::rectWithMargin const):
        (WebCore::Layout::FloatBox::setTop):
        * layout/floats/FloatingContext.cpp:
        (WebCore::Layout::FloatingPair::verticalPosition const):
        (WebCore::Layout::begin):
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingPair::horiztonalPosition const):
        (WebCore::Layout::FloatingPair::bottom const):
        (WebCore::Layout::Iterator::Iterator):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):
        (WebCore::Layout::FloatingContext::initialVerticalPosition const): Deleted.
        (WebCore::Layout::FloatingContext::alignWithContainingBlock const): Deleted.
        (WebCore::Layout::FloatingContext::alignWithFloatings const): Deleted.
        (WebCore::Layout::FloatingContext::toContainingBlock const): Deleted.
        * layout/floats/FloatingContext.h:
        * layout/floats/FloatingState.h:
        (WebCore::Layout::FloatingState::root const):
        (WebCore::Layout::FloatingState::layoutContext const):

2018-08-23  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove the remaining CoordinatedGraphicsLayerState cruft
        https://bugs.webkit.org/show_bug.cgi?id=188881

        Reviewed by Carlos Garcia Campos.

        Remove what's left of CoordinatedGraphicsLayerState usage in the
        CoordinatedGraphics subsystem. In CoordinatedGraphicsLayer, this means
        dropping the m_layerState member variable since at this point it is not
        used anymore in any capacity. Affected helper methods and member
        variables are also removed where possible.

        The syncLayerState() method on the CoordinatedGraphicsLayerClient
        interface is adjusted to not accept any parameters. Client should just
        mark frame synchronization as required while the layer state is now
        managed differently.

        Instead of the CoordinatedLayerID (which is removed) the
        Nicosia::PlatformLayer::LayerID alias is introduced as a layer ID type,
        aliased to the uint64_t type.

        CoordinatedGraphicsState.h file is rid of all structs except the
        basic CoordinatedGraphicsState struct that at this point contains only
        a reference to the Nicosia::Scene object. This will be further
        simplified in the patches that follow.

        * platform/graphics/nicosia/NicosiaPlatformLayer.h:
        (Nicosia::PlatformLayer::id const):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::didChangeAnimations):
        (WebCore::CoordinatedGraphicsLayer::didChangeChildren):
        (WebCore::CoordinatedGraphicsLayer::didChangeFilters):
        (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
        (WebCore::CoordinatedGraphicsLayer::didChangeGeometry):
        (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::setShowDebugBorder):
        (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
        (WebCore::CoordinatedGraphicsLayer::setMaskLayer):
        (WebCore::CoordinatedGraphicsLayer::setReplicatedByLayer):
        (WebCore::CoordinatedGraphicsLayer::setNeedsDisplay):
        (WebCore::CoordinatedGraphicsLayer::setNeedsDisplayInRect):
        (WebCore::CoordinatedGraphicsLayer::setDebugBorder):
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
        (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
        (WebCore::CoordinatedGraphicsLayer::setCoordinatorIncludingSubLayersIfNeeded):
        (WebCore::toCoordinatedLayerID): Deleted.
        (WebCore::CoordinatedGraphicsLayer::didChangeLayerState): Deleted.
        (WebCore::CoordinatedGraphicsLayer::syncChildren): Deleted.
        (WebCore::CoordinatedGraphicsLayer::syncFilters): Deleted.
        (WebCore::CoordinatedGraphicsLayer::syncLayerState): Deleted.
        (WebCore::CoordinatedGraphicsLayer::syncAnimations): Deleted.
        (WebCore::CoordinatedGraphicsLayer::resetLayerState): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        (): Deleted.
        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState): Deleted.
        (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const): Deleted.

2018-08-22  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Drop old-school PlatformLayer management in CoordinatedGraphicsLayer
        https://bugs.webkit.org/show_bug.cgi?id=188850

        Reviewed by Michael Catanzaro.

        Remove the m_platformLayer member from the CoordinatedGraphicsLayer
        class as it's been unused since the rework in r235165.

        The CoordinatedGraphicsLayer::syncPlatformLayer() helper method and the
        related member variable can both be removed as well. On the
        CoordinatedGraphicsLayerState class, we can remove the obsolete
        flags and the TextureMapperPlatformLayerProxy member variable that's
        unused now that such objects are handled through the Nicosia impl class.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
        (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
        (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
        (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
        (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):

2018-08-22  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove TiledBackingStoreClient inheritance from CoordinatedGraphicsLayer
        https://bugs.webkit.org/show_bug.cgi?id=188849

        Reviewed by Michael Catanzaro.

        Remove the TiledBackingStoreClient inheritance from the
        CoordinatedGraphicsLayer class since it's not used anymore after changes
        made in r235165.

        Related TiledBackingStore objects on this class, along with tile state
        tracking member variables on the CoordinatedGraphicsLayerState class,
        are also removed.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
        (WebCore::CoordinatedGraphicsLayer::resetLayerState):
        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
        (WebCore::CoordinatedGraphicsLayer::tiledBackingStoreHasPendingTileCreation): Deleted.
        (WebCore::CoordinatedGraphicsLayer::createTile): Deleted.
        (WebCore::CoordinatedGraphicsLayer::updateTile): Deleted.
        (WebCore::CoordinatedGraphicsLayer::removeTile): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        (WebCore::CoordinatedGraphicsLayerState::hasPendingChanges const):

2018-08-22  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Remove CoordinatedImageBacking and related functionality
        https://bugs.webkit.org/show_bug.cgi?id=188847

        Reviewed by Michael Catanzaro.

        Remove the CoordinatedImageBacking class and its intertwining use in the
        CoordinatedGraphics system.

        Remove the now-unused m_coordinatedImageBacking member variable from the
        CoordinatedGraphicsLayer class, along with CoordinatedImageBacking::Host
        inheritance. Various related helper methods are also removed.

        In CoordinatedGraphicsState and CoordinatedGraphicsLayerState classes,
        we are able to drop different CoordinatedImageBacking-related state
        values that are not used anymore.

        * platform/TextureMapper.cmake:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
        (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
        (WebCore::CoordinatedGraphicsLayer::setContentsToImage):
        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
        (WebCore::CoordinatedGraphicsLayer::didChangeImageBacking): Deleted.
        (WebCore::CoordinatedGraphicsLayer::syncImageBacking): Deleted.
        (WebCore::CoordinatedGraphicsLayer::imageBackingVisible): Deleted.
        (WebCore::CoordinatedGraphicsLayer::releaseImageBackingIfNeeded): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.cpp: Removed.
        * platform/graphics/texmap/coordinated/CoordinatedImageBacking.h: Removed.

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

        Store RefPtr in FocusNavigationScope
        https://bugs.webkit.org/show_bug.cgi?id=188864

        Reviewed by Simon Fraser.

        Use RefPtr to store the root node of a tree scope and a slot element instead of a reference and a raw pointer.

        * page/FocusController.cpp:
        (WebCore::FocusNavigationScope::parentInScope const):
        (WebCore::FocusNavigationScope::firstNodeInScope const):
        (WebCore::FocusNavigationScope::lastNodeInScope const):
        (WebCore::FocusNavigationScope::FocusNavigationScope):
        (WebCore::FocusNavigationScope::owner const):

2018-08-22  Jiewen Tan  <jiewen_tan@apple.com>

        Unreviewed, update "Web Authentication" from "Under Consideration" to "In Development"
        in features.json.

        * features.json:

2018-08-22  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Support dragging attachment elements out as files on macOS
        https://bugs.webkit.org/show_bug.cgi?id=181294
        <rdar://problem/36298801>

        Reviewed by Tim Horton.

        Serialize a dragged attachment element as a web archive on macOS. This allows us to move attachment elements
        around a document by dragging, without performing a file upload upon every drop. Ideally, we should do this on
        iOS as well, but this currently causes attachment data to go missing; further investigation to fix this for iOS
        is tracked in <https://bugs.webkit.org/show_bug.cgi?id=181514>.

        Tests:  WKAttachmentTestsMac.DragAttachmentAsFilePromise
                WKAttachmentTests.MoveAttachmentElementAsIconByDragging

        * editing/cocoa/EditorCocoa.mm:
        (WebCore::Editor::getPasteboardTypesAndDataForAttachment):

2018-08-22  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Add support for the inputmode attribute
        https://bugs.webkit.org/show_bug.cgi?id=183621

        Reviewed by Tim Horton.

        Added the inputmode attribute to the HTMLInputElement and HTMLTextAreaElement IDL
        files. The possible values for the attribute are specified in InputModeNames.

        Test: fast/forms/inputmode-attribute.html

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * html/HTMLAttributeNames.in:
        * html/HTMLInputElement.idl:
        * html/HTMLTextAreaElement.idl:
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::inputMode const):
        (WebCore::HTMLTextFormControlElement::setInputMode):
        * html/HTMLTextFormControlElement.h:
        * html/InputModeNames.cpp: Added.
        (WebCore::InputModeNames::text):
        (WebCore::InputModeNames::tel):
        (WebCore::InputModeNames::url):
        (WebCore::InputModeNames::email):
        (WebCore::InputModeNames::numeric):
        (WebCore::InputModeNames::decimal):
        (WebCore::InputModeNames::search):
        * html/InputModeNames.h: Added.

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

        Log more often during AirPlay state changes
        https://bugs.webkit.org/show_bug.cgi?id=188854

        Always log some infrequent but important AirPlay state changes to make debugging easier.

        Reviewed by Jer Noble.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::webkitShowPlaybackTargetPicker): Low always.
        (WebCore::HTMLMediaElement::mediaPlayerCurrentPlaybackTargetIsWirelessChanged): Ditto.
        (WebCore::HTMLMediaElement::setWirelessPlaybackTarget): Ditto.
        (WebCore::HTMLMediaElement::setShouldPlayToPlaybackTarget): Ditto.

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

        Focus navigation order in slot fallback contents is wrong
        https://bugs.webkit.org/show_bug.cgi?id=178001
        <rdar://problem/42842997>

        Reviewed by Antti Koivisto.

        The bug here is that when a slot uses its fallback content, the fallback content's focus order doesn't get
        grouped by that of the slot. Consider the following DOM tree:

        - ShadowRoot
            - div tabindex = 2
            - slot tabindex = 1
                - span tabindex = 3

        In this example, the sequential focus navigation should be slot, span, then div. Even though span has tabindex
        order of 3, which is lower than that of div, the fallback content of the slot should be grouped together
        before the focus moves out of the slot content.

        In WebKit, this concept of grouping elements for the sequential focus navigation ordering is implemeneted
        as FocusNavigationScope. Both ShadowRoot and HTMLSlotElement are treated as a focus scope owner but we had
        a bug that a slot element which uses its fallback content was not treated as a focus scope owner.

        This patch addresses the bug by treating a slot wich uses its fallback content as a focus scope owner.

        Test: fast/shadow-dom/focus-navigation-across-slots.html

        * page/FocusController.cpp:
        (WebCore::isFocusScopeOwner): Treat a slot elment hs a focus scope owner regardless of whether it has assigned
        nodes or not.
        (WebCore::FocusNavigationScope::SlotKind): Added.
        (WebCore::FocusNavigationScope::m_slotKind): Added.
        (WebCore::FocusNavigationScope::parentInScope const): Return null if `node` is a child of the slot element for
        which this FocusNavigationScope is created (i.e. `node` is slot's fallback content).
        (WebCore::FocusNavigationScope::firstNodeInScope const): Return the first child node when this
        FocusNavigationScope is for a slot element using its fallback content.
        (WebCore::FocusNavigationScope::lastNodeInScope const): Ditto for the last child.
        (WebCore::FocusNavigationScope::FocusNavigationScope):
        (WebCore::FocusNavigationScope::scopeOf): The scope of a child of a slot element which uses its fallback content
        is its slot element (i.e. the current node is a fallback content). We can't simply check the current node is
        a slot element which uses a fallback content since the scope of a slot element is the parent scope. e.g. its
        tree scope like ShadowRoot or Document inside which this slot element appears.
        (WebCore::FocusNavigationScope::scopeOwnedByScopeOwner): Create the appropriate FocusNavigationScope based on
        whether the slot element has assigned or it uses its fallback content.

2018-08-22  David Kilzer  <ddkilzer@apple.com>

        Move files in WebCore project to match Xcode folder structure
        <https://webkit.org/b/188851>

        Reviewed by Tim Horton.

        * Scripts/LocalizableStrings.pm: Renamed from Source/WebCore/LocalizableStrings.pm.
        * Scripts/extract-localizable-strings.pl: Renamed from Source/WebCore/extract-localizable-strings.pl.
        * WebCore.xcodeproj/project.pbxproj: Update to match new location of files.
        * platform/audio/cocoa/WebAudioBufferList.cpp: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.cpp.
        * platform/audio/cocoa/WebAudioBufferList.h: Renamed from Source/WebCore/platform/audio/WebAudioBufferList.h.
        * platform/graphics/avfoundation/objc/MediaSampleAVFObjC.h: Renamed from Source/WebCore/platform/graphics/avfoundation/MediaSampleAVFObjC.h.
        * platform/ios/wak/WAKViewInternal.h: Renamed from Source/WebCore/platform/WAKViewInternal.h.
          Also fix 3 webkit-style warnings.

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

        [LFC][Floating] Move files to a dedicated directory.
        https://bugs.webkit.org/show_bug.cgi?id=188846

        Reviewed by Simon Fraser.

        layout/Float* -> layout/floats

        * WebCore.xcodeproj/project.pbxproj:
        * layout/floatformatting/FloatingContext.cpp: Renamed from Source/WebCore/layout/FloatingContext.cpp.
        (WebCore::Layout::FloatingPair::isEmpty const):
        (WebCore::Layout::FloatingPair::verticalPosition const):
        (WebCore::Layout::Iterator::operator* const):
        (WebCore::Layout::begin):
        (WebCore::Layout::end):
        (WebCore::Layout::FloatingContext::FloatingContext):
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingContext::initialVerticalPosition const):
        (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
        (WebCore::Layout::FloatingContext::alignWithFloatings const):
        (WebCore::Layout::FloatingContext::toContainingBlock const):
        (WebCore::Layout::FloatingPair::FloatingPair):
        (WebCore::Layout::FloatingPair::left const):
        (WebCore::Layout::FloatingPair::right const):
        (WebCore::Layout::FloatingPair::intersects const):
        (WebCore::Layout::FloatingPair::operator == const):
        (WebCore::Layout::FloatingPair::bottom const):
        (WebCore::Layout::Iterator::Iterator):
        (WebCore::Layout::previousFloatingIndex):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):
        (WebCore::Layout::Iterator::operator== const):
        (WebCore::Layout::Iterator::operator!= const):
        * layout/floatformatting/FloatingContext.h: Renamed from Source/WebCore/layout/FloatingContext.h.
        (WebCore::Layout::FloatingContext::floatingState const):
        (WebCore::Layout::FloatingContext::layoutContext const):
        * layout/floatformatting/FloatingState.cpp: Renamed from Source/WebCore/layout/FloatingState.cpp.
        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
        (WebCore::Layout::FloatingState::FloatingState):
        (WebCore::Layout::belongsToThisFloatingContext):
        (WebCore::Layout::FloatingState::remove):
        (WebCore::Layout::FloatingState::append):
        (WebCore::Layout::FloatingState::bottom const):
        * layout/floatformatting/FloatingState.h: Renamed from Source/WebCore/layout/FloatingState.h.
        (WebCore::Layout::FloatingState::create):
        (WebCore::Layout::FloatingState::isEmpty const):
        (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
        (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
        (WebCore::Layout::FloatingState::FloatItem::displayBox const):
        (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
        (WebCore::Layout::FloatingState::floats const):
        (WebCore::Layout::FloatingState::last const):
        (WebCore::Layout::FloatingState::layoutContext const):
        (WebCore::Layout::FloatingState::root const):
        (WebCore::Layout::FloatingState::leftBottom const):
        (WebCore::Layout::FloatingState::rightBottom const):
        (WebCore::Layout::FloatingState::bottom const):

2018-08-22  Rob Buis  <rbuis@igalia.com>

        Fetch: Stop checking Request.integrity's value in no-cors mode
        https://bugs.webkit.org/show_bug.cgi?id=188802

        Reviewed by Frédéric Wang.

        Remove this check since it was removed from the spec.

        Behavior matches Chrome and Firefox.

        Test: http/tests/subresource-integrity/sri-fetch.js:

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::FetchRequest::initializeOptions):

2018-08-22  Youenn Fablet  <youenn@apple.com>

        Mark MediaStream Recording API as under consideration
        https://bugs.webkit.org/show_bug.cgi?id=188822

        Reviewed by Jon Lee.

        * features.json:

2018-08-22  Ms2ger  <Ms2ger@igalia.com>

        [GTK] Never return an uninitialized ImageGStreamer object.
        https://bugs.webkit.org/show_bug.cgi?id=188305

        Reviewed by Philippe Normand.

        The single caller was already checking for a null return value, so
        make that check actually do something. Also remove the null-check on
        the return value of image(), which asserted that it would never return
        null.

        Test: fast/canvas/canvas-createPattern-video-loading.html

        * platform/graphics/gstreamer/ImageGStreamer.h:
        (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
        (WebCore::ImageGStreamer::image): Return a reference.
        (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.

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

        Add changes missing from r234925.

        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::isMarginBottomCollapsedThrough):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):

2018-08-22  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Switch to Nicosia::CompositionLayer state tracking
        https://bugs.webkit.org/show_bug.cgi?id=188693

        Reviewed by Carlos Garcia Campos.

        Populate Nicosia::CompositionLayer with additional LayerState member
        objects. For now we're using pending, staging and committed states,
        though it might be possible to narrow down these to just two.

        Pending state contains state that will be moved to staging during the
        final steps of the next layer flush. flushState() method accumulates all
        state changes in the staging state, and also allows the caller to
        additionally perform flushing operations that are specific to backing
        store, image backing or content layer containers.

        commitState() method moves staging state over into the committed state,
        again allowing user to pass a functor that receives the just-committed
        state and apply it to their composition engine.

        Changes in state objects are done under a thread-safe lock. This might
        not be completely necessary at this point, but will be useful when
        additonal layer state updates will be coming from e.g. the scrolling
        thread. It might also make sense to tie in this lock use with the
        Nicosia::Scene lock in the future.

        Nicosia::ContentLayerTextureMapperImpl is modified slightly to allow
        determining during flushes whether an update is pending. This is
        necessary for a special case in ThreadedCompositor where content (i.e.
        platform) layers like WebGL or video require an additional level of
        scene update coordination. This complete special case has to go through
        another review to see whether it's still necessary. Ideally we would be
        able to remove it.

        CoordinatedGraphicsLayer is finally switched over to using
        Nicosia layer objects for state updates of any kind. This patch only
        adds all the necessary bits, but doesn't yet remove any of the existing
        code (but rather disables it temporarily, before it's removed).

        Updating of simple state values is already in place. For backing stores,
        the flushCompositingStateForThisLayerOnly() method now takes care of
        preparing the backing store object if necessary as per layer state,
        while the updateContentBuffers() method is switched to operate with
        TiledBackingStore objects now kept on the BackingStoreTextureMapperImpl
        instance associated with that backing store. Helper methods like
        adjustContentsScale() and createBackingStore(), only called from the
        updateContentBuffers() method, are removed and the code there inlined.

        For image-backed layers, the update is now done directly in
        the flushCompositingStateForThisLayerOnly() method, if necessary. The
        helper syncImageBacking() method is commented out in order to prevent
        double-painting of image buffers for now, but all this (along with the
        CoordinatedImageBacking logic in CompositingCoordinator) will be removed
        later.

        For layers backed by platform layer objects, integration is relatively
        simple. setContentsToPlatformLayer() is changed to properly handle any
        passed-in platform layer object, and updatePlatformLayer() invokes the
        swapBuffersIfNeeded() method on the ContentLayerTextureMapperImpl object
        during each flush, if necessary.

        In order to ensure any Nicosia-specific state update properly triggers
        a composition update, m_nicosia.performLayerUpdate is added and flipped
        to true during the flush in case of any state change. This then triggers
        a layer sync in the CompositingCoordinator object when the
        syncPendingStateChangesIncludingSubLayers() method is called. While no
        old-style layer state update is provided, it causes the necessary
        synchronization step that properly picks up the Nicosia-provided state
        changes. Once the old-style layer state tracking is removed, this method
        of update triggering will have to be updated as well.

        * platform/graphics/nicosia/NicosiaPlatformLayer.h:
        (Nicosia::CompositionLayer::flushState):
        (Nicosia::CompositionLayer::commitState):
        (Nicosia::CompositionLayer::accessCommitted):
        * platform/graphics/nicosia/NicosiaScene.h:
        * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp:
        (Nicosia::ContentLayerTextureMapperImpl::flushUpdate):
        * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::~CoordinatedGraphicsLayer):
        (WebCore::CoordinatedGraphicsLayer::setContentsNeedsDisplay):
        (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
        (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):
        (WebCore::CoordinatedGraphicsLayer::syncPendingStateChangesIncludingSubLayers):
        (WebCore::CoordinatedGraphicsLayer::updateContentBuffers):
        (WebCore::CoordinatedGraphicsLayer::purgeBackingStores):
        (WebCore::CoordinatedGraphicsLayer::adjustContentsScale): Deleted.
        (WebCore::CoordinatedGraphicsLayer::createBackingStore): Deleted.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h:

2018-08-22  David Kilzer  <ddkilzer@apple.com>

        Remove stale file references in WebCore Xcode project

        I manually removed these using Xcode and verified that there was
        a commit that removed the original files.

        Found by tool created for Bug 188754: Tool to fix folders that
        should map to directories in Xcode project files.

        * WebCore.xcodeproj/project.pbxproj:
        (dom/DOMExceptions.in): Removed in r219741.
        (Modules/modern-media-controls/start-button.js):
        (Modules/modern-media-controls/volume-slider.css):
        (Modules/modern-media-controls/icon-button.css):
        (Modules/modern-media-controls/volume-slider.js):
        (Modules/modern-media-controls/macos-media-controls.js):
        (Modules/modern-media-controls/ios-inline-media-controls.css):
        (Modules/modern-media-controls/scrubber.css):
        (Modules/modern-media-controls/start-button.css):
        (Modules/modern-media-controls/scrubber.js):
        (Modules/modern-media-controls/icon-button.js):
        (Modules/modern-media-controls/macos-compact-inline-media-controls.css):
        (Modules/modern-media-controls/images/iOS/enter-fullscreen@2x.png):
        (Modules/modern-media-controls/images/iOS/start@1x.png):
        (Modules/modern-media-controls/images/iOS/enter-fullscreen@1x.png):
        (Modules/modern-media-controls/images/iOS/pause@2x.png):
        (Modules/modern-media-controls/images/iOS/play@3x.png):
        (Modules/modern-media-controls/images/iOS/interval-skip-back@2x.png):
        (Modules/modern-media-controls/images/iOS/interval-skip-back@3x.png):
        (Modules/modern-media-controls/images/iOS/pip-in@2x.png):
        (Modules/modern-media-controls/images/iOS/start@3x.png):
        (Modules/modern-media-controls/images/iOS/airplay@1x.png):
        (Modules/modern-media-controls/images/iOS/enter-fullscreen@3x.png):
        (Modules/modern-media-controls/images/iOS/slider-thumb@2x.png):
        (Modules/modern-media-controls/images/iOS/airplay@2x.png):
        (Modules/modern-media-controls/images/iOS/pause@3x.png):
        (Modules/modern-media-controls/images/iOS/pip-in@3x.png):
        (Modules/modern-media-controls/images/iOS/interval-skip-back@1x.png):
        (Modules/modern-media-controls/images/iOS/pause@1x.png):
        (Modules/modern-media-controls/images/iOS/start@2x.png):
        (Modules/modern-media-controls/images/iOS/play@2x.png):
        (Modules/modern-media-controls/images/iOS/pip-in@1x.png):
        (Modules/modern-media-controls/images/iOS/play@1x.png):
        (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@1x.png):
        (Modules/modern-media-controls/images/macOS/rewind@1x.png):
        (Modules/modern-media-controls/images/macOS/play@2x.png):
        (Modules/modern-media-controls/images/macOS/volume-mute@2x.png):
        (Modules/modern-media-controls/images/macOS/airplay-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/volume@2x.png):
        (Modules/modern-media-controls/images/macOS/interval-skip-back@2x.png):
        (Modules/modern-media-controls/images/macOS/volume-compact@2x.png):
        (Modules/modern-media-controls/images/macOS/start@2x.png):
        (Modules/modern-media-controls/images/macOS/exit-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/airplay@2x.png):
        (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/interval-skip-back@1x.png):
        (Modules/modern-media-controls/images/macOS/airplay@1x.png):
        (Modules/modern-media-controls/images/macOS/pip-in@1x.png):
        (Modules/modern-media-controls/images/macOS/scale-to-fill@2x.png):
        (Modules/modern-media-controls/images/macOS/rewind@2x.png):
        (Modules/modern-media-controls/images/macOS/play-compact@1x.png):
        (Modules/modern-media-controls/images/macOS/media-selection-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/volume@1x.png):
        (Modules/modern-media-controls/images/macOS/pip-in@2x.png):
        (Modules/modern-media-controls/images/macOS/play-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/pause-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/enter-fullscreen-compact@2x.png):
        (Modules/modern-media-controls/images/macOS/enter-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/pause-compact@1x.png):
        (Modules/modern-media-controls/images/macOS/start@1x.png):
        (Modules/modern-media-controls/images/macOS/pip-in-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/pause-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/play@1x.png):
        (Modules/modern-media-controls/images/macOS/exit-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/forward@1x.png):
        (Modules/modern-media-controls/images/macOS/enter-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/pause@1x.png):
        (Modules/modern-media-controls/images/macOS/scale-to-fit@2x.png):
        (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@2x.png):
        (Modules/modern-media-controls/images/macOS/pause@2x.png):
        (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/volume-compact@1x.png):
        (Modules/modern-media-controls/images/macOS/play-compact@2x.png):
        (Modules/modern-media-controls/images/macOS/media-selection@2x.png):
        (Modules/modern-media-controls/images/macOS/forward@2x.png):
        (Modules/modern-media-controls/images/macOS/interval-skip-back-compact@1x.png):
        (Modules/modern-media-controls/images/macOS/scale-to-fill@1x.png):
        (Modules/modern-media-controls/images/macOS/airplay-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/media-selection@1x.png):
        (Modules/modern-media-controls/images/macOS/volume-mute@1x.png):
        (Modules/modern-media-controls/images/macOS/pause-compact@2x.png):
        (Modules/modern-media-controls/images/macOS/volume-up-fullscreen@2x.png):
        (Modules/modern-media-controls/images/macOS/scale-to-fit@1x.png):
        (Modules/modern-media-controls/images/macOS/play-fullscreen@1x.png):
        (Modules/modern-media-controls/images/macOS/volume-down-fullscreen@2x.png):
        (Modules/modern-media-controls/media/time-labels-support.js):
        - Removed in r217823.
        (Modules/webvr/VRDisplayCapabilities.cpp): Removed in r229089.
        (Modules/webvr/VRFieldOfView.cpp): Removed in r228819.
        (rendering/svg/RenderSVGAllInOne.cpp): Removed in r234655.

2018-08-22  Carlos Garcia Campos  <cgarcia@igalia.com>

        Do not try to update the compositing policy when not in accelerated compositing mode
        https://bugs.webkit.org/show_bug.cgi?id=188787

        Reviewed by Simon Fraser.

        RenderLayerCompositor::updateCompositingPolicy() is called very often (called from
        RenderLayerCompositor::cacheAcceleratedCompositingFlags()) and it uses WTF::memoryFootprint() to decide the
        current compositing policy. Getting the memory footprint is an expensive operation in Linux (and I suspect other
        non-cocoa ports too), causing an excessive CPU usage. This caused the WPE and GTK+ unit test
        /webkit/WebKitWebContext/uri-scheme to start timing out in the bots, because the test expects things to happen
        fast and that's no longer the case. We could reduce the CPU usage a lot by not trying to update the policy when
        not in accelerated compositing mode. We will need a solution for the accelerated compositing mode, though.

        Fixes WPE/GTK+ unit test /webkit/WebKitWebContext/uri-scheme.

        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateCompositingPolicy): Return early when not in accelerated compositing mode.

2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Support "name" option for dedicated workers
        https://bugs.webkit.org/show_bug.cgi?id=188779

        Reviewed by Joseph Pecoraro.

        This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
        This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
        It is useful for debugging dedicated workers if the inspector can show the
        names of the workers. This enhancement is tracked by [2].

        [1]: https://github.com/whatwg/html/issues/2477
        [2]: https://bugs.webkit.org/show_bug.cgi?id=164678

        Tests: http/wpt/workers/name-property-enhanced.html
               http/wpt/workers/name-property-no-name.html

        * workers/DedicatedWorkerGlobalScope.cpp:
        (WebCore::DedicatedWorkerGlobalScope::create):
        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
        Hold `name` member.

        * workers/DedicatedWorkerGlobalScope.h:
        * workers/DedicatedWorkerGlobalScope.idl:
        Add `name` attribute.

        * workers/DedicatedWorkerThread.cpp:
        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
        * workers/DedicatedWorkerThread.h:
        * workers/Worker.cpp:
        (WebCore::Worker::Worker):
        (WebCore::Worker::create):
        (WebCore::Worker::notifyFinished):
        * workers/Worker.h:
        * workers/Worker.idl:
        Add WorkerOptions for dedicated worker creation.

        * workers/WorkerGlobalScopeProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
        Isolate copy the given `name` to pass the worker thread.

        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:

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

        Replace booleans for modifier keys in UIEventWithKeyState with OptionSet<Modifier>
        https://bugs.webkit.org/show_bug.cgi?id=188777

        Reviewed by Simon Fraser.

        Replaced boolean arguments and instance variables for modifier keys (ctrl, alt, shift, and meta keys) in
        UIEventWithKeyState with OptionSet<Modifier> and isSimulated boolean in MouseRelatedEvent with IsSimulated
        enum class.

        Also made movementDelta always compiled instead of only when ENABLE(POINTER_LOCK) to simplify the code.

        No new tests since there should be no observable behavioral change.

        * dom/Element.cpp:
        (WebCore::Element::dispatchMouseEvent):
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::KeyboardEvent):
        (WebCore::KeyboardEvent::initKeyboardEvent): Call setModifierKeys.
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create):
        (WebCore::MouseEvent::MouseEvent):
        (WebCore::MouseEvent::initMouseEvent): Ditto.
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent): Added a new variant which takes the minimum arguments
        for gesture & touch events. In those events, detail is always set to 0, movementDelta is always set to 0,0,
        and they are never simulated.
        * dom/MouseRelatedEvent.h:
        (WebCore::MouseRelatedEvent::IsSimulated): Added.
        * dom/SimulatedClick.cpp:
        (WebCore::SimulatedMouseEvent::SimulatedMouseEvent): Get OptionSet<Modifier> out of the underlying event
        instead of manually setting each key state. This code now preserves the state of caps lock and alt-graph
        keys but this is not observable because we have yet to implement getModifierState on MouseEvent.
        (WebCore::SimulatedMouseEvent::modifiersFromUnderlyingEvent): Added.
        * dom/TouchEvent.cpp:
        (WebCore::TouchEvent::TouchEvent):
        * dom/TouchEvent.h:
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::Modifier): Alias to PlatformEvent::Modifier.
        (WebCore::UIEventWithKeyState::ctrlKey const): Updated to use m_modifiers.
        (WebCore::UIEventWithKeyState::shiftKey const): Ditto.
        (WebCore::UIEventWithKeyState::altKey const): Ditto.
        (WebCore::UIEventWithKeyState::metaKey const): Ditto.
        (WebCore::UIEventWithKeyState::altGraphKey const): Ditto.
        (WebCore::UIEventWithKeyState::capsLockKey const): Ditto.
        (WebCore::UIEventWithKeyState::modifierKeys): Added.
        (WebCore::UIEventWithKeyState::UIEventWithKeyState): Now takes OptionSet<Modifier>.
        (WebCore::UIEventWithKeyState::setModifierKeys): Added. Used by init*Event functions in subclasses. Note that
        these functions preseve the states of alt-graph and caps lock keys to match the existing behaviors in this
        cleanup patch but they don't match behaviors of Chrome or Firefox.
        (WebCore::UIEventWithKeyState::modifiersFromInitializer): Added.
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::WheelEvent): Simulated::No corresponds to the last boolean being false.
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchDragEvent):
        (WebCore::EventHandler::handleTouchEvent):
        * platform/PlatformEvent.h:
        (WebCore::PlatformEvent::Modifier): Added AltGraphKey.
        * platform/mac/PlatformEventFactoryMac.h:
        (WebCore::modifiersForEvent): Exported to be used in [WebPDFView PDFViewWillClickOnLink:withURL:].
        * platform/mac/PlatformEventFactoryMac.mm:
        (WebCore::modifiersForEvent):
        * testing/Internals.cpp:
        (WebCore::Internals::accessKeyModifiers const):

2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Remove _WKAttachments and notify the UI client upon mainframe navigation
        https://bugs.webkit.org/show_bug.cgi?id=188715
        <rdar://problem/43541790>

        Reviewed by Tim Horton.

        Rename didInsertAttachment to didInsertAttachmentWithIdentifier. See WebKit ChangeLog for more detail.

        Tests:  WKAttachmentTests.InvalidateAttachmentsAfterMainFrameNavigation
                WKAttachmentTests.InvalidateAttachmentsAfterWebProcessTermination

        * editing/Editor.cpp:
        (WebCore::Editor::notifyClientOfAttachmentUpdates):
        * page/EditorClient.h:
        (WebCore::EditorClient::didInsertAttachmentWithIdentifier):
        (WebCore::EditorClient::didRemoveAttachmentWithIdentifier):
        (WebCore::EditorClient::didInsertAttachment): Deleted.
        (WebCore::EditorClient::didRemoveAttachment): Deleted.

2018-08-21  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r235128.

        The test added with this change is frequently failing.

        Reverted changeset:

        "Support "name" option for dedicated workers"
        https://bugs.webkit.org/show_bug.cgi?id=188779
        https://trac.webkit.org/changeset/235128

2018-08-21  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r235107.
        https://bugs.webkit.org/show_bug.cgi?id=188832

        "It revealed bugs in Blob code as well as regressed JS
        performance tests" (Requested by saamyjoon on #webkit).

        Reverted changeset:

        "JSRunLoopTimer may run part of a member function after it's
        destroyed"
        https://bugs.webkit.org/show_bug.cgi?id=188426
        https://trac.webkit.org/changeset/235107

2018-08-21  Megan Gardner  <megan_gardner@apple.com>

        Use VisiblePosition to calculate selection ranges
        https://bugs.webkit.org/show_bug.cgi?id=188767
        <rdar://problem/43577166>

        Reviewed by Ryosuke Niwa.

        Exposing comparePositions.

        * editing/Editing.h:

2018-08-21  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment Support] Augment _WKAttachment SPI to handle NSFileWrappers in addition to NSData
        https://bugs.webkit.org/show_bug.cgi?id=188496
        <rdar://problem/43216836>

        Reviewed by Tim Horton.

        Refactors logic around HTMLAttachmentElement and pasteboard reading helpers, in support of moving the data
        backing for attachment elements to the client layer, instead of keeping it in the attachment element's File.
        Augmented existing API tests in WKAttachmentTests, and also added a new API test (see Tools for more detail).

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::didInsertAttachmentElement):

        Notify the client layer when a newly inserted attachment element's identifier has been updated to avoid
        colliding with the identifier of an existing attachment element. This can happen if, for instance, one or more
        attachments are copied and pasted within the same document.

        * editing/Editor.cpp:
        (WebCore::Editor::registerAttachmentIdentifier):
        (WebCore::Editor::cloneAttachmentData):

        Add new helper functions to notify the client when the attachment identifier to data mapping needs to be
        updated. This can happen in three ways: (1) an attachment is created with raw data, or (2) an attachment is
        created with a file path, or (3) the unique identifier for an attachment element has been reassigned. These
        correspond to the two versions of `registerAttachmentIdentifier`, and `cloneAttachmentData`, respectively.

        (WebCore::EditorClient::supportsClientSideAttachmentData const):

        Add a new EditorClient hook to determine whether client-side attachment data management is supported. Currently,
        this only returns true for WebKit2. If this flag is set to true, we register attachment identifiers and don't
        create a new File object for the attachment element; otherwise, fall back to creating and setting a File for the
        new attachment element.

        (WebCore::Editor::insertAttachment):
        (WebCore::Editor::insertAttachmentFromFile): Deleted.

        Adjust logic when inserting an attachment; we now only need to update the attributes of the attachment element
        with metadata from the client layer.

        * editing/Editor.h:
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::supportsClientSideAttachmentData):
        (WebCore::createFragmentForImageAttachment):

        Notify the client when creating an attachment element from image data on the pasteboard.

        (WebCore::replaceRichContentWithAttachments):

        Refactor this helper function to no longer connect attachment elements to File objects created from
        subresources. Instead, just update each attachment element's attributes using information about the subresource,
        and then notify the client about the new attachment data and attachment identifier.

        (WebCore::createFragmentAndAddResources):
        (WebCore::sanitizeMarkupWithArchive):

        Plumb the current WebContentReader's Frame& to each of these helpers, so that it can call out to the client.

        (WebCore::WebContentReader::readWebArchive):
        (WebCore::WebContentMarkupReader::readWebArchive):
        (WebCore::WebContentReader::readImage):
        (WebCore::WebContentReader::readFilePaths):

        Notify the client when creating an attachment from the path of a dropped file.

        * html/AttachmentTypes.h:

        Remove AttachmentInfo. This is no longer necessary because we don't need to request attachment data from the web
        process anymore.

        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::ensureUniqueIdentifier):

        Add a helper function on the attachment element to create and return a unique identifier if needed.

        (WebCore::HTMLAttachmentElement::updateAttributes):

        Add a helper method to update the displayed element attributes (type, title and subtitle) or an attachment.

        (WebCore::AttachmentDataReader::create): Deleted.
        (WebCore::AttachmentDataReader::AttachmentDataReader): Deleted.

        Remove AttachmentDataReader. This helper class was only used to load attachment data when requesting attachment
        information in the client, but this is now obviated by moving attachment data to the client layer.

        (WebCore::HTMLAttachmentElement::updateFileWithData): Deleted.
        (WebCore::HTMLAttachmentElement::requestInfo): Deleted.
        (WebCore::HTMLAttachmentElement::destroyReader): Deleted.
        (WebCore::AttachmentDataReader::~AttachmentDataReader): Deleted.
        (WebCore::AttachmentDataReader::didFinishLoading): Deleted.
        (WebCore::AttachmentDataReader::didFail): Deleted.
        (WebCore::AttachmentDataReader::invokeCallbackAndFinishReading): Deleted.
        * html/HTMLAttachmentElement.h:
        * page/DragClient.h:
        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        (WebCore::DragController::doSystemDrag):
        (WebCore::DragController::promisedAttachmentInfo):

        Allow dragging an attachment (even if it does not have a file) as long as it has a unique identifier and a
        content type.

        (WebCore::DragController::promisedBlobInfo): Deleted.
        * page/DragController.h:
        * page/EditorClient.h:
        (WebCore::EditorClient::registerAttachmentIdentifier):
        (WebCore::EditorClient::cloneAttachmentData):
        * platform/DragItem.h:
        (WebCore::DragItem::encode const):
        (WebCore::DragItem::decode):
        * platform/PromisedAttachmentInfo.h: Renamed from Source/WebCore/platform/PromisedBlobInfo.h.

        Add an attachment identifier to PromisedBlobInfo. Additionally, rename PromisedBlobInfo to
        PromisedAttachmentInfo, since it is currently exclusively used to attachment element data to the pasteboard.
        In the future, this could be renamed to something more general (e.g. PromisedPasteboardData), should we use this
        mechanism to write data from other sources to the pasteboard.

        (WebCore::PromisedAttachmentInfo::operator bool const):

2018-08-21  Brent Fulgham  <bfulgham@apple.com>

        Remove experimental affiliated domain code now that StorageAccess API is available
        https://bugs.webkit.org/show_bug.cgi?id=188756
        <rdar://problem/43527848>

        Reviewed by Alex Christensen.

        In Bug 174661 we added a compatibility quirk to support wsj.com authentication. This quirk is no longer needed,
        since the StorageAccess API provides the necessary tools to do this type of interaction without needing global
        cross-site access.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
        (WebCore::areDomainsAssociated): Deleted.
        (WebCore::shouldEnableSiteSpecificQuirks): Deleted.
        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::areDomainsAssociated): Deleted.
        * loader/ResourceLoadStatistics.h:

2018-08-21  Antti Koivisto  <antti@apple.com>

        Allow creating WeakPtrs to const objects
        https://bugs.webkit.org/show_bug.cgi?id=188785

        Reviewed by Geoffrey Garen.

        Remove some unneeded const_casts.

        * css/MediaQueryEvaluator.cpp:
        (WebCore::MediaQueryEvaluator::MediaQueryEvaluator):
        (WebCore::MediaQueryEvaluator::evaluate const):
        * css/MediaQueryEvaluator.h:
        * rendering/FloatingObjects.cpp:
        (WebCore::ComputeFloatOffsetAdapter::ComputeFloatOffsetAdapter):
        (WebCore::ComputeFloatOffsetForFloatLayoutAdapter::ComputeFloatOffsetForFloatLayoutAdapter):
        (WebCore::ComputeFloatOffsetForLineLayoutAdapter::ComputeFloatOffsetForLineLayoutAdapter):
        (WebCore::FindNextFloatLogicalBottomAdapter::FindNextFloatLogicalBottomAdapter):
        (WebCore::FloatingObjects::FloatingObjects):
        * rendering/FloatingObjects.h:
        (WebCore::FloatingObjects::renderer const):

2018-08-21  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Support "name" option for dedicated workers
        https://bugs.webkit.org/show_bug.cgi?id=188779

        Reviewed by Joseph Pecoraro.

        This patch adds `new Worker(url, { name: "Worker Name" })` option support[1].
        This name can be accessible from `self.name` of DedicatedWorkerGlobalScope.
        It is useful for debugging dedicated workers if the inspector can show the
        names of the workers. This enhancement is tracked by [2].

        [1]: https://github.com/whatwg/html/issues/2477
        [2]: https://bugs.webkit.org/show_bug.cgi?id=164678

        * workers/DedicatedWorkerGlobalScope.cpp:
        (WebCore::DedicatedWorkerGlobalScope::create):
        (WebCore::DedicatedWorkerGlobalScope::DedicatedWorkerGlobalScope):
        Hold `name` member.

        * workers/DedicatedWorkerGlobalScope.h:
        * workers/DedicatedWorkerGlobalScope.idl:
        Add `name` attribute.

        * workers/DedicatedWorkerThread.cpp:
        (WebCore::DedicatedWorkerThread::DedicatedWorkerThread):
        (WebCore::DedicatedWorkerThread::createWorkerGlobalScope):
        * workers/DedicatedWorkerThread.h:
        * workers/Worker.cpp:
        (WebCore::Worker::Worker):
        (WebCore::Worker::create):
        (WebCore::Worker::notifyFinished):
        * workers/Worker.h:
        * workers/Worker.idl:
        Add WorkerOptions for dedicated worker creation.

        * workers/WorkerGlobalScopeProxy.h:
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::startWorkerGlobalScope):
        * workers/WorkerMessagingProxy.h:
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThreadStartupData::WorkerThreadStartupData):
        Isolate copy the given `name` to pass the worker thread.

        (WebCore::WorkerThread::WorkerThread):
        (WebCore::WorkerThread::workerThread):
        * workers/WorkerThread.h:
        * workers/service/context/ServiceWorkerThread.cpp:
        (WebCore::ServiceWorkerThread::ServiceWorkerThread):
        (WebCore::ServiceWorkerThread::createWorkerGlobalScope):
        * workers/service/context/ServiceWorkerThread.h:

2018-08-21  Per Arne Vollan  <pvollan@apple.com>

        [WebGL] Contexts are not updated when display configuration changed.
        https://bugs.webkit.org/show_bug.cgi?id=188750

        Reviewed by Brent Fulgham.

        Calling CGDisplayRegisterReconfigurationCallback in GraphicsContext3DManager::addContext
        returns kCGErrorSuccess when WindowServer access is blocked in the WebContent process,
        but the callback function is never called. We should register the callback function in
        the UI process, and send a message to the WebContent process when the display
        configuration changed.

        Test: fast/canvas/webgl/context-update-on-display-configuration.html

        * WebCore.xcodeproj/project.pbxproj:
        * platform/graphics/GraphicsContext3DManager.cpp:
        (WebCore::GraphicsContext3DManager::displayWasReconfigured):
        (WebCore::GraphicsContext3DManager::addContext):
        (WebCore::GraphicsContext3DManager::removeContext):
        (WebCore::displayWasReconfigured): Deleted.
        * platform/graphics/GraphicsContext3DManager.h:

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

        Make ResourceLoadObserver::logWebSocketLoading() handle websockets in detached frames
        https://bugs.webkit.org/show_bug.cgi?id=188757
        <rdar://problem/38713390>

        Reviewed by Alex Christensen.

        Test: http/tests/websocket/construct-in-detached-frame-resource-load-statistics.html

        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::connect):
            Now logs even when a frame doesn't exist.
        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::shouldLog const):
            Now takes boolean 'usesEphemeralSession' instead of a page to support logging when there is no page.
        (WebCore::ResourceLoadObserver::logSubresourceLoading):
            Changed to send a boolean to ResourceLoadObserver::shouldLog().
        (WebCore::ResourceLoadObserver::logWebSocketLoading):
            Changed to:
            - receive the main frame's URL and a boolean for ephemeral sessions instead of the Frame.
            - send a boolean to ResourceLoadObserver::shouldLog().
            - No longer call areDomainsAssociated(). It is being removed in https://bugs.webkit.org/show_bug.cgi?id=188756.
        (WebCore::ResourceLoadObserver::logUserInteractionWithReducedTimeResolution):
            Changed to send a boolean to ResourceLoadObserver::shouldLog().
        * loader/ResourceLoadObserver.h:

2018-08-21  Daniel Bates  <dabates@apple.com>

        Disallow navigations when page cache updates the current document of the frame
        https://bugs.webkit.org/show_bug.cgi?id=188422

        Reviewed by Ryosuke Niwa.

        Make use of NavigationDisabler to disallow navigations when associating the cached
        document back with its frame (i.e. calling Frame::setDocument()).

        When we associate a cached document with its frame we will construct its render tree
        and run post style resolution callbacks that can do anything, including performing
        a frame load. Until page restoration is comnplete the frame tree is in a transient
        state that makes reasoning about it difficult and error prone. We should not allow
        navigations in this state.

        Test: fast/history/go-back-to-object-subframe.html

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

2018-08-21  Daniel Bates  <dabates@apple.com>

        Replace TextCheckingTypeMask with OptionSet
        https://bugs.webkit.org/show_bug.cgi?id=188678

        Reviewed by Antti Koivisto.

        Replaces TextCheckingTypeMask with an OptionSet to improve type safety and code clarity. Additionally
        change the values of TextCheckingType such that all the enumerators fit within an uint8_t.

        * PlatformMac.cmake:
        * SourcesCocoa.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::hasMisspelling const):
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (AXAttributeStringSetSpelling):
        * editing/AlternativeTextController.cpp:
        (WebCore::AlternativeTextController::timerFired):
        (WebCore::AlternativeTextController::processMarkersOnTextToBeReplacedByResult):
        * editing/Editor.cpp:
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::markMisspellingsAfterTypingToWord):
        (WebCore::Editor::markAllMisspellingsAndBadGrammarInRanges):
        (WebCore::isAutomaticTextReplacementType):
        (WebCore::Editor::markAndReplaceFor): For now, change a local variable from const to non-const to work
        around the following MSVC compiler bug: <https://developercommunity.visualstudio.com/content/problem/316713/msvc-cant-compile-webkits-optionsetcontainsany.html>.
        (WebCore::Editor::markMisspellingsAndBadGrammar):
        (WebCore::Editor::updateMarkersForWordsAffectedByEditing):
        (WebCore::Editor::editorUIUpdateTimerFired):
        (WebCore::Editor::resolveTextCheckingTypeMask):
        * editing/Editor.h:
        * editing/SpellChecker.cpp:
        (WebCore::SpellCheckRequest::SpellCheckRequest):
        (WebCore::SpellCheckRequest::create):
        (WebCore::SpellChecker::didCheckSucceed):
        * editing/SpellChecker.h:
        * editing/TextCheckingHelper.cpp:
        (WebCore::findGrammaticalErrors):
        (WebCore::findMisspellings):
        (WebCore::TextCheckingHelper::findFirstMisspellingOrBadGrammar):
        (WebCore::TextCheckingHelper::guessesForMisspelledOrUngrammaticalRange const):
        (WebCore::checkTextOfParagraph):
        * editing/TextCheckingHelper.h:
        * loader/EmptyClients.cpp:
        * platform/text/TextCheckerClient.h:
        * platform/text/TextChecking.h: Remove TextCheckingTypeMask. Reorganized the fields of TextCheckingRequestData
        to coallesce padding and move it to the end of class. Also used default initializer syntax and defaulted (= default)
        the default constructor of TextCheckingRequestData, removing the need for a user-defined default constructor.
        (WebCore::TextCheckingRequestData::TextCheckingRequestData):
        (WebCore::TextCheckingRequestData::text const): Changed return type from String to const String&
        to avoid unnecessary ref-count churn for callers that do not need to take a shared ownership in
        this string.
        (WebCore::TextCheckingRequestData::checkingTypes const): Renamed; formerly named mask.
        (WebCore::TextCheckingRequestData::mask const): Deleted.
        * platform/text/mac/TextCheckingMac.mm: Added.
        (WebCore::nsTextCheckingTypes):
        * testing/Internals.cpp:
        (WebCore::Internals::handleAcceptedCandidate):

2018-08-21  Fujii Hironori  <Hironori.Fujii@sony.com>

        Don't place "using namespace XXX;" in global space for unified source builds
        https://bugs.webkit.org/show_bug.cgi?id=188739

        Reviewed by Yusuke Suzuki.

        No new tests (No behavior change).

        * html/track/AudioTrackList.cpp:
        * html/track/TextTrackList.cpp:
        * html/track/VideoTrackList.cpp:
        * page/SecurityOriginData.cpp:
        * page/TextIndicator.cpp:
        * platform/geoclue/GeolocationProviderGeoclue.cpp:
        * platform/graphics/gstreamer/ImageGStreamerCairo.cpp:
        * platform/graphics/win/FullScreenController.cpp:
        * platform/mediastream/CaptureDeviceManager.cpp:
        * platform/mock/MediaPlaybackTargetPickerMock.cpp:
        * svg/animation/SMILTime.cpp:
        * testing/js/WebCoreTestSupport.cpp:
        * xml/XPathParser.cpp:

2018-08-21  Philippe Normand  <philn@igalia.com>

        [GStreamer] Warn early about incomplete MSE track switching support
        https://bugs.webkit.org/show_bug.cgi?id=188653

        Reviewed by Xabier Rodriguez-Calvar.

        The proper track switching support shall be fixed at some point by:
        https://bugs.webkit.org/show_bug.cgi?id=182531.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Remove redundant test.
        (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Exit early if
        this method is called by the MSE player.

2018-08-21  Philippe Normand  <philn@igalia.com>

        [GStreamer][MSE] Generic main thread notification support
        https://bugs.webkit.org/show_bug.cgi?id=188647

        Reviewed by Xabier Rodriguez-Calvar.

        Using GstBus for main thread notifications has the side effect of "leaking" the
        application messages to the media player, leading to CPU cycles wasting.

        No new tests, existing MSE tests cover this change.

        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
        (webkit_media_src_init):
        (webKitMediaSrcFinalize):
        (webKitMediaSrcSetMediaPlayerPrivate):
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:

2018-08-21  Philippe Normand  <philn@igalia.com>

        [GStreamer][MSE] Remove parsers from playback pipeline
        https://bugs.webkit.org/show_bug.cgi?id=188646

        Reviewed by Xabier Rodriguez-Calvar.

        Decodebin already includes parsers in front of the decoders.

        No new tests, existing MSE tests cover this change.

        * platform/graphics/gstreamer/mse/PlaybackPipeline.cpp:
        (WebCore::PlaybackPipeline::addSourceBuffer):
        (WebCore::PlaybackPipeline::attachTrack):
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp:
        (webKitMediaSrcLinkSourcePad):
        * platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamerPrivate.h:

2018-08-21  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234979.
        https://bugs.webkit.org/show_bug.cgi?id=188780

        broke ubuntu LTS build (Requested by philn on #webkit).

        Reverted changeset:

        "[GTK] Never return an uninitialized ImageGStreamer object."
        https://bugs.webkit.org/show_bug.cgi?id=188305
        https://trac.webkit.org/changeset/234979

2018-08-21  Saam barati  <sbarati@apple.com>

        JSRunLoopTimer may run part of a member function after it's destroyed
        https://bugs.webkit.org/show_bug.cgi?id=188426

        Reviewed by Mark Lam.

        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::ResourceUsageThread::platformThreadBody):
        * page/linux/ResourceUsageThreadLinux.cpp:
        (WebCore::ResourceUsageThread::platformThreadBody):

2018-08-20  Devin Rousso  <drousso@apple.com>

        Web Inspector: allow breakpoints to be set for specific event listeners
        https://bugs.webkit.org/show_bug.cgi?id=183138

        Reviewed by Joseph Pecoraro.

        Test: inspector/dom/breakpoint-for-event-listener.html

        * inspector/agents/InspectorDOMAgent.h:
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::getEventListenersForNode):
        (WebCore::InspectorDOMAgent::setEventListenerDisabled):
        (WebCore::InspectorDOMAgent::setBreakpointForEventListener): Added.
        (WebCore::InspectorDOMAgent::removeBreakpointForEventListener): Added.
        (WebCore::InspectorDOMAgent::buildObjectForEventListener):
        (WebCore::InspectorDOMAgent::willRemoveEventListener):
        (WebCore::InspectorDOMAgent::isEventListenerDisabled):
        (WebCore::InspectorDOMAgent::hasBreakpointForEventListener): Added.
        (WebCore::InspectorDOMAgent::idForEventListener): Added.
        Rework the event listener data structure to be based on ID instead of `EventListener`, since
        it is possible to have the same `EventListener` be used for multiple events.

        * inspector/agents/InspectorDOMDebuggerAgent.h:
        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::setEventListenerBreakpoint):
        (WebCore::InspectorDOMDebuggerAgent::setInstrumentationBreakpoint):
        (WebCore::InspectorDOMDebuggerAgent::removeEventListenerBreakpoint):
        (WebCore::InspectorDOMDebuggerAgent::removeInstrumentationBreakpoint):
        (WebCore::InspectorDOMDebuggerAgent::willHandleEvent): Added.
        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):
        For DOM events, also check to see if there is a matching event listener specific breakpoint
        set via the DOMAgent, and break on it if one is found.

        * inspector/InspectorInstrumentation.h:
        * inspector/InspectorInstrumentation.cpp:
        (WebCore::InspectorInstrumentation::didInstallTimerImpl):
        (WebCore::InspectorInstrumentation::didRemoveTimerImpl):
        (WebCore::InspectorInstrumentation::willHandleEventImpl):
        (WebCore::InspectorInstrumentation::willFireTimerImpl):
        (WebCore::InspectorInstrumentation::pauseOnNativeEventIfNeeded):
        (WebCore::InspectorInstrumentation::didRequestAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::didCancelAnimationFrameImpl):
        (WebCore::InspectorInstrumentation::willFireAnimationFrameImpl):
        Split off `pauseOnNativeEventIfNeeded` to only handle non-DOM events, since all DOM events
        would already only go through `willHandleEvent`.

2018-08-20  Michael Catanzaro  <mcatanzaro@igalia.com>

        [CMake] Sync unified build with Cocoa ports
        https://bugs.webkit.org/show_bug.cgi?id=188732

        Reviewed by Tim Horton.

        For iOS, disambiguate between ::WebEvent declared in PlatformKeyboardEvent.h and
        WebCore::WebEvent declared in WebEvent.h. It's expected that we'll have to deal with random
        issues like this when modifying unrelated source files in higher-level projects, since any
        change to the sources list changes which files get bundled together, and headers from
        lower-level projects that were not included before may now be included together.

        * platform/PlatformKeyboardEvent.h:
        (WebCore::PlatformKeyboardEvent::event const):

2018-08-20  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r223192): Remove invalid `path` for Modules/geolocation/ios folder

        * WebCore.xcodeproj/project.pbxproj: Remove invalid `path`
        setting for WebCore/Modules/geolocation/ios folder. This was
        found while working on a script for Bug 188754: Tool to fix
        folders that should map to directories in Xcode project files.

2018-08-20  David Kilzer  <ddkilzer@apple.com>

        REGRESSION (r235015): Xcode changes `mainGroup` name when updating WebCore project file

        * WebCore.xcodeproj/project.pbxproj:
        - Change `name` to "WebCore" within the group used by
          `mainGroup` so Xcode won't keep changing its value back to
          "WebKit".

2018-08-20  Jeremy Jones  <jeremyj@apple.com>

        UIWebView crashes while attempting to play youtube video on phone
        https://bugs.webkit.org/show_bug.cgi?id=188351
        rdar://problem/42489664

        Reviewed by David Kilzer.

        Test will be incorporated with fix for 188749, which will test both fixes.

        VideoFullscreenControllerContext must remove unretained reference to it from m_playbackModel during cleanup.

        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
        (VideoFullscreenControllerContext::didCleanupFullscreen):

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

        [MediaStream] Move capture device monitoring to WebKit
        https://bugs.webkit.org/show_bug.cgi?id=188521
        <rdar://problem/43251787>

        Reviewed by Youenn Fablet.

        No new tests, updated fast/mediastream/device-change-event-2.html for the changes.

        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::MediaDevices): Device change listener is added in addEventListener.
        (WebCore::MediaDevices::stop): Device change listener is on the user media controller.
        (WebCore::MediaDevices::addEventListener): Add the device change listener only once the first
        event handler is added.
        * Modules/mediastream/MediaDevices.h:

        * Modules/mediastream/UserMediaClient.h:
        * Modules/mediastream/UserMediaController.h:
        (WebCore::UserMediaController::addDeviceChangeObserver): Pass through to the client.
        (WebCore::UserMediaController::removeDeviceChangeObserver): Ditto.

        * platform/mediastream/CaptureDeviceManager.cpp:
        (CaptureDeviceManager::deviceChanged): Notify RealtimeMediaSourceCenter.
        (nextObserverToken): Deleted.
        (CaptureDeviceManager::addCaptureDeviceChangedObserver): Deleted.
        (CaptureDeviceManager::removeCaptureDeviceChangedObserver): Deleted.
        * platform/mediastream/CaptureDeviceManager.h:

        * platform/mediastream/RealtimeMediaSourceCenter.cpp:
        (WebCore::RealtimeMediaSourceCenter::setDevicesChangedObserver):
        (WebCore::RealtimeMediaSourceCenter::captureDevicesChanged):
        (WebCore::observerMap): Deleted.
        (WebCore::RealtimeMediaSourceCenter::addDevicesChangedObserver): Deleted.
        (WebCore::RealtimeMediaSourceCenter::removeDevicesChangedObserver): Deleted.
        * platform/mediastream/RealtimeMediaSourceCenter.h:

        * platform/mediastream/ios/AVAudioSessionCaptureDeviceManager.mm:
        (WebCore::AVAudioSessionCaptureDeviceManager::refreshAudioCaptureDevices): Call base class.

        * platform/mediastream/mac/AVCaptureDeviceManager.mm:
        (WebCore::AVCaptureDeviceManager::deviceConnected): Ditto.
        (WebCore::AVCaptureDeviceManager::deviceDisconnected): Ditto.

        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.cpp:
        (WebCore::deviceHasInputStreams): Drive-by fix, check the number of buffers to see if the
        device has input streams.
        (WebCore::CoreAudioCaptureDeviceManager::coreAudioCaptureDevices): Use new bool parameter
        added to refreshAudioCaptureDevices so we won't trigger a device change event on the first scan.
        (WebCore::CoreAudioCaptureDeviceManager::refreshAudioCaptureDevices): Add param.
        (WebCore::CoreAudioCaptureDeviceManager::devicesChanged): Use new param.
        * platform/mediastream/mac/CoreAudioCaptureDeviceManager.h:

        * platform/mock/MockRealtimeMediaSourceCenter.cpp:
        (WebCore::MockRealtimeMediaSourceCenter::setDevices): Don't need to call captureDevicesChanged,
        it is done in the UI process.
        (WebCore::MockRealtimeMediaSourceCenter::addDevice): Ditto.
        (WebCore::MockRealtimeMediaSourceCenter::removeDevice): Ditto.

        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::setPageIsFocusedAndActive): New, used by updated test.
        * testing/Internals.h:
        * testing/Internals.idl:

2018-08-20  Rob Buis  <rbuis@igalia.com>

        Throw an exception if window.open() gets passed a URL that cannot be parsed
        https://bugs.webkit.org/show_bug.cgi?id=171656

        Reviewed by Darin Adler.

        Throw a SyntaxError exception when an invalid url gets passed into window.open().

        Tests: imported/w3c/web-platform-tests/url/failure.html
               fast/dom/Window/open-invalid-url.html

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::createWindow):
        (WebCore::DOMWindow::open):
        (WebCore::DOMWindow::showModalDialog):
        * page/DOMWindow.h:
        * page/DOMWindow.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::openDummyInspectorFrontend):

2018-08-20  Ms2ger  <Ms2ger@igalia.com>

        [SOUP] Check length before calling soup_message_body_append_buffer.
        https://bugs.webkit.org/show_bug.cgi?id=176803

        Reviewed by Carlos Garcia Campos.

        The function has a precondition that the buffer is non-empty.

        Test: http/tests/local/blob/send-hybrid-blob-using-open-panel.html

        * platform/network/soup/ResourceRequestSoup.cpp:
        (WebCore::appendEncodedBlobItemToSoupMessageBody):
        (WebCore::ResourceRequest::updateSoupMessageBody const):

2018-08-20  Rob Buis  <rbuis@igalia.com>

        Relax Request constructor around referrers
        https://bugs.webkit.org/show_bug.cgi?id=168649

        Reviewed by Darin Adler.

        Implement remaining part of fetch change
        https://github.com/whatwg/fetch/pull/377, i.e.
        if "parsedReferrer’s origin is not same origin with origin",
        then set request’s referrer to "client", instead of
        throwing an exception [1].

        WebKit's new behavior matches that of Chrome and Firefox.

        Testing is covered by existing wpt tests.

        [1] Step 15.3.3 of https://fetch.spec.whatwg.org/#main-fetch

        * Modules/fetch/FetchRequest.cpp:
        (WebCore::computeReferrer):

2018-08-19  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Shrink size of WebCore::Event further by reordering members
        https://bugs.webkit.org/show_bug.cgi?id=188734

        Reviewed by Daniel Bates.

        Since WebCore::Event is ref-counted class, it has 4bytes m_refCount at the head of the class.
        So placing 4bytes just after that before placing 8bytes aligned member (like pointers in 64bit
        platforms) can save the size of WebCore::Event further.
        This patch reorders members of WebCore::Event to shrink the size from 80bytes to 72bytes.

        No behavior change.

        * dom/Event.cpp:
        (WebCore::Event::Event):
        * dom/Event.h:

2018-08-18  David Kilzer  <ddkilzer@apple.com>

        Let Xcode have its way with the WebCore project

        * WebCore.xcodeproj/project.pbxproj:
        - Let Xcode sort recently added resources by unique ID.
        - Manually change the `mainGroup` name from "WebKit" to
          "WebCore".  There's no need to do this other than to make the
          inside of the proverbial cabinet match the outside.  It's been
          this way since the project file was committed in r9857.

2018-08-18  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Fire an initial dummy notification
        https://bugs.webkit.org/show_bug.cgi?id=188670

        Reviewed by Simon Fraser.

        Add logic to track ongoing intersection observations. Create an IntersectionObserverRegistration
        and fire a single dummy notification for each one.

        Test: intersection-observer/root-element-moved.html
        Also tested by existing tests in imported/w3c/web-platform-tests/intersection-observer.

        * dom/Document.cpp:
        (WebCore::Document::~Document):
        (WebCore::Document::addIntersectionObserver):
        (WebCore::Document::removeIntersectionObserver):
        (WebCore::Document::updateIntersectionObservations):
        (WebCore::Document::notifyIntersectionObserversTimerFired):
        * dom/Document.h:
        (WebCore::Document::numberOfIntersectionObservers const):
        * dom/Element.cpp:
        (WebCore::Element::didMoveToNewDocument):
        (WebCore::Element::disconnectFromIntersectionObservers):
        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::create):
        (WebCore::IntersectionObserver::IntersectionObserver):
        (WebCore::IntersectionObserver::~IntersectionObserver):
        (WebCore::IntersectionObserver::observe):
        (WebCore::IntersectionObserver::unobserve):
        (WebCore::IntersectionObserver::disconnect):
        (WebCore::IntersectionObserver::takeRecords):
        (WebCore::IntersectionObserver::targetDestroyed):
        (WebCore::IntersectionObserver::removeTargetRegistration):
        (WebCore::IntersectionObserver::removeAllTargets):
        (WebCore::IntersectionObserver::rootDestroyed):
        (WebCore::IntersectionObserver::appendQueuedEntry):
        (WebCore::IntersectionObserver::notify):
        * page/IntersectionObserver.h:
        (WebCore::IntersectionObserver::trackingDocument):
        (WebCore::IntersectionObserver:: const):
        (WebCore::IntersectionObserver::hasObservationTargets const):
        * page/IntersectionObserver.idl:
        * testing/Internals.cpp:
        (WebCore::Internals::numberOfIntersectionObservers const):
        * testing/Internals.h:
        * testing/Internals.idl:

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

        [iOS] Paste is missing from callout bar when pasteboard only contains custom data
        https://bugs.webkit.org/show_bug.cgi?id=184271
        <rdar://problem/39256708>

        Reviewed by Ryosuke Niwa.

        Export a couple of WebCore functions for use in WebKit.

        * dom/Document.h:
        * platform/Pasteboard.h:

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

        Pack booleans in Event into a bitfield
        https://bugs.webkit.org/show_bug.cgi?id=188713

        Reviewed by Daniel Bates.

        Use bitfields for booleans in Event class.

        * dom/Event.cpp:
        (WebCore::Event::Event):
        * dom/Event.h:
        (WebCore::Event::IsComposed): Added.
        (WebCore::Event): Packed booleans into a bitfield.

2018-08-17  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][iOS] Display suggestions for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=188669

        Reviewed by Tim Horton.

        Expose suggestedColors() in HTMLInputElement in order to allow the UIProcess to
        access the list of suggested colors from a <datalist> element.

        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::suggestedColors const):
        * html/ColorInputType.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::suggestedColors const):
        * html/HTMLInputElement.h:
        * html/InputType.cpp:
        (WebCore::InputType::suggestedColors const):
        * html/InputType.h:
        * platform/ColorChooserClient.h:

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

        Clean up CSSSelectorList after r234825
        https://bugs.webkit.org/show_bug.cgi?id=188566

        Reviewed by Megan Gardner.

        This is responding to Darin's feedback in https://bugs.webkit.org/show_bug.cgi?id=188539

        * css/CSSSelectorList.cpp:
        (WebCore::CSSSelectorList::operator=): Deleted.
        * css/CSSSelectorList.h:
        (WebCore::CSSSelectorList::CSSSelectorList):
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::parsePageSelector):
        * css/parser/CSSSelectorParser.cpp:
        (WebCore::CSSSelectorParser::consumeComplexSelectorList):
        (WebCore::CSSSelectorParser::consumeCompoundSelectorList):

2018-08-17  Brent Fulgham  <bfulgham@apple.com>

        Remove Adobe SSO exception now that StorageAccess API is available
        https://bugs.webkit.org/show_bug.cgi?id=188710
        <rdar://problem/35056707>

        Reviewed by Alex Christensen.

        Remove custom quirk now that proper API exists to allow the same functions.

        * loader/ResourceLoadObserver.cpp:
        (WebCore::ResourceLoadObserver::logSubresourceLoading): Remove unneeded quirk.
        (WebCore::resourceNeedsSSOQuirk): Deleted.

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

        Replace canBubble and cancelable booleans in Event by enum classes
        https://bugs.webkit.org/show_bug.cgi?id=188692
        <rdar://problem/43411944>

        Rubber-stamped by Alex Christensen.

        Make these enum classes uint8_t.

        * dom/Event.h:

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

        Add some plumbing for safe browsing
        https://bugs.webkit.org/show_bug.cgi?id=188709

        Reviewed by Tim Horton.

        No change in behavior.  Just passing around unused booleans.
        We will need this for a way to load a page even though safe browsing says it's unsafe.

        * WebCore.xcodeproj/project.pbxproj:
        * loader/EmptyClients.cpp:
        (WebCore::EmptyFrameLoaderClient::dispatchDecidePolicyForNavigationAction):
        * loader/EmptyFrameLoaderClient.h:
        * loader/FrameLoadRequest.h:
        (WebCore::FrameLoadRequest::setShouldSkipSafeBrowsingCheck):
        (WebCore::FrameLoadRequest::shouldSkipSafeBrowsingCheck):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadArchive):
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::load):
        (WebCore::FrameLoader::loadWithNavigationAction):
        (WebCore::FrameLoader::loadWithDocumentLoader):
        (WebCore::FrameLoader::shouldReloadToHandleUnreachableURL):
        (WebCore::FrameLoader::reloadWithOverrideEncoding):
        (WebCore::FrameLoader::reload):
        (WebCore::FrameLoader::loadPostRequest):
        (WebCore::FrameLoader::continueLoadAfterNewWindowPolicy):
        (WebCore::FrameLoader::loadDifferentDocumentItem):
        * loader/FrameLoader.h:
        (WebCore::FrameLoader::loadWithDocumentLoader):
        (WebCore::FrameLoader::loadWithNavigationAction):
        * loader/FrameLoaderClient.h:
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * loader/PolicyChecker.h:
        * loader/ShouldSkipSafeBrowsingCheck.h: Added.

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

        Replace canBubble and cancelable booleans in Event by enum classes
        https://bugs.webkit.org/show_bug.cgi?id=188692

        Reviewed by Alex Christensen.

        Replaced booleans indicating whether an event can bubble and an event is cancelable
        by two enum classes: CanBubble and IsCancelable.

        No new tests since there should be no behavioral changes.

        * Modules/airplay/WebKitPlaybackTargetAvailabilityEvent.cpp:
        (WebCore::WebKitPlaybackTargetAvailabilityEvent::WebKitPlaybackTargetAvailabilityEvent):
        * Modules/applepay/ApplePayPaymentAuthorizedEvent.cpp:
        (WebCore::ApplePayPaymentAuthorizedEvent::ApplePayPaymentAuthorizedEvent):
        * Modules/applepay/ApplePayPaymentMethodSelectedEvent.cpp:
        (WebCore::ApplePayPaymentMethodSelectedEvent::ApplePayPaymentMethodSelectedEvent):
        * Modules/applepay/ApplePaySession.cpp:
        (WebCore::ApplePaySession::didCancelPaymentSession):
        * Modules/applepay/ApplePayShippingContactSelectedEvent.cpp:
        (WebCore::ApplePayShippingContactSelectedEvent::ApplePayShippingContactSelectedEvent):
        * Modules/applepay/ApplePayShippingMethodSelectedEvent.cpp:
        (WebCore::ApplePayShippingMethodSelectedEvent::ApplePayShippingMethodSelectedEvent):
        * Modules/applepay/ApplePayValidateMerchantEvent.cpp:
        (WebCore::ApplePayValidateMerchantEvent::ApplePayValidateMerchantEvent):
        * Modules/encryptedmedia/MediaKeySession.cpp:
        (WebCore::MediaKeySession::updateKeyStatuses):
        * Modules/encryptedmedia/legacy/WebKitMediaKeyMessageEvent.cpp:
        (WebCore::WebKitMediaKeyMessageEvent::WebKitMediaKeyMessageEvent):
        * Modules/encryptedmedia/legacy/WebKitMediaKeyNeededEvent.cpp:
        (WebCore::WebKitMediaKeyNeededEvent::WebKitMediaKeyNeededEvent):
        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::addKeyTimerFired):
        (WebCore::WebKitMediaKeySession::sendError):
        * Modules/gamepad/GamepadEvent.cpp:
        (WebCore::GamepadEvent::GamepadEvent):
        * Modules/indexeddb/IDBDatabase.cpp:
        (WebCore::IDBDatabase::connectionToServerLost):
        * Modules/indexeddb/IDBOpenDBRequest.cpp:
        (WebCore::IDBOpenDBRequest::onError):
        (WebCore::IDBOpenDBRequest::fireSuccessAfterVersionChangeCommit):
        (WebCore::IDBOpenDBRequest::fireErrorAfterVersionChangeCompletion):
        (WebCore::IDBOpenDBRequest::onSuccess):
        * Modules/indexeddb/IDBRequest.cpp:
        (WebCore::IDBRequest::onError):
        (WebCore::IDBRequest::onSuccess):
        * Modules/indexeddb/IDBRequestCompletionEvent.cpp:
        (WebCore::IDBRequestCompletionEvent::IDBRequestCompletionEvent):
        * Modules/indexeddb/IDBRequestCompletionEvent.h:
        (WebCore::IDBRequestCompletionEvent::create):
        * Modules/indexeddb/IDBTransaction.cpp:
        (WebCore::IDBTransaction::fireOnComplete):
        (WebCore::IDBTransaction::fireOnAbort):
        * Modules/indexeddb/IDBVersionChangeEvent.cpp:
        (WebCore::IDBVersionChangeEvent::IDBVersionChangeEvent):
        * Modules/mediasession/MediaSession.cpp:
        (WebCore::MediaSession::skipToNextTrack):
        (WebCore::MediaSession::skipToPreviousTrack):
        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::scheduleEvent):
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::scheduleEvent):
        * Modules/mediasource/SourceBufferList.cpp:
        (WebCore::SourceBufferList::scheduleEvent):
        * Modules/mediastream/MediaDevices.cpp:
        (WebCore::MediaDevices::scheduledEventTimerFired):
        * Modules/mediastream/MediaStream.cpp:
        (WebCore::MediaStream::internalAddTrack):
        (WebCore::MediaStream::internalRemoveTrack):
        * Modules/mediastream/MediaStreamEvent.cpp:
        (WebCore::MediaStreamEvent::create):
        (WebCore::MediaStreamEvent::MediaStreamEvent):
        * Modules/mediastream/MediaStreamEvent.h:
        * Modules/mediastream/MediaStreamTrack.cpp:
        (WebCore::MediaStreamTrack::trackEnded):
        (WebCore::MediaStreamTrack::trackMutedChanged):
        * Modules/mediastream/MediaStreamTrackEvent.cpp:
        (WebCore::MediaStreamTrackEvent::create):
        (WebCore::MediaStreamTrackEvent::MediaStreamTrackEvent):
        * Modules/mediastream/MediaStreamTrackEvent.h:
        * Modules/mediastream/OverconstrainedErrorEvent.h:
        (WebCore::OverconstrainedErrorEvent::create):
        (WebCore::OverconstrainedErrorEvent::OverconstrainedErrorEvent):
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::PeerConnectionBackend::fireICECandidateEvent):
        (WebCore::PeerConnectionBackend::doneGatheringCandidates):
        (WebCore::PeerConnectionBackend::updateSignalingState):
        * Modules/mediastream/RTCDTMFToneChangeEvent.cpp:
        (WebCore::RTCDTMFToneChangeEvent::RTCDTMFToneChangeEvent):
        * Modules/mediastream/RTCDataChannel.cpp:
        (WebCore::RTCDataChannel::didChangeReadyState):
        (WebCore::RTCDataChannel::didDetectError):
        (WebCore::RTCDataChannel::bufferedAmountIsDecreasing):
        * Modules/mediastream/RTCDataChannelEvent.cpp:
        (WebCore::RTCDataChannelEvent::create):
        (WebCore::RTCDataChannelEvent::RTCDataChannelEvent):
        * Modules/mediastream/RTCDataChannelEvent.h:
        * Modules/mediastream/RTCPeerConnection.cpp:
        (WebCore::RTCPeerConnection::updateIceGatheringState):
        (WebCore::RTCPeerConnection::updateIceConnectionState):
        (WebCore::RTCPeerConnection::updateConnectionState):
        (WebCore::RTCPeerConnection::scheduleNegotiationNeededEvent):
        * Modules/mediastream/RTCPeerConnectionIceEvent.cpp:
        (WebCore::RTCPeerConnectionIceEvent::create):
        (WebCore::RTCPeerConnectionIceEvent::RTCPeerConnectionIceEvent):
        * Modules/mediastream/RTCPeerConnectionIceEvent.h:
        * Modules/mediastream/RTCTrackEvent.cpp:
        (WebCore::RTCTrackEvent::create):
        (WebCore::RTCTrackEvent::RTCTrackEvent):
        * Modules/mediastream/RTCTrackEvent.h:
        * Modules/mediastream/libwebrtc/LibWebRTCMediaEndpoint.cpp:
        (WebCore::LibWebRTCMediaEndpoint::addRemoteStream):
        (WebCore::LibWebRTCMediaEndpoint::addRemoteTrack):
        (WebCore::LibWebRTCMediaEndpoint::addDataChannel):
        * Modules/notifications/Notification.cpp:
        (WebCore::Notification::dispatchShowEvent):
        (WebCore::Notification::dispatchClickEvent):
        (WebCore::Notification::dispatchCloseEvent):
        (WebCore::Notification::dispatchErrorEvent):
        * Modules/paymentrequest/MerchantValidationEvent.cpp:
        (WebCore::MerchantValidationEvent::MerchantValidationEvent):
        * Modules/paymentrequest/PaymentRequestUpdateEvent.cpp:
        (WebCore::PaymentRequestUpdateEvent::PaymentRequestUpdateEvent):
        * Modules/plugins/QuickTimePluginReplacement.mm:
        (WebCore::QuickTimePluginReplacement::postEvent):
        * Modules/speech/SpeechSynthesisEvent.cpp:
        (WebCore::SpeechSynthesisEvent::SpeechSynthesisEvent):
        * Modules/webaudio/AudioContext.cpp:
        (WebCore::AudioContext::setState):
        * Modules/webaudio/AudioProcessingEvent.cpp:
        (WebCore::AudioProcessingEvent::AudioProcessingEvent):
        * Modules/webaudio/AudioScheduledSourceNode.cpp:
        (WebCore::AudioScheduledSourceNode::finish):
        * Modules/webaudio/OfflineAudioCompletionEvent.cpp:
        (WebCore::OfflineAudioCompletionEvent::OfflineAudioCompletionEvent):
        * Modules/websockets/CloseEvent.h:
        (WebCore::CloseEvent::CloseEvent):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::WebSocket::didConnect):
        (WebCore::WebSocket::dispatchOrQueueErrorEvent):
        * Modules/webvr/VRDisplayEvent.cpp:
        (WebCore::VRDisplayEvent::VRDisplayEvent):
        * accessibility/AccessibilityObject.cpp:
        (WebCore::AccessibilityObject::dispatchAccessibilityEventWithType const):
        * accessibility/AccessibleSetValueEvent.cpp:
        (WebCore::AccessibleSetValueEvent::AccessibleSetValueEvent):
        * animation/AnimationPlaybackEvent.cpp:
        (WebCore::AnimationPlaybackEvent::AnimationPlaybackEvent):
        * dom/AbortSignal.cpp:
        (WebCore::AbortSignal::abort):
        * dom/AnimationEvent.cpp:
        (WebCore::AnimationEvent::AnimationEvent):
        * dom/BeforeLoadEvent.h:
        * dom/BeforeTextInsertedEvent.cpp:
        (WebCore::BeforeTextInsertedEvent::BeforeTextInsertedEvent):
        * dom/BeforeUnloadEvent.cpp:
        (WebCore::BeforeUnloadEvent::BeforeUnloadEvent):
        * dom/CharacterData.cpp:
        (WebCore::CharacterData::dispatchModifiedEvent):
        * dom/CompositionEvent.cpp:
        (WebCore::CompositionEvent::CompositionEvent):
        * dom/ContainerNode.cpp:
        (WebCore::dispatchChildInsertionEvents):
        (WebCore::dispatchChildRemovalEvents):
        * dom/DeviceMotionEvent.cpp:
        (WebCore::DeviceMotionEvent::DeviceMotionEvent):
        * dom/DeviceOrientationEvent.cpp:
        (WebCore::DeviceOrientationEvent::DeviceOrientationEvent):
        * dom/Document.cpp:
        (WebCore::Document::setReadyState):
        (WebCore::Document::visibilityStateChanged):
        (WebCore::Document::finishedParsing):
        (WebCore::Document::dispatchFullScreenChangeOrErrorEvent):
        (WebCore::Document::orientationChanged):
        * dom/DocumentEventQueue.cpp:
        (WebCore::DocumentEventQueue::enqueueOrDispatchScrollEvent):
        (WebCore::DocumentEventQueue::enqueueScrollEvent):
        (WebCore::DocumentEventQueue::enqueueResizeEvent):
        * dom/DocumentEventQueue.h:
        * dom/Element.cpp:
        (WebCore::Element::dispatchMouseEvent):
        (WebCore::Element::dispatchFocusInEvent):
        (WebCore::Element::dispatchFocusOutEvent):
        (WebCore::Element::dispatchFocusEvent):
        (WebCore::Element::dispatchBlurEvent):
        (WebCore::Element::dispatchWebKitImageReadyEventForTesting):
        * dom/ErrorEvent.cpp:
        (WebCore::ErrorEvent::ErrorEvent):
        * dom/Event.cpp:
        (WebCore::Event::Event):
        (WebCore::Event::create):
        * dom/Event.h:
        * dom/FocusEvent.cpp:
        (WebCore::FocusEvent::FocusEvent):
        * dom/FocusEvent.h:
        * dom/HashChangeEvent.h:
        * dom/InputEvent.cpp:
        (WebCore::InputEvent::create):
        (WebCore::InputEvent::InputEvent):
        * dom/InputEvent.h:
        * dom/KeyboardEvent.cpp:
        (WebCore::KeyboardEvent::KeyboardEvent):
        * dom/MessageEvent.cpp:
        (WebCore::MessageEvent::MessageEvent):
        * dom/MouseEvent.cpp:
        (WebCore::MouseEvent::create):
        (WebCore::MouseEvent::MouseEvent):
        * dom/MouseEvent.h:
        * dom/MouseRelatedEvent.cpp:
        (WebCore::MouseRelatedEvent::MouseRelatedEvent):
        * dom/MouseRelatedEvent.h:
        * dom/MutationEvent.cpp:
        (WebCore::MutationEvent::MutationEvent):
        * dom/MutationEvent.h:
        * dom/Node.cpp:
        (WebCore::Node::dispatchSubtreeModifiedEvent):
        (WebCore::Node::dispatchDOMActivateEvent):
        (WebCore::Node::dispatchInputEvent):
        * dom/OverflowEvent.cpp:
        (WebCore::OverflowEvent::OverflowEvent):
        * dom/PageTransitionEvent.cpp:
        (WebCore::PageTransitionEvent::PageTransitionEvent):
        * dom/PopStateEvent.cpp:
        (WebCore::PopStateEvent::PopStateEvent):
        * dom/ProgressEvent.cpp:
        (WebCore::ProgressEvent::ProgressEvent):
        * dom/ScriptElement.cpp:
        (WebCore::ScriptElement::dispatchErrorEvent):
        * dom/SecurityPolicyViolationEvent.h:
        * dom/SimulatedClick.cpp:
        * dom/TextEvent.cpp:
        (WebCore::TextEvent::TextEvent):
        * dom/TransitionEvent.cpp:
        (WebCore::TransitionEvent::TransitionEvent):
        * dom/UIEvent.cpp:
        (WebCore::UIEvent::UIEvent):
        * dom/UIEvent.h:
        (WebCore::UIEvent::create):
        * dom/UIEventWithKeyState.h:
        (WebCore::UIEventWithKeyState::UIEventWithKeyState):
        * dom/WebKitAnimationEvent.cpp:
        (WebCore::WebKitAnimationEvent::WebKitAnimationEvent):
        * dom/WebKitTransitionEvent.cpp:
        (WebCore::WebKitTransitionEvent::WebKitTransitionEvent):
        * dom/WheelEvent.cpp:
        (WebCore::WheelEvent::WheelEvent):
        * editing/Editor.cpp:
        (WebCore::dispatchBeforeInputEvent):
        (WebCore::dispatchBeforeInputEvents):
        (WebCore::Editor::willApplyEditing const):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
        (WebCore::FrameSelection::selectAll):
        (WebCore::FrameSelection::dispatchSelectStart):
        * html/HTMLDetailsElement.cpp:
        (WebCore::HTMLDetailsElement::dispatchPendingEvent):
        * html/HTMLFormControlElement.cpp:
        (WebCore::HTMLFormControlElement::dispatchChangeEvent):
        (WebCore::HTMLFormControlElement::checkValidity):
        * html/HTMLFormElement.cpp:
        (WebCore::HTMLFormElement::prepareForSubmission):
        (WebCore::HTMLFormElement::reset):
        * html/HTMLImageLoader.cpp:
        (WebCore::HTMLImageLoader::dispatchLoadEvent):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::onSearch):
        * html/HTMLLinkElement.cpp:
        (WebCore::HTMLLinkElement::dispatchPendingEvent):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::scheduleEvent):
        (WebCore::HTMLMediaElement::notifyAboutPlaying):
        (WebCore::HTMLMediaElement::updateActiveTextTrackCues):
        (WebCore::HTMLMediaElement::layoutSizeChanged):
        * html/HTMLPlugInImageElement.cpp:
        (WebCore::HTMLPlugInImageElement::checkSnapshotStatus):
        * html/HTMLScriptElement.cpp:
        (WebCore::HTMLScriptElement::dispatchLoadEvent):
        * html/HTMLSlotElement.cpp:
        (WebCore::HTMLSlotElement::dispatchSlotChangeEvent):
        * html/HTMLSourceElement.cpp:
        (WebCore::HTMLSourceElement::errorEventTimerFired):
        * html/HTMLStyleElement.cpp:
        (WebCore::HTMLStyleElement::dispatchPendingEvent):
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::selectionChanged):
        * html/HTMLTrackElement.cpp:
        (WebCore::HTMLTrackElement::didCompleteLoad):
        * html/MediaController.cpp:
        (WebCore::MediaController::scheduleEvent):
        * html/canvas/WebGLContextEvent.cpp:
        (WebCore::WebGLContextEvent::WebGLContextEvent):
        * html/canvas/WebGLContextEvent.h:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create):
        (WebCore::WebGLRenderingContextBase::dispatchContextLostEvent):
        (WebCore::WebGLRenderingContextBase::maybeRestoreContext):
        (WebCore::WebGLRenderingContextBase::dispatchContextChangedEvent):
        * html/parser/HTMLScriptRunner.cpp:
        (WebCore::createScriptLoadEvent):
        * html/track/TrackEvent.cpp:
        (WebCore::TrackEvent::TrackEvent):
        * html/track/TrackEvent.h:
        * html/track/TrackListBase.cpp:
        (WebCore::TrackListBase::scheduleTrackEvent):
        (WebCore::TrackListBase::scheduleChangeEvent):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::stopLoadingAfterXFrameOptionsOrContentSecurityPolicyDenied):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::dispatchUnloadEvents):
        * loader/ImageLoader.cpp:
        (WebCore::ImageLoader::dispatchPendingErrorEvent):
        * loader/PolicyChecker.cpp:
        (WebCore::PolicyChecker::checkNavigationPolicy):
        * loader/appcache/ApplicationCacheHost.cpp:
        (WebCore::createApplicationCacheEvent):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::dispatchAllPendingUnloadEvents):
        (WebCore::DOMWindow::languagesChanged):
        (WebCore::DOMWindow::dispatchLoadEvent):
        * page/EventHandler.cpp:
        (WebCore::dispatchSelectStart):
        (WebCore::EventHandler::dispatchDragEvent):
        * page/EventSource.cpp:
        (WebCore::EventSource::scheduleReconnect):
        (WebCore::EventSource::didReceiveResponse):
        (WebCore::EventSource::abortConnectionAttempt):
        * page/FocusController.cpp:
        (WebCore::dispatchEventsOnWindowAndFocusedElement):
        (WebCore::FocusController::setFocusedFrame):
        * page/FrameView.cpp:
        (WebCore::FrameView::sendResizeEventIfNeeded):
        * page/Page.cpp:
        (WebCore::networkStateChanged):
        * page/Performance.cpp:
        (WebCore::Performance::resourceTimingBufferFullTimerFired):
        * page/PointerLockController.cpp:
        (WebCore::PointerLockController::enqueueEvent):
        * page/VisualViewport.cpp:
        (WebCore::VisualViewport::enqueueResizeEvent):
        (WebCore::VisualViewport::enqueueScrollEvent):
        * storage/StorageEvent.cpp:
        (WebCore::StorageEvent::StorageEvent):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::sendSVGLoadEventIfPossible):
        * svg/SVGImageLoader.cpp:
        (WebCore::SVGImageLoader::dispatchLoadEvent):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::notifyFinished):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::dispatchPendingEvent):
        * workers/Worker.cpp:
        (WebCore::Worker::notifyFinished):
        * workers/WorkerMessagingProxy.cpp:
        (WebCore::WorkerMessagingProxy::notifyNetworkStateChange):
        * workers/service/ExtendableEvent.cpp:
        (WebCore::ExtendableEvent::ExtendableEvent):
        * workers/service/ExtendableEvent.h:
        * workers/service/ExtendableMessageEvent.cpp:
        (WebCore::ExtendableMessageEvent::ExtendableMessageEvent):
        * workers/service/ServiceWorker.cpp:
        (WebCore::ServiceWorker::scheduleTaskToUpdateState):
        * workers/service/ServiceWorkerContainer.cpp:
        (WebCore::ServiceWorkerContainer::scheduleTaskToFireControllerChangeEvent):
        * workers/service/ServiceWorkerRegistration.cpp:
        (WebCore::ServiceWorkerRegistration::scheduleTaskToFireUpdateFoundEvent):
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::ServiceWorkerThreadProxy::notifyNetworkStateChange):
        * xml/XMLHttpRequest.cpp:
        (WebCore::XMLHttpRequest::callReadyStateChangeListener):

2018-08-17  Yusuke Suzuki  <yusukesuzuki@slowstart.org> and Fujii Hironori  <Hironori.Fujii@sony.com>

        [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
        https://bugs.webkit.org/show_bug.cgi?id=188589

        Reviewed by Mark Lam.
        And reviewed by Yusuke Suzuki for Hironori's change.

        * cssjit/FunctionCall.h:
        (WebCore::FunctionCall::FunctionCall):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):
        * html/HTMLKeygenElement.cpp:
        Remove `using namespace WebCore` not to introduce `operator+/-` which makes the resolution of `operator+/-` for RegisterID ambiguous.

2018-08-17  Philippe Normand  <philn@igalia.com>

        [GStreamer] reduce position queries frequency
        https://bugs.webkit.org/show_bug.cgi?id=188645

        Reviewed by Xabier Rodriguez-Calvar.

        There is no need to perform dozens of position queries per second.
        One every 300ms is enough.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::MediaPlayerPrivateGStreamer):
        (WebCore::MediaPlayerPrivateGStreamer::playbackPosition const):
        (WebCore::MediaPlayerPrivateGStreamer::asyncStateChangeDone):
        (WebCore::MediaPlayerPrivateGStreamer::updateStates):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h:

2018-08-17  Michael Catanzaro  <mcatanzaro@igalia.com>

        [SOUP] Handle OAuth authentication after r234912
        https://bugs.webkit.org/show_bug.cgi?id=188651

        Reviewed by Carlos Garcia Campos.

        Update this switch to consider the new OAuth enum value added in r234912. I suppose OAuth is
        used for HTTP Auth now. It will be a one-time compatibility break as passwords previously
        stored with type "Unknown" will no longer be accessible.

        * platform/network/soup/NetworkStorageSessionSoup.cpp:
        (WebCore::authTypeFromProtectionSpaceAuthenticationScheme):

2018-08-17  Ms2ger  <Ms2ger@igalia.com>

        [GTK] Never return an uninitialized ImageGStreamer object.
        https://bugs.webkit.org/show_bug.cgi?id=188305

        Reviewed by Philippe Normand.

        The single caller was already checking for a null return value, so
        make that check actually do something. Also remove the null-check on
        the return value of image(), which asserted that it would never return
        null.

        Test: fast/canvas/canvas-createPattern-video-loading.html

        * platform/graphics/gstreamer/ImageGStreamer.h:
        (WebCore::ImageGStreamer::createImage): Return null if m_image wasn't created.
        (WebCore::ImageGStreamer::image): Return a reference.
        (WebCore::ImageGStreamer::rect): Always assert that m_image is present.
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::paint): Update for new signature.

2018-08-17  Philippe Normand  <philn@igalia.com>

        [GStreamer] Enable fpsdisplaysink only when MEDIA_STATISTICS is enabled
        https://bugs.webkit.org/show_bug.cgi?id=188648

        Reviewed by Xabier Rodriguez-Calvar.

        The fpsdisplaysink is useful only when MEDIA_STATISTICS is turned on.
        The text overlay is now enabled when GST_DEBUG tracing is enabled for the player.

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::createVideoSink):

2018-08-17  Philippe Normand  <philn@igalia.com>

        [GStreamer][MSE] Disable last-sample support in AppendPipeline
        https://bugs.webkit.org/show_bug.cgi?id=188649

        Reviewed by Xabier Rodriguez-Calvar.

        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::AppendPipeline): This property isn't
        used by the append pipeline. So as a micro-optimization, it is now
        disabled.

2018-08-16  Devin Rousso  <drousso@apple.com>

        Web Inspector: support breakpoints for arbitrary event names
        https://bugs.webkit.org/show_bug.cgi?id=183118

        Reviewed by Joseph Pecoraro.

        Tests: inspector/dom-debugger/event-breakpoints.html
               inspector/dom-debugger/event-breakpoints-with-navigation.html

        * inspector/agents/InspectorDOMDebuggerAgent.cpp:
        (WebCore::InspectorDOMDebuggerAgent::pauseOnNativeEventIfNeeded):

2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Bug fix on deleting cookies when Max-Age is set to zero.
        https://bugs.webkit.org/show_bug.cgi?id=188617

        Reviewed by Alex Christensen.

        Delete cookie if Max-Age is set to zero in Set-Cookie. Original implementation was
        compared using "less than", but it must be "less than or equal" to zero.

        Tests: http/tests/websocket/tests/hybi/websocket-cookie-overwrite-behavior.html

        * platform/network/curl/CookieJarDB.cpp:
        (WebCore::CookieJarDB::setCookie):

2018-08-16  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Implement deleteAllCookies()
        https://bugs.webkit.org/show_bug.cgi?id=188612

        Reviewed by Alex Christensen.

        deleteAllCookies() was not implemented. Connect the interface to the implementation.

        Tests: http/tests/cookies/simple-cookies-expired.html
               http/tests/cookies/simple-cookies-max-age.html

        * platform/network/curl/CookieJarCurlDatabase.cpp:
        (WebCore::CookieJarCurlDatabase::deleteAllCookies const):

2018-08-16  Ross Kirsling  <ross.kirsling@sony.com>

        REGRESSION(r234930): Don't embed a #if in an ASSERT
        https://bugs.webkit.org/show_bug.cgi?id=188680

        Reviewed by Tim Horton.

        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleDrag):
        Simplify the ASSERT -- it seems we just want to know that DragSourceActionSelection and exactly one other DragSourceAction is set. 

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

        Remove unused allowScriptsToCloseWindows setting
        https://bugs.webkit.org/show_bug.cgi?id=188602

        Reviewed by Simon Fraser.

        No change in behaviour. It was always false.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::close):
        * page/Settings.yaml:

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

        Custom element constructor doesn't use HTMLElement in new.target's realm
        https://bugs.webkit.org/show_bug.cgi?id=188634

        Reviewed by Keith Miller.

        Fixed the bug that HTMLElement's constructor was constructing an element of its own realm
        instead of the realm of new.target. This results in the JS wrapper created for the element
        belonging to the global object of the HTMLElement constructor which was invoked instead of
        the global object of new.target as specified in:
        https://html.spec.whatwg.org/multipage/dom.html#html-element-constructors

        In particular, step 9.2. specifies that we "perform element.[[SetPrototypeOf]](prototype)."
        where prototype is the result of Get(NewTarget, "prototype") in step 7.

        WebKit's new behavior matches that of Chrome and Firefox.

        Test: imported/w3c/web-platform-tests/custom-elements/htmlconstructor/newtarget.html

        * bindings/js/JSHTMLElementCustom.cpp:
        (WebCore::constructJSHTMLElement): 

2018-08-16  Aditya Keerthi  <akeerthi@apple.com>

        Unreviewed, fix the watchOS build after r188464.

        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::setColor):

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

        Custom element doesn't invalidate its style when :defined rule starts to apply
        https://bugs.webkit.org/show_bug.cgi?id=188637

        Reviewed by Antti Koivisto.

        Fixed the bug by invalidating the subtree when a custom element gets defined.

        Test: fast/custom-elements/defined-update-style.html

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

2018-08-16  Youenn Fablet  <youenn@apple.com>

        Change the input camera in the sources & outputs example on Safari (11) with M.Way camera
        https://bugs.webkit.org/show_bug.cgi?id=187756
        <rdar://problem/42332178>

        Reviewed by Eric Carlson.

        Covered by manual testing.

        640x480x30fps is added as ideal constraints to getUserMedia if none other is added to provide consistent behavior.
        Some cameras do not support 30fps as they have discrete frame rate ranges.
        Before the patch, we were rejecting getUserMedia promise if the 'ideal' frameRate was not supported.
        After the patch, we do not check whether frame rate is supported if it is not mandatory.
        At capture time, we will still try to apply frame rate change and if not supported, the frame rate will not be set to 30 fps.

        While we could surface discrete width/height/frame rate ranges, it seems best to fix the issue this way.
        In the future, we might implement video interpolation for width/height/framerate at WebCore level.

        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::supportsSizeAndFrameRate):
        (WebCore::RealtimeMediaSource::supportsConstraint const):
        (WebCore::RealtimeMediaSource::supportsConstraints):

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

        Perform a microtask checkpoint before creating a custom element
        https://bugs.webkit.org/show_bug.cgi?id=188189
        <rdar://problem/42843022>

        Reviewed by Geoffrey Garen.

        Fixed the bug that the HTML parser was not performing a microtask checkpoint prior to synchronously constructing
        a custom element in the concept to create an element for a token:
        https://html.spec.whatwg.org/multipage/parsing.html#creating-and-inserting-nodes:perform-a-microtask-checkpoint

        Also added a microtask checkpoint before dispatching DOMContentLoaded to work around webkit.org/b/82931 since
        scheduling a task to fire a DOMContentLoaded event in Document::finishedParsing as the HTML5 spec mandates
        is a long standing bug with a lot of implications, which is completely outside the scope of this bug fix:
        https://html.spec.whatwg.org/multipage/parsing.html#stop-parsing

        Test: fast/custom-elements/perform-microtask-checkpoint-before-construction.html

        * dom/Document.cpp:
        (WebCore::Document::finishedParsing): Perform a microtask checkpoint before dispatching DOMContentLoaded here as
        a workaround for webkit.org/b/82931.
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Perform a microtask checkpoint here to fix the bug.

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

        Re-introduce assertion removed in r234890
        https://bugs.webkit.org/show_bug.cgi?id=188611

        Reviewed by Geoffrey Garen.

        The assertion was failing because Vector<String>::operator== was using memcmp,
        which failed to consider different instances of equal Strings equal.  Added an
        API test and this assertion, which now succeeds.

        * contentextensions/ContentExtensionCompiler.cpp:
        (WebCore::ContentExtensions::compileRuleList):

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

        Add Experimental Feature support for SourceBuffer.changeType()
        https://bugs.webkit.org/show_bug.cgi?id=188626

        Reviewed by Eric Carlson.

        Tests: imported/w3c/web-platform-tests/media-source/mediasource-changetype-play.html
               imported/w3c/web-platform-tests/media-source/mediasource-changetype.html

        The WICG is incubating a new proposal to allow clients to switch between streams
        with different codecs within the same SourceBuffer. The proposal is being tracked
        by <https://github.com/w3c/media-source/issues/155> and the proposed spec change
        is available at <https://rawgit.com/wicg/media-source/codec-switching/index.html>.

        Drive-by fix: One of the wpt tests uses a .mp3 file to test SourceBuffer switching.
        The AVStreamDataParser does not necessarily emit every frame appended, and after a
        new init segment is appended, it's possible that frames from the previous media
        segment will be emitted. This causes an error condition to occur, due to an added
        check in the spec for a new flag. When the SourceBuffer asks its private implementation
        to reset the parser state, since there's no API on AVStreamDataParser to actually
        reset the parser state, just set a flag to drop all emitted buffers until the next
        initialization segment is parsed.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::contentTypeShouldGenerateTimestamps):
        (WebCore::MediaSource::setDurationInternal):
        (WebCore::MediaSource::addSourceBuffer):
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::changeType):
        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
        (WebCore::SourceBuffer::validateInitializationSegment):
        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveSample):
        * Modules/mediasource/SourceBuffer.h:
        * Modules/mediasource/SourceBuffer.idl:
        * page/Settings.yaml:
        * platform/graphics/SourceBufferPrivate.h:
        (WebCore::SourceBufferPrivate::canSwitchToType):
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.h:
        * platform/graphics/avfoundation/objc/SourceBufferPrivateAVFObjC.mm:
        (WebCore::SourceBufferPrivateAVFObjC::didParseStreamDataAsAsset):
        (WebCore::SourceBufferPrivateAVFObjC::processCodedFrame):
        (WebCore::SourceBufferPrivateAVFObjC::resetParserState):
        (WebCore::SourceBufferPrivateAVFObjC::canSwitchToType):

2018-08-16  Christopher Reid  <chris.reid@sony.com>

        [Curl] Not all Cookie database files are deleted on corruption
        https://bugs.webkit.org/show_bug.cgi?id=185873

        Reviewed by Fujii Hironori.

        No new tests.

        Delete the cookie database file and the corruption flag file when corruption is detected.
        Adding a quick integrity check in case it can catch anything when opening the database.
        Removing PRAGMA temp_store = MEMORY and PRAGMA journal_mode = WAL as they are set in SQLiteDatabase::open.

        * platform/network/curl/CookieJarDB.cpp:

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

        [Nicosia] Add Nicosia::ImageBackingTextureMapperImpl
        https://bugs.webkit.org/show_bug.cgi?id=188550

        Reviewed by Carlos Garcia Campos.

        Add the Nicosia::ImageBackingTextureMapperImpl class, the
        TextureMapper-specific implementation that will extend the ImageBacking
        class.

        This class will be used to contain and manage updates for layers that
        are backed by image objects. The CoordinatedGraphicsLayer instance will
        use the LayerState object to track the currently-presented image objects
        and to store the latest update of these objects. The Update struct
        contains information about the current visibility of the image in the
        layer tree as well as the Nicosia::Buffer object containing the painted
        image data that's to be presented on the screen.

        During the layer flush the flushUpdate() method will move the current
        update data into the pending position, from which this data will be
        gathered by the composition component through the takeUpdate() method
        and used to update the CoordinatedBackingStore object that's kept in
        the CompositionState object on this impl class.

        This will be deployed for use in the CoordinatedGraphicsLayer at a later
        stage as it requires a larger rework in both CoordinatedGraphicsLayer as
        well as the CoordinatedGraphicsScene classes.

        The implementation itself differs from the current image backing support
        in CoordinatedGraphicsLayer and CompositingCoordinator by abandoning the
        idea of sharing single image backings between layers that might be
        backed by identical Image objects. We thus end up trading any memory
        consumption benefit in these scenarios for a much simplified
        implementation. Overall this area needs more research both in figuring
        out whether there's worthy improvements in grouping image backings, as
        well as investigating whether it's possible to avoid additional image
        rasterization by just leveraging direct pixel data via the
        NativeImagePtr object.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.cpp: Added.
        (Nicosia::ImageBackingTextureMapperImpl::createFactory):
        (Nicosia::ImageBackingTextureMapperImpl::flushUpdate):
        (Nicosia::ImageBackingTextureMapperImpl::takeUpdate):
        * platform/graphics/nicosia/texmap/NicosiaImageBackingTextureMapperImpl.h: Added.

2018-08-16  Aditya Keerthi  <akeerthi@apple.com>

        Support drag-and-drop for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=188464

        Reviewed by Wenson Hsieh.

        input[type=color] should support native drag and drop on both macOS and iOS.

        Added methods to Pasteboard and PlatformPasteboard to enable colors to be read
        from and written to the pasteboard. On macOS, colors are managed through the
        NSColorPboardType, whereas on iOS, colors are managed through the
        'com.apple.uikit.color' identifier.

        DragSourceActionColor was added to the list of DragSourceActions to identify
        when a color input is being dragged.

        Tests: editing/pasteboard/drag-and-drop-color-input-events.html
               editing/pasteboard/drag-and-drop-color-input.html

        * page/DragActions.h:
        * page/DragController.cpp:
        (WebCore::DragController::dragEnteredOrUpdated):
        (WebCore::isEnabledColorInput):
        (WebCore::DragController::concludeEditDrag):
        (WebCore::DragController::canProcessDrag):
        (WebCore::DragController::draggableElement const):
        (WebCore::DragController::startDrag):
        * page/EventHandler.cpp:
        (WebCore::EventHandler::dragHysteresisExceeded const):
        (WebCore::EventHandler::handleDrag):
        * page/EventHandler.h:
        * page/mac/DragControllerMac.mm:
        (WebCore::DragController::updateSupportedTypeIdentifiersForDragHandlingMethod const):
        * platform/DragData.h:
        * platform/DragImage.cpp:
        (WebCore::DragImage::operator=):
        * platform/DragImage.h: Added the visiblePath property to DragImage, in order for
        us to be able to clip images in the UITargetedDragPreview on iOS.
        * platform/DragItem.h:
        (WebCore::DragItem::encode const):
        (WebCore::DragItem::decode):
        * platform/Pasteboard.h:
        * platform/PasteboardStrategy.h:
        * platform/PlatformPasteboard.h:
        * platform/gtk/DragImageGtk.cpp:
        (WebCore::createDragImageForColor):
        * platform/gtk/PasteboardGtk.cpp:
        (WebCore::Pasteboard::write):
        * platform/ios/DragImageIOS.mm:
        (WebCore::createDragImageForColor):
        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::write):
        * platform/ios/PlatformPasteboardIOS.mm:
        (WebCore::PlatformPasteboard::color):
        (WebCore::PlatformPasteboard::setColor):
        * platform/mac/DragDataMac.mm:
        (WebCore::colorPasteboardType):
        (WebCore::DragData::containsCompatibleContent const):
        * platform/mac/DragImageMac.mm:
        (WebCore::createDragImageForColor): Draw a rounded rectangle with a fill color
        matching the value of the dragged color input. The rendered image is designed to
        mimic the preview shown when dragging an NSColorWell.
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::write):
        * platform/mac/PlatformPasteboardMac.mm:
        (WebCore::PlatformPasteboard::setColor):
        * platform/win/PasteboardWin.cpp:
        (WebCore::Pasteboard::write):
        * platform/wpe/PasteboardWPE.cpp:
        (WebCore::Pasteboard::write):

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

        [lFC][Floating] Add estimated margin top computation.
        https://bugs.webkit.org/show_bug.cgi?id=188619

        Reviewed by Antti Koivisto.

        In order to figure out whether a box should avoid a float, we need to know the final positions of both (ignore relative positioning for now).
        In block formatting context the final position for a normal flow box includes
        1. the static position and
        2. the corresponding (non)collapsed margins.
        Now the vertical margins are computed when all the descendants are finalized, because the margin values might be depending on the height of the box
        (and the height might be based on the content).
        So when we get to the point where we intersect the box with the float to decide if the box needs to move, we don't yet have the final vertical position.

        The idea here is that as long as we don't cross the block formatting context boundary, we should be able to pre-compute the final top margin.
        (if this holds true for all the cases, the estimated prefix could be removed and just use marginTop() instead.)

        Covered by existing block-only tests.

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTop const):
        (WebCore::Layout::BlockFormattingContext::computeEstimatedMarginTopForAncestors const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForFloatClear const):
        (WebCore::Layout::BlockFormattingContext::computeInFlowHeightAndMargin const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::estimatedMarginTop):
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::Box):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::setHasValidTop):
        (WebCore::Display::Box::setHasValidLeft):
        (WebCore::Display::Box::top const):
        (WebCore::Display::Box::left const):
        (WebCore::Display::Box::topLeft const):
        (WebCore::Display::Box::setTopLeft):
        (WebCore::Display::Box::setTop):
        (WebCore::Display::Box::setLeft):
        (WebCore::Display::Box::setVerticalMargin):
        (WebCore::Display::Box::setEstimatedMarginTop):
        (WebCore::Display::Box::estimatedMarginTop const):

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

        [LFC][BFC] Display::Box interface should reflect that padding is optional.
        https://bugs.webkit.org/show_bug.cgi?id=188630

        Reviewed by Antti Koivisto.

        Certain type of boxes can't have paddings (see Layout::Box::isPaddingApplicable).

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::computeBorderAndPadding const):
        (WebCore::Layout::FormattingContext::validateGeometryConstraintsAfterLayout const):
        * layout/FormattingContextGeometry.cpp:
        (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::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::width const):
        (WebCore::Display::Box::height const):
        (WebCore::Display::Box::contentBoxTop const):
        (WebCore::Display::Box::contentBoxLeft const):
        (WebCore::Display::Box::setPadding):
        (WebCore::Display::Box::paddingTop const):
        (WebCore::Display::Box::paddingLeft const):
        (WebCore::Display::Box::paddingBottom const):
        (WebCore::Display::Box::paddingRight const):

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

        [LFC] Add showLayoutTree() that does not require LayoutContext.
        https://bugs.webkit.org/show_bug.cgi?id=188631

        Reviewed by Antti Koivisto.

        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::formattingContextRoot const):
        (WebCore::Layout::Box::initialContainingBlock const):
        * layout/layouttree/LayoutBox.h:
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::outputLayoutTree):
        (WebCore::Layout::showLayoutTree):
        (WebCore::Layout::TreeBuilder::showLayoutTree): Deleted.
        * layout/layouttree/LayoutTreeBuilder.h:

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

        [LFC] Tree builder should construct block and inline containers based on the display type.
        https://bugs.webkit.org/show_bug.cgi?id=188632

        Reviewed by Antti Koivisto.

        Inline elements can also construct RenderBlock renderers (inline-bloc etc), so use the display type instead when deciding what type of container to construct.   

        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::TreeBuilder::createSubTree):

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

        [LFC] Bail out of subtree verification when trees are out of sync.
        https://bugs.webkit.org/show_bug.cgi?id=188633

        Reviewed by Antti Koivisto.

        There's no point of trying to match geometry when subtrees are out of sync.
        They get out of sync when the render tree has unsupported boxes (see LayoutTreeBuilder).

        * layout/Verification.cpp:
        (WebCore::Layout::verifyAndOutputSubtree):

2018-08-16  Antti Koivisto  <antti@apple.com>

        Use OptionSet for ActivityState::Flags
        https://bugs.webkit.org/show_bug.cgi?id=188554

        Reviewed by Brent Fulgham.

        More typesafe flags.

        * Modules/geolocation/GeolocationController.cpp:
        (WebCore::GeolocationController::activityStateDidChange):
        * Modules/geolocation/GeolocationController.h:
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::activityStateDidChange):
        * html/canvas/WebGLRenderingContextBase.h:
        * page/ActivityState.cpp:
        (WebCore::operator<<):
        (WebCore::activityStateFlagsToString): Deleted.
        * page/ActivityState.h:
        (WebCore::ActivityState::allFlags):
        * page/ActivityStateChangeObserver.h:
        * page/FocusController.cpp:
        (WebCore::FocusController::FocusController):
        (WebCore::FocusController::setFocused):
        (WebCore::FocusController::setActivityState):
        (WebCore::FocusController::setActive):
        * page/FocusController.h:
        (WebCore::FocusController::isActive const):
        (WebCore::FocusController::isFocused const):
        (WebCore::FocusController::contentIsVisible const):
        * page/Page.cpp:
        (WebCore::pageInitialActivityState):
        (WebCore::Page::Page):
        (WebCore::Page::setIsInWindow):
        (WebCore::Page::updateTimerThrottlingState):
        (WebCore::Page::setActivityState):
        (WebCore::Page::isVisibleAndActive const):
        (WebCore::Page::isWindowActive const):
        (WebCore::Page::setIsVisible):
        * page/Page.h:
        (WebCore::Page::activityState const):
        (WebCore::Page::isVisible const):
        (WebCore::Page::isInWindow const):
        * page/PerformanceMonitor.cpp:
        (WebCore::activityStateForCPUSampling):
        (WebCore::PerformanceMonitor::activityStateChanged):
        * page/PerformanceMonitor.h:
        * platform/text/cocoa: Added.

2018-08-15  Ansh Shukla  <ansh_shukla@apple.com>

        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
        https://bugs.webkit.org/show_bug.cgi?id=186870
        <rdar://problem/41314410>

        Reviewed by Alex Christensen.

        Add the ProtectionSpaceAuthenticationSchemeOAuth type.

        * platform/network/ProtectionSpaceBase.cpp:
        (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
        expects a token in return.
        * platform/network/ProtectionSpaceBase.h:
        * platform/network/cocoa/ProtectionSpaceCocoa.mm:
        (WebCore::scheme):
        (WebCore::ProtectionSpace::nsSpace const):

2018-08-15  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        Added functionality to FileHandle so that it can lock a file while open.
        Added a function to FileSystem to delete non empty directories.

        * platform/FileHandle.cpp:
        (WebCore::FileHandle::FileHandle):
        (WebCore::FileHandle::open):
        (WebCore::FileHandle::close):
        * platform/FileHandle.h:
        * platform/FileSystem.h:
        * platform/cocoa/FileSystemCocoa.mm:
        (WebCore::FileSystem::deleteNonEmptyDirectory):

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-08-15  Christopher Reid  <chris.reid@sony.com>

        [Curl] Implement default cookie path handling correctly as outlined in RFC6265.
        https://bugs.webkit.org/show_bug.cgi?id=188609

        Reviewed by Alex Christensen.

        Curl implementation of default cookie path was wrong so that some cookies cannot be accessible.
        It should be generated as outlined in: https://tools.ietf.org/html/rfc6265#section-5.1.4

        Tests: http/tests/cookies/http-get-cookie-set-in-js.html

        * platform/network/curl/CookieJarDB.cpp:
        (WebCore::CookieJarDB::setCookie):
        * platform/network/curl/CookieUtil.cpp:
        (WebCore::CookieUtil::defaultPathForURL):
        * platform/network/curl/CookieUtil.h:

2018-08-15  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist] Add button to TextFieldInputs with a datalist
        https://bugs.webkit.org/show_bug.cgi?id=187741

        Reviewed by Tim Horton.

        TextFieldInputs that have an associated datalist element should be drawn as
        combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
        is not height-resizable. Furthermore, the input should also be able to contain
        additional elements, such as the stepper for type=number and the cancel button
        for type=search. For these reasons, we draw a button at the end of the input,
        mimicking appearance of a combo box.

        The list-button -webkit-appearance value was added to display the new button.

        Tests: fast/forms/datalist/datalist-searchinput-appearance.html
               fast/forms/datalist/datalist-textinput-appearance.html

        * Resources/ListButtonArrow.png: Added.
        * Resources/ListButtonArrow@2x.png: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        * css/CSSProperties.json:
        * css/CSSValueKeywords.in:
        * css/html.css:
        (input::-webkit-list-button):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::dataListButtonElement const):
        * html/HTMLInputElement.h:
        * html/InputType.h:
        (WebCore::InputType::dataListButtonElement const):
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::needsContainer const):
        (WebCore::TextFieldInputType::createShadowSubtree):
        (WebCore::TextFieldInputType::destroyShadowSubtree):
        (WebCore::TextFieldInputType::listAttributeTargetChanged):
        (WebCore::TextFieldInputType::dataListButtonElement const):
        (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
        (WebCore::TextFieldInputType::didCloseSuggestions):
        * html/TextFieldInputType.h:
        * html/shadow/DataListButtonElement.cpp: Added.
        (WebCore::DataListButtonElement::create):
        (WebCore::DataListButtonElement::DataListButtonElement):
        (WebCore::DataListButtonElement::~DataListButtonElement):
        (WebCore::DataListButtonElement::defaultEventHandler):
        * html/shadow/DataListButtonElement.h: Added.
        * platform/ThemeTypes.h:
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        (WebCore::RenderTheme::adjustListButtonStyle const):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (-[WebListButtonCell drawWithFrame:inView:]):
        (WebCore::RenderThemeMac::paintListButtonForInput):
        (WebCore::RenderThemeMac::adjustListButtonStyle const):
        (WebCore::RenderThemeMac::paintTextField):
        (WebCore::RenderThemeMac::paintSearchField):
        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
        (WebCore::RenderThemeMac::listButton const):

2018-08-15  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234870.

        The test introduced with this change is a flaky failure.

        Reverted changeset:

        "NSURLAuthenticationMethodOAuth challenges are surfaced to
        clients in -didReceiveAuthenticationChallenge as
        NSURLAuthenticationMethodDefault"
        https://bugs.webkit.org/show_bug.cgi?id=186870
        https://trac.webkit.org/changeset/234870

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

        connectedCallback is invoked by the HTML parser after child nodes had been inserted
        https://bugs.webkit.org/show_bug.cgi?id=183931
        <rdar://problem/38843548>

        Reviewed by Alex Christensen.

        Invoke the custom element reactions after constructing and inserting a custom element as specifed in step 3.3 of:
        https://html.spec.whatwg.org/multipage/parsing.html#insert-a-foreign-element

        The bug here was that HTMLConstructionSite::insertCustomElement uses attachLater so that even though the task
        to insert the custom element was created, it didn't get executed until after CustomElementReactionStack in
        HTMLDocumentParser::runScriptsForPausedTreeBuilder had been popped off of the stack.

        Test: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html

        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::HTMLConstructionSite::insertCustomElement): Fixed the bug by manually executing the scheduled tasks.
        This will enqueue any custom element reactions while CustomElementReactionStack in runScriptsForPausedTreeBuilder
        is still in the stack.

2018-08-15  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Don't send Content-Type header for POST request when body is null.
        https://bugs.webkit.org/show_bug.cgi?id=188588

        Reviewed by Youenn Fablet.

        The Content-Type header was sent by libcurl automatically. Suppress that behavior
        when body is null.

        Tests: http/tests/xmlhttprequest/methods.html

        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupPOST):

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-08-15  Wenson Hsieh  <wenson_hsieh@apple.com>

        [Attachment SPI] Remove attachment display mode options
        https://bugs.webkit.org/show_bug.cgi?id=188596

        Reviewed by Dan Bernstein.

        Remove the ability to specify an "in-place" or "icon" representation for attachment elements, as well as logic
        needed to allow an attachment element to render image or video elements in a shadow root. The requirements that
        initially drove this effort are obviated by r227068, which allows Mail to intercept and provide a custom scheme
        for images inserted into the document via rich editing operations.

        Removed some existing API tests in _WKAttachmentTests that exercised this functionality.

        * editing/Editor.cpp:
        (WebCore::Editor::insertAttachmentFromFile):
        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::createFragmentForImageAttachment):
        (WebCore::replaceRichContentWithAttachments):
        * html/AttachmentTypes.h:
        (WebCore::AttachmentDisplayOptions::encode const):
        (WebCore::AttachmentDisplayOptions::decode):

        Remove logic for encoding the attachment display mode. While this leaves AttachmentDisplayOptions completely
        empty, I haven't removed AttachmentDisplayOptions as well in this patch, since it's not clear that we won't be
        needing any mechanism for influencing the display of attachment elements inserted via native SPI.

        (): Deleted.
        * html/HTMLAttachmentElement.cpp:
        (WebCore::HTMLAttachmentElement::createElementRenderer):
        (WebCore::HTMLAttachmentElement::setFile):
        (WebCore::HTMLAttachmentElement::parseAttribute):
        (WebCore::HTMLAttachmentElement::invalidateShadowRootChildrenIfNecessary): Deleted.
        (WebCore::HTMLAttachmentElement::attachmentRenderer const): Deleted.
        (WebCore::HTMLAttachmentElement::updateDisplayMode): Deleted.
        (WebCore::HTMLAttachmentElement::ensureInnerImage): Deleted.
        (WebCore::HTMLAttachmentElement::ensureInnerVideo): Deleted.
        (WebCore::HTMLAttachmentElement::innerImage const): Deleted.
        (WebCore::HTMLAttachmentElement::innerVideo const): Deleted.
        (WebCore::HTMLAttachmentElement::populateShadowRootIfNecessary): Deleted.

        Remove logic for building the shadow root to house inline media elements.

        * html/HTMLAttachmentElement.h:

        The renderer of the attachment element is once again always a `RenderAttachment`, so we can remove
        `attachmentRenderer()` altogether and revert to overriding `renderer()` to return a `RenderAttachment*`.

        * page/DragController.cpp:
        (WebCore::DragController::startDrag):
        * rendering/RenderAttachment.h:
        (WebCore::HTMLAttachmentElement::renderer const):

2018-08-15  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Do not hold a strong reference to the root element
        https://bugs.webkit.org/show_bug.cgi?id=188575

        Reviewed by Simon Fraser.

        Make IntersectionObserver have only a raw pointer to its root element rather than
        a reference, so that an otherwise-unreachable root isn't kept alive. Add logic to
        to clear this pointer when the root element gets deleted.

        Test: intersection-observer/root-element-deleted.html

        * dom/Element.cpp:
        (WebCore::Element::~Element):
        (WebCore::Element::disconnectFromIntersectionObservers):
        (WebCore::Element::ensureIntersectionObserverData):
        (WebCore::Element::intersectionObserverData):
        * dom/Element.h:
        * dom/ElementRareData.cpp:
        * dom/ElementRareData.h:
        (WebCore::ElementRareData::intersectionObserverData):
        (WebCore::ElementRareData::setIntersectionObserverData):
        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::create):
        (WebCore::IntersectionObserver::IntersectionObserver):
        (WebCore::IntersectionObserver::~IntersectionObserver):
        (WebCore::IntersectionObserver::rootDestroyed):
        * page/IntersectionObserver.h:
        (WebCore::IntersectionObserver::root const):

2018-08-14  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add Nicosia::BackingStoreTextureMapperImpl
        https://bugs.webkit.org/show_bug.cgi?id=188548

        Reviewed by Carlos Garcia Campos.

        Add the Nicosia::BackingStoreTextureMapperImpl class, the
        TextureMapper-specific implementation that will extend the BackingStore
        class.

        Purpose of this class is to manage content of painted layers. In the
        LayerState object that will be exposed to the CoordinatedGraphicsLayer
        owner we keep the current and previous TiledBackingStore objects that
        will be used for painting. A TileUpdate object is used to store all tile
        creation, removal and update changes that happen during the painting
        that's performed during the CoordinatedGraphicsLayer flush.

        At the point of synchronization under the Nicosia::Scene object, these
        updates will be moved over to the pending TileUpdate object that will
        then be accessed during the composition step. For that purpose we keep
        in the CompositionState member object a reference to the
        CoordinatedBackingStore object that will get updated with the tile
        creation, removal and update changes (if there are any). The composition
        step will use the takeUpdate() method to retrieve all these changes and
        apply them outside of the point of synchronization (avoiding this sync
        step to take too long).

        This will be integrated into the CoordinatedGraphicsLayer class at a
        later point, when the switch to the new infrastructure can be made in
        one go.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.cpp: Added.
        (Nicosia::BackingStoreTextureMapperImpl::createFactory):
        (Nicosia::BackingStoreTextureMapperImpl::tiledBackingStoreHasPendingTileCreation):
        (Nicosia::BackingStoreTextureMapperImpl::createTile):
        (Nicosia::BackingStoreTextureMapperImpl::updateTile):
        (Nicosia::BackingStoreTextureMapperImpl::removeTile):
        (Nicosia::BackingStoreTextureMapperImpl::flushUpdate):
        (Nicosia::BackingStoreTextureMapperImpl::takeUpdate):
        * platform/graphics/nicosia/texmap/NicosiaBackingStoreTextureMapperImpl.h: Added.

2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed, rolling out r234874 and r234876.

        WinCairo port can't compile

        Reverted changesets:

        "[JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg"
        https://bugs.webkit.org/show_bug.cgi?id=188589
        https://trac.webkit.org/changeset/234874

        "Unreviewed, attempt to fix CLoop build"
        https://bugs.webkit.org/show_bug.cgi?id=188589
        https://trac.webkit.org/changeset/234876

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

        [LFC][Floating] Add support for negative clearance.
        https://bugs.webkit.org/show_bug.cgi?id=188555

        Reviewed by Simon Fraser.

        1. Compute clearance to avoid float(s) (border box needs to avoid floats)
        2. Reset vertical margins to non-collapsed values.
        4. Adjust clearance with the new margins.
        5. Take the adjusted clearance and move the box vertically if needed.

        Test: fast/block/block-only/margin-collapse-with-clearance.html

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::mapBoxToAncestor):
        (WebCore::Layout::FormattingContext::mapTopLeftToAncestor):
        (WebCore::Layout::FormattingContext::mapCoordinateToAncestor):
        (WebCore::Layout::FormattingContext::mapToAncestor): Deleted.
        * layout/FormattingContext.h:
        * layout/LayoutUnits.h:
        (WebCore::Layout::Position::Position):
        (WebCore::Layout::Position::moveBy):
        * layout/displaytree/DisplayBox.h:

2018-08-14  Fujii Hironori  <Hironori.Fujii@sony.com>

        Unreviewed, rolling out r234859.

        Windows ports can't compile

        Reverted changeset:

        "Use a Variant instead of a union in CSSSelector"
        https://bugs.webkit.org/show_bug.cgi?id=188559
        https://trac.webkit.org/changeset/234859

2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        [JSC] Add GPRReg::InvalidGPRReg and FPRReg::InvalidFPRReg
        https://bugs.webkit.org/show_bug.cgi?id=188589

        Reviewed by Mark Lam.

        No behavior change.

        * cssjit/FunctionCall.h:
        (WebCore::FunctionCall::FunctionCall):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::SelectorCodeGenerator::modulo):

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-08-14  Ansh Shukla  <ansh_shukla@apple.com>

        NSURLAuthenticationMethodOAuth challenges are surfaced to clients in -didReceiveAuthenticationChallenge as NSURLAuthenticationMethodDefault
        https://bugs.webkit.org/show_bug.cgi?id=186870
        <rdar://problem/41314410>

        Reviewed by Alex Christensen.

        Add the ProtectionSpaceAuthenticationSchemeOAuth type.

        * platform/network/ProtectionSpaceBase.cpp:
        (WebCore::ProtectionSpaceBase::isPasswordBased const): Return yes because the oauth challenge
        expects a token in return.
        * platform/network/ProtectionSpaceBase.h:
        * platform/network/cocoa/ProtectionSpaceCocoa.mm:
        (WebCore::scheme):
        (WebCore::ProtectionSpace::nsSpace const):

2018-08-14  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Implement platform default timeout interval.
        https://bugs.webkit.org/show_bug.cgi?id=188565

        Reviewed by Alex Christensen.

        Curl port didn't implement platform default timeout interval. It treated
        zero value for timeout interval as no timeout.

        Add platform dependent timeout interval into CurlContext and use that if
        timeout and default timeout aren't supplied.

        Tests: http/tests/xmlhttprequest/on-network-timeout-error-during-preflight.html

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::setTimeout):
        * platform/network/curl/CurlContext.h:
        (WebCore::CurlContext::defaultTimeoutInterval const):
        * platform/network/curl/CurlRequest.cpp:
        (WebCore::CurlRequest::setupTransfer):
        (WebCore::CurlRequest::timeoutInterval const):
        (WebCore::CurlRequest::didCompleteTransfer):
        * platform/network/curl/CurlRequest.h:

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

        Use a Variant instead of a union in CSSSelector
        https://bugs.webkit.org/show_bug.cgi?id=188559

        Reviewed by Antti Koivisto.

        No change in behavior. This just makes some of the existing problems more obvious and easy to fix.

        I moved m_caseInsensitiveAttributeValueMatching to RareData because it's only used with RareData.
        I only have m_isForPage when assertions are enabled because it's only used for an assertion.
        The rest is pretty straightforward translating union syntax to Variant syntax.
        I use RefPtr for now where I could use Ref because it's never null to make copying easier, but that's temporary.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::CSSSelector):
        (WebCore::CSSSelector::createRareData):
        (WebCore::CSSSelector::setAttribute):
        (WebCore::CSSSelector::setArgument):
        (WebCore::CSSSelector::setLangArgumentList):
        (WebCore::CSSSelector::setSelectorList):
        (WebCore::CSSSelector::setNth):
        (WebCore::CSSSelector::matchNth const):
        (WebCore::CSSSelector::nthA const):
        (WebCore::CSSSelector::nthB const):
        (WebCore::CSSSelector::RareData::RareData):
        * css/CSSSelector.h:
        (WebCore::CSSSelector::argument const):
        (WebCore::CSSSelector::langArgumentList const):
        (WebCore::CSSSelector::selectorList const):
        (WebCore::CSSSelector::attribute const):
        (WebCore::CSSSelector::attributeCanonicalLocalName const):
        (WebCore::CSSSelector::setValue):
        (WebCore::CSSSelector::CSSSelector):
        (WebCore::CSSSelector::~CSSSelector):
        (WebCore::CSSSelector::tagQName const):
        (WebCore::CSSSelector::tagLowercaseLocalName const):
        (WebCore::CSSSelector::value const):
        (WebCore::CSSSelector::serializingValue const):
        (WebCore::CSSSelector::attributeValueMatchingIsCaseInsensitive const):
        (WebCore::CSSSelector::RareData::create): Deleted.
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::parsePageSelector):
        * css/parser/CSSParserSelector.h:

2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Unhandled Promise Rejection logging in workers should not emit ErrorEvent to host Worker object
        https://bugs.webkit.org/show_bug.cgi?id=188551

        Reviewed by Youenn Fablet.

        Previously we dispatched ErrorEvent on the Worker object of the host side when the unhandled promise
        rejection happens in the worker. But that was wrong. We should not dispatch such an event and we
        should just log the error message.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::reportUnhandledPromiseRejection):

2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Unreviewed, follow-up patch for comments
        https://bugs.webkit.org/show_bug.cgi?id=188265

        * bindings/js/JSExecState.cpp:
        (WebCore::JSExecState::didLeaveScriptContext):
        Do nothing if `context` is nullptr. It is OK since we do not need to drain microtasks / rejected
        promise events after ScriptExecutionContext is gone.

        * dom/Microtasks.cpp:
        (WebCore::MicrotaskQueue::contextQueue):
        Drop unnecessary assertion since it is subsumed by downcast<>.

2018-08-14  Ali Juma  <ajuma@chromium.org>

        Follow-up: [IntersectionObserver] Implement rootMargin parsing
        https://bugs.webkit.org/show_bug.cgi?id=188469

        Address review feedback from Darin Adler.

        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::rootMargin const):
        Use StringBuilder::appendLiteral instead of ::append to append a literal.

2018-08-14  Antoine Quint  <graouts@apple.com>

        [Web Animations] Crash under AnimationTimeline::cancelOrRemoveDeclarativeAnimation()
        https://bugs.webkit.org/show_bug.cgi?id=188519
        <rdar://problem/43237889>

        Reviewed by Eric Carlson.

        Test: webanimations/css-animation-effect-target-change-and-animation-removal-crash.html

        We would crash because we blindly assumed an animation that was found in the previous style must be in the list of running animations
        but in fact it could have been removed already due to the element being removed from the DOM or its effect target changing, etc. So when
        we iterate over names of animations that were found in the previous style but not in the new style, we must make a null check to ensure
        that there is an animation to remove. Adding an ASSERT() in AnimationTimeline::cancelOrRemoveDeclarativeAnimation() will also clarify the
        expectation here.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
        (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):

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

        [LFC][Floating] Adjust vertical position with non-collapsed previous sibling margin.
        https://bugs.webkit.org/show_bug.cgi?id=188543

        Reviewed by Antti Koivisto.

        This patch ensures that the inital vertical position for a float is adjusted with the non-collapsed sibling margin.

        <div id=A style="margin-bottom: 20px;"></div>
        <div id=B style='float: left'></div>
        <div id=C style="margin-top: 10px;"></div>

        While computing the static position for element "B", we simply call marginBottom() on A.
        In the case above, A's margin bottom is collapsed with C's margin top and the value is 0 (C.marginTop() is 20px).
        However CSS spec says that in block formatting context, the non-collapsed margin should be used instead to offset the float box.
        (The reason why this should not be part of the BlockMarginCollapse::marginBottom() logic is because it can not differentiate the context of
        sibling float/sibling inflow. When we margin collapse, we always do it in the context of inflow boxes.)

        Test: fast/block/block-only/float-and-siblings-with-margins.html

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        * layout/blockformatting/BlockFormattingContext.h:

2018-08-14  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Worker should support unhandled promise rejections
        https://bugs.webkit.org/show_bug.cgi?id=188265

        Reviewed by Darin Adler.

        This patch adds PromiseRejectionEvent support in workers.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSDOMGlobalObject.cpp:
        (WebCore::JSDOMGlobalObject::promiseRejectionTracker):
        Move promiseRejectionTracker handler from JSDOMWindowBase to JSDOMGlobalObject
        to share it with WorkerGlobalScope.

        * bindings/js/JSDOMGlobalObject.h:
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::promiseRejectionTracker): Deleted.
        Moved to JSDOMGlobalObject.

        * bindings/js/JSDOMWindowBase.h:
        * bindings/js/JSExecState.cpp:
        (WebCore::JSExecState::didLeaveScriptContext):
        PromiseRejectionTracker is driven in workers too.

        * bindings/js/JSPromiseRejectionEventCustom.cpp: Added.
        (WebCore::JSPromiseRejectionEvent::visitAdditionalChildren):
        Marking PromiseRejectionEvent::m_reason.

        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        Configure promiseRejectionTracker.

        * dom/Microtasks.cpp:
        (WebCore::MicrotaskQueue::contextQueue):
        * dom/Microtasks.h:
        * dom/PromiseRejectionEvent.cpp:
        (WebCore::PromiseRejectionEvent::PromiseRejectionEvent):
        * dom/PromiseRejectionEvent.h:
        * dom/PromiseRejectionEvent.idl:
        Expose it to worker scope. The custom mark function is required since we start
        using JSValueInWrappedObject. And the constructor no longer requires ExecState.

        * dom/RejectedPromiseTracker.cpp:
        (WebCore::RejectedPromiseTracker::reportUnhandledRejections):
        (WebCore::RejectedPromiseTracker::reportRejectionHandled):
        Remove state argument for PromiseRejectionEvent::create.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::removeRejectedPromiseTracker):
        * dom/ScriptExecutionContext.h:
        In worker thread, we should delete PromiseRejectionTracker before destroying VM
        because PromiseRejectionTracker's destruction requires VM. If we destroy VM first,
        PromiseRejectionTracker's destruction causes crashing. In main thread, we do not
        need to handle this case since we never destroy VM.

        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::prepareForTermination):
        (WebCore::WorkerGlobalScope::removeMicrotaskQueue): Deleted.
        * workers/WorkerGlobalScope.h:
        * workers/WorkerGlobalScope.idl:
        Add onunhandledrejection and onrejectionhandled event handler attributes.

        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::stop):
        We call WorkerGlobalScope::prepareForTermination, which cleans up Worker's objects touching VM.

2018-08-14  Rob Buis  <rbuis@igalia.com>

        Fetch: content-length header is being added to the safe-list
        https://bugs.webkit.org/show_bug.cgi?id=185473

        Reviewed by Youenn Fablet.

        Content-Length is a CORS-safelisted reponse header:
        https://fetch.spec.whatwg.org/#cors-safelisted-response-header-name

        Tests: web-platform-tests/fetch/api/cors/cors-filtering.html
               web-platform-tests/fetch/api/cors/cors-filtering-worker.html

        * platform/network/HTTPParsers.cpp:
        (WebCore::isCrossOriginSafeHeader):

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

        [LFC][Floating] Do not confuse clear with clearance.
        https://bugs.webkit.org/show_bug.cgi?id=188541

        Reviewed by Simon Fraser.

        clear -> CSS property.
        clearance -> the offset required to avoid floats when clear is present.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionForClear const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const): Deleted.
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::hasClear const):
        (WebCore::Layout::Box::hasClearance const): Deleted.
        * layout/layouttree/LayoutBox.h:

2018-08-13  James Savage  <james.savage@apple.com>

        [iOS] Crash at -[UIViewController _presentViewController:withAnimationController:completion:]
        https://bugs.webkit.org/show_bug.cgi?id=188537
        <rdar://problem/41400259>

        Reviewed by Tim Horton.

        * platform/ios/ValidationBubbleIOS.mm:
        (WebCore::ValidationBubble::show): Avoid hitting a UIKit exception for
        presenting an already presented view controller by turning the scenario
        into an early return.

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

        Make CSSSelectorList a little more sane
        https://bugs.webkit.org/show_bug.cgi?id=188539

        Reviewed by Simon Fraser.

        This patch does four things:
        1. Use a UniqueArray<CSSSelector> instead of a raw pointer and manually calling destructors.
        2. Use move semantics a little bit better.
        3. Add a CSSSelectorList&& to the StyleRule and StyleRulePage because every time we create either
        one of those objects we call a setter to give it a CSSSelectorList.  That's what constructor arguments are for.
        4. Don't use CSSSelectorList.componentCount(), which iterates all components, to determine if it's empty.
        Use first() instead.

        * css/CSSPageRule.cpp:
        (WebCore::CSSPageRule::setSelectorText):
        * css/CSSSelectorList.cpp:
        (WebCore::CSSSelectorList::CSSSelectorList):
        (WebCore::CSSSelectorList::componentCount const):
        (WebCore::CSSSelectorList::listSize const):
        (WebCore::CSSSelectorList::operator=):
        (WebCore::CSSSelectorList::deleteSelectors): Deleted.
        * css/CSSSelectorList.h:
        (WebCore::CSSSelectorList::CSSSelectorList):
        (WebCore::CSSSelectorList::first const):
        (WebCore::CSSSelectorList::indexOfNextSelectorAfter const):
        (WebCore::CSSSelectorList::~CSSSelectorList): Deleted.
        (WebCore::CSSSelectorList::adoptSelectorArray): Deleted.
        (WebCore::CSSSelectorList::hasOneSelector const): Deleted.
        * css/CSSStyleRule.cpp:
        (WebCore::CSSStyleRule::setSelectorText):
        * css/StyleRule.cpp:
        (WebCore::StyleRule::StyleRule):
        (WebCore::StyleRule::createForSplitting):
        (WebCore::StyleRulePage::StyleRulePage):
        * css/StyleRule.h:
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::consumePageRule):
        (WebCore::CSSParserImpl::consumeStyleRule):
        * css/parser/CSSSelectorParser.cpp:
        (WebCore::CSSSelectorParser::consumePseudo):

2018-08-13  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Validate threshold values
        https://bugs.webkit.org/show_bug.cgi?id=188475

        Reviewed by Simon Fraser.

        Throw an exception if any of an IntersectionObserver's thresholds are outside
        the range [0, 1].

        Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
                   intersection-observer/intersection-observer-interface.html

        * page/IntersectionObserver.cpp:
        (WebCore::IntersectionObserver::create):
        (WebCore::IntersectionObserver::IntersectionObserver):
        * page/IntersectionObserver.h:

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

        Remove unused CSSSelector::parseNth
        https://bugs.webkit.org/show_bug.cgi?id=188529

        Reviewed by Simon Fraser.

        This was conceptually replaced by the call to setNth in CSSSelectorParser::consumePseudo.

        * css/CSSSelector.cpp:
        (WebCore::CSSSelector::CSSSelector):
        (WebCore::CSSSelector::setNth):
        (WebCore::CSSSelector::nthA const):
        (WebCore::CSSSelector::nthB const):
        (WebCore::CSSSelector::parseNth const): Deleted.
        (WebCore::CSSSelector::RareData::parseNth): Deleted.
        * css/CSSSelector.h:
        (WebCore::CSSSelector::CSSSelector):
        * css/SelectorChecker.cpp:
        (WebCore::SelectorChecker::checkOne const):
        * cssjit/SelectorCompiler.cpp:
        (WebCore::SelectorCompiler::addNthChildType):

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

        Remove unused code in CSSParserSelector/CSSSelector
        https://bugs.webkit.org/show_bug.cgi?id=188528

        Reviewed by Simon Fraser.

        * css/CSSSelector.cpp:
        * css/CSSSelector.h:
        (WebCore::CSSSelector::serializingValue const):
        (WebCore::CSSSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted.
        * css/parser/CSSParserSelector.h:
        (WebCore::CSSParserSelector::setAttributeValueMatchingIsCaseInsensitive): Deleted.

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

        Modernize CSSSelectorList a little
        https://bugs.webkit.org/show_bug.cgi?id=188527

        Reviewed by Simon Fraser.

        No change in behavior.  Just use make_unique and move semantics a little more.

        * css/CSSSelectorList.cpp:
        (WebCore::CSSSelectorList::CSSSelectorList):
        (WebCore::CSSSelectorList::adoptSelectorVector): Deleted.
        * css/CSSSelectorList.h:
        * css/StyleRule.h:
        * css/parser/CSSParserImpl.cpp:
        (WebCore::CSSParserImpl::parsePageSelector):
        * css/parser/CSSParserSelector.cpp:
        (WebCore::CSSParserSelector::adoptSelectorVector):
        * css/parser/CSSParserSelector.h:
        * css/parser/CSSSelectorParser.cpp:
        (WebCore::CSSSelectorParser::consumeComplexSelectorList):
        (WebCore::CSSSelectorParser::consumeCompoundSelectorList):
        (WebCore::CSSSelectorParser::consumePseudo):

2018-08-13  Antti Koivisto  <antti@apple.com>

        Meaning of OptionSet::contains is unclear when used with OptionSet argument
        https://bugs.webkit.org/show_bug.cgi?id=188501

        Reviewed by Anders Carlsson.

        * dom/DocumentMarkerController.cpp:
        (WebCore::DocumentMarkerController::possiblyHasMarkers):
        * dom/DocumentMarkerController.h:
        (WebCore::DocumentMarkerController::hasMarkers const):
        * platform/FileSystem.h:
        (WebCore::FileSystem::openAndLockFile):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::selectionColor const):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::paintForegroundForFragments):

2018-08-13  Commit Queue  <commit-queue@webkit.org>

        Unreviewed, rolling out r234747.
        https://bugs.webkit.org/show_bug.cgi?id=188524

        plugin processes crash on launch (Requested by smfr on
        #webkit).

        Reverted changeset:

        "We should cache the compiled sandbox profile in a data vault"
        https://bugs.webkit.org/show_bug.cgi?id=184991
        https://trac.webkit.org/changeset/234747

2018-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>

        [iOS] Dragging a non-editable text selection into a plain text input inserts HTML markup
        https://bugs.webkit.org/show_bug.cgi?id=188485
        <rdar://problem/43168784>

        Reviewed by Tim Horton.

        Before r223678, -typeIdentifiersToLoadForRegisteredTypeIdentifiers:, which is responsible for determining which
        type identifiers to load upon performing a drop, returned the following when dropping a rich text selection onto
        a textarea:

            "public.plain-text",
            "public.html"

        After r223678, we now propagate a custom pasteboard data type when dragging, and the same list now looks like:

            "com.apple.WebKit.custom-pasteboard-data",
            "public.html",
            "public.plain-text"

        Subsequently, logic in `-_preLoadedDataConformingToType:…` (responsible for mapping a requested type identifier
        to data that has been loaded from an item provider) iterates through the aforementioned list of type identifiers
        and selects the data of the first type identifier in the list that conforms to the requested type identifier.
        However, this list of type identifiers is currently the result of `-[NSSet allObjects]`, which means that the
        type identifiers in the list are in no particular order!

        As such, this particular use case only worked by accident prior to r223678, and after that change, this latent
        bug was surfaced. The patch here makes two adjustments to pasteboard handling on iOS to fix the bug.

        Test: DragAndDropTests.NonEditableTextSelectionToTextarea

        * platform/ios/PasteboardIOS.mm:
        (WebCore::Pasteboard::read):

        When reading plain text from the pasteboard, give "public.plain-text" priority over "public.text". This ensures
        that we don't end up reading markup as "plain text" when there's already more relevant plain text data present
        in the pasteboard.

        * platform/ios/WebItemProviderPasteboard.mm:
        (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentifiers:]):

        Refactor existing logic to enforce a consistent ordering of type identifiers to load. First, we use
        NSMutableOrderedSet instead of just an NSMutableSet to store type identifiers we've added. Secondly, move all
        logic to insert type identifiers into this set to the end of the method, where we iterate over all of the type
        identifiers in order and add each type identifier to the set if needed. This ensures that the order of resulting
        types is from highest to lowest fidelity.

        (-[WebItemProviderPasteboard doAfterLoadingProvidedContentIntoFileURLs:synchronousTimeout:]):
        (-[WebItemProviderPasteboard typeIdentifiersToLoadForRegisteredTypeIdentfiers:]): Deleted.

        Fix a typo in the method name.

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

        Use a 1-byte enum class for TextDirection
        https://bugs.webkit.org/show_bug.cgi?id=188350

        Reviewed by Simon Fraser.

        * Modules/notifications/Notification.h:
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator TextDirection const):
        * css/ElementRuleCollector.cpp:
        (WebCore::ElementRuleCollector::matchAllRules):
        * dom/Document.cpp:
        (WebCore::Document::updateTitleFromTitleElement):
        (WebCore::Document::setTitle):
        * dom/Position.cpp:
        (WebCore::Position::primaryDirection const):
        * dom/Range.cpp:
        (WebCore::Range::collectSelectionRectsWithoutUnionInteriorLines const):
        * editing/Editing.cpp:
        (WebCore::directionOfEnclosingBlock):
        * editing/Editor.cpp:
        (WebCore::Editor::baseWritingDirectionForSelectionStart const):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::willBeModified):
        (WebCore::FrameSelection::modifyExtendingRight):
        (WebCore::FrameSelection::modifyExtendingForward):
        (WebCore::FrameSelection::modifyMovingRight):
        (WebCore::FrameSelection::modifyExtendingLeft):
        (WebCore::FrameSelection::modifyExtendingBackward):
        (WebCore::FrameSelection::modifyMovingLeft):
        (WebCore::FrameSelection::textSelectionIntent):
        (WebCore::FrameSelection::modify):
        * editing/VisiblePosition.cpp:
        (WebCore::VisiblePosition::leftVisuallyDistinctCandidate const):
        (WebCore::VisiblePosition::rightVisuallyDistinctCandidate const):
        * editing/VisibleUnits.cpp:
        (WebCore::visualWordPosition):
        (WebCore::leftWordPosition):
        (WebCore::rightWordPosition):
        (WebCore::leftBoundaryOfLine):
        (WebCore::rightBoundaryOfLine):
        * html/HTMLElement.cpp:
        (WebCore::HTMLElement::directionalityIfhasDirAutoAttribute const):
        (WebCore::HTMLElement::directionality const):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::setupDateTimeChooserParameters):
        * html/HTMLTextFormControlElement.cpp:
        (WebCore::HTMLTextFormControlElement::directionForFormData const):
        (WebCore::HTMLTextFormControlElement::adjustInnerTextStyle const):
        * html/HTMLTitleElement.cpp:
        (WebCore::HTMLTitleElement::computedTextWithDirection):
        * html/canvas/CanvasRenderingContext2D.cpp:
        (WebCore::CanvasRenderingContext2D::toTextDirection const):
        (WebCore::CanvasRenderingContext2D::direction const):
        (WebCore::CanvasRenderingContext2D::textOffset):
        * html/shadow/SliderThumbElement.cpp:
        (WebCore::RenderSliderContainer::layout):
        * html/shadow/TextControlInnerElements.cpp:
        (WebCore::TextControlInnerElement::resolveCustomStyle):
        * page/Chrome.cpp:
        (WebCore::Chrome::setToolTip):
        * page/FrameView.cpp:
        (WebCore::paginationModeForRenderStyle):
        * page/Settings.yaml:
        * platform/RectEdges.h:
        (WebCore::RectEdges::start):
        (WebCore::RectEdges::end):
        (WebCore::RectEdges::start const):
        (WebCore::RectEdges::end const):
        (WebCore::RectEdges::setStart):
        (WebCore::RectEdges::setEnd):
        * platform/UserInterfaceLayoutDirection.h:
        * platform/graphics/ComplexTextController.cpp:
        (WebCore::ComplexTextController::computeExpansionOpportunity):
        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::expansionOpportunityCountInternal):
        (WebCore::FontCascade::leadingExpansionOpportunity):
        (WebCore::FontCascade::trailingExpansionOpportunity):
        * platform/graphics/GraphicsContext.cpp:
        (WebCore::GraphicsContext::drawBidiText):
        * platform/graphics/TextRun.h:
        (WebCore::TextRun::TextRun):
        (WebCore::TextRun::rtl const):
        (WebCore::TextRun::ltr const):
        (WebCore::TextRun::setDirection):
        * platform/graphics/WidthIterator.cpp:
        (WebCore::WidthIterator::WidthIterator):
        * platform/ios/SelectionRect.cpp:
        (WebCore::SelectionRect::SelectionRect):
        * platform/text/BidiResolver.h:
        (WebCore::BidiStatus::BidiStatus):
        * platform/text/StringWithDirection.h:
        * platform/text/WritingMode.h:
        (WebCore::isLeftToRightDirection):
        (WebCore::isVerticalWritingMode):
        (WebCore::isFlippedWritingMode):
        (WebCore::mapLogicalSideToPhysicalSide):
        * rendering/HitTestResult.cpp:
        (WebCore::HitTestResult::spellingToolTip const):
        (WebCore::HitTestResult::title const):
        (WebCore::HitTestResult::innerTextIfTruncated const):
        * rendering/InlineBox.h:
        (WebCore::InlineBox::direction const):
        (WebCore::InlineBox::isLeftToRightDirection const):
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::paintFillLayer):
        * rendering/InlineIterator.h:
        (WebCore::embedCharFromDirection):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        (WebCore::mirrorRTLSegment):
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::constructTextRun):
        * rendering/RenderBlockLineLayout.cpp:
        (WebCore::determineDirectionality):
        (WebCore::RenderBlockFlow::textAlignmentForLine const):
        (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
        (WebCore::RenderBlockFlow::handleTrailingSpaces):
        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
        * rendering/RenderBox.cpp:
        (WebCore::computeInlineStaticDistance):
        (WebCore::RenderBox::computePositionedLogicalWidthUsing const):
        (WebCore::RenderBox::computePositionedLogicalWidthReplaced const):
        * rendering/RenderDeprecatedFlexibleBox.cpp:
        (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::updateLogicalWidth):
        (WebCore::RenderFragmentedFlow::updateFragmentsFragmentedFlowPortionRect):
        * rendering/RenderLayerModelObject.cpp:
        (WebCore::RenderLayerModelObject::shouldPlaceBlockDirectionScrollbarOnLeft const):
        * rendering/RenderMarquee.cpp:
        (WebCore::RenderMarquee::direction const):
        * rendering/RenderMenuList.cpp:
        (WebCore::RenderMenuList::adjustInnerStyle):
        (RenderMenuList::clientPaddingLeft const):
        (RenderMenuList::clientPaddingRight const):
        * rendering/RenderThemeIOS.mm:
        (WebCore::RenderThemeIOS::popupInternalPaddingBox const):
        (WebCore::RenderThemeIOS::paintMenuListButtonDecorations):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintMenuListButtonDecorations):
        (WebCore::RenderThemeMac::popupInternalPaddingBox const):
        (WebCore::RenderThemeMac::setPopupButtonCellState):
        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
        (WebCore::RenderThemeMac::paintSearchFieldResultsButton):
        * rendering/mathml/RenderMathMLBlock.cpp:
        (WebCore::RenderMathMLBlock::mirrorIfNeeded const):
        * rendering/mathml/RenderMathMLOperator.cpp:
        (WebCore::RenderMathMLOperator::layoutBlock):
        * rendering/style/RenderStyle.cpp:
        (WebCore::RenderStyle::RenderStyle):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::isLeftToRightDirection const):
        (WebCore::RenderStyle::initialDirection):
        * testing/InternalSettings.cpp:
        (WebCore::InternalSettings::systemLayoutDirection):
        (WebCore::InternalSettings::setSystemLayoutDirection):
        * testing/Internals.h:

2018-08-13  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Followup (r234683): Element::getAttribute() should return the first non-null attribute value
        https://bugs.webkit.org/show_bug.cgi?id=188419

        Reviewed by Darin Adler.

        Element::getAttribute() should return the first non-null attribute value
        since an empty string is a legitimate attribute value.

        Test: svg/custom/href-svg-namespace-empty.html

        * dom/Element.h:
        (WebCore::Element::getAttribute const):

2018-08-13  Michael Catanzaro  <mcatanzaro@igalia.com>

        Unreviewed, since -Wsign-compare warnings in URL.cpp

        This regressed in r233798 when m_schemeEnd changed to a bitfield. The code looks safe to
        me, so just silence the warnings with casts.

        * platform/URL.cpp:
        (WebCore::URL::setHost):
        (WebCore::URL::setHostAndPort):
        (WebCore::URL::setUser):
        (WebCore::URL::setPass):

2018-08-13  Antti Koivisto  <antti@apple.com>

        Use OptionSet more in editing code
        https://bugs.webkit.org/show_bug.cgi?id=188500

        Reviewed by Wenson Hsieh.

        Typesafe flags.

        * editing/CompositeEditCommand.cpp:
        (WebCore::CompositeEditCommand::moveParagraphs):
        * editing/Editor.cpp:
        (WebCore::TemporarySelectionChange::TemporarySelectionChange):
        (WebCore::Editor::replaceSelectionWithFragment):
        (WebCore::Editor::appliedEditing):
        (WebCore::Editor::selectComposition):
        (WebCore::Editor::changeSelectionAfterCommand):
        (WebCore::Editor::respondToChangedSelection):
        * editing/Editor.h:
        (WebCore::TemporarySelectionChange::TemporarySelectionChange):
        * editing/FrameSelection.cpp:
        (WebCore::FrameSelection::moveWithoutValidationTo):
        (WebCore::FrameSelection::setSelectionWithoutUpdatingAppearance):
        (WebCore::FrameSelection::setSelection):
        (WebCore::FrameSelection::setSelectedRange):
        * editing/FrameSelection.h:
        (WebCore::FrameSelection::defaultSetSelectionOptions):
        * editing/MoveSelectionCommand.cpp:
        (WebCore::MoveSelectionCommand::doApply):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::ReplaceSelectionCommand):
        * editing/ReplaceSelectionCommand.h:
        (WebCore::ReplaceSelectionCommand::create):
        * editing/SetSelectionCommand.cpp:
        (WebCore::SetSelectionCommand::SetSelectionCommand):
        * editing/SetSelectionCommand.h:
        (WebCore::SetSelectionCommand::create):
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected):
        * page/DragController.cpp:
        (WebCore::DragController::concludeEditDrag):
        * page/TextIndicator.cpp:
        (WebCore::TextIndicator::createWithRange):

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

        [LFC][Floating] Add basic clearance support
        https://bugs.webkit.org/show_bug.cgi?id=188492

        Reviewed by Antti Koivisto.

        Adjust final position of a block level box with clearance when float is present.

        Test: fast/block/block-only/floating-left-and-right-with-clearance.html

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::positionForFloat const):
        (WebCore::Layout::FloatingContext::verticalPositionWithClearance const):
        (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
        (WebCore::Layout::FloatingContext::toContainingBlock const):
        (WebCore::Layout::FloatingContext::computePosition const): Deleted.
        * layout/FloatingContext.h:
        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::bottom const):
        * layout/FloatingState.h:
        (WebCore::Layout::FloatingState::leftBottom const):
        (WebCore::Layout::FloatingState::rightBottom const):
        (WebCore::Layout::FloatingState::bottom const):
        * layout/Verification.cpp:
        (WebCore::Layout::LayoutContext::verifyAndOutputMismatchingLayoutTree const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        (WebCore::Layout::BlockFormattingContext::computeVerticalPositionWithClearance const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::hasClearance const):
        * layout/layouttree/LayoutBox.h:

2018-08-13  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Expose CloseEvent and CustomEvent to workers
        https://bugs.webkit.org/show_bug.cgi?id=188493

        Reviewed by Sam Weinig.

        This patch exposes CloseEvent and CustomEvent to workers.
        It is OK since they do not depend on things in the main thread.
        For example, we cannot expose FormData right now since it depends
        on Page.

        We do not expose PromiseRejectionEvent in this patch since it will
        be done in [1].

        [1]: https://bugs.webkit.org/show_bug.cgi?id=188265

        * Modules/websockets/CloseEvent.idl:
        * dom/CustomEvent.idl:

2018-08-13  Oriol Brufau  <obrufau@igalia.com>

        [css-logical] Implement flow-relative margin, padding, border and sizing properties
        https://bugs.webkit.org/show_bug.cgi?id=188386

        Reviewed by Manuel Rego Casasnovas.

        These properties provide the author with the ability to control margins
        through logical, rather than physical, direction and dimension mappings.

        Only longhand properties and border shorthands for specific sides are
        implemented as part of this patch.

        The existing prefixed properties become aliases of the new ones.

        The change in WebCore::isLayoutDependent fixes an existing issue that
        made getComputedStyle provide an old value for -webkit-logical-height
        and -webkit-logical-height (see https://crbug.com/849855).

        Tests: imported/w3c/web-platform-tests/css/css-logical/animation-001.html
               imported/w3c/web-platform-tests/css/css-logical/animation-002.html
               imported/w3c/web-platform-tests/css/css-logical/animation-003.tentative.html
               imported/w3c/web-platform-tests/css/css-logical/cascading-001.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-border-color.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-border-shorthands.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-border-style.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-border-width.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-inset.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-margin.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-padding.html
               imported/w3c/web-platform-tests/css/css-logical/logical-box-size.html
               imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size-vlr.html
               imported/w3c/web-platform-tests/css/css-logical/logicalprops-block-size.html
               imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size-vlr.html
               imported/w3c/web-platform-tests/css/css-logical/logicalprops-inline-size.html
               imported/w3c/web-platform-tests/css/css-logical/logicalprops-quirklength.html

        * css/CSSComputedStyleDeclaration.cpp:
        (WebCore::isLayoutDependent):
        (WebCore::ComputedStyleExtractor::valueForPropertyinStyle):
        * css/CSSProperties.json:
        * css/CSSProperty.cpp:
        (WebCore::CSSProperty::resolveDirectionAwareProperty):
        (WebCore::CSSProperty::isDirectionAwareProperty):
        * css/StyleProperties.cpp:
        (WebCore::StyleProperties::getPropertyValue const):
        * css/parser/CSSParserFastPaths.cpp:
        (WebCore::isSimpleLengthPropertyID):
        (WebCore::isColorPropertyID):
        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
        (WebCore::CSSParserFastPaths::isKeywordPropertyID):
        * css/parser/CSSPropertyParser.cpp:
        (WebCore::CSSPropertyParser::parseSingleValue):
        (WebCore::CSSPropertyParser::parseShorthand):
        * html/HTMLTableElement.cpp:
        (WebCore::HTMLTableElement::collectStyleForPresentationAttribute):
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::computeCollapsedStartBorder const):
        (WebCore::RenderTableCell::computeCollapsedEndBorder const):
        (WebCore::RenderTableCell::computeCollapsedBeforeBorder const):
        (WebCore::RenderTableCell::computeCollapsedAfterBorder const):

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

        CrashTracer: com.apple.WebKit.Storage at WebCore::IDBServer::UniqueIDBDatabase::connectionClosedFromClient(WebCore::IDBServer::UniqueIDBDatabaseConnection&)
        https://bugs.webkit.org/show_bug.cgi?id=188474

        Reviewed by Chris Dumez.

        UniqueIDBDatabaseConnection is refcounted by UniqueIDBDatabaseTransaction and it refcounts
        UniqueIDBDatabaseTransaction. This cycle could make UniqueIDBDatabaseConnection outlives
        UniqueIDBDatabase, so its reference to UniqueIDBDatabase may be stale. Calling a function
        on a stale object is probably the reason of recent various storage process crashes in
        indexedDB.

        This patch makes m_database a WeakPtr and adds assertions that could help us debug the
        crashes.

        * Modules/indexeddb/server/IDBServer.cpp:
        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesModifiedSince):
        (WebCore::IDBServer::IDBServer::closeAndDeleteDatabasesForOrigins):
        * Modules/indexeddb/server/UniqueIDBDatabase.cpp:
        (WebCore::IDBServer::UniqueIDBDatabase::commitTransaction):
        (WebCore::IDBServer::UniqueIDBDatabase::abortTransaction):
        * Modules/indexeddb/server/UniqueIDBDatabase.h:
        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.cpp:
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::UniqueIDBDatabaseConnection):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::~UniqueIDBDatabaseConnection):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::abortTransactionWithoutCallback):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::connectionClosedFromClient):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::confirmDidCloseFromServer):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFireVersionChangeEvent):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didFinishHandlingVersionChange):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::createVersionChangeTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::establishTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::didAbortTransaction):
        * Modules/indexeddb/server/UniqueIDBDatabaseConnection.h:
        (WebCore::IDBServer::UniqueIDBDatabaseConnection::database):
        * Modules/indexeddb/server/UniqueIDBDatabaseTransaction.cpp:
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::UniqueIDBDatabaseTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::~UniqueIDBDatabaseTransaction):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::abort):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::commit):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::clearObjectStore):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::createIndex):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteIndex):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::renameIndex):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::putOrAdd):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getRecord):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getAllRecords):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::getCount):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::deleteRecord):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::openCursor):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::iterateCursor):
        (WebCore::IDBServer::UniqueIDBDatabaseTransaction::objectStoreIdentifiers):
        * Modules/indexeddb/shared/IDBResultData.cpp:
        (WebCore::IDBResultData::openDatabaseSuccess):
        (WebCore::IDBResultData::openDatabaseUpgradeNeeded):

2018-08-12  Yusuke Suzuki  <yusukesuzuki@slowstart.org>

        Break reference cycle in ErrorEvent by using JSValueInWrappedObject
        https://bugs.webkit.org/show_bug.cgi?id=188491

        Reviewed by Darin Adler.

        ErrorEvent should not use Strong<Unkonwn> to hold error JSValue. This patch integrates
        JSValueInWrappedObject into ErrorEvent.

        * Modules/webvr/VRDisplayEvent.h:
        Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSErrorEventCustom.cpp: Copied from Source/WebCore/Modules/webvr/VRDisplayEvent.h.
        (WebCore::JSErrorEvent::visitAdditionalChildren):
        Add custom mark function for JSValueInWrappedObject.

        * bindings/js/JSEventListener.h:
        * bindings/js/WindowProxy.cpp:
        Fix unified build errors due to added JSErrorEventCustom.cpp. It changes the files grouped in unified build.

        * dom/ErrorEvent.cpp:
        (WebCore::ErrorEvent::ErrorEvent):
        (WebCore::ErrorEvent::error):
        (WebCore::ErrorEvent::trySerializeError):
        Align the implementation to PushStateEvent::trySerializeState.

        * dom/ErrorEvent.h:
        * dom/ErrorEvent.idl:

2018-08-12  Aditya Keerthi  <akeerthi@apple.com>

        [macOS] Color wells should appear pressed when presenting a color picker
        https://bugs.webkit.org/show_bug.cgi?id=188477

        Reviewed by Tim Horton.

        Currently, when clicking on a color well, the color well loses its pressed
        appearance once the mouse is lifted. Because of this behavior, the color well
        does not appear to be active when the color picker is displayed.

        Added the color-well -webkit-appearance value to control the drawing of the color
        well separate from other buttons. Also added a new ControlState, named
        PresentingState. A control can be in this state whenever it is presenting some
        attached view. In the case of the color well this is the color picker. The
        Information as to whether a form control is in the presenting state comes from
        isPresentingAttachedView() in HTMLInputElement.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        * css/CSSProperties.json:
        * css/CSSValueKeywords.in:
        * css/html.css:
        (input[type="color"]::-webkit-color-swatch):
        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::isPresentingAttachedView const):
        (WebCore::ColorInputType::elementDidBlur):
        (WebCore::ColorInputType::didEndChooser):
        * html/ColorInputType.h:
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::isPresentingAttachedView const):
        * html/HTMLInputElement.h:
        * html/InputType.cpp:
        (WebCore::InputType::isPresentingAttachedView const):
        * html/InputType.h:
        * platform/ControlStates.h:
        * platform/ThemeTypes.h:
        * platform/mac/ThemeMac.mm:
        (WebCore::updateStates):
        (WebCore::setUpButtonCell):
        (WebCore::paintColorWell):
        (WebCore::ThemeMac::minimumControlSize const):
        (WebCore::ThemeMac::controlBorder const):
        (WebCore::ThemeMac::paint):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        (WebCore::RenderTheme::paint):
        (WebCore::RenderTheme::paintBorderOnly):
        (WebCore::RenderTheme::paintDecorations):
        (WebCore::RenderTheme::isControlStyled const):
        (WebCore::RenderTheme::extractControlStatesForRenderer const):
        (WebCore::RenderTheme::isPresenting const):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::adjustRepaintRect):

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

        [LFC] Float prev/next sibling should prevent top/bottom margin collapsing with parent.
        https://bugs.webkit.org/show_bug.cgi?id=188487

        Reviewed by Antti Koivisto.

        Test: fast/block/block-only/floating-and-next-previous-inflow-with-margin.html

        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::isMarginBottomCollapsedWithParent):

2018-08-10  Antti Koivisto  <antti@apple.com>

        Use OptionSet for various RenderLayer flags
        https://bugs.webkit.org/show_bug.cgi?id=188472
        <rdar://problem/43153059>

        Followup, fix some mistakes.

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

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-08-10  Daniel Bates  <dabates@apple.com>

        Cleanup: Remove unnecessary code to resume animations from CachedFrameBase::restore()
        https://bugs.webkit.org/show_bug.cgi?id=188459

        Reviewed by Chris Dumez.

        It is unnessary for CachedFrameBase::restore() to explicitly resume animations on the
        document as it calls Document::resume(), which already does this.

        No functionality changed. So, no new tests.

        * history/CachedFrame.cpp:
        (WebCore::CachedFrameBase::restore):

2018-08-10  Antti Koivisto  <antti@apple.com>

        Use OptionSet for various RenderLayer flags
        https://bugs.webkit.org/show_bug.cgi?id=188472

        Reviewed by Simon Fraser.

        Typesafe flags.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
        * page/FrameView.cpp:
        (WebCore::updateLayerPositionFlags):
        (WebCore::FrameView::paintContents):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::updateLayerPositionsAfterLayout):
        (WebCore::RenderLayer::updateLayerPositions):
        (WebCore::RenderLayer::updateLayerPositionsAfterScroll):
        (WebCore::RenderLayer::paint):
        (WebCore::paintForFixedRootBackground):
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::paintLayerContentsAndReflection):
        (WebCore::RenderLayer::filterPainter const):
        (WebCore::RenderLayer::hasFilterThatIsPainting const):
        (WebCore::RenderLayer::setupFilters):
        (WebCore::RenderLayer::paintLayerContents):
        (RenderLayer::paintLayerByApplyingTransform):
        (RenderLayer::paintList):
        (RenderLayer::updatePaintingInfoForFragments):
        (RenderLayer::paintTransformedLayerIntoFragments):
        (RenderLayer::calculateClipRects const):
        (WebCore::RenderLayer::paintLayerByApplyingTransform): Deleted.
        (WebCore::RenderLayer::paintList): Deleted.
        (WebCore::RenderLayer::enclosingPaginationLayerInSubtree const): Deleted.
        (WebCore::RenderLayer::collectFragments): Deleted.
        (WebCore::RenderLayer::updatePaintingInfoForFragments): Deleted.
        (WebCore::RenderLayer::paintTransformedLayerIntoFragments): Deleted.
        (WebCore::RenderLayer::paintBackgroundForFragments): Deleted.
        (WebCore::RenderLayer::paintForegroundForFragments): Deleted.
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase): Deleted.
        (WebCore::RenderLayer::paintOutlineForFragments): Deleted.
        (WebCore::RenderLayer::paintMaskForFragments): Deleted.
        (WebCore::RenderLayer::paintChildClippingMaskForFragments): Deleted.
        (WebCore::RenderLayer::paintOverflowControlsForFragments): Deleted.
        (WebCore::RenderLayer::hitTest): Deleted.
        (WebCore::RenderLayer::enclosingElement const): Deleted.
        (WebCore::RenderLayer::enclosingFragmentedFlowAncestor const): Deleted.
        (WebCore::computeZOffset): Deleted.
        (WebCore::RenderLayer::createLocalTransformState const): Deleted.
        (WebCore::isHitCandidate): Deleted.
        (WebCore::RenderLayer::hitTestLayer): Deleted.
        (WebCore::RenderLayer::hitTestContentsForFragments const): Deleted.
        (WebCore::RenderLayer::hitTestResizerInFragments const): Deleted.
        (WebCore::RenderLayer::hitTestTransformedLayerInFragments): Deleted.
        (WebCore::RenderLayer::hitTestLayerByApplyingTransform): Deleted.
        (WebCore::RenderLayer::hitTestContents const): Deleted.
        (WebCore::RenderLayer::hitTestList): Deleted.
        (WebCore::RenderLayer::updateClipRects): Deleted.
        (WebCore::RenderLayer::clipRects const): Deleted.
        (WebCore::RenderLayer::calculateClipRects const): Deleted.
        (WebCore::showLayerTree): Deleted.
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateCompositedBounds):
        (WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
        (WebCore::RenderLayerBacking::paintIntoLayer):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer):
        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
        * rendering/RenderLayerCompositor.h:
        * rendering/RenderReplica.cpp:
        (WebCore::RenderReplica::paint):

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-08-10  Daniel Bates  <dabates@apple.com>

        Once <object> is hidden, its content won't be displayed again if its URL has fragment identifier ("#").
        https://bugs.webkit.org/show_bug.cgi?id=187990

        Reviewed by Simon Fraser.

        Fixes an issue where an HTML object element that behaves like an iframe and references a resource
        whose URL contains a fragment would not be repainted when its CSS display property changes. 

        Rendering of an <object> that behaves like an iframe is handled by a widget (FrameView). When
        the CSS display property for an <object> is set to "none" we detach the widget from its renderer
        as part of destroying the render tree for the <object>. Subsequently changing the CSS display
        to a non-"none"/"contents" value will create a new renderer for <object> R. For an <object> that
        behaves like an iframe, we navigate to the resource associated with the <object> reusing the
        existing Frame F object created when we first displayed the <object>. Unlike the case where
        the URL of the resource does not contain a fragment, navigating to a fragment in the same document
        uses a different code path that does not re-associate the FrameView of F with R before it scrolls
        the view; => the FrameView of F is not in the view hierarchy. Therefore we do not paint anything
        for the content of the <object> and hence the scroll is not observable. Instead we need to ensure
        that the FrameView of F installed in the view hierarchy when navigating to an anchor in the same
        document.

        As a side benefit of this fix we now also repaint an <object> that is programmatically navigated
        to a different anchor in the same document.

        Tests: fast/repaint/object-as-iframe-hide-and-show-document-at-anchor.html
               fast/repaint/object-as-iframe-navigate-to-same-document-anchor-repaint.html

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

2018-08-10  Ali Juma  <ajuma@chromium.org>

        [IntersectionObserver] Implement rootMargin parsing
        https://bugs.webkit.org/show_bug.cgi?id=188469

        Reviewed by Darin Adler.

        Parse IntersectionObserver's rootMargin argument and throw an exception if it's invalid.
        Change the stored rootMargin from a String to a LengthBox so that future patches can
        use this value in intersection logic.

        Tested by: imported/w3c/web-platform-tests/intersection-observer/observer-attributes.html
                   imported/w3c/web-platform-tests/intersection-observer/observer-exceptions.html
                   intersection-observer/intersection-observer-interface.html

        * page/IntersectionObserver.cpp:
        (WebCore::parseRootMargin):
        (WebCore::IntersectionObserver::create):
        (WebCore::IntersectionObserver::IntersectionObserver):
        (WebCore::IntersectionObserver::rootMargin const):
        * page/IntersectionObserver.h:
        (WebCore::IntersectionObserver::create): Deleted.
        (WebCore::IntersectionObserver::rootMargin const): Deleted.
        * page/IntersectionObserver.idl:

2018-08-09  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        Added functionality to FileHandle so that it can lock a file while open.
        Added a function to FileSystem to delete non empty directories.

        * platform/FileHandle.cpp:
        (WebCore::FileHandle::FileHandle):
        (WebCore::FileHandle::open):
        (WebCore::FileHandle::close):
        * platform/FileHandle.h:
        * platform/FileSystem.h:
        * platform/cocoa/FileSystemCocoa.mm:
        (WebCore::FileSystem::deleteNonEmptyDirectory):

2018-08-09  Chris Dumez  <cdumez@apple.com>

        InputType should not interact with an HTMLInputElement is no longer associated with
        https://bugs.webkit.org/show_bug.cgi?id=188410

        Reviewed by Ryosuke Niwa.

        Clear InputType::m_element when the InputType is no longer associated with the HTMLInputElement
        because the element changed type. We were already dealing with the InputType no longer being
        associated with an element because the element died by using a WeakPtr. However, it is conceptually
        better (more correct) to also clear this pointer if the element is still alive but associated with
        another InputType.

        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::updateType):
        * html/InputType.h:
        (WebCore::InputType::detachFromElement):

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

        Video playback is using more power
        https://bugs.webkit.org/show_bug.cgi?id=188452
        <rdar://problem/42298937>

        Reviewed by Eric Carlson.

        Test: TestWebKitAPI/Tests/WebKitCocoa/PreferredAudioBufferSize.mm

        When the meaning of PlatformMediaSession::Video changed to "video-only", we failed to update
        MediaSessionManagerCocoa::updateSessionState() to use the new PlatformMediaSession::VideoAudio
        enum, so Video-only sessions were getting the higher audio buffer size (where it's not needed)
        and Video-and-Audio sessions were getting the default value.

        To enable testing, add a preferredAudioBufferSize property to Internals. Also, the getter for
        AudioSession::preferredBufferSize was using the wrong CoreAudio property address, and was
        always returning 0.

        * platform/audio/AudioSession.h:
        * platform/audio/cocoa/MediaSessionManagerCocoa.cpp:
        (MediaSessionManagerCocoa::updateSessionState):
        * platform/audio/mac/AudioSessionMac.cpp:
        (WebCore::AudioSession::preferredBufferSize const):
        * testing/Internals.cpp:
        (WebCore::Internals::preferredAudioBufferSize const):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-08-09  Saam Barati  <sbarati@apple.com>

        memoryFootprint should return size_t not optional<size_t>
        https://bugs.webkit.org/show_bug.cgi?id=188444

        Reviewed by Simon Fraser.

        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::ResourceUsageOverlay::platformDraw):

2018-08-09  Ali Juma  <ajuma@chromium.org>

        Update IDL for IntersectionObserverEntry and IntersectionObserverEntryInit
        https://bugs.webkit.org/show_bug.cgi?id=188445

        Reviewed by Simon Fraser.

        Update IntersectionObserverEntry by making rootBounds nullable, and adding an
        isIntersecting attribute. Make the same changes to IntersectionObserverEntryInit,
        and also add an intersectionRatio attribute.

        Tested by intersection-observer/intersection-observer-entry-interface.html

        * page/IntersectionObserverEntry.cpp:
        (WebCore::IntersectionObserverEntry::IntersectionObserverEntry):
        * page/IntersectionObserverEntry.h:
        (WebCore::IntersectionObserverEntry::isIntersecting const):
        * page/IntersectionObserverEntry.idl:

2018-08-09  Charlie Turner  <cturner@igalia.com>

        Fix copyright headers on new ISO parsing class
        https://bugs.webkit.org/show_bug.cgi?id=188432

        Unreviewed fix.

        This was left off from a previous bug by mistake, retrospectively
        adding the correct copyright headers.

        No tests required.

        * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
        * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h:

2018-08-08  Ross Kirsling  <ross.kirsling@sony.com>

        run-bindings-tests is not Win32-compatible
        https://bugs.webkit.org/show_bug.cgi?id=188424

        Reviewed by Fujii Hironori.

        * bindings/scripts/preprocessor.pm:
        (applyPreprocessor):
        Ensure that we fall back to cl.exe if CC env var is not set on Windows.

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-08  Justin Fan  <justin_fan@apple.com>

        Prevent collectScreenProperties from crashing Base System
        https://bugs.webkit.org/show_bug.cgi?id=188429
        <rdar://problem/43075662>

        Reviewed by Simon Fraser.

        Adding some error-checking and early returns to further prevent calling CGLDescribeRenderer with invalid parameters.

        Existing WebGL tests should cover; no expected change in behavior. Crash happened primarily on Base System.

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

2018-08-08  Don Olmstead  <don.olmstead@sony.com>

        [Curl] Surface additional NetworkLoadMetrics
        https://bugs.webkit.org/show_bug.cgi?id=188391

        Reviewed by Joseph Pecoraro.

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlHandle::getNetworkLoadMetrics):

2018-08-08  Don Olmstead  <don.olmstead@sony.com>

        [Nicosia] Add the Nicosia-specific PlatformLayer type alias
        https://bugs.webkit.org/show_bug.cgi?id=188405
        <rdar://problem/43039520>

        Unreviewed build fix.

        * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:

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

        Add a WebKit2 logging channel for ActivityState
        https://bugs.webkit.org/show_bug.cgi?id=188411

        Reviewed by Tim Horton.

        Add logging for ActivityState changes and the entrypoints that affect ActivityState.
        
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * page/ActivityState.cpp: Added.
        (WebCore::activityStateFlagsToString):
        * page/ActivityState.h:

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

        Add LogArgument template for PlatformMediaSession::RemoteControlCommandType
        https://bugs.webkit.org/show_bug.cgi?id=188314

        Reviewed by Alex Christensen.

        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::didReceiveRemoteControlCommand): Don't coerce to int for logging.

        * platform/audio/PlatformMediaSession.cpp:
        (WebCore::convertEnumerationToString): New.
        (WebCore::PlatformMediaSession::didReceiveRemoteControlCommand): Log command.
        * platform/audio/PlatformMediaSession.h:
        (WTF::LogArgument<WebCore::PlatformMediaSession::RemoteControlCommandType>::toString):

2018-08-08  Joseph Pecoraro  <pecoraro@apple.com>

        Web Inspector: XHR content sometimes shows as error even though load succeeded
        https://bugs.webkit.org/show_bug.cgi?id=188385
        <rdar://problem/42646160>

        Reviewed by Devin Rousso.

        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::didReceiveData):
        Avoid a double hash lookup in the common case.
        Allow synchronous XHR to have text data appended in the normal case.
        Allow synchronous XHR to set base64 encoded data right here for non-text data.

        * inspector/NetworkResourcesData.h:
        (WebCore::NetworkResourcesData::ResourceData::hasBufferedData const):
        Getter to see if data is buffered or not for this resource.

        * inspector/NetworkResourcesData.cpp:
        (WebCore::NetworkResourcesData::maybeAddResourceData):
        Return the updated ResourceData to avoid clients having to do a lookup.

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

        Assertion failed in Webcore::Process::setIdentifier()
        https://bugs.webkit.org/show_bug.cgi?id=188404
        <rdar://problem/43029137>

        Reviewed by Chris Dumez.

        App using both WebKit1 and WebKit may crash in WebKit initialization.

        * platform/Process.cpp:
        (WebCore::Process::setIdentifier):

2018-08-08  Charlie Turner  <cturner@igalia.com>

        Add CENC sanitization
        https://bugs.webkit.org/show_bug.cgi?id=188376

        Reviewed by Xabier Rodriguez-Calvar.

        This patch adds support for sanitizing the CENC initialization
        data, to ensure there are no obviously bogus values in the
        untrusted input from generateRequest, see
        https://www.w3.org/TR/encrypted-media/#dom-mediakeysession-generaterequest
        for more details on sanitization.

        Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html

        * Modules/encryptedmedia/InitDataRegistry.cpp: The diff looks a
        bit wonky because I had to reorder extractKeyIDsCenc to come
        before sanitizeCenc.
        (WebCore::extractKeyIDsCenc): Added implementation, a nullopt
        return value here indicates the parsing found an error in the box
        values.
        (WebCore::sanitizeCenc): Added implementation, if the box can be
        parsed, return a copy of the buffer as before, otherwise an error
        value.
        * Sources.txt: Add the new PSSH box type.
        * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.cpp:
        Added, parsing methods come from ISO/IEC 23001-7-2016 Section
        8.1.1.
        (WebCore::ISOProtectionSystemSpecificHeaderBox::parse): Ditto.
        * platform/graphics/iso/ISOProtectionSystemSpecificHeaderBox.h: Ditto.
        (WebCore::ISOProtectionSystemSpecificHeaderBox::boxTypeName): Ditto.
        (WebCore::ISOProtectionSystemSpecificHeaderBox::systemID const): Ditto.
        (WebCore::ISOProtectionSystemSpecificHeaderBox::keyIDs const):
        Ditto.
        (WebCore::ISOProtectionSystemSpecificHeaderBox::data const): Ditto.

2018-08-08  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add the Nicosia-specific PlatformLayer type alias
        https://bugs.webkit.org/show_bug.cgi?id=188405

        Reviewed by Carlos Garcia Campos.

        Add a Nicosia-specific PlatformLayer type alias that points to the
        Nicosia::PlatformLayer type. This is guarded by the USE(NICOSIA) macro,
        which guards additional code in this patch but will be added to other
        Nicosia-specific classes later.

        To keep things buildable when USE(NICOSIA) is defined, additional
        changes are made to classes that operate with platform layers.
        Cairo-specific ImageBuffer implementation and the related
        ImageBufferData class are modified to work with a Nicosia::ContentLayer
        object. This object is using the TextureMapper-specific Impl class which
        internally keeps a TextureMapperPlatformLayerProxy object. This way
        we can reuse existing code that also works with an object of this type,
        only difference is where the proxy object is kept. Main difference is in
        the ImageBuffer::platformLayer() method, where pointer to the
        Nicosia::ContentLayer object is returned when USE(NICOSIA) is enabled.

        Similar approach is taked for the MediaPlayerPrivateGStreamerBase class.
        When USE(NICOSIA) is enabled, a Nicosia::ContentLayer object is
        constructed, and with the TextureMapper-specific Impl we again operate
        on the TextureMapperPlatformLayerProxy object like before, so all of
        the proxy-specific code is bundled into helper lambdas that operate on
        the given proxy object. In the platformLayer() method, we again return
        pointer to the Nicosia::ContentLayer object when USE(NICOSIA) is on.

        For the GraphicsContext3D integration, we have to provide a separate
        class that replicates most of the functionality currently present in the
        TextureMapperGC3DPlatformLayer class. Main difference is that in the new
        Nicosia::GC3DLayer class, a Nicosia::ContentLayer object is spawned with
        the TextureMapper-specific Impl. The proxy object held by that Impl is
        then again used to push new buffers into the rendering pipeline. As
        before, pointer to the Nicosia::ContentLayer is returned in the
        GraphicsContext3D::platformLayer() object.

        Integration of the GraphicsContext3D class into Nicosia layering needs
        further work in the future. Target should be providing a class that is
        not specific to the TextureMapper layer. Additionally, when USE(NICOSIA)
        is enabled, we remove the TextureMapperGC3DPlatformLayer class from
        compilation since it depends on a PlatformLayer type alias to the
        TextureMapperPlatformLayerProxyProvider class.

        This patch also doesn't address the abundance of macros that this code
        now uses. While USE(NICOSIA) is introduced, we have to work around
        four additional macros in this code: USE(TEXTURE_MAPPER),
        USE(TEXTURE_MAPPER_GL), USE(COORDINATED_GRAPHICS) and
        USE(COORDINATED_GRAPHICS_THREADED). In a lot of places these are used
        interchangeably, but they should be merged and simplified in use. I hope
        to approach this once the USE(NICOSIA) functionality lands and is turned
        on for ports that currently build with USE(COORDINATED_GRAPHICS).

        * platform/TextureMapper.cmake:
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/PlatformLayer.h:
        * platform/graphics/cairo/ImageBufferCairo.cpp:
        (WebCore::ImageBufferData::ImageBufferData):
        (WebCore::ImageBufferData::~ImageBufferData):
        (WebCore::ImageBufferData::swapBuffersIfNeeded):
        (WebCore::ImageBuffer::platformLayer const):
        * platform/graphics/cairo/ImageBufferDataCairo.h:
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::~MediaPlayerPrivateGStreamerBase):
        (WebCore::MediaPlayerPrivateGStreamerBase::platformLayer const):
        (WebCore::MediaPlayerPrivateGStreamerBase::swapBuffersIfNeeded):
        (WebCore::MediaPlayerPrivateGStreamerBase::pushTextureToCompositor):
        (WebCore::MediaPlayerPrivateGStreamerBase::triggerRepaint):
        (WebCore::MediaPlayerPrivateGStreamerBase::flushCurrentBuffer):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.h:
        * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.cpp: Added.
        (Nicosia::GC3DLayer::GC3DLayer):
        (Nicosia::GC3DLayer::~GC3DLayer):
        (Nicosia::GC3DLayer::makeContextCurrent):
        (Nicosia::GC3DLayer::platformContext):
        (Nicosia::GC3DLayer::swapBuffersIfNeeded):
        * platform/graphics/nicosia/texmap/NicosiaGC3DLayer.h: Added.
        (Nicosia::GC3DLayer::contentLayer const):
        * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp:
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        (WebCore::GraphicsContext3D::makeContextCurrent):
        (WebCore::GraphicsContext3D::platformGraphicsContext3D):
        (WebCore::GraphicsContext3D::platformLayer const):
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.cpp:
        * platform/graphics/texmap/TextureMapperGC3DPlatformLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::setContentsToPlatformLayer):
        (WebCore::CoordinatedGraphicsLayer::syncPlatformLayer):
        (WebCore::CoordinatedGraphicsLayer::updatePlatformLayer):

2018-08-08  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Update behavior of percentage row tracks and gutters
        https://bugs.webkit.org/show_bug.cgi?id=188403

        Reviewed by Sergio Villar Senin.

        The CSSWG decided to change how percentage row tracks and gutters
        in a grid container with indefinite height are resolved.

        The CSSWG issues are:
        - https://github.com/w3c/csswg-drafts/issues/1921
        - https://github.com/w3c/csswg-drafts/issues/509

        So far they were resolved as "auto", like it happens with
        percentage heights in regular blocks. But now they're going to behave
        similar to what happens in the columns axis, they would be ignored
        to compute the intrinsic height.
        This causes that we need to repeat the track sizing algorithm
        when we have a grid container with indefinite height
        that has some percentage rows using the intrinsic height
        calculated on the first pass. Then the percentages will be resolved
        against the intrinsic height.

        Tests: imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-001.html
               imported/w3c/web-platform-tests/css/css-grid/alignment/grid-content-alignment-second-pass-002.html
               imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-001.html
               imported/w3c/web-platform-tests/css/css-grid/grid-definition/grid-percentage-rows-indefinite-height-002.html

        * rendering/GridTrackSizingAlgorithm.cpp:
        (WebCore::GridTrackSizingAlgorithm::gridTrackSize const):
        (WebCore::GridTrackSizingAlgorithm::initializeTrackSizes):
        (WebCore::GridTrackSizingAlgorithm::setup):
        (WebCore::GridTrackSizingAlgorithm::reset):
        * rendering/GridTrackSizingAlgorithm.h:
        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::availableSpaceForGutters const):
        (WebCore::RenderGrid::repeatTracksSizingIfNeeded):
        (WebCore::RenderGrid::layoutBlock):

2018-08-07  Saam Barati  <sbarati@apple.com>

        ResourceUsageOverlay should use physical footprint for its "Footprint" label
        https://bugs.webkit.org/show_bug.cgi?id=188395

        Reviewed by Simon Fraser.

        Let's use physical footprint on Cocoa for the number we say is "footprint".
        Before, we were just using the number of dirty pages multiplies by
        page size. This number was an upper bound on footprint since it
        doesn't take into account compressed memory.

        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::ResourceUsageOverlay::platformDraw):

2018-08-05  Darin Adler  <darin@apple.com>

        [Cocoa] More tweaks and refactoring to prepare for ARC
        https://bugs.webkit.org/show_bug.cgi?id=188245

        Reviewed by Dan Bernstein.

        * bridge/objc/objc_instance.mm: Updated include for rename: FoundationSPI.h -> objcSPI.h.
        * platform/ios/wak/WebCoreThread.mm: Ditto.

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

        navigator.sendBeacon does not work in pagehide callbacks
        https://bugs.webkit.org/show_bug.cgi?id=188329

        Reviewed by Alex Christensen.

        Add support for sending beacons from pagehide event handlers. We normally do not allow loads because we're
        about to enter PageCache. However, in case of Beacon, this is fine since it uses PingLoad and does not
        WebCore to do the load.

        Test: http/wpt/beacon/sendBeacon-in-pagehide.html

        * loader/cache/CachedResource.cpp:
        (WebCore::CachedResource::load):
        - Allow Beacon loads to go through even if the document's pageCacheState is AboutToEnterPageCache (i.e.
        we're firing the 'pagehide' event)
        - Allow Becon loads to go though even if the FrameLoader's state is provisional (i.e. a load is pending)

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

        Allow href attribute without xlink on SVG elements
        https://bugs.webkit.org/show_bug.cgi?id=153854

        Reviewed by Dean Jackson.

        SVG 2 has moved the href attribute from xlink namespace to svg namespace.
        Instead of using xlink:href, svg:href should be used or simply use href 
        if the svg namespace is defined.

        See https://www.w3.org/TR/SVG2/linking.html#XLinkRefAttrs.

        For backward compatibility, xlink:href will be treated as an alias to href
        till it is acceptable to completely remove the support for the deprecated 
        xlink:href.

        Tests: svg/custom/href-svg-namespace-animate.svg
               svg/custom/href-svg-namespace-dynamic.svg
               svg/custom/href-svg-namespace-elements.html
               svg/custom/href-svg-namespace-expected.svg
               svg/custom/href-svg-namespace-static.svg

        * dom/Element.cpp:
        (WebCore::Element::absoluteLinkURL const):
        * dom/Element.h:
        (WebCore::Element::getAttribute const): This new template function with
        template pack parameter QualifiedNames is added to return the first none
        empty attribute value given a set of attributes' names. This should be
        useful for deprecated attributes. When we decide to remove the support 
        for the deprecated attribute, all we need is to remove it as a parameter
        to getAttribute(). In this case, the none template function will be called.
        * dom/VisitedLinkState.cpp:
        (WebCore::linkAttribute):
        * html/parser/XSSAuditor.cpp:
        (WebCore::XSSAuditor::filterScriptToken):
        * svg/SVGAElement.cpp:
        (WebCore::SVGAElement::isURLAttribute const):
        * svg/SVGAltGlyphElement.cpp:
        (WebCore::SVGAltGlyphElement::hasValidGlyphElements const):
        * svg/SVGCursorElement.cpp:
        * svg/SVGDocumentExtensions.cpp:
        (WebCore::SVGDocumentExtensions::rebuildElements):
        (WebCore::SVGDocumentExtensions::rebuildAllElementReferencesForTarget):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::animatableAttributeForName):
        * svg/SVGFEImageElement.cpp:
        * svg/SVGFilterElement.cpp:
        * svg/SVGFontFaceUriElement.cpp:
        (WebCore::SVGFontFaceUriElement::srcValue const):
        (WebCore::SVGFontFaceUriElement::parseAttribute):
        (WebCore::SVGFontFaceUriElement::loadFont):
        * svg/SVGForeignObjectElement.cpp:
        * svg/SVGGlyphRefElement.cpp:
        (WebCore::SVGGlyphRefElement::hasValidGlyphElement const):
        * svg/SVGGradientElement.cpp:
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::imageSourceURL const):
        * svg/SVGMPathElement.cpp:
        * svg/SVGPatternElement.cpp:
        * svg/SVGScriptElement.h:
        * svg/SVGTRefElement.cpp:
        * svg/SVGTextPathElement.cpp:
        * svg/SVGURIReference.cpp:
        (WebCore::SVGURIReference::registerAttributes):
        (WebCore::SVGURIReference::parseAttribute):
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::expandUseElementsInShadowTree const):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::isSupportedAttribute):
        (WebCore::SVGSMILElement::svgAttributeChanged):
        * svg/svgattrs.in:

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

        document.open and document.write must throw while the HTML parser is synchronously constructing a custom element
        https://bugs.webkit.org/show_bug.cgi?id=187319
        <rdar://problem/42843012>

        Reviewed by Frédéric Wang.

        Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during
        a synchronous custom element construction as specified:
        https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
        https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter

        Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
               fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero.
        (WebCore::Document::closeForBindings): Ditto.
        (WebCore::Document::write): Ditto.
        (WebCore::Document::writeln): Ditto.
        * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs.
        * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added.
        (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added.
        (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer):
        (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer):
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer.

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

        Use 1-byte enum class for Document::StandaloneStatus
        https://bugs.webkit.org/show_bug.cgi?id=188352

        Reviewed by Chris Dumez.

        * dom/Document.cpp:
        (WebCore::Document::setXMLStandalone):
        * dom/Document.h:
        (WebCore::Document::xmlStandalone const):
        * editing/MarkupAccumulator.cpp:
        (WebCore::MarkupAccumulator::appendXMLDeclaration):

2018-08-07  Rob Buis  <rbuis@igalia.com>

        fetch() with subresource integrity crashes on zero length body
        https://bugs.webkit.org/show_bug.cgi?id=184325

        Reviewed by Alex Christensen.

        Check that resourceBuffer() is non null before dereferencing.

        Tests: http/tests/subresource-integrity/sri-fetch.js
               http/tests/subresource-integrity/sri-fetch-worker.js

        * loader/DocumentThreadableLoader.cpp:
        (WebCore::DocumentThreadableLoader::didFinishLoading):

2018-08-07  Justin Fan  <justin_fan@apple.com>

        Prevent querying for renderer info for disconnected or uninitialized displays
        https://bugs.webkit.org/show_bug.cgi?id=188387
        <rdar://problem/42588769>

        Reviewed by Simon Fraser.

        Calling CGL functions with a NULL displayMask crashes the process.

        No tests; requires multiple displays.

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

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

        document.open and document.write must throw while the HTML parser is synchronously constructing a custom element
        https://bugs.webkit.org/show_bug.cgi?id=187319
        <rdar://problem/42843012>

        Reviewed by Frédéric Wang.

        Make document.open, document.write, document.writeln, and document.close throw InvalidStateError during
        a synchronous custom element construction as specified:
        https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
        https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#throw-on-dynamic-markup-insertion-counter

        Tests: fast/custom-elements/throw-on-dynamic-markup-insertion-counter-construct.html
               fast/custom-elements/throw-on-dynamic-markup-insertion-counter-reactions.html

        * WebCore.xcodeproj/project.pbxproj:
        * dom/Document.cpp:
        (WebCore::Document::openForBindings): Throw InvalidStateError when m_throwOnDynamicMarkupInsertionCount is non-zero.
        (WebCore::Document::closeForBindings): Ditto.
        (WebCore::Document::write): Ditto.
        (WebCore::Document::writeln): Ditto.
        * dom/Document.h: Re-ordered the related instance variables in the order they appear in the spec, and updated spec URLs.
        * dom/ThrowOnDynamicMarkupInsertionCountIncrementer.h: Added.
        (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer): Added.
        (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::ThrowOnDynamicMarkupInsertionCountIncrementer):
        (WebCore::ThrowOnDynamicMarkupInsertionCountIncrementer::~ThrowOnDynamicMarkupInsertionCountIncrementer):
        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate ThrowOnDynamicMarkupInsertionCountIncrementer.

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

        Unreviewed, suppress warnings to fix the build.

        * crypto/CommonCryptoUtilities.cpp:
        (WebCore::getCommonCryptoDigestAlgorithm):

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

        Removed unused *AllInOne.cpp
        https://bugs.webkit.org/show_bug.cgi?id=188369

        Reviewed by Yusuke Suzuki.

        * accessibility/AccessibilityAllInOne.cpp: Removed.
        * bindings/js/JSBindingsAllInOne.cpp: Removed.
        * css/CSSAllInOne.cpp: Removed.
        * dom/DOMAllInOne.cpp: Removed.
        * editing/EditingAllInOne.cpp: Removed.
        * html/HTMLElementsAllInOne.cpp: Removed.
        * inspector/InspectorAllInOne.cpp: Removed.
        * loader/appcache/ApplicationCacheAllInOne.cpp: Removed.
        * mathml/MathMLAllInOne.cpp: Removed.
        * platform/text/TextAllInOne.cpp: Removed.
        * rendering/RenderingAllInOne.cpp: Removed.
        * rendering/style/StyleAllInOne.cpp: Removed.
        * rendering/svg/RenderSVGAllInOne.cpp: Removed.
        * svg/SVGAllInOne.cpp: Removed.

2018-08-07  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE][GTK] Handle some virtual keys commonly used on TVs
        https://bugs.webkit.org/show_bug.cgi?id=188375

        Reviewed by Žan Doberšek.

        * platform/gtk/PlatformKeyboardEventGtk.cpp:
        (WebCore::PlatformKeyboardEvent::keyValueForGdkKeyCode):
        (WebCore::PlatformKeyboardEvent::windowsKeyCodeForGdkKeyCode):
        * platform/wpe/PlatformKeyboardEventWPE.cpp:
        (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
        (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode):

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

        [Nicosia] Add Nicosia::CompositionLayerTextureMapperImpl
        https://bugs.webkit.org/show_bug.cgi?id=188348

        Reviewed by Carlos Garcia Campos.

        Add the Nicosia::CompositionLayerTextureMapperImpl class, the
        TextureMapper-specific implementation that will extend the
        CompositionLayer class.

        The important deatil of this implementation is the TextureMapperLayer
        object that's expected to be managed by the composition controller. As
        such, it is placed inside the CompositionState struct to clearly
        indicate its utility and expected place of management. In the current
        setup, this place would be the CoordinatedGraphicsScene class.

        The Nicosia::CompositionLayer object that's spawned for each
        CoordinatedGraphicsLayer instance is now switched to using the
        CompositionLayerTextureMapperImpl object, with the local temporary no-op
        CompositionLayer::Impl class removed.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.cpp: Added.
        (Nicosia::CompositionLayerTextureMapperImpl::createFactory):
        * platform/graphics/nicosia/texmap/NicosiaCompositionLayerTextureMapperImpl.h: Added.
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):
        (): Deleted.

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

        [Nicosia] Add the TextureMapper-specific ContentLayer::Impl derivative
        https://bugs.webkit.org/show_bug.cgi?id=188344

        Reviewed by Carlos Garcia Campos.

        Add Nicosia::ContentLayerTextureMapperImpl class, providing the
        TextureMapper-specific implementation that derives from the
        ContentLayer::Impl class and which can be used by the
        Nicosia::ContentLayer instances.

        Internally a TextureMapperPlatformLayerProxy is created, and is
        accessible to others through a getter. This way the content producers
        can push new buffers into this proxy object, and the scene compositor
        can take these buffers for display purposes.

        Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded() will be
        called during layer flushes, and the call will cause the content layer
        clients to take their texture, wrap it into a buffer, and push it into
        the TextureMapperPlatformLayerProxy object. At the moment this operation
        is required by the ImageBuffer and GraphicsContext3D producers.

        The Client object is managed under its own lock. While the producers
        will only live on the main thread, the thread-safe check in the
        destructor is necessary in case the ContentLayerTextureMapperImpl object
        ends up being destroyed on some other thread.

        The patch only adds the class implementation. It will be integrated into
        the layer tree later, once all the other pieces of the puzzle land.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.cpp: Added.
        (Nicosia::ContentLayerTextureMapperImpl::createFactory):
        (Nicosia::ContentLayerTextureMapperImpl::ContentLayerTextureMapperImpl):
        (Nicosia::ContentLayerTextureMapperImpl::~ContentLayerTextureMapperImpl):
        (Nicosia::ContentLayerTextureMapperImpl::invalidateClient):
        (Nicosia::ContentLayerTextureMapperImpl::swapBuffersIfNeeded):
        * platform/graphics/nicosia/texmap/NicosiaContentLayerTextureMapperImpl.h: Added.

2018-08-07  Frederic Wang  <fwang@igalia.com>

        Make DOMWindow::scrollBy rely on DOMWindow::scrollTo
        https://bugs.webkit.org/show_bug.cgi?id=188343

        Reviewed by Darin Adler.

        This patch makes DOMWindow::scrollBy rely on DOMWindow::scrollTo in order to perform actual
        scrolling of the view. In particular, this reduces the number of code path to modify in order
        to implement the ScrollBehavior option (bug 188043). The only change is an optimization when
        scrolling to position (0, 0) but it is not observable.

        No new tests, behavior unchanged and already tested.

        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::scrollBy const): Add the current view position to the scrollBy offset in
        order to obtain the scrollTo offset.

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

        Add CEReactions=NotNeeded for reactions only needed for customized builtins
        https://bugs.webkit.org/show_bug.cgi?id=187851

        Reviewed by Chris Dumez.

        Because WebKit doesn't and will not support customized builtin elements, there are many DOM APIs marked with
        [CEReactions] which don't actually need CustomElementReactionStack.

        To clarify and document this difference, this patch introduces WebKit extention: [CEReactions=NotNeeded].
        When this IDL attribute is specified, we generate CustomElementReactionDisallowedScope in the bindings code
        to assert that there are no custom elements reactions being enqueued within the DOM API.

        We suppress this assertion in CustomElementReactionStack since a DOM API with [CEReactions=NotNeeded] can
        synchronously fire an event and otherwise execute arbirary scripts, which in turn could invoke a DOM API
        with [CEReactions].

        This patch deployes this change to HTMLIFrameElement since "src" IDL attribute triggers this second scenario.

        Test: fast/custom-elements/custom-element-reaction-within-disallowed-scope.html

        * bindings/scripts/CodeGeneratorJS.pm:
        (GeneratePut):
        (GeneratePutByIndex):
        (GenerateDefineOwnProperty):
        (GenerateDeletePropertyCommon):
        (GenerateAttributeSetterBodyDefinition):
        (GenerateCustomElementReactionsStackIfNeeded): Added. Generate CustomElementReactionStack for [CEReactions]
        and CustomElementReactionDisallowedScope for [CEReactions=NotNeeded].
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        * bindings/scripts/test/TestCEReactions.idl: Added test cases for [CEReactions=NotNeeded].
        * bindings/scripts/test/TestCEReactionsStringifier.idl: Ditto.
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Added an assertion to catch cases where
        a DOM API with [CEReactions=NotNeeded] enqueues a custom element reaction; i.e. cases where [CEReactions]
        should have been used.
        (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded): Ditto.
        (WebCore::CustomElementReactionQueue::enqueuePostUpgradeReactions): Ditto.
        * dom/CustomElementReactionQueue.h:
        (WebCore::CustomElementReactionDisallowedScope): Added. Enables the assertion in enqueue* functions above.
        (WebCore::CustomElementReactionDisallowedScope::CustomElementReactionDisallowedScope): Added.
        (WebCore::CustomElementReactionDisallowedScope::~CustomElementReactionDisallowedScope): Added.
        (WebCore::CustomElementReactionDisallowedScope::isReactionAllowed): Added.
        (WebCore::CustomElementReactionDisallowedScope::AllowedScope): Added.
        (WebCore::CustomElementReactionDisallowedScope::AllowedScope::AllowedScope): Added.
        (WebCore::CustomElementReactionDisallowedScope::AllowedScope::~AllowedScope): Added.
        (WebCore::CustomElementReactionStack): Suppress the assertion. See above for why this is needed.
        * html/HTMLIFrameElement.idl:

2018-08-06  Simon Fraser  <simon.fraser@apple.com>

        Clean up initialization of some RenderLayer members
        https://bugs.webkit.org/show_bug.cgi?id=188330

        Reviewed by Dean Jackson.

        Use initializers for the pointers. No need to initialize LayoutUnits, which initialize to zero.

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

2018-08-06  Said Abou-Hallawa  <sabouhallawa@apple.com>

        Remove the SVG elements' attributes macros
        https://bugs.webkit.org/show_bug.cgi?id=186751

        Reviewed by Simon Fraser.

        This is how the SVG attributes are implemented after removing the SVG macros:

        1) The SVG attribute is defined as a super class of SVGAttribute. The super
           classes of SVGAttribute are template classes. The type of these template
           are the property type or the TearOff type.

        2) To unify accessing attributes of the SVGElements and its super classes
           an SVGAttributeAccessor template class is added. It is inherited by other
           template classes. The types of these templates are the owner and the
           attributes types. The main functions of these classes is to synchronize 
           the new property value with the document attributes pool and to create
           and cache the TearOff objects.

        3) To make code shorter and more readable, attribute types and attribute
           accessors are defined for every SVG TearOff type, e.g. 
           -- SVGLength: 
                SVGAnimatedLengthAttribute and SVGAnimatedLengthAttributeAccessor
           -- SVGAnimatedNumber: 
                SVGAnimatedNumberAttribute and SVGAnimatedNumberAttributeAccessor

        4) A special accessor is defined for animated pair and optional attributes:
           SVGAnimatedPairAttributeAccessor, e.g.
           -- SVGMarkerElement:
                orient attribute: "angle" or "type"
           -- SVGFEGaussianBlurElement:
                stdDeviation attribute: "x" and "y"

        5) The SVG attributes have to be registered into an singleton SVGAttributeRegistry.
           The SVGAttributeRegistry is a template class. The types of this template
           class are the the type of the owner and the base classes of this owner.
           This registry holds a map from "attribute name" to  "attribute accessor".

        6) To make the code easier to read, the SVGAttributeRegistry implements
           registerAttribute() for different attribute types. The owner needs only
           to provide the attribute name and a pointer to the class member of this
           attribute to the same function "registerAttribute()". The compiler will
           pick the right function to call based on the type of the attribute.

        7) Given a reference to the owner element, SVGAttributeRegistry can loop
           through the attributes of this owner and through the attributes of its
           base classes as well to do operations like synchronizing all the attributes
           or creating the TearOff object of a certain attribute.

        8) To make the base class SVGElement have the ability to access the attributes
           of any of its super classes, SVGAttributeOwnerProxy will be used.
           SVGAttributeOwnerProxy is a base class which have all the functions that
           SVGElement needs as pure virtual functions.

        9) SVGAttributeOwnerProxyImpl is a template class which implements 
           SVGAttributeOwnerProxy and whose types are the owner and its base classes.
           SVGAttributeOwnerProxyImpl keeps a reference to the owner and the context
           SVGElement.

        10) All the SVG attribute owners have to implement the virtual function
            attributeOwnerProxy() which returns a reference to SVGAttributeOwnerProxy.
            The local attributeOwnerProxy() returns a reference to a local
            SVGAttributeOwnerProxyImpl. Its type and base types are the class
            hierarchy of this element.

        All the attributes of the non-SVGElement-based classes are moved as members
        of these classes instead of adding them to all the super classes. These
        classes are:
           -- SVGExternalResourcesRequired
           -- SVGURIReference
           -- SVGFitToViewBox
           -- SVGZoomAndPan
           -- SVGLangSpace

        The svgAttributeChanged() of all the SVGElement-based classes are now 
        simplified by distributing the responsibilities of changing an attribute
        to the base classes. One exception is the SVGURIReference since the action
        to be taken when changing the "href" is different for every super class.

        Other work will be done in separate patches.
           -- Shrinking the memory of the SVGElements.
           -- Making all the attributes RefCounted objects.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * rendering/svg/RenderSVGResourceMarker.cpp:
        (WebCore::RenderSVGResourceMarker::draw):
        * svg/SVGAElement.cpp:
        (WebCore::SVGAElement::SVGAElement):
        (WebCore::SVGAElement::registerAttributes):
        (WebCore::SVGAElement::parseAttribute):
        (WebCore::SVGAElement::svgAttributeChanged):
        * svg/SVGAElement.h:
        * svg/SVGAElement.idl:
        * svg/SVGAltGlyphElement.cpp:
        (WebCore::SVGAltGlyphElement::SVGAltGlyphElement):
        * svg/SVGAltGlyphElement.h:
        * svg/SVGAnimatedAngle.h:
        * svg/SVGAnimatedBoolean.h:
        * svg/SVGAnimatedEnumeration.h:
        * svg/SVGAnimatedInteger.h:
        * svg/SVGAnimatedLength.h:
        * svg/SVGAnimatedLengthList.h:
        * svg/SVGAnimatedNumber.h:
        * svg/SVGAnimatedNumberList.h:
        * svg/SVGAnimatedPath.h:
        * svg/SVGAnimatedPointList.h:
        * svg/SVGAnimatedPreserveAspectRatio.h:
        * svg/SVGAnimatedRect.h:
        * svg/SVGAnimatedString.h:
        * svg/SVGAnimatedTransformList.h:
        * svg/SVGAnimatedTypeAnimator.cpp:
        (WebCore::SVGAnimatedTypeAnimator::findAnimatedPropertiesForAttributeName):
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::SVGAnimationElement):
        (WebCore::SVGAnimationElement::requiredFeatures): Deleted.
        (WebCore::SVGAnimationElement::requiredExtensions): Deleted.
        (WebCore::SVGAnimationElement::systemLanguage): Deleted.
        * svg/SVGAnimationElement.h:
        (WebCore::SVGAnimationElement::attributeRegistry):
        * svg/SVGCircleElement.cpp:
        (WebCore::SVGCircleElement::SVGCircleElement):
        (WebCore::SVGCircleElement::registerAttributes):
        (WebCore::SVGCircleElement::parseAttribute):
        (WebCore::SVGCircleElement::svgAttributeChanged):
        * svg/SVGCircleElement.h:
        * svg/SVGClipPathElement.cpp:
        (WebCore::SVGClipPathElement::SVGClipPathElement):
        (WebCore::SVGClipPathElement::registerAttributes):
        (WebCore::SVGClipPathElement::parseAttribute):
        (WebCore::SVGClipPathElement::svgAttributeChanged):
        (WebCore::SVGClipPathElement::isSupportedAttribute): Deleted.
        * svg/SVGClipPathElement.h:
        * svg/SVGComponentTransferFunctionElement.cpp:
        (WebCore::SVGComponentTransferFunctionElement::SVGComponentTransferFunctionElement):
        (WebCore::SVGComponentTransferFunctionElement::registerAttributes):
        (WebCore::SVGComponentTransferFunctionElement::parseAttribute):
        (WebCore::SVGComponentTransferFunctionElement::svgAttributeChanged):
        (WebCore::SVGComponentTransferFunctionElement::transferFunction const):
        (WebCore::SVGComponentTransferFunctionElement::isSupportedAttribute): Deleted.
        * svg/SVGComponentTransferFunctionElement.h:
        (WebCore::SVGComponentTransferFunctionElement::type const):
        (WebCore::SVGComponentTransferFunctionElement::tableValues const):
        (WebCore::SVGComponentTransferFunctionElement::slope const):
        (WebCore::SVGComponentTransferFunctionElement::intercept const):
        (WebCore::SVGComponentTransferFunctionElement::amplitude const):
        (WebCore::SVGComponentTransferFunctionElement::exponent const):
        (WebCore::SVGComponentTransferFunctionElement::offset const):
        (WebCore::SVGComponentTransferFunctionElement::typeAnimated):
        (WebCore::SVGComponentTransferFunctionElement::tableValuesAnimated):
        (WebCore::SVGComponentTransferFunctionElement::slopeAnimated):
        (WebCore::SVGComponentTransferFunctionElement::interceptAnimated):
        (WebCore::SVGComponentTransferFunctionElement::amplitudeAnimated):
        (WebCore::SVGComponentTransferFunctionElement::exponentAnimated):
        (WebCore::SVGComponentTransferFunctionElement::offsetAnimated):
        (WebCore::SVGComponentTransferFunctionElement::attributeRegistry):
        (WebCore::SVGComponentTransferFunctionElement::isKnownAttribute):
        * svg/SVGCursorElement.cpp:
        (WebCore::SVGCursorElement::SVGCursorElement):
        (WebCore::SVGCursorElement::registerAttributes):
        (WebCore::SVGCursorElement::parseAttribute):
        (WebCore::SVGCursorElement::svgAttributeChanged):
        (WebCore::SVGCursorElement::isSupportedAttribute): Deleted.
        (WebCore::SVGCursorElement::requiredFeatures): Deleted.
        (WebCore::SVGCursorElement::requiredExtensions): Deleted.
        (WebCore::SVGCursorElement::systemLanguage): Deleted.
        * svg/SVGCursorElement.h:
        * svg/SVGDefsElement.cpp:
        (WebCore::SVGDefsElement::SVGDefsElement):
        * svg/SVGDefsElement.h:
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::SVGElement):
        (WebCore::SVGElement::registerAttributes):
        (WebCore::SVGElement::parseAttribute):
        (WebCore::SVGElement::animatedPropertyTypesForAttribute):
        (WebCore::SVGElement::synchronizeAllAnimatedSVGAttribute):
        (WebCore::SVGElement::synchronizeAnimatedSVGAttribute const):
        (WebCore::SVGElement::isPresentationAttributeWithSVGDOM):
        (WebCore::SVGElement::svgAttributeChanged):
        (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
        (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
        (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
        (WebCore::SVGElement::isKnownAttribute): Deleted.
        * svg/SVGElement.h:
        (WebCore::SVGElement::attributeRegistry):
        (WebCore::SVGElement::isKnownAttribute):
        (WebCore::SVGElement::attributeOwnerProxy const):
        (WebCore::SVGElement::synchronizeAttribute):
        (WebCore::SVGElement::synchronizeAttributes):
        (WebCore::SVGElement::animatedTypes const):
        (WebCore::SVGElement::lookupAnimatedProperty const):
        (WebCore::SVGElement::lookupOrCreateAnimatedProperty):
        (WebCore::SVGElement::lookupOrCreateAnimatedProperties):
        (WebCore::SVGElement::className const):
        (WebCore::SVGElement::classNameAnimated):
        (WebCore::SVGElement::synchronizeRequiredFeatures): Deleted.
        (WebCore::SVGElement::synchronizeRequiredExtensions): Deleted.
        (WebCore::SVGElement::synchronizeSystemLanguage): Deleted.
        * svg/SVGEllipseElement.cpp:
        (WebCore::SVGEllipseElement::SVGEllipseElement):
        (WebCore::SVGEllipseElement::registerAttributes):
        (WebCore::SVGEllipseElement::parseAttribute):
        (WebCore::SVGEllipseElement::svgAttributeChanged):
        * svg/SVGEllipseElement.h:
        * svg/SVGExternalResourcesRequired.cpp:
        (WebCore::SVGExternalResourcesRequired::SVGExternalResourcesRequired):
        (WebCore::SVGExternalResourcesRequired::registerAttributes):
        (WebCore::SVGExternalResourcesRequired::parseAttribute):
        (WebCore::SVGExternalResourcesRequired::svgAttributeChanged):
        (WebCore::SVGExternalResourcesRequired::addSupportedAttributes):
        (WebCore::SVGExternalResourcesRequired::dispatchLoadEvent):
        (WebCore::SVGExternalResourcesRequired::insertedIntoDocument):
        (WebCore::SVGExternalResourcesRequired::finishParsingChildren):
        (WebCore::SVGExternalResourcesRequired::haveLoadedRequiredResources const):
        (WebCore::SVGExternalResourcesRequired::isKnownAttribute): Deleted.
        (WebCore::SVGExternalResourcesRequired::handleAttributeChange): Deleted.
        * svg/SVGExternalResourcesRequired.h:
        (WebCore::SVGExternalResourcesRequired::attributeRegistry):
        (WebCore::SVGExternalResourcesRequired::externalResourcesRequiredAnimated):
        (WebCore::SVGExternalResourcesRequired::externalResourcesRequired const):
        (WebCore::SVGExternalResourcesRequired::setExternalResourcesRequired):
        (WebCore::SVGExternalResourcesRequired::isKnownAttribute):
        (WebCore::SVGExternalResourcesRequired::attributeOwnerProxy):
        * svg/SVGFEBlendElement.cpp:
        (WebCore::SVGFEBlendElement::SVGFEBlendElement):
        (WebCore::SVGFEBlendElement::registerAttributes):
        (WebCore::SVGFEBlendElement::parseAttribute):
        * svg/SVGFEBlendElement.h:
        * svg/SVGFEColorMatrixElement.cpp:
        (WebCore::SVGFEColorMatrixElement::SVGFEColorMatrixElement):
        (WebCore::SVGFEColorMatrixElement::registerAttributes):
        (WebCore::SVGFEColorMatrixElement::parseAttribute):
        * svg/SVGFEColorMatrixElement.h:
        * svg/SVGFEComponentTransferElement.cpp:
        (WebCore::SVGFEComponentTransferElement::SVGFEComponentTransferElement):
        (WebCore::SVGFEComponentTransferElement::registerAttributes):
        (WebCore::SVGFEComponentTransferElement::parseAttribute):
        * svg/SVGFEComponentTransferElement.h:
        * svg/SVGFECompositeElement.cpp:
        (WebCore::SVGFECompositeElement::SVGFECompositeElement):
        (WebCore::SVGFECompositeElement::registerAttributes):
        (WebCore::SVGFECompositeElement::parseAttribute):
        * svg/SVGFECompositeElement.h:
        * svg/SVGFEConvolveMatrixElement.cpp:
        (WebCore::SVGFEConvolveMatrixElement::SVGFEConvolveMatrixElement):
        (WebCore::SVGFEConvolveMatrixElement::registerAttributes):
        (WebCore::SVGFEConvolveMatrixElement::parseAttribute):
        (WebCore::SVGFEConvolveMatrixElement::setFilterEffectAttribute):
        (WebCore::SVGFEConvolveMatrixElement::setOrder):
        (WebCore::SVGFEConvolveMatrixElement::setKernelUnitLength):
        * svg/SVGFEConvolveMatrixElement.h:
        (WebCore::SVGPropertyTraits<EdgeModeType>::initialValue):
        * svg/SVGFEDiffuseLightingElement.cpp:
        (WebCore::SVGFEDiffuseLightingElement::SVGFEDiffuseLightingElement):
        (WebCore::SVGFEDiffuseLightingElement::registerAttributes):
        (WebCore::SVGFEDiffuseLightingElement::parseAttribute):
        * svg/SVGFEDiffuseLightingElement.h:
        * svg/SVGFEDisplacementMapElement.cpp:
        (WebCore::SVGFEDisplacementMapElement::SVGFEDisplacementMapElement):
        (WebCore::SVGFEDisplacementMapElement::registerAttributes):
        (WebCore::SVGFEDisplacementMapElement::parseAttribute):
        * svg/SVGFEDisplacementMapElement.h:
        * svg/SVGFEDropShadowElement.cpp:
        (WebCore::SVGFEDropShadowElement::SVGFEDropShadowElement):
        (WebCore::SVGFEDropShadowElement::setStdDeviation):
        (WebCore::SVGFEDropShadowElement::registerAttributes):
        (WebCore::SVGFEDropShadowElement::parseAttribute):
        (WebCore::SVGFEDropShadowElement::svgAttributeChanged):
        * svg/SVGFEDropShadowElement.h:
        * svg/SVGFEGaussianBlurElement.cpp:
        (WebCore::SVGFEGaussianBlurElement::SVGFEGaussianBlurElement):
        (WebCore::SVGFEGaussianBlurElement::setStdDeviation):
        (WebCore::SVGFEGaussianBlurElement::registerAttributes):
        (WebCore::SVGFEGaussianBlurElement::parseAttribute):
        (WebCore::SVGFEGaussianBlurElement::svgAttributeChanged):
        * svg/SVGFEGaussianBlurElement.h:
        * svg/SVGFEImageElement.cpp:
        (WebCore::SVGFEImageElement::SVGFEImageElement):
        (WebCore::SVGFEImageElement::registerAttributes):
        (WebCore::SVGFEImageElement::parseAttribute):
        * svg/SVGFEImageElement.h:
        * svg/SVGFELightElement.cpp:
        (WebCore::SVGFELightElement::SVGFELightElement):
        (WebCore::SVGFELightElement::registerAttributes):
        (WebCore::SVGFELightElement::parseAttribute):
        (WebCore::SVGFELightElement::svgAttributeChanged):
        * svg/SVGFELightElement.h:
        (WebCore::SVGFELightElement::azimuth const):
        (WebCore::SVGFELightElement::elevation const):
        (WebCore::SVGFELightElement::x const):
        (WebCore::SVGFELightElement::y const):
        (WebCore::SVGFELightElement::z const):
        (WebCore::SVGFELightElement::pointsAtX const):
        (WebCore::SVGFELightElement::pointsAtY const):
        (WebCore::SVGFELightElement::pointsAtZ const):
        (WebCore::SVGFELightElement::specularExponent const):
        (WebCore::SVGFELightElement::limitingConeAngle const):
        (WebCore::SVGFELightElement::azimuthAnimated):
        (WebCore::SVGFELightElement::elevationAnimated):
        (WebCore::SVGFELightElement::xAnimated):
        (WebCore::SVGFELightElement::yAnimated):
        (WebCore::SVGFELightElement::zAnimated):
        (WebCore::SVGFELightElement::pointsAtXAnimated):
        (WebCore::SVGFELightElement::pointsAtYAnimated):
        (WebCore::SVGFELightElement::pointsAtZAnimated):
        (WebCore::SVGFELightElement::specularExponentAnimated):
        (WebCore::SVGFELightElement::limitingConeAngleAnimated):
        (WebCore::SVGFELightElement::attributeRegistry):
        (WebCore::SVGFELightElement::isKnownAttribute):
        * svg/SVGFEMergeNodeElement.cpp:
        (WebCore::SVGFEMergeNodeElement::SVGFEMergeNodeElement):
        (WebCore::SVGFEMergeNodeElement::registerAttributes):
        (WebCore::SVGFEMergeNodeElement::parseAttribute):
        * svg/SVGFEMergeNodeElement.h:
        * svg/SVGFEMorphologyElement.cpp:
        (WebCore::SVGFEMorphologyElement::SVGFEMorphologyElement):
        (WebCore::SVGFEMorphologyElement::setRadius):
        (WebCore::SVGFEMorphologyElement::registerAttributes):
        (WebCore::SVGFEMorphologyElement::parseAttribute):
        * svg/SVGFEMorphologyElement.h:
        * svg/SVGFEOffsetElement.cpp:
        (WebCore::SVGFEOffsetElement::SVGFEOffsetElement):
        (WebCore::SVGFEOffsetElement::registerAttributes):
        (WebCore::SVGFEOffsetElement::parseAttribute):
        (WebCore::SVGFEOffsetElement::svgAttributeChanged):
        * svg/SVGFEOffsetElement.h:
        * svg/SVGFESpecularLightingElement.cpp:
        (WebCore::SVGFESpecularLightingElement::SVGFESpecularLightingElement):
        (WebCore::SVGFESpecularLightingElement::registerAttributes):
        (WebCore::SVGFESpecularLightingElement::parseAttribute):
        * svg/SVGFESpecularLightingElement.h:
        * svg/SVGFETileElement.cpp:
        (WebCore::SVGFETileElement::SVGFETileElement):
        (WebCore::SVGFETileElement::registerAttributes):
        (WebCore::SVGFETileElement::parseAttribute):
        * svg/SVGFETileElement.h:
        * svg/SVGFETurbulenceElement.cpp:
        (WebCore::SVGFETurbulenceElement::SVGFETurbulenceElement):
        (WebCore::SVGFETurbulenceElement::registerAttributes):
        (WebCore::SVGFETurbulenceElement::parseAttribute):
        (WebCore::SVGFETurbulenceElement::setFilterEffectAttribute):
        (WebCore::SVGFETurbulenceElement::svgAttributeChanged):
        * svg/SVGFETurbulenceElement.h:
        * svg/SVGFilterElement.cpp:
        (WebCore::SVGFilterElement::SVGFilterElement):
        (WebCore::SVGFilterElement::setFilterRes):
        (WebCore::SVGFilterElement::registerAttributes):
        (WebCore::SVGFilterElement::parseAttribute):
        (WebCore::SVGFilterElement::svgAttributeChanged):
        (WebCore::SVGFilterElement::isSupportedAttribute): Deleted.
        * svg/SVGFilterElement.h:
        * svg/SVGFilterPrimitiveStandardAttributes.cpp:
        (WebCore::SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes):
        (WebCore::SVGFilterPrimitiveStandardAttributes::registerAttributes):
        (WebCore::SVGFilterPrimitiveStandardAttributes::parseAttribute):
        (WebCore::SVGFilterPrimitiveStandardAttributes::svgAttributeChanged):
        (WebCore::SVGFilterPrimitiveStandardAttributes::isSupportedAttribute): Deleted.
        * svg/SVGFilterPrimitiveStandardAttributes.h:
        (WebCore::SVGFilterPrimitiveStandardAttributes::attributeRegistry):
        (WebCore::SVGFilterPrimitiveStandardAttributes::x const):
        (WebCore::SVGFilterPrimitiveStandardAttributes::y const):
        (WebCore::SVGFilterPrimitiveStandardAttributes::width const):
        (WebCore::SVGFilterPrimitiveStandardAttributes::height const):
        (WebCore::SVGFilterPrimitiveStandardAttributes::result const):
        (WebCore::SVGFilterPrimitiveStandardAttributes::xAnimated):
        (WebCore::SVGFilterPrimitiveStandardAttributes::yAnimated):
        (WebCore::SVGFilterPrimitiveStandardAttributes::widthAnimated):
        (WebCore::SVGFilterPrimitiveStandardAttributes::heightAnimated):
        (WebCore::SVGFilterPrimitiveStandardAttributes::resultAnimated):
        (WebCore::SVGFilterPrimitiveStandardAttributes::isKnownAttribute):
        * svg/SVGFitToViewBox.cpp:
        (WebCore::SVGFitToViewBox::SVGFitToViewBox):
        (WebCore::SVGFitToViewBox::registerAttributes):
        (WebCore::SVGFitToViewBox::setViewBox):
        (WebCore::SVGFitToViewBox::resetViewBox):
        (WebCore::SVGFitToViewBox::reset):
        (WebCore::SVGFitToViewBox::parseAttribute):
        (WebCore::SVGFitToViewBox::parseViewBox):
        (WebCore::SVGFitToViewBox::isKnownAttribute): Deleted.
        (WebCore::SVGFitToViewBox::addSupportedAttributes): Deleted.
        * svg/SVGFitToViewBox.h:
        (WebCore::SVGFitToViewBox::attributeRegistry):
        (WebCore::SVGFitToViewBox::viewBox const):
        (WebCore::SVGFitToViewBox::preserveAspectRatio const):
        (WebCore::SVGFitToViewBox::viewBoxAnimated):
        (WebCore::SVGFitToViewBox::preserveAspectRatioAnimated):
        (WebCore::SVGFitToViewBox::setPreserveAspectRatio):
        (WebCore::SVGFitToViewBox::resetPreserveAspectRatio):
        (WebCore::SVGFitToViewBox::viewBoxString const):
        (WebCore::SVGFitToViewBox::preserveAspectRatioString const):
        (WebCore::SVGFitToViewBox::hasValidViewBox const):
        (WebCore::SVGFitToViewBox::hasEmptyViewBox const):
        (WebCore::SVGFitToViewBox::isKnownAttribute):
        (WebCore::SVGFitToViewBox::parseAttribute): Deleted.
        * svg/SVGFontElement.cpp:
        (WebCore::SVGFontElement::SVGFontElement):
        * svg/SVGFontElement.h:
        * svg/SVGForeignObjectElement.cpp:
        (WebCore::SVGForeignObjectElement::SVGForeignObjectElement):
        (WebCore::SVGForeignObjectElement::registerAttributes):
        (WebCore::SVGForeignObjectElement::parseAttribute):
        (WebCore::SVGForeignObjectElement::svgAttributeChanged):
        (WebCore::SVGForeignObjectElement::isSupportedAttribute): Deleted.
        * svg/SVGForeignObjectElement.h:
        * svg/SVGGElement.cpp:
        (WebCore::SVGGElement::SVGGElement):
        (WebCore::SVGGElement::svgAttributeChanged):
        (WebCore::SVGGElement::isSupportedAttribute): Deleted.
        * svg/SVGGElement.h:
        * svg/SVGGeometryElement.cpp:
        (WebCore::SVGGeometryElement::SVGGeometryElement):
        (WebCore::SVGGeometryElement::registerAttributes):
        (WebCore::SVGGeometryElement::parseAttribute):
        (WebCore::SVGGeometryElement::svgAttributeChanged):
        (WebCore::SVGGeometryElement::isSupportedAttribute): Deleted.
        * svg/SVGGeometryElement.h:
        (WebCore::SVGGeometryElement::attributeRegistry):
        (WebCore::SVGGeometryElement::pathLengthAnimated):
        (WebCore::SVGGeometryElement::isKnownAttribute):
        * svg/SVGGlyphRefElement.cpp:
        (WebCore::SVGGlyphRefElement::SVGGlyphRefElement):
        * svg/SVGGlyphRefElement.h:
        * svg/SVGGradientElement.cpp:
        (WebCore::SVGGradientElement::SVGGradientElement):
        (WebCore::SVGGradientElement::registerAttributes):
        (WebCore::SVGGradientElement::parseAttribute):
        (WebCore::SVGGradientElement::svgAttributeChanged):
        (WebCore::SVGGradientElement::isSupportedAttribute): Deleted.
        * svg/SVGGradientElement.h:
        (WebCore::SVGGradientElement::attributeRegistry):
        (WebCore::SVGGradientElement::spreadMethod const):
        (WebCore::SVGGradientElement::gradientUnits const):
        (WebCore::SVGGradientElement::gradientTransform const):
        (WebCore::SVGGradientElement::spreadMethodAnimated):
        (WebCore::SVGGradientElement::gradientUnitsAnimated):
        (WebCore::SVGGradientElement::gradientTransformAnimated):
        (WebCore::SVGGradientElement::isKnownAttribute):
        * svg/SVGGraphicsElement.cpp:
        (WebCore::SVGGraphicsElement::SVGGraphicsElement):
        (WebCore::SVGGraphicsElement::registerAttributes):
        (WebCore::SVGGraphicsElement::parseAttribute):
        (WebCore::SVGGraphicsElement::svgAttributeChanged):
        (WebCore::SVGGraphicsElement::isSupportedAttribute): Deleted.
        (WebCore::SVGGraphicsElement::requiredFeatures): Deleted.
        (WebCore::SVGGraphicsElement::requiredExtensions): Deleted.
        (WebCore::SVGGraphicsElement::systemLanguage): Deleted.
        * svg/SVGGraphicsElement.h:
        (WebCore::SVGGraphicsElement::attributeRegistry):
        (WebCore::SVGGraphicsElement::transform const):
        (WebCore::SVGGraphicsElement::transformAnimated):
        (WebCore::SVGGraphicsElement::isKnownAttribute):
        * svg/SVGImageElement.cpp:
        (WebCore::SVGImageElement::SVGImageElement):
        (WebCore::SVGImageElement::registerAttributes):
        (WebCore::SVGImageElement::parseAttribute):
        (WebCore::SVGImageElement::svgAttributeChanged):
        (WebCore::SVGImageElement::haveLoadedRequiredResources):
        (WebCore::SVGImageElement::isSupportedAttribute): Deleted.
        * svg/SVGImageElement.h:
        * svg/SVGImageLoader.cpp:
        (WebCore::SVGImageLoader::dispatchLoadEvent):
        * svg/SVGLangSpace.cpp:
        (WebCore::SVGLangSpace::SVGLangSpace):
        (WebCore::SVGLangSpace::registerAttributes):
        (WebCore::SVGLangSpace::xmlspace const):
        (WebCore::SVGLangSpace::svgAttributeChanged):
        (WebCore::SVGLangSpace::setXmllang): Deleted.
        (WebCore::SVGLangSpace::setXmlspace): Deleted.
        (WebCore::SVGLangSpace::isKnownAttribute): Deleted.
        (WebCore::addWithAndWithoutXMLPrefix): Deleted.
        (WebCore::SVGLangSpace::addSupportedAttributes): Deleted.
        * svg/SVGLangSpace.h:
        (WebCore::SVGLangSpace::xmllang const):
        (WebCore::SVGLangSpace::setXmllang):
        (WebCore::SVGLangSpace::setXmlspace):
        (WebCore::SVGLangSpace::attributeRegistry):
        (WebCore::SVGLangSpace::isKnownAttribute):
        * svg/SVGLineElement.cpp:
        (WebCore::SVGLineElement::SVGLineElement):
        (WebCore::SVGLineElement::registerAttributes):
        (WebCore::SVGLineElement::parseAttribute):
        (WebCore::SVGLineElement::svgAttributeChanged):
        (WebCore::SVGLineElement::isSupportedAttribute): Deleted.
        * svg/SVGLineElement.h:
        * svg/SVGLinearGradientElement.cpp:
        (WebCore::SVGLinearGradientElement::SVGLinearGradientElement):
        (WebCore::SVGLinearGradientElement::registerAttributes):
        (WebCore::SVGLinearGradientElement::parseAttribute):
        (WebCore::SVGLinearGradientElement::svgAttributeChanged):
        (WebCore::SVGLinearGradientElement::isSupportedAttribute): Deleted.
        * svg/SVGLinearGradientElement.h:
        * svg/SVGMPathElement.cpp:
        (WebCore::SVGMPathElement::SVGMPathElement):
        (WebCore::SVGMPathElement::svgAttributeChanged):
        * svg/SVGMPathElement.h:
        * svg/SVGMarkerElement.cpp:
        (WebCore::SVGMarkerElement::SVGMarkerElement):
        (WebCore::SVGMarkerElement::registerAttributes):
        (WebCore::SVGMarkerElement::parseAttribute):
        (WebCore::SVGMarkerElement::svgAttributeChanged):
        (WebCore::SVGMarkerElement::setOrient):
        (WebCore::SVGMarkerElement::orientTypePropertyInfo): Deleted.
        (WebCore::SVGMarkerElement::isSupportedAttribute): Deleted.
        (WebCore::SVGMarkerElement::synchronizeOrientType): Deleted.
        (WebCore::SVGMarkerElement::lookupOrCreateOrientTypeWrapper): Deleted.
        (WebCore::SVGMarkerElement::orientType const): Deleted.
        (WebCore::SVGMarkerElement::orientTypeAnimated): Deleted.
        * svg/SVGMarkerElement.h:
        * svg/SVGMaskElement.cpp:
        (WebCore::SVGMaskElement::SVGMaskElement):
        (WebCore::SVGMaskElement::registerAttributes):
        (WebCore::SVGMaskElement::parseAttribute):
        (WebCore::SVGMaskElement::svgAttributeChanged):
        (WebCore::SVGMaskElement::isSupportedAttribute): Deleted.
        (WebCore::SVGMaskElement::requiredFeatures): Deleted.
        (WebCore::SVGMaskElement::requiredExtensions): Deleted.
        (WebCore::SVGMaskElement::systemLanguage): Deleted.
        * svg/SVGMaskElement.h:
        * svg/SVGPathElement.cpp:
        (WebCore::SVGPathElement::SVGPathElement):
        (WebCore::SVGPathElement::registerAttributes):
        (WebCore::SVGPathElement::parseAttribute):
        (WebCore::SVGPathElement::svgAttributeChanged):
        (WebCore::SVGPathElement::pathByteStream const):
        (WebCore::SVGPathElement::lookupOrCreateDWrapper):
        (WebCore::SVGPathElement::animatedPropertyWillBeDeleted):
        (WebCore::SVGPathElement::pathSegList):
        (WebCore::SVGPathElement::animatedPathSegList):
        (WebCore::SVGPathElement::pathSegListChanged):
        (WebCore::SVGPathElement::dPropertyInfo): Deleted.
        (WebCore::SVGPathElement::isSupportedAttribute): Deleted.
        (WebCore::SVGPathElement::synchronizeD): Deleted.
        * svg/SVGPathElement.h:
        * svg/SVGPathSegListValues.h:
        (WebCore::SVGPropertyTraits<SVGPathSegListValues>::toString):
        * svg/SVGPathSegWithContext.h:
        (WebCore::SVGPathSegWithContext::animatedProperty const):
        * svg/SVGPatternElement.cpp:
        (WebCore::SVGPatternElement::SVGPatternElement):
        (WebCore::SVGPatternElement::registerAttributes):
        (WebCore::SVGPatternElement::parseAttribute):
        (WebCore::SVGPatternElement::svgAttributeChanged):
        (WebCore::SVGPatternElement::collectPatternAttributes const):
        (WebCore::SVGPatternElement::isSupportedAttribute): Deleted.
        (WebCore::SVGPatternElement::requiredFeatures): Deleted.
        (WebCore::SVGPatternElement::requiredExtensions): Deleted.
        (WebCore::SVGPatternElement::systemLanguage): Deleted.
        * svg/SVGPatternElement.h:
        * svg/SVGPointListValues.h:
        (WebCore::SVGPropertyTraits<SVGPointListValues>::toString):
        * svg/SVGPolyElement.cpp:
        (WebCore::SVGPolyElement::SVGPolyElement):
        (WebCore::SVGPolyElement::registerAttributes):
        (WebCore::SVGPolyElement::parseAttribute):
        (WebCore::SVGPolyElement::svgAttributeChanged):
        (WebCore::SVGPolyElement::points):
        (WebCore::SVGPolyElement::animatedPoints):
        (WebCore::SVGPolyElement::pointsPropertyInfo): Deleted.
        (WebCore::SVGPolyElement::synchronizePoints): Deleted.
        (WebCore::SVGPolyElement::lookupOrCreatePointsWrapper): Deleted.
        * svg/SVGPolyElement.h:
        (WebCore::SVGPolyElement::pointList const):
        (WebCore::SVGPolyElement::attributeRegistry):
        (WebCore::SVGPolyElement::isKnownAttribute):
        * svg/SVGPreserveAspectRatioValue.cpp:
        (WebCore::SVGPreserveAspectRatioValue::transformRect const):
        (WebCore::SVGPreserveAspectRatioValue::transformRect): Deleted.
        * svg/SVGPreserveAspectRatioValue.h:
        * svg/SVGRadialGradientElement.cpp:
        (WebCore::SVGRadialGradientElement::SVGRadialGradientElement):
        (WebCore::SVGRadialGradientElement::registerAttributes):
        (WebCore::SVGRadialGradientElement::parseAttribute):
        (WebCore::SVGRadialGradientElement::svgAttributeChanged):
        (WebCore::SVGRadialGradientElement::isSupportedAttribute): Deleted.
        * svg/SVGRadialGradientElement.h:
        * svg/SVGRectElement.cpp:
        (WebCore::SVGRectElement::SVGRectElement):
        (WebCore::SVGRectElement::registerAttributes):
        (WebCore::SVGRectElement::parseAttribute):
        (WebCore::SVGRectElement::svgAttributeChanged):
        * svg/SVGRectElement.h:
        * svg/SVGSVGElement.cpp:
        (WebCore::SVGSVGElement::SVGSVGElement):
        (WebCore::SVGSVGElement::registerAttributes):
        (WebCore::SVGSVGElement::parseAttribute):
        (WebCore::SVGSVGElement::svgAttributeChanged):
        (WebCore::SVGSVGElement::viewBoxToViewTransform const):
        (WebCore::SVGSVGElement::resetScrollAnchor):
        (WebCore::SVGSVGElement::inheritViewAttributes):
        * svg/SVGSVGElement.h:
        (WebCore::SVGSVGElement::useCurrentView const): Deleted.
        (WebCore::SVGSVGElement::currentTranslateValue): Deleted.
        (WebCore::SVGSVGElement::zoomAndPan const): Deleted.
        (WebCore::SVGSVGElement::setZoomAndPan): Deleted.
        (WebCore::SVGSVGElement::timeContainer): Deleted.
        (WebCore::SVGSVGElement::hasEmptyViewBox const): Deleted.
        * svg/SVGScriptElement.cpp:
        (WebCore::SVGScriptElement::SVGScriptElement):
        (WebCore::SVGScriptElement::svgAttributeChanged):
        (WebCore::SVGScriptElement::insertedIntoAncestor):
        (WebCore::SVGScriptElement::addSubresourceAttributeURLs const):
        (WebCore::SVGScriptElement::isURLAttribute const): Deleted.
        (WebCore::SVGScriptElement::sourceAttributeValue const): Deleted.
        (WebCore::SVGScriptElement::charsetAttributeValue const): Deleted.
        (WebCore::SVGScriptElement::typeAttributeValue const): Deleted.
        (WebCore::SVGScriptElement::languageAttributeValue const): Deleted.
        (WebCore::SVGScriptElement::forAttributeValue const): Deleted.
        (WebCore::SVGScriptElement::eventAttributeValue const): Deleted.
        (WebCore::SVGScriptElement::hasAsyncAttribute const): Deleted.
        (WebCore::SVGScriptElement::hasDeferAttribute const): Deleted.
        (WebCore::SVGScriptElement::hasNoModuleAttribute const): Deleted.
        (WebCore::SVGScriptElement::hasSourceAttribute const): Deleted.
        (WebCore::SVGScriptElement::filterOutAnimatableAttribute const): Deleted.
        * svg/SVGScriptElement.h:
        * svg/SVGStopElement.cpp:
        (WebCore::SVGStopElement::SVGStopElement):
        (WebCore::SVGStopElement::registerAttributes):
        (WebCore::SVGStopElement::parseAttribute):
        * svg/SVGStopElement.h:
        * svg/SVGStringListValues.h:
        (WebCore::SVGPropertyTraits<SVGStringListValues>::toString):
        * svg/SVGSwitchElement.cpp:
        (WebCore::SVGSwitchElement::SVGSwitchElement):
        * svg/SVGSwitchElement.h:
        * svg/SVGSymbolElement.cpp:
        (WebCore::SVGSymbolElement::SVGSymbolElement):
        (WebCore::SVGSymbolElement::parseAttribute):
        (WebCore::SVGSymbolElement::svgAttributeChanged):
        * svg/SVGSymbolElement.h:
        * svg/SVGTRefElement.cpp:
        (WebCore::SVGTRefElement::SVGTRefElement):
        * svg/SVGTRefElement.h:
        * svg/SVGTests.cpp:
        (WebCore::SVGTests::SVGTests):
        (WebCore::SVGTests::registerAttributes):
        (WebCore::SVGTests::attributeRegistry):
        (WebCore::SVGTests::isKnownAttribute):
        (WebCore::SVGTests::isValid const):
        (WebCore::SVGTests::parseAttribute):
        (WebCore::SVGTests::svgAttributeChanged):
        (WebCore::SVGTests::requiredFeatures):
        (WebCore::SVGTests::requiredExtensions):
        (WebCore::SVGTests::systemLanguage):
        (WebCore::createSVGTestPropertyInfo): Deleted.
        (WebCore::createSVGTextAttributeToPropertyMap): Deleted.
        (WebCore::SVGTests::attributeToPropertyMap): Deleted.
        (WebCore::SVGTests::handleAttributeChange): Deleted.
        (WebCore::SVGTests::synchronizeAttribute): Deleted.
        (WebCore::SVGTests::synchronizeRequiredFeatures): Deleted.
        (WebCore::SVGTests::synchronizeRequiredExtensions): Deleted.
        (WebCore::SVGTests::synchronizeSystemLanguage): Deleted.
        * svg/SVGTests.h:
        * svg/SVGTextContentElement.cpp:
        (WebCore::SVGTextContentElement::SVGTextContentElement):
        (WebCore::SVGTextContentElement::registerAttributes):
        (WebCore::SVGTextContentElement::parseAttribute):
        (WebCore::SVGTextContentElement::svgAttributeChanged):
        (WebCore::SVGTextContentElement::textLengthPropertyInfo): Deleted.
        (WebCore::SVGTextContentElement::synchronizeTextLength): Deleted.
        (WebCore::SVGTextContentElement::lookupOrCreateTextLengthWrapper): Deleted.
        (WebCore::SVGTextContentElement::textLengthAnimated): Deleted.
        (WebCore::SVGTextContentElement::isSupportedAttribute): Deleted.
        * svg/SVGTextContentElement.h:
        (WebCore::SVGTextContentElement::specifiedTextLength):
        (WebCore::SVGTextContentElement::attributeRegistry):
        (WebCore::SVGTextContentElement::textLength const):
        (WebCore::SVGTextContentElement::lengthAdjust const):
        (WebCore::SVGTextContentElement::textLengthAnimated):
        (WebCore::SVGTextContentElement::lengthAdjustAnimated):
        (WebCore::SVGTextContentElement::isKnownAttribute):
        (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::SVGAnimatedCustomLengthAttribute):
        (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::synchronize):
        (WebCore::SVGTextContentElement::SVGAnimatedCustomLengthAttribute::animatedProperty):
        * svg/SVGTextPathElement.cpp:
        (WebCore::SVGTextPathElement::SVGTextPathElement):
        (WebCore::SVGTextPathElement::registerAttributes):
        (WebCore::SVGTextPathElement::parseAttribute):
        (WebCore::SVGTextPathElement::svgAttributeChanged):
        (WebCore::SVGTextPathElement::isSupportedAttribute): Deleted.
        * svg/SVGTextPathElement.h:
        * svg/SVGTextPositioningElement.cpp:
        (WebCore::SVGTextPositioningElement::SVGTextPositioningElement):
        (WebCore::SVGTextPositioningElement::registerAttributes):
        (WebCore::SVGTextPositioningElement::parseAttribute):
        (WebCore::SVGTextPositioningElement::svgAttributeChanged):
        * svg/SVGTextPositioningElement.h:
        (WebCore::SVGTextPositioningElement::attributeRegistry):
        (WebCore::SVGTextPositioningElement::x const):
        (WebCore::SVGTextPositioningElement::y const):
        (WebCore::SVGTextPositioningElement::dx const):
        (WebCore::SVGTextPositioningElement::dy const):
        (WebCore::SVGTextPositioningElement::rotate const):
        (WebCore::SVGTextPositioningElement::xAnimated):
        (WebCore::SVGTextPositioningElement::yAnimated):
        (WebCore::SVGTextPositioningElement::dxAnimated):
        (WebCore::SVGTextPositioningElement::dyAnimated):
        (WebCore::SVGTextPositioningElement::rotateAnimated):
        (WebCore::SVGTextPositioningElement::isKnownAttribute):
        * svg/SVGURIReference.cpp:
        (WebCore::SVGURIReference::SVGURIReference):
        (WebCore::SVGURIReference::registerAttributes):
        (WebCore::SVGURIReference::attributeRegistry):
        (WebCore::SVGURIReference::isKnownAttribute):
        (WebCore::SVGURIReference::parseAttribute):
        (WebCore::SVGURIReference::href const):
        (WebCore::SVGURIReference::hrefAnimated):
        (WebCore::SVGURIReference::addSupportedAttributes): Deleted.
        * svg/SVGURIReference.h:
        * svg/SVGUseElement.cpp:
        (WebCore::SVGUseElement::SVGUseElement):
        (WebCore::SVGUseElement::registerAttributes):
        (WebCore::SVGUseElement::parseAttribute):
        (WebCore::SVGUseElement::insertedIntoAncestor):
        (WebCore::SVGUseElement::transferSizeAttributesToTargetClone const):
        (WebCore::SVGUseElement::svgAttributeChanged):
        (WebCore::SVGUseElement::notifyFinished):
        * svg/SVGUseElement.h:
        * svg/SVGValue.h:
        * svg/SVGViewElement.cpp:
        (WebCore::SVGViewElement::SVGViewElement):
        (WebCore::SVGViewElement::parseAttribute):
        * svg/SVGViewElement.h:
        * svg/SVGViewSpec.cpp:
        (WebCore::SVGViewSpec::SVGViewSpec):
        (WebCore::SVGViewSpec::registerAttributes):
        (WebCore::SVGViewSpec::transform):
        (WebCore::SVGViewSpec::reset):
        (WebCore::SVGViewSpec::parseViewSpec):
        (WebCore::SVGViewSpec::viewBoxPropertyInfo): Deleted.
        (WebCore::SVGViewSpec::preserveAspectRatioPropertyInfo): Deleted.
        (WebCore::SVGViewSpec::transformPropertyInfo): Deleted.
        (WebCore::SVGViewSpec::viewBoxIdentifier): Deleted.
        (WebCore::SVGViewSpec::preserveAspectRatioIdentifier): Deleted.
        (WebCore::SVGViewSpec::transformIdentifier): Deleted.
        (WebCore::SVGViewSpec::setZoomAndPan): Deleted.
        (WebCore::SVGViewSpec::transformString const): Deleted.
        (WebCore::SVGViewSpec::viewBoxString const): Deleted.
        (WebCore::SVGViewSpec::preserveAspectRatioString const): Deleted.
        (WebCore::SVGViewSpec::viewBoxAnimated): Deleted.
        (WebCore::SVGViewSpec::preserveAspectRatioAnimated): Deleted.
        (WebCore::SVGViewSpec::lookupOrCreateViewBoxWrapper): Deleted.
        (WebCore::SVGViewSpec::lookupOrCreatePreserveAspectRatioWrapper): Deleted.
        (WebCore::SVGViewSpec::lookupOrCreateTransformWrapper): Deleted.
        * svg/SVGViewSpec.h:
        * svg/SVGViewSpec.idl:
        * svg/SVGZoomAndPan.cpp:
        (WebCore::SVGZoomAndPan::SVGZoomAndPan):
        (WebCore::SVGZoomAndPan::registerAttributes):
        (WebCore::SVGZoomAndPan::parseZoomAndPan):
        (WebCore::SVGZoomAndPan::parseAttribute):
        (WebCore::SVGZoomAndPan::parse): Deleted.
        (WebCore::SVGZoomAndPan::parseAttributeValue): Deleted.
        * svg/SVGZoomAndPan.h:
        (WebCore::SVGZoomAndPan::zoomAndPan const):
        (WebCore::SVGZoomAndPan::setZoomAndPan):
        (WebCore::SVGZoomAndPan::reset):
        (WebCore::SVGZoomAndPan::attributeRegistry):
        (WebCore::SVGZoomAndPan::isKnownAttribute):
        (WebCore::SVGZoomAndPan::parseFromNumber): Deleted.
        (WebCore::SVGZoomAndPan::parseAttribute): Deleted.
        * svg/SVGZoomAndPanType.h: Copied from Source/WebCore/svg/SVGValue.h.
        (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::initialValue):
        (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::toString):
        (WebCore::SVGPropertyTraits<SVGZoomAndPanType>::fromString):
        * svg/properties/SVGAnimatedEnumerationPropertyTearOff.h:
        * svg/properties/SVGAnimatedPathSegListPropertyTearOff.cpp: Copied from Source/WebCore/svg/SVGValue.h.
        (WebCore::SVGAnimatedPathSegListPropertyTearOff::SVGAnimatedPathSegListPropertyTearOff):
        (WebCore::SVGAnimatedPathSegListPropertyTearOff::~SVGAnimatedPathSegListPropertyTearOff):
        (WebCore::SVGAnimatedPathSegListPropertyTearOff::animValDidChange):
        * svg/properties/SVGAnimatedPathSegListPropertyTearOff.h:
        * svg/properties/SVGAnimatedProperty.cpp:
        (WebCore::SVGAnimatedProperty::SVGAnimatedProperty):
        (WebCore::SVGAnimatedProperty::~SVGAnimatedProperty):
        (WebCore::SVGAnimatedProperty::animatedPropertyCache): Deleted.
        * svg/properties/SVGAnimatedProperty.h:
        (WebCore::SVGAnimatedProperty::isAnimating const):
        (WebCore::SVGAnimatedProperty::isAnimatedListTearOff const):
        (WebCore::SVGAnimatedProperty::lookupOrCreateAnimatedProperty):
        (WebCore::SVGAnimatedProperty::lookupAnimatedProperty):
        (WebCore::SVGAnimatedProperty::animatedPropertyCache):
        (WebCore::SVGAnimatedProperty::lookupOrCreateWrapper): Deleted.
        (WebCore::SVGAnimatedProperty::lookupWrapper): Deleted.
        * svg/properties/SVGAnimatedPropertyMacros.h: Removed.
        * svg/properties/SVGAnimatedPropertyType.h: Copied from Source/WebCore/svg/SVGAElement.idl.
        * svg/properties/SVGAttribute.h: Added.
        (WebCore::SVGPropertyAttribute::SVGPropertyAttribute):
        (WebCore::SVGPropertyAttribute::value):
        (WebCore::SVGPropertyAttribute::value const):
        (WebCore::SVGPropertyAttribute::setValue):
        (WebCore::SVGPropertyAttribute::resetValue):
        (WebCore::SVGPropertyAttribute::toString const):
        (WebCore::SVGPropertyAttribute::setShouldSynchronize):
        (WebCore::SVGPropertyAttribute::shouldSynchronize const):
        (WebCore::SVGPropertyAttribute::synchronize):
        (WebCore::SVGAnimatedAttribute::SVGAnimatedAttribute):
        (WebCore::SVGAnimatedAttribute::currentValue const):
        (WebCore::SVGAnimatedAttribute::animatedProperty):
        (WebCore::SVGAnimatedAttributeList::SVGAnimatedAttributeList):
        (WebCore::SVGAnimatedAttributeList::detachAnimatedListWrappers):
        * svg/properties/SVGAttributeAccessor.h: Added.
        (WebCore::SVGAttributeAccessor::SVGAttributeAccessor):
        (WebCore::SVGAttributeAccessor::attributeName const):
        (WebCore::SVGAttributeAccessor::isAnimatedLengthAttribute const):
        (WebCore::SVGAttributeAccessor::animatedType const):
        (WebCore::SVGAttributeAccessor::animatedTypes const):
        (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperty const):
        (WebCore::SVGAttributeAccessor::lookupAnimatedProperty const):
        (WebCore::SVGAttributeAccessor::lookupOrCreateAnimatedProperties const):
        (WebCore::SVGPropertyAttributeAccessor::singleton):
        (WebCore::SVGPropertyAttributeAccessor::SVGPropertyAttributeAccessor):
        (WebCore::SVGPropertyAttributeAccessor::attribute const):
        (WebCore::SVGAnimatedAttributeAccessor::singleton):
        (WebCore::SVGAnimatedAttributeAccessor::SVGAnimatedAttributeAccessor):
        (WebCore::SVGAnimatedAttributeAccessor::lookupOrCreateAnimatedProperty):
        (WebCore::SVGAnimatedAttributeAccessor::lookupAnimatedProperty):
        (WebCore::SVGAnimatedPairAttributeAccessor::SVGAnimatedPairAttributeAccessor):
        (WebCore::SVGAnimatedPairAttributeAccessor::secondAttribute const):
        * svg/properties/SVGAttributeOwnerProxy.h: Copied from Source/WebCore/svg/SVGValue.h.
        (WebCore::SVGAttributeOwnerProxy::SVGAttributeOwnerProxy):
        (WebCore::SVGAttributeOwnerProxy::element const):
        * svg/properties/SVGAttributeOwnerProxyImpl.h: Added.
        (WebCore::SVGAttributeOwnerProxyImpl::SVGAttributeOwnerProxyImpl):
        (WebCore::SVGAttributeOwnerProxyImpl::attributeRegistry):
        (WebCore::SVGAttributeOwnerProxyImpl::isKnownAttribute):
        (WebCore::SVGAttributeOwnerProxyImpl::isAnimatedLengthAttribute):
        * svg/properties/SVGAttributeRegistry.h: Added.
        (WebCore::SVGAttributeRegistry::registerAttribute):
        (WebCore::SVGAttributeRegistry::isEmpty const):
        (WebCore::SVGAttributeRegistry::isKnownAttribute const):
        (WebCore::SVGAttributeRegistry::isAnimatedLengthAttribute const):
        (WebCore::SVGAttributeRegistry::animatedTypes const):
        (WebCore::SVGAttributeRegistry::synchronizeAttributes const):
        (WebCore::SVGAttributeRegistry::synchronizeAttribute const):
        (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperty const):
        (WebCore::SVGAttributeRegistry::lookupAnimatedProperty const):
        (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedProperties const):
        (WebCore::SVGAttributeRegistry::animatedTypesBaseTypes):
        (WebCore::SVGAttributeRegistry::synchronizeAttributesBaseTypes):
        (WebCore::SVGAttributeRegistry::synchronizeAttributeBaseTypes):
        (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertyBaseTypes):
        (WebCore::SVGAttributeRegistry::lookupAnimatedPropertyBaseTypes):
        (WebCore::SVGAttributeRegistry::lookupOrCreateAnimatedPropertiesBaseTypes):
        (WebCore::SVGAttributeRegistry::findAttributeAccessor const):
        * svg/properties/SVGAttributeToPropertyMap.cpp: Removed.
        * svg/properties/SVGAttributeToPropertyMap.h: Removed.
        * svg/properties/SVGPropertyInfo.cpp: Removed.
        * svg/properties/SVGPropertyInfo.h: Removed.

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

        Use enum classes and OptionSets for PaintPhase and PaintBehavior
        https://bugs.webkit.org/show_bug.cgi?id=188323

        Reviewed by Simon Fraser.

        No change in behaviour.

        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlTextTrackContainerElement::createTextTrackRepresentationImage):
        * page/FrameSnapshotting.cpp:
        (WebCore::snapshotFrameRectWithClip):
        * page/FrameView.cpp:
        (WebCore::FrameView::reset):
        (WebCore::FrameView::willPaintContents):
        (WebCore::FrameView::paintContents):
        (WebCore::FrameView::setPaintBehavior):
        (WebCore::FrameView::paintBehavior const):
        (WebCore::FrameView::paintContentsForSnapshot):
        * page/FrameView.h:
        * rendering/InlineElementBox.cpp:
        (WebCore::InlineElementBox::paint):
        * rendering/InlineFlowBox.cpp:
        (WebCore::InlineFlowBox::paint):
        (WebCore::InlineFlowBox::paintBoxDecorations):
        (WebCore::InlineFlowBox::paintMask):
        * rendering/InlineTextBox.cpp:
        (WebCore::InlineTextBox::paint):
        * rendering/PaintInfo.h:
        (WebCore::PaintInfo::PaintInfo):
        (WebCore::PaintInfo::forceBlackText const):
        (WebCore::PaintInfo::forceWhiteText const):
        (WebCore::PaintInfo::skipRootBackground const):
        (WebCore::PaintInfo::paintRootBackgroundOnly const):
        * rendering/PaintPhase.h:
        (): Deleted.
        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::paint):
        (WebCore::RenderBlock::paintContents):
        (WebCore::RenderBlock::paintObject):
        (WebCore::RenderBlock::paintSelection):
        * rendering/RenderBlockFlow.cpp:
        (WebCore::RenderBlockFlow::paintFloats):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintMask):
        (WebCore::RenderBox::paintClippingMask):
        (WebCore::RenderBox::paintMaskImages):
        (WebCore::RenderBox::pushContentsClip):
        (WebCore::RenderBox::popContentsClip):
        * rendering/RenderBox.h:
        * rendering/RenderBoxModelObject.cpp:
        (WebCore::RenderBoxModelObject::decodingModeForImageDraw const):
        (WebCore::RenderBoxModelObject::paintMaskForTextFillBox):
        (WebCore::RenderBoxModelObject::fixedBackgroundPaintsInLocalCoordinates const):
        * rendering/RenderDetailsMarker.cpp:
        (WebCore::RenderDetailsMarker::paint):
        * rendering/RenderElement.cpp:
        (WebCore::RenderElement::paintAsInlineBlock):
        (WebCore::RenderElement::selectionColor const):
        * rendering/RenderEmbeddedObject.cpp:
        (WebCore::RenderEmbeddedObject::paint):
        (WebCore::RenderEmbeddedObject::paintReplaced):
        * rendering/RenderFileUploadControl.cpp:
        (WebCore::RenderFileUploadControl::paintObject):
        * rendering/RenderFrameSet.cpp:
        (WebCore::RenderFrameSet::paint):
        * rendering/RenderHTMLCanvas.cpp:
        (WebCore::RenderHTMLCanvas::paintReplaced):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintReplaced):
        (WebCore::RenderImage::paint):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::renderableTransform const):
        (WebCore::transparencyClipBox):
        (WebCore::expandClipRectForDescendantsAndReflection):
        (WebCore::paintingExtent):
        (WebCore::RenderLayer::paint):
        (WebCore::RenderLayer::paintOverlayScrollbars):
        (WebCore::RenderLayer::paintLayer):
        (WebCore::RenderLayer::paintLayerContents):
        (WebCore::RenderLayer::paintBackgroundForFragments):
        (WebCore::RenderLayer::paintForegroundForFragments):
        (WebCore::RenderLayer::paintForegroundForFragmentsWithPhase):
        (WebCore::RenderLayer::paintOutlineForFragments):
        (WebCore::RenderLayer::paintMaskForFragments):
        (WebCore::RenderLayer::paintChildClippingMaskForFragments):
        (WebCore::RenderLayer::calculateClipRects const):
        * rendering/RenderLayer.h:
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::paintIntoLayer):
        (WebCore::RenderLayerBacking::paintContents):
        * rendering/RenderLayerBacking.h:
        * rendering/RenderLineBoxList.cpp:
        (WebCore::RenderLineBoxList::paint const):
        * rendering/RenderListBox.cpp:
        (WebCore::RenderListBox::paintObject):
        * rendering/RenderListMarker.cpp:
        (WebCore::RenderListMarker::paint):
        * rendering/RenderReplaced.cpp:
        (WebCore::RenderReplaced::paint):
        (WebCore::RenderReplaced::shouldPaint):
        * rendering/RenderReplica.cpp:
        (WebCore::RenderReplica::paint):
        * rendering/RenderScrollbarPart.cpp:
        (WebCore::RenderScrollbarPart::paintIntoRect):
        * rendering/RenderSnapshottedPlugIn.cpp:
        (WebCore::RenderSnapshottedPlugIn::paint):
        * rendering/RenderTable.cpp:
        (WebCore::RenderTable::paintObject):
        (WebCore::RenderTable::paintMask):
        (WebCore::RenderTable::overflowClipRect):
        * rendering/RenderTable.h:
        * rendering/RenderTableCell.cpp:
        (WebCore::RenderTableCell::paint):
        (WebCore::RenderTableCell::paintCollapsedBorders):
        (WebCore::RenderTableCell::paintMask):
        * rendering/RenderTableRow.cpp:
        (WebCore::RenderTableRow::paintOutlineForRowIfNeeded):
        (WebCore::RenderTableRow::paint):
        * rendering/RenderTableSection.cpp:
        (WebCore::RenderTableSection::paint):
        (WebCore::RenderTableSection::paintCell):
        (WebCore::RenderTableSection::paintObject):
        * rendering/RenderThemeMac.mm:
        (WebCore::RenderThemeMac::paintSnapshottedPluginOverlay):
        (WebCore::RenderThemeMac::paintImageControlsButton):
        * rendering/RenderVideo.cpp:
        (WebCore::RenderVideo::paintReplaced):
        * rendering/RenderWidget.cpp:
        (WebCore::RenderWidget::paintContents):
        (WebCore::RenderWidget::paint):
        * rendering/RootInlineBox.cpp:
        (WebCore::RootInlineBox::paintEllipsisBox const):
        * rendering/SimpleLineLayoutFunctions.cpp:
        (WebCore::SimpleLineLayout::paintFlow):
        * rendering/mathml/MathOperator.cpp:
        (WebCore::MathOperator::paint):
        * rendering/mathml/RenderMathMLBlock.cpp:
        (WebCore::RenderMathMLBlock::paint):
        * rendering/mathml/RenderMathMLFraction.cpp:
        (WebCore::RenderMathMLFraction::paint):
        * rendering/mathml/RenderMathMLMenclose.cpp:
        (WebCore::RenderMathMLMenclose::paint):
        * rendering/mathml/RenderMathMLToken.cpp:
        (WebCore::RenderMathMLToken::paint):
        * rendering/svg/RenderSVGContainer.cpp:
        (WebCore::RenderSVGContainer::paint):
        * rendering/svg/RenderSVGForeignObject.cpp:
        (WebCore::RenderSVGForeignObject::paint):
        * rendering/svg/RenderSVGImage.cpp:
        (WebCore::RenderSVGImage::paint):
        * rendering/svg/RenderSVGResource.cpp:
        (WebCore::requestPaintingResource):
        * rendering/svg/RenderSVGResourceClipper.cpp:
        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
        * rendering/svg/RenderSVGResourceSolidColor.cpp:
        (WebCore::RenderSVGResourceSolidColor::applyResource):
        * rendering/svg/RenderSVGRoot.cpp:
        (WebCore::RenderSVGRoot::paintReplaced):
        * rendering/svg/RenderSVGShape.cpp:
        (WebCore::RenderSVGShape::paint):
        * rendering/svg/RenderSVGText.cpp:
        (WebCore::RenderSVGText::paint):
        * rendering/svg/SVGInlineFlowBox.cpp:
        (WebCore::SVGInlineFlowBox::paintSelectionBackground):
        (WebCore::SVGInlineFlowBox::paint):
        * rendering/svg/SVGInlineTextBox.cpp:
        (WebCore::SVGInlineTextBox::paintSelectionBackground):
        (WebCore::SVGInlineTextBox::paint):
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::isRenderingMaskImage):
        (WebCore::SVGRenderingContext::renderSubtreeToImageBuffer):
        * rendering/svg/SVGRootInlineBox.cpp:
        (WebCore::SVGRootInlineBox::paint):

2018-08-06  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234569.

        Breaks internal builds.

        Reverted changeset:

        "We should cache the compiled sandbox profile in a data vault"
        https://bugs.webkit.org/show_bug.cgi?id=184991
        https://trac.webkit.org/changeset/234569

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

        Make BlendMode an enum class
        https://bugs.webkit.org/show_bug.cgi?id=188325

        Reviewed by Darin Adler.

        No change in behavior.

        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        (WebCore::CSSPrimitiveValue::operator BlendMode const):
        * html/HTMLImageElement.cpp:
        (WebCore::HTMLImageElement::parseAttribute):
        * html/canvas/CanvasRenderingContext2DBase.cpp:
        (WebCore::CanvasRenderingContext2DBase::State::State):
        (WebCore::CanvasRenderingContext2DBase::setGlobalCompositeOperation):
        (WebCore::CanvasRenderingContext2DBase::drawImageFromRect):
        * platform/graphics/BitmapImage.h:
        * platform/graphics/GraphicsContext.h:
        (WebCore::ImagePaintingOptions::ImagePaintingOptions):
        * platform/graphics/GraphicsContextImpl.h:
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::dumpProperties const):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/GraphicsTypes.cpp:
        (WebCore::parseBlendMode):
        (WebCore::parseCompositeAndBlendOperator):
        (WebCore::compositeOperatorName):
        (WebCore::blendModeName):
        (WebCore::operator<<):
        * platform/graphics/GraphicsTypes.h:
        * platform/graphics/Image.cpp:
        (WebCore::Image::drawTiled):
        * platform/graphics/Image.h:
        * platform/graphics/ImageBuffer.h:
        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm:
        (PlatformCAFilters::setBlendingFiltersOnLayer):
        * platform/graphics/cg/GraphicsContextCG.cpp:
        (WebCore::selectCGBlendMode):
        * platform/graphics/cpu/arm/filters/FEBlendNEON.h:
        (WebCore::FEBlend::platformApplyNEON):
        * platform/graphics/displaylists/DisplayListItems.h:
        * platform/graphics/displaylists/DisplayListRecorder.h:
        * platform/graphics/filters/FEBlend.cpp:
        (WebCore::FEBlend::externalRepresentation const):
        * rendering/RenderBox.cpp:
        (WebCore::RenderBox::paintFillLayers):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::paintIntoRect):
        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::RenderLayer):
        (WebCore::RenderLayer::updateBlendMode):
        (WebCore::RenderLayer::beginTransparencyLayers):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateBlendMode):
        * rendering/style/FillLayer.cpp:
        (WebCore::FillLayer::FillLayer):
        (WebCore::FillLayer::hasOpaqueImage const):
        * rendering/style/FillLayer.h:
        (WebCore::FillLayer::initialFillBlendMode):
        * rendering/style/RenderStyle.h:
        (WebCore::RenderStyle::setBlendMode):
        (WebCore::RenderStyle::hasBlendMode const):
        (WebCore::RenderStyle::blendMode const):
        (WebCore::RenderStyle::initialBlendMode):
        * rendering/style/StyleRareNonInheritedData.cpp:
        (WebCore::StyleRareNonInheritedData::StyleRareNonInheritedData):
        * rendering/svg/SVGRenderingContext.cpp:
        (WebCore::SVGRenderingContext::prepareToRenderSVGContent):
        * svg/SVGAnimatedEnumeration.cpp:
        (WebCore::enumerationValueForTargetAttribute):
        * svg/SVGFEBlendElement.cpp:
        (WebCore::SVGFEBlendElement::SVGFEBlendElement):
        (WebCore::SVGFEBlendElement::parseAttribute):
        * svg/SVGFEBlendElement.h:
        (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
        (WebCore::SVGPropertyTraits<BlendMode>::toString):
        * svg/graphics/SVGImage.cpp:
        (WebCore::SVGImage::nativeImageForCurrentFrame):
        (WebCore::SVGImage::nativeImage):
        (WebCore::SVGImage::drawPatternForContainer):
        (WebCore::SVGImage::draw):

2018-08-06  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Indeterminate checkboxes appear unchecked
        https://bugs.webkit.org/show_bug.cgi?id=160484
        <rdar://problem/31143185>

        Reviewed by Wenson Hsieh.

        Add support for rendering indeterminate checkboxes on iOS.

        We now paint the unchecked appearance only if the checkbox is not checked and is
        not indeterminate. Otherwise, we draw a checkmark if the checkbox is in the
        checked state and a dash if the checkbox is in the indeterminate state. Both of
        these states share the same dark background.

        Test: fast/forms/ios/render-indeterminate-checkbox.html

        * css/html.css:
        (input[type="checkbox"]:indeterminate):
        (input[type="checkbox"]:indeterminate:disabled):
        * rendering/RenderThemeIOS.mm:
        (WebCore::drawJoinedLines):
        (WebCore::RenderThemeIOS::paintCheckboxDecorations):

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

        HTML parser should execute custom element reactions for setting attributes immediately after creating a custom element
        https://bugs.webkit.org/show_bug.cgi?id=188336

        Reviewed by Frédéric Wang.

        Push and pop an element queue from the custom element reactions stack when constructing a custom element:
        https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token

        To do this, we instantiate CustomElementReactionStack in HTMLDocumentParser::runScriptsForPausedTreeBuilder
        where we synchronously construct a custom element. We don't have to worry about whether *will execute script*
        is set or not since the presence of an element queue should not be observable in the case where we're constructing
        a fallback element (since it would not enqueue any new custom element reaction).

        Tests: imported/w3c/web-platform-tests/custom-elements/parser/parser-sets-attributes-and-children.html

        * html/parser/HTMLDocumentParser.cpp:
        (WebCore::HTMLDocumentParser::runScriptsForPausedTreeBuilder): Instantiate CustomElementReactionStack. Note that we
        don't insert the custom element into the parser until we finish processing the custom element reactions.

2018-08-06  Charlie Turner  <cturner@igalia.com>

        Return extracted key ids as an optional
        https://bugs.webkit.org/show_bug.cgi?id=188303

        Reviewed by Darin Adler.

        An empty list of extracted key ids was being considered a failure
        case before this patch. In the PSSH boxes from the CENC standard,
        it's not uncommon for the box to be version 0, meaning it has no
        embedded key ids, so the case when there's an empty list should
        not be treated as an error. Given this, the interface should be
        more general and allow for a sentinel value indicating a parsing
        error rather than an absence of key ids.

        Covered by existing tests.

        * Modules/encryptedmedia/InitDataRegistry.cpp:
        (WebCore::extractKeyIDsKeyids): Change return type to be wrapped
        in an optional, and make parsing errors return a nullopt rather
        than an empty vector.
        (WebCore::sanitizeKeyids): Use the new optional interface, return
        a null RefPtr in the case of a parsing error, this method may now
        return an empty vector.
        (WebCore::extractKeyIDsCenc): Not implemented, so return an error
        value rather than an empty vector.
        (WebCore::extractKeyIDsWebM): Ditto.
        (WebCore::InitDataRegistry::extractKeyIDs): Ditto.
        * Modules/encryptedmedia/InitDataRegistry.h: Update the interface
        to use an optional return type.
        * platform/graphics/avfoundation/CDMFairPlayStreaming.cpp:
        (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSinf): Update
        to use the new interface.
        (WebCore::CDMPrivateFairPlayStreaming::extractKeyIDsSkd): Ditto.
        * platform/graphics/avfoundation/CDMFairPlayStreaming.h: Ditto.
        * platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm:
        (WebCore::CDMInstanceFairPlayStreamingAVFObjC::keyIDs): Convert
        the optional value into a vector, since it is assumed you can not
        have an empty vector of key ids in the init datas FPS supports.
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDMInstance::requestLicense): Only return an error
        if there really was a parsing error, rather than the case of there
        being zero key ids in the init data payload.

2018-08-06  Frederic Wang  <fwang@igalia.com>

        Make two-arguments versions of scrollBy/scrollTo depend on the one-argument versions
        https://bugs.webkit.org/show_bug.cgi?id=188300

        Reviewed by Darin Adler.

        This patch refactors a bit the scrollBy/scrollTo code, so that the two-arguments versions
        share the same code path as the more generic one-argument versions. In particular, this
        helps to implement the ScrollBehavior option (bug 188043) since the one-argument versions
        will require to distinguish between smooth and instant scrolling. The logic to normalize
        non finite left/right values or to use a fallback when they are absent is also factored out
        into ScrollToOptions.

        References:
        https://drafts.csswg.org/cssom-view/#dom-element-scroll
        https://drafts.csswg.org/cssom-view/#dom-element-scrollby
        https://drafts.csswg.org/cssom-view/#dom-window-scroll
        https://drafts.csswg.org/cssom-view/#dom-window-scrollby

        No new tests, behavior is unchanged.

        * dom/Element.cpp:
        (WebCore::Element::scrollBy): Make two-parameter version depends on one-parameter version
        and rewrite the normalize / fallback logic.
        (WebCore::Element::scrollTo): Rewrite the normalize / fallback logic.
        (WebCore::normalizeNonFiniteValue): Deleted. The logic is moved to ScrollToOptions.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::scrollBy const): Make two-parameter version depends on one-parameter
        version and rewrite the normalize / fallback logic.
        (WebCore::DOMWindow::scrollTo const): Make two-parameter version depends on one-parameter
        version and rewrite the normalize / fallback logic.
        * page/ScrollToOptions.h: Add <cmath> to use std::isfinite
        (WebCore::ScrollToOptions::normalizeNonFiniteCoordinatesOrFallBackTo): New function to
        normalize left/right values or fallback to the specified value if it is missing.

2018-08-06  Zan Dobersek  <zdobersek@igalia.com>

        Unreviewed follow-up to r234594.

        Add missing constructor and destructor definitions for the bunch of new
        classes that were added in that revision.

        * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
        (Nicosia::ContentLayer::ContentLayer):
        (Nicosia::BackingStore::BackingStore):
        (Nicosia::ImageBacking::ImageBacking):

2018-08-06  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add additional layer state classes, use impl-based approach to make them extendable
        https://bugs.webkit.org/show_bug.cgi?id=188341

        Reviewed by Carlos Garcia Campos.

        Add the ContentLayer, BackingStore and ImageBacking classes in the
        Nicosia namespace. State objects of CompositionLayer instances keep
        references to objects of these classes depending on the content that's
        presented in the associated GraphicsLayer.

        ContentLayer derives from the PlatformLayer class. It's used for layers
        that display things like WebGL and HTML5 canvas and media content in a
        platform-specific way. In case of TextureMapper the hardware-accelerated
        content is piped into that rendering pipeline.

        BackingStore is meant to represent the painted contents of a layer. The
        equivalent current functionality is using a tiled backing store that
        has its contents copied into the CoordinatedBackingStore instance.

        ImageBacking is used for a layer whose content is a simple Image object.
        Image's pixel data is rasterized and again managed through
        CoordinatedBackingStore for rendering.

        All these classes, along with the CompositionLayer class, should now be
        constructed with a factory function that returns an object that derives
        the class-specific Impl interface. This will allow for simpler
        implementation of different approaches in parallel. The TextureMapper
        variants will be the first ones, replicating the current behavior as it
        is implemented across classes in the CoordinatedGraphics and
        TextureMapper layers.

        * platform/graphics/nicosia/NicosiaPlatformLayer.cpp:
        (Nicosia::CompositionLayer::CompositionLayer):
        * platform/graphics/nicosia/NicosiaPlatformLayer.h:
        (Nicosia::PlatformLayer::isContentLayer const):
        (Nicosia::CompositionLayer::Impl::isTextureMapperImpl const):
        (Nicosia::CompositionLayer::create):
        (Nicosia::CompositionLayer::impl const):
        (Nicosia::ContentLayer::Impl::isTextureMapperImpl const):
        (Nicosia::ContentLayer::create):
        (Nicosia::ContentLayer::impl const):
        (Nicosia::BackingStore::Impl::isTextureMapperImpl const):
        (Nicosia::BackingStore::create):
        (Nicosia::BackingStore::impl const):
        (Nicosia::ImageBacking::Impl::isTextureMapperImpl const):
        (Nicosia::ImageBacking::create):
        (Nicosia::ImageBacking::impl const):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::CoordinatedGraphicsLayer):

2018-08-06  Zan Dobersek  <zdobersek@igalia.com>

        [Nicosia] Add Nicosia::Scene
        https://bugs.webkit.org/show_bug.cgi?id=188340

        Reviewed by Carlos Garcia Campos.

        Add the Nicosia::Scene class that controls the scene's state and enables
        thread-safe updates to that state.

        The State struct itself holds a set of all the layers in the scene, and
        separates out the root layer specifically. An ID counter is also present
        there, allowing consumers of this state to easily check for any updates.

        A reference to the Nicosia::Scene object now replaces the
        HashSet-and-root-layer pair in the CoordinatedGraphicsState struct.

        * platform/TextureMapper.cmake:
        * platform/graphics/nicosia/NicosiaScene.cpp: Added.
        * platform/graphics/nicosia/NicosiaScene.h: Added.
        (Nicosia::Scene::create):
        (Nicosia::Scene::accessState):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:

2018-08-06  Carlos Eduardo Ramalho  <cadubentzen@gmail.com>

        [GTK] Buttons are drawn too large, text not centered
        https://bugs.webkit.org/show_bug.cgi?id=185854

        Reviewed by Carlos Garcia Campos.

        Some pages require small buttons and the GTK theme was
        drawing only down to a minimum size.

        No new tests required. Current layout tests and ManualTests/gtk/theme.html
        already cover it.

        * platform/gtk/RenderThemeGadget.cpp:
        (WebCore::RenderThemeGadget::create):
        (WebCore::RenderThemeButtonGadget::RenderThemeButtonGadget): Added
        (WebCore::RenderThemeButtonGadget::minimumSize const):
        Allow sizes smaller than the minimum size.
        * platform/gtk/RenderThemeGadget.h:
        * platform/gtk/RenderThemeWidget.cpp:
        (WebCore::RenderThemeButton::RenderThemeButton):

2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Implement self.queueMicrotask in Workers
        https://bugs.webkit.org/show_bug.cgi?id=188247

        Reviewed by Ryosuke Niwa.

        This patch adds support for self.queueMicrotask to workers.

        Tests: http/wpt/workers/queue-microtask.any.html
               http/wpt/workers/queue-microtask.any.worker.html

        * bindings/js/JSWorkerGlobalScopeCustom.cpp:
        (WebCore::JSWorkerGlobalScope::queueMicrotask):
        * page/DOMWindow.idl:
        Move queueMicrotask declaration to WindowOrWorkerGlobalScope.idl.
        * page/WindowOrWorkerGlobalScope.idl:

2018-08-05  Rob Buis  <rbuis@igalia.com>

        [GTK][WPE] Fetch tests assert in SubresourceLoader::didReceiveResponse()
        https://bugs.webkit.org/show_bug.cgi?id=188163

        Reviewed by Frédéric Wang.

        Fetch in manual redirect mode uses didReceiveResponse instead of
        willSendRequestInternal, so update the ASSERT.

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

2018-08-05  Yusuke Suzuki  <utatane.tea@gmail.com>

        Add support for microtasks in workers
        https://bugs.webkit.org/show_bug.cgi?id=188246

        Reviewed by Darin Adler.

        This patch adds the microtask mechanism to workers. To adopt the existing microtask mechanism from the main thread,
        we extend JSMainThreadExecState for non-main-threads. We rename it to JSExecState, and store stacked
        ExecState* data in thread local storage in ThreadGlobalData instead of a static variable s_mainThreadState.

        We add MicrotaskQueue to WorkerGlobalScope since each worker has its own thread and it should have its
        own microtask queue.

        * Modules/encryptedmedia/legacy/LegacyCDMSessionClearKey.cpp:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/JSBindingsAllInOne.cpp:
        * bindings/js/JSCallbackData.cpp:
        (WebCore::JSCallbackData::invokeCallback):
        * bindings/js/JSCustomElementInterface.cpp:
        (WebCore::constructCustomElementSynchronously):
        (WebCore::JSCustomElementInterface::upgradeElement):
        (WebCore::JSCustomElementInterface::invokeCallback):
        * bindings/js/JSCustomXPathNSResolver.cpp:
        (WebCore::JSCustomXPathNSResolver::lookupNamespaceURI):
        * bindings/js/JSDOMGlobalObjectTask.cpp:
        * bindings/js/JSDOMWindowBase.cpp:
        (WebCore::JSDOMWindowBase::queueTaskToEventLoop):
        Queue a microtask to MicrotaskQueue instead of posting a macrotask.

        (WebCore::JSDOMWindowMicrotaskCallback::create): Deleted.
        (WebCore::JSDOMWindowMicrotaskCallback::call): Deleted.
        (WebCore::JSDOMWindowMicrotaskCallback::JSDOMWindowMicrotaskCallback): Deleted.
        (): Deleted.
        Extract JSDOMWindowMicrotaskCallback as JSMicrotaskCallback and create a new file for it.

        * bindings/js/JSErrorHandler.cpp:
        (WebCore::JSErrorHandler::handleEvent):
        * bindings/js/JSEventListener.cpp:
        (WebCore::JSEventListener::handleEvent):
        * bindings/js/JSExecState.cpp: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.cpp.
        (WebCore::JSExecState::didLeaveScriptContext):
        If we are in a main thread, we consume main thread microtask queue. If we are in worker thread,
        we consume a microtask queue per worker.

        (WebCore::functionCallHandlerFromAnyThread):
        (WebCore::evaluateHandlerFromAnyThread):
        * bindings/js/JSExecState.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecState.h.
        (WebCore::JSExecState::currentState):
        (WebCore::JSExecState::call):
        (WebCore::JSExecState::evaluate):
        (WebCore::JSExecState::profiledCall):
        (WebCore::JSExecState::profiledEvaluate):
        (WebCore::JSExecState::runTask):
        (WebCore::JSExecState::loadModule):
        (WebCore::JSExecState::linkAndEvaluateModule):
        (WebCore::JSExecState::JSExecState):
        (WebCore::JSExecState::~JSExecState):
        (WebCore::JSExecState::setCurrentState):
        Store and load ExecState in thread local storage, ThreadGlobalData. This allows us to use it for workers.

        (WebCore::JSMainThreadNullState::JSMainThreadNullState):
        (WebCore::JSMainThreadNullState::~JSMainThreadNullState):
        We keep this name "JSMainThreadNullState" since CustomElementReactionStack should be stick to the main thread.
        And this class is only used in the main thread.

        * bindings/js/JSExecStateInstrumentation.h: Renamed from Source/WebCore/bindings/js/JSMainThreadExecStateInstrumentation.h.
        (WebCore::JSExecState::instrumentFunctionInternal):
        (WebCore::JSExecState::instrumentFunctionCall):
        (WebCore::JSExecState::instrumentFunctionConstruct):
        * bindings/js/JSMicrotaskCallback.h: Copied from Source/WebKitLegacy/mac/DOM/DOMHTMLBaseElement.mm.
        (WebCore::JSMicrotaskCallback::create):
        (WebCore::JSMicrotaskCallback::call):
        (WebCore::JSMicrotaskCallback::JSMicrotaskCallback):
        * bindings/js/JSWorkerGlobalScopeBase.cpp:
        (WebCore::JSWorkerGlobalScopeBase::queueTaskToEventLoop):
        * bindings/js/ScheduledAction.cpp:
        (WebCore::ScheduledAction::executeFunctionInContext):
        * bindings/js/ScriptController.cpp:
        (WebCore::ScriptController::evaluateInWorld):
        (WebCore::ScriptController::loadModuleScriptInWorld):
        (WebCore::ScriptController::linkAndEvaluateModuleScriptInWorld):
        (WebCore::ScriptController::canAccessFromCurrentOrigin):
        * bindings/js/WorkerScriptController.cpp:
        (WebCore::WorkerScriptController::evaluate):
        * bridge/objc/WebScriptObject.mm:
        (-[WebScriptObject callWebScriptMethod:withArguments:]):
        (-[WebScriptObject evaluateWebScript:]):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::compileShader):
        (WebCore::WebGLRenderingContextBase::printToConsole):
        * inspector/InspectorCanvas.cpp:
        (WebCore::InspectorCanvas::buildObjectForCanvas):
        (WebCore::InspectorCanvas::buildAction):
        * inspector/InspectorController.cpp:
        * inspector/InspectorFrontendHost.cpp:
        * inspector/TimelineRecordFactory.cpp:
        (WebCore::TimelineRecordFactory::createGenericRecord):
        * inspector/WorkerInspectorController.cpp:
        * inspector/agents/InspectorCanvasAgent.cpp:
        * inspector/agents/InspectorNetworkAgent.cpp:
        (WebCore::InspectorNetworkAgent::buildInitiatorObject):
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::postMessage):
        * page/PageConsoleClient.cpp:
        (WebCore::PageConsoleClient::addMessage):
        * page/csp/ContentSecurityPolicy.cpp:
        (WebCore::ContentSecurityPolicy::reportViolation const):
        * platform/ThreadGlobalData.h:
        (WebCore::ThreadGlobalData::ThreadGlobalData::currentState const):
        (WebCore::ThreadGlobalData::ThreadGlobalData::setCurrentState):
        * workers/WorkerGlobalScope.cpp:
        (WebCore::WorkerGlobalScope::WorkerGlobalScope):
        (WebCore::WorkerGlobalScope::removeMicrotaskQueue):
        * workers/WorkerGlobalScope.h:
        (WebCore::WorkerGlobalScope::microtaskQueue const):
        * workers/WorkerThread.cpp:
        (WebCore::WorkerThread::stop):
        * workers/service/ExtendableEvent.cpp:
        (WebCore::ExtendableEvent::addExtendLifetimePromise):
        When dispatching an "install" event from service worker, we first create an event,
        dispatch it, and set a handler which is called when a pending promise count becomes zero.
        However, the old code checked pending promise count in a queued microtask. It worked
        previously because microtask is actually a macrotask in the service worker. So this check
        is done after a handler is set. But this patch introduces real microtask, and this check
        happens before a handler is set because dispatching an event can exhaust microtask queue.
        According to the spec, this check should not be done in microtask[1]. We make this checking
        part as a macrotask. We note that algorithm noted as FIXMEs should be done in this
        microtask while the checking part should not be done.

        [1]: https://w3c.github.io/ServiceWorker/#installation-algorithm

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

        Properties set on window.customElements can disappear due to GC
        https://bugs.webkit.org/show_bug.cgi?id=172575

        Lexicologically sort the IDL attributes per Darin's comment.

        * dom/CustomElementRegistry.idl:

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

        [LFC][BFC] contentHeightForFormattingContextRoot uses the wrong coordinate system to compute the height.
        https://bugs.webkit.org/show_bug.cgi?id=188319

        Reviewed by Antti Koivisto.

        Display::Box::marginBox() is in the coordinate system of the box itself (8px top margin translates to y = -8px).
        What we need instead to compute the content height is the top/bottom position in the containing block's coordinate system (rect and rectWithMargin).

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):

2018-08-05  Ms2ger  <Ms2ger@igalia.com>

        [GStreamer] Remove unsound assertions in MediaPlayerPrivateGStreamerBase.
        https://bugs.webkit.org/show_bug.cgi?id=188162

        Reviewed by Philippe Normand.

        These assertions sometimes fail, and there's a runtime check right
        after them anyway.

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

        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamerBase.cpp:
        (WebCore::MediaPlayerPrivateGStreamerBase::copyVideoTextureToPlatformTexture):
        (WebCore::MediaPlayerPrivateGStreamerBase::nativeImageForCurrentTime):

2018-08-05  Philippe Normand  <pnormand@igalia.com>

        [MediaCapabilities] Platform integration
        https://bugs.webkit.org/show_bug.cgi?id=187850

        Reviewed by Eric Carlson.

        Mock platform support for the MediaCapabilities specification.

        Test: media/mediacapabilities/mock-decodingInfo.html
              media/mediacapabilities/mock-encodingInfo.html

        * Modules/mediacapabilities/MediaCapabilities.cpp:
        (WebCore::MediaCapabilities::decodingInfo):
        (WebCore::MediaCapabilities::encodingInfo):
        * Modules/mediacapabilities/MediaCapabilitiesInfo.h:
        (WebCore::MediaCapabilitiesInfo::create):
        * PlatformGTK.cmake:
        * PlatformMac.cmake:
        * PlatformWPE.cmake:
        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * platform/mediacapabilities/MediaEngineConfiguration.cpp: Added.
        (WebCore::MediaEngineVideoConfiguration::MediaEngineVideoConfiguration):
        (WebCore::MediaEngineAudioConfiguration::MediaEngineAudioConfiguration):
        (WebCore::MediaEngineConfiguration::MediaEngineConfiguration):
        * platform/mediacapabilities/MediaEngineConfiguration.h: Added.
        (WebCore::MediaEngineVideoConfiguration::create):
        (WebCore::MediaEngineVideoConfiguration::contentType const):
        (WebCore::MediaEngineVideoConfiguration::size const):
        (WebCore::MediaEngineVideoConfiguration::bitrate const):
        (WebCore::MediaEngineVideoConfiguration::framerate const):
        (WebCore::MediaEngineAudioConfiguration::create):
        (WebCore::MediaEngineAudioConfiguration::contentType const):
        (WebCore::MediaEngineAudioConfiguration::channels const):
        (WebCore::MediaEngineAudioConfiguration::bitrate const):
        (WebCore::MediaEngineAudioConfiguration::samplerate const):
        (WebCore::MediaEngineConfiguration::audioConfiguration const):
        (WebCore::MediaEngineConfiguration::videoConfiguration const):
        * platform/mediacapabilities/MediaEngineConfigurationFactory.cpp: Added.
        (WebCore::mockEnabled):
        (WebCore::MediaEngineConfigurationFactory::createDecodingConfiguration):
        (WebCore::MediaEngineConfigurationFactory::createEncodingConfiguration):
        (WebCore::MediaEngineConfigurationFactory::enableMock):
        (WebCore::MediaEngineConfigurationFactory::disableMock):
        * platform/mediacapabilities/MediaEngineConfigurationFactory.h: Added.
        * platform/mediacapabilities/MediaEngineDecodingConfiguration.h: Added.
        (WebCore::MediaEngineDecodingConfiguration::MediaEngineDecodingConfiguration):
        (WebCore::MediaEngineDecodingConfiguration::canDecodeMedia):
        (WebCore::MediaEngineDecodingConfiguration::canSmoothlyDecodeMedia):
        (WebCore::MediaEngineDecodingConfiguration::canPowerEfficientlyDecodeMedia):
        (WebCore::MediaEngineDecodingConfiguration::decodingType const):
        * platform/mediacapabilities/MediaEngineEncodingConfiguration.h: Added.
        (WebCore::MediaEngineEncodingConfiguration::MediaEngineEncodingConfiguration):
        (WebCore::MediaEngineEncodingConfiguration::canEncodeMedia):
        (WebCore::MediaEngineEncodingConfiguration::canSmoothlyEncodeMedia):
        (WebCore::MediaEngineEncodingConfiguration::canPowerEfficientlyEncodeMedia):
        (WebCore::MediaEngineEncodingConfiguration::encodingType const):
        * platform/mock/MediaEngineDecodingConfigurationMock.cpp: Added.
        (WebCore::MediaEngineDecodingConfigurationMock::canDecodeMedia):
        (WebCore::MediaEngineDecodingConfigurationMock::canSmoothlyDecodeMedia):
        (WebCore::MediaEngineDecodingConfigurationMock::canPowerEfficientlyDecodeMedia):
        * platform/mock/MediaEngineDecodingConfigurationMock.h: Added.
        * platform/mock/MediaEngineEncodingConfigurationMock.cpp: Added.
        (WebCore::MediaEngineEncodingConfigurationMock::canEncodeMedia):
        (WebCore::MediaEngineEncodingConfigurationMock::canSmoothlyEncodeMedia):
        (WebCore::MediaEngineEncodingConfigurationMock::canPowerEfficientlyEncodeMedia):
        * platform/mock/MediaEngineEncodingConfigurationMock.h: Added.
        * testing/Internals.cpp:
        (WebCore::Internals::resetToConsistentState):
        (WebCore::Internals::enableMockMediaCapabilities):
        * testing/Internals.h:
        * testing/Internals.idl:

2018-08-04  Simon Fraser  <simon.fraser@apple.com>

        Make WebCore::Timer more space-efficient
        https://bugs.webkit.org/show_bug.cgi?id=187455

        Reviewed by Brent Fulgham.

        Steal a bit from m_heapIndex for m_wasDeleted to eliminate padding in Timer.
        This reduces the size of Document, which has 8 Timers, from 3360 to 3296 bytes (saving 64 bytes).

        * platform/Timer.cpp:
        (WebCore::TimerBase::TimerBase):
        * platform/Timer.h:

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

        Properties set on window.customElements can disappear due to GC
        https://bugs.webkit.org/show_bug.cgi?id=172575
        <rdar://problem/32440668>

        Reviewed by Saam Barati.

        Fixed the bug that JS wrapper of CustomElementsRegistry can erroneously get collected during GC
        by keeping it alive as long as the global object is alive.

        Test: fast/custom-elements/custom-element-registry-wrapper-should-stay-alive.html

        * dom/CustomElementRegistry.cpp:
        (WebCore::CustomElementRegistry::create):
        (WebCore::CustomElementRegistry::CustomElementRegistry):
        * dom/CustomElementRegistry.h:
        (WebCore::CustomElementRegistry): Make this inherited from ContextDestructionObserver.
        * dom/CustomElementRegistry.idl: Set GenerateIsReachable=ImplScriptExecutionContext in IDL. This will
        make CustomElementRegistry reachable from the global object.
        * page/DOMWindow.cpp:
        (WebCore::DOMWindow::ensureCustomElementRegistry):

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

        innerHTML should not synchronously create a custom element
        https://bugs.webkit.org/show_bug.cgi?id=188327
        <rdar://problem/42923114>

        Reviewed by Daniel Bates.

        Fixed the bug that the fragment parsing algorithm was synchronously constructing a custom element instead of
        enqueuing an element to upgrade.

        The fragment parsing algorithm creates an element for a token with *will execute script* flag set to false:
        https://html.spec.whatwg.org/multipage/parsing.html#create-an-element-for-the-token
        which results in creating an element with synchronous custom elements flag *not* set:
        https://dom.spec.whatwg.org/#concept-create-element

        When synchronous custom elements flag is false, we're supposed to create an element and enqueue a custom element
        upgrade reaction. createHTMLElementOrFindCustomElementInterface was missing this last logic. 

        Also fixed a bug that Element::enqueueToUpgrade would hit a debug assertion when a custom element which has been
        enqueued to upgrade is enqueued to upgrade for the second time. In this case, we need to put the element into the
        current element queue (https://html.spec.whatwg.org/multipage/custom-elements.html#current-element-queue) again.

        While the specification simply enqueues another upgrade reaction and bails out immediately in the first step of
        the upgrade, WebKit's implementation simply avoids this redundancy in the first place:
        https://html.spec.whatwg.org/multipage/custom-elements.html#concept-upgrade-an-element

        Existing tests such as imported/w3c/web-platform-tests/custom-elements/reactions/Document.html exercises this
        code path after the fragment parsing algorithm fix.

        Tests: imported/w3c/web-platform-tests/custom-elements/connected-callbacks-html-fragment-parsing.html

        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueueItem::type const): Added for an assertion.
        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade): Enqueue this element to the current element queue
        by calling ensureCurrentQueue and avoid inserting a redundant upgrade reaction.
        * dom/CustomElementReactionQueue.h:
        * dom/Element.cpp:
        (WebCore::Element::enqueueToUpgrade): Handle the case when a custom element is enqueued to upgrade for the second
        time while it had been waiting in some element queue. In this case, the reaction queue for this element has
        already been created and we simply need to put this element back into the current element queue (i.e. this element
        now belongs to both element queues).
        * html/parser/HTMLConstructionSite.cpp:
        (WebCore::findCustomElementInterface): Extracted out of createHTMLElementOrFindCustomElementInterface.
        (WebCore::HTMLConstructionSite::createHTMLElementOrFindCustomElementInterface): Fixed the bug that the HTML parser
        was synchronously constructing a custom element even for the fragment parsing algorithm.

2018-08-03  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        Added functionality to FileHandle so that it can lock a file while open.
        Added a function to FileSystem to delete non empty directories.

        * platform/FileHandle.cpp:
        (WebCore::FileHandle::FileHandle):
        (WebCore::FileHandle::open):
        (WebCore::FileHandle::close):
        * platform/FileHandle.h:
        * platform/FileSystem.h:
        * platform/cocoa/FileSystemCocoa.mm:
        (WebCore::FileSystem::deleteNonEmptyDirectory):

2018-08-03  Justin Fan  <justin_fan@apple.com>

        WebGL 2 conformance: vertex_arrays/vertex_array_object.html
        https://bugs.webkit.org/show_bug.cgi?id=188291
        <rdar://problem/42792709>

        Reviewed by Dean Jackson.

        Get https://www.khronos.org/registry/webgl/conformance-suites/2.0.0/conformance2/vertex_arrays/vertex-array-object.html 
        working on Mac OS and iOS, and check in the new test expectations.

        Existing test: webgl/2.0.0/conformance2/vertex_arrays/vertex-array-object.html

        * html/canvas/WebGL2RenderingContext.cpp:
        (WebCore::WebGL2RenderingContext::initializeVertexArrayObjects):
        (WebCore::WebGL2RenderingContext::deleteVertexArray):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::deleteObject):
        * html/canvas/WebGLVertexArrayObject.cpp:
        (WebCore::WebGLVertexArrayObject::WebGLVertexArrayObject):
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::checkVaryingsPacking const):
        (WebCore::GraphicsContext3D::createVertexArray):
        (WebCore::GraphicsContext3D::deleteVertexArray):
        (WebCore::GraphicsContext3D::isVertexArray):
        (WebCore::GraphicsContext3D::bindVertexArray):

2018-08-03  Sam Weinig  <sam@webkit.org>

        Remove WebGPUObject
        https://bugs.webkit.org/show_bug.cgi?id=188114

        Reviewed by Darin Adler.

        This removes the unecessary WebGPUObject base class and updates the classes
        that were inheriting from it to instead inherit directly from RefCounted. This
        shrinks the size of all the classes that were inheriting from it, as they no
        longer store a RefPtr<WebGPURenderingContext> member, which is unused. Most
        of the classes also shrink because they can be devirtualized.

        This also updates most of the create functions and constructors for the classes
        that were inheriting from WebGPUObject to no longer require the WebGPURenderingContext
        to be passed in. 
        - For WebGPUBuffer, WebGPUCommandQueue, WebGPUComputeCommandEncoder, WebGPUComputePipelineState, 
        WebGPUDepthStencilState, WebGPUDrawable, WebGPUFunction, WebGPULibrary, WebGPURenderCommandEncoder, 
        WebGPURenderPassDepthAttachmentDescriptor, WebGPURenderPipelineColorAttachmentDescriptor, 
        WebGPURenderPipelineState, and WebGPUTexture the WebGPURenderingContext and any other additional 
        parameters needed for initialization were replaced with the underlying type (e.g. WebGPUBuffer 
        now gets passed a GPUBuffer).
        - WebGPUCommandBuffer is passed a GPUCommandQueue, since it needs to construct the underlying
        GPUCommandBuffer itself so it can pass in the completion handler.
        - For WebGPUDepthStencilDescriptor, WebGPURenderPassAttachmentDescriptor, 
        WebGPURenderPassColorAttachmentDescriptor, WebGPURenderPassDescriptor and WebGPURenderPipelineDescriptor
        the create and constructor functions are empty.        

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        Remove WebGPUObject.h/cpp

        * html/canvas/WebGPUBuffer.cpp:
        (WebCore::WebGPUBuffer::WebGPUBuffer):
        * html/canvas/WebGPUBuffer.h:
        * html/canvas/WebGPUBuffer.idl:
        Switch from inheriting from WebGPUObject to directly inheriting from 
        RefCounted<WebGPUBuffer>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create 
        and constructor to take a GPUBuffer directly, rather than the context.

        * html/canvas/WebGPUCommandBuffer.cpp:
        (WebCore::WebGPUCommandBuffer::create):
        (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer):
        Update create and constructor to no longer require a context, as it would
        now be unused, as it no longer inherits from WebGPUObject nor needs to hold
        onto the context for any reason.

        (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
        Update to call the new WebGPURenderCommandEncoder::create, which no longer
        requires a context.

        (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder):
        Update to call the new WebGPUComputeCommandEncoder::create, which no longer
        requires a context.

        * html/canvas/WebGPUCommandBuffer.h:
        * html/canvas/WebGPUCommandBuffer.idl:
        Switch from inheriting from GPUObject to directly inheriting from 
        RefCounted<WebGPUCommandBuffer>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and constructor 
        to no longer take a context, and just take a GPUCommandQueue. We can't directly
        pass a GPUCommandBuffer as WebGPUCommandBuffer needs to pass in a completion handler
        on construction of the underlying GPUCommandBuffer.
        
        * html/canvas/WebGPUCommandQueue.cpp:
        (WebCore::WebGPUCommandQueue::WebGPUCommandQueue):
        (WebCore::WebGPUCommandQueue::createCommandBuffer):
        Update to call the new WebGPUCommandBuffer::create, which no longer
        requires a context.
    
        * html/canvas/WebGPUCommandQueue.h:
        * html/canvas/WebGPUCommandQueue.idl:
        Switch from inheriting from GPUObject to directly inheriting from 
        RefCounted<WebGPUCommandQueue>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPUCommandQueue directly.

        * html/canvas/WebGPUComputeCommandEncoder.cpp:
        (WebCore::WebGPUComputeCommandEncoder::create):
        (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder):
        * html/canvas/WebGPUComputeCommandEncoder.h:
        * html/canvas/WebGPUComputeCommandEncoder.idl:
        Switch from inheriting from GPUObject to directly inheriting from 
        RefCounted<WebGPUComputeCommandEncoder>. Since this de-virtualizes it, 
        also add ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPUComputeCommandEncoder directly

        * html/canvas/WebGPUComputePipelineState.cpp:
        (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState):
        * html/canvas/WebGPUComputePipelineState.h:
        * html/canvas/WebGPUComputePipelineState.idl:
        Switch from inheriting from WebGPUObject to directly inheriting from 
        RefCounted<WebGPUComputePipelineState>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPUComputePipelineState directly.

        * html/canvas/WebGPUDepthStencilDescriptor.cpp:
        Remove unneeded include of include "WebGPURenderingContext.h".

        * html/canvas/WebGPUDepthStencilDescriptor.h:
        * html/canvas/WebGPUDepthStencilDescriptor.idl:
        Switch from inheriting from WebGPUObject to directly inheriting from 
        RefCounted<WebGPUDepthStencilDescriptor>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file.

        * html/canvas/WebGPUDepthStencilState.cpp:
        (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState):
        * html/canvas/WebGPUDepthStencilState.h:
        * html/canvas/WebGPUDepthStencilState.idl:
        Switch from inheriting from WebGPUObject to directly inheriting from 
        RefCounted<WebGPUDepthStencilState>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPUDepthStencilState directly.

        * html/canvas/WebGPUDrawable.cpp:
        (WebCore::WebGPUDrawable::WebGPUDrawable):
        * html/canvas/WebGPUDrawable.h:
        * html/canvas/WebGPUDrawable.idl:
        Switch from inheriting from WebGPUObject to directly inheriting from 
        RefCounted<WebGPUDrawable>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPUDrawable directly.

        * html/canvas/WebGPUFunction.cpp:
        (WebCore::WebGPUFunction::create):
        (WebCore::WebGPUFunction::WebGPUFunction):
        * html/canvas/WebGPUFunction.h:
        * html/canvas/WebGPUFunction.idl:
        Switch from inheriting from GPUObject to directly inheriting from 
        RefCounted<WebGPUFunction>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPUFunction directly.

        * html/canvas/WebGPULibrary.cpp:
        (WebCore::WebGPULibrary::WebGPULibrary):
        (WebCore::WebGPULibrary::functionWithName const):
        Update for new WebGPUFunction::create, which no longer requires a
        context.

        * html/canvas/WebGPULibrary.h:
        * html/canvas/WebGPULibrary.idl:
        Switch from inheriting from WebGPUObject to directly inheriting from 
        RefCounted<WebGPULibrary>. Since this de-virtualizes it, also add 
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPULibrary directly, rather than the context.
        Unlike the other create functions that take their underlying type, this
        one also continues to need the sourceCode String to be passed, as that
        is not available from the underlying GPULibrary and must be stored
        seperately.

        * html/canvas/WebGPUObject.cpp: Removed.
        * html/canvas/WebGPUObject.h: Removed.
        Deleted.

        * html/canvas/WebGPURenderCommandEncoder.cpp:
        (WebCore::WebGPURenderCommandEncoder::create):
        (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder):
        * html/canvas/WebGPURenderCommandEncoder.h:
        * html/canvas/WebGPURenderCommandEncoder.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPURenderCommandEncoder>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPURenderCommandEncoder directly.

        * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
        * html/canvas/WebGPURenderPassAttachmentDescriptor.h:
        Switch from inheriting from GPUObject to directly inheriting from 
        RefCounted<WebGPURenderPassAttachmentDescriptor>. Also update create and 
        constructor to no longer take a context, as it is now not used. This remains virtual
        as it is inherited from by WebGPURenderPassColorAttachmentDescriptor and WebGPURenderPassDepthAttachmentDescriptor.

        * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::create):
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor):
        * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h:
        Update create and constructor to no longer take a context, as it is now not used. Declare final
        as this is not inherited by anything.

        * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create):
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor):
        * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h:
        Update create and constructor to no longer take a context, as it is now not used. Declare final
        as this is not inherited by anything.

        * html/canvas/WebGPURenderPassDescriptor.cpp:
        (WebCore::WebGPURenderPassDescriptor::depthAttachment):
        Update for new WebGPURenderPassDepthAttachmentDescriptor::create function which no longer requires
        a context. 
        
        Semi-interesting note: This function was previously calling "*context()" to pass a WebGPURenderingContext&
        to WebGPURenderPassDepthAttachmentDescriptor::create. However, "context()" was always returning null, as
        the constructor of WebGPURenderPassDescriptor was not initializing the WebGPUObject with a WebGPURenderingContext.
        Now, one might think that this would cause a null-deref, but, because it was being assigned into a 
        WebGPURenderingContext&, no dereference happens right away (it essentially just passes a pointer) and since
        the function it is being passed to does not use it, it never actually gets dereferenced.

        (WebCore::WebGPURenderPassDescriptor::colorAttachments):
        Update for new WebGPURenderPassColorAttachmentDescriptor::create function which no longer requires
        a context. 

        * html/canvas/WebGPURenderPassDescriptor.h:
        * html/canvas/WebGPURenderPassDescriptor.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPURenderPassDescriptor>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file.

        * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create):
        (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor):
        * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h:
        * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPURenderPipelineColorAttachmentDescriptor>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file. Also update create and constructor to
        no longer take a context, as it is now not used.

        * html/canvas/WebGPURenderPipelineDescriptor.cpp:
        (WebCore::WebGPURenderPipelineDescriptor::colorAttachments):
        Update for new WebGPURenderPipelineColorAttachmentDescriptor::create which no longer requires
        a context.

        * html/canvas/WebGPURenderPipelineDescriptor.h:
        * html/canvas/WebGPURenderPipelineDescriptor.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPURenderPipelineDescriptor>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file.

        * html/canvas/WebGPURenderPipelineState.cpp:
        (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState):
        * html/canvas/WebGPURenderPipelineState.h:
        * html/canvas/WebGPURenderPipelineState.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPURenderPipelineState>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file. Also update create and
        constructor to take a GPURenderPipelineState directly.

        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::createLibrary):
        (WebCore::WebGPURenderingContext::createRenderPipelineState):
        (WebCore::WebGPURenderingContext::createDepthStencilState):
        (WebCore::WebGPURenderingContext::createComputePipelineState):
        (WebCore::WebGPURenderingContext::createCommandQueue):
        (WebCore::WebGPURenderingContext::nextDrawable):
        (WebCore::WebGPURenderingContext::createBuffer):
        (WebCore::WebGPURenderingContext::createTexture):
        Update for new create functions which require the caller to pass
        the underlying type.

        * html/canvas/WebGPUTexture.cpp:
        (WebCore::WebGPUTexture::createFromDrawableTexture):
        Renamed to create.

        (WebCore::WebGPUTexture::create): Deleted
        All callers now pass a GPUTexture directly.

        * html/canvas/WebGPUTexture.h:
        * html/canvas/WebGPUTexture.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPUTexture>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file. 

        * html/canvas/WebGPUTextureDescriptor.h:
        * html/canvas/WebGPUTextureDescriptor.idl:
        Switch from inheriting from GPUObject to directly inheriting from
        RefCounted<WebGPUTextureDescriptor>. Since this de-virtualizes it, also add
        ImplementationLacksVTable to the IDL file.

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

        Fix spelling of "overridden"
        https://bugs.webkit.org/show_bug.cgi?id=188315

        Reviewed by Darin Adler.

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper accessibilityLabel]):
        (-[WebAccessibilityObjectWrapper accessibilityValue]):
        * contentextensions/ContentExtensionsBackend.h:
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::removeStyleFromRulesAndContext):
        * inspector/CommandLineAPIModuleSource.js:
        * platform/ScrollView.h:
        * platform/ScrollableArea.h:
        * platform/mediasession/MediaSessionInterruptionProvider.h:
        * rendering/RenderFragmentedFlow.cpp:
        (WebCore::RenderFragmentedFlow::adjustedPositionRelativeToOffsetParent const):
        * rendering/RenderLayer.h:
        * rendering/RenderListBox.h:
        * rendering/svg/RenderSVGResourceClipper.cpp:
        (WebCore::RenderSVGResourceClipper::drawContentIntoMaskImage):
        * svg/SVGElement.cpp:
        (WebCore::SVGElement::localCoordinateSpaceTransform const):
        * svg/SVGLengthContext.cpp:
        (WebCore::SVGLengthContext::SVGLengthContext):
        (WebCore::SVGLengthContext::convertValueToUserUnits const):
        (WebCore::SVGLengthContext::determineViewport const):
        * svg/SVGLengthContext.h:

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

        [LFC][BFC] Special case the document renderer when computing the height and margin
        https://bugs.webkit.org/show_bug.cgi?id=188313

        Reviewed by Antti Koivisto.

        The document renderer is certainly special and its geometry is likely to be computed as part of "10.6.6 Complicated cases" (spec is unclear) but probably not by
        making the it a formatting root. Let's just special case it at contentHeightForFormattingContextRoot(), since having the document renderer as a context root has unwanted side effect. 

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::establishesBlockFormattingContext const):

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

        [LFC][BFC] Layout out-of-flow descendants only on the formatting context root.
        https://bugs.webkit.org/show_bug.cgi?id=188312

        Reviewed by Antti Koivisto.

        Collect out-of-flow descendants on the formatting root container instead of the containing block and run layout on them on the root level. It's more efficient this way.

        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::TreeBuilder::createSubTree):

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

        ContentFilterUnblockHandler's constructors access moved-from variables
        https://bugs.webkit.org/show_bug.cgi?id=188308
        <rdar://problem/42882758>

        Reviewed by Alex Christensen.

        * platform/cocoa/ContentFilterUnblockHandlerCocoa.mm:

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

        [LFC][Floating] Now that the document renderer belongs to "complicated cases", adjust viewport stretching.
        https://bugs.webkit.org/show_bug.cgi?id=188306

        Reviewed by Antti Koivisto.

        And add passing cases for floats.

        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::initialContainingBlock):
        (WebCore::Layout::isStretchedToInitialContainingBlock):
        (WebCore::Layout::stretchHeightToInitialContainingBlock):
        (WebCore::Layout::stretchWidthToInitialContainingBlock):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedWidthAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::isStretchedToViewport): Deleted.

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

        [LFC] Do not check margin box while validating geometry.
        https://bugs.webkit.org/show_bug.cgi?id=188297

        Reviewed by Antti Koivisto.

        The current RenderBox::marginBox implementation is not spec compliant. Ignore it for now.

        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):

2018-08-03  Carlos Garcia Campos  <cgarcia@igalia.com>

        [WPE] Use WPE key symbols and new API instead of xkbcommon and the key mapper
        https://bugs.webkit.org/show_bug.cgi?id=188093

        Reviewed by Žan Doberšek.

        Add helper functions to get key code, hardware key code, key identifier and windows key code from a WPE key symbol.

        * platform/PlatformKeyboardEvent.h:
        * platform/wpe/PlatformKeyboardEventWPE.cpp:
        (WebCore::PlatformKeyboardEvent::keyValueForWPEKeyCode):
        (WebCore::PlatformKeyboardEvent::keyCodeForHardwareKeyCode):
        (WebCore::PlatformKeyboardEvent::keyIdentifierForWPEKeyCode):
        (WebCore::PlatformKeyboardEvent::windowsKeyCodeForWPEKeyCode):
        (WebCore::PlatformKeyboardEvent::singleCharacterString):

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

        Release assert when throwing exceptions in custom element reactions
        https://bugs.webkit.org/show_bug.cgi?id=187805
        <rdar://problem/42432714>

        Reviewed by Saam Barati.

        The release assertion was hit because we were not catching & re-throwing the exception thrown by DOM API
        before trying to execute custom elements reactions in ~CustomElementReactionStack as specified here:
        https://html.spec.whatwg.org/multipage/custom-elements.html#cereactions
        Fixed the bug by capturing the exception and re-throwing the exception as specified.

        Tests: imported/w3c/web-platform-tests/custom-elements/reactions/with-exceptions.html

        * bindings/js/JSMainThreadExecState.h:
        (WebCore::JSMainThreadNullState::JSMainThreadNullState): Use the previous JS state.
        * bindings/scripts/CodeGeneratorJS.pm:
        (GeneratePut): Pass in the exec state to CustomElementReactionStack.
        (GeneratePutByIndex): Ditto.
        (GenerateDefineOwnProperty): Ditto.
        (GenerateDeletePropertyCommon): Ditto.
        (GenerateAttributeSetterBodyDefinition): Ditto.
        (GenerateOperationBodyDefinition): Ditto.
        * bindings/scripts/test/JS/JSTestCEReactions.cpp:
        (WebCore::setJSTestCEReactionsAttributeWithCEReactionsSetter):
        (WebCore::setJSTestCEReactionsReflectAttributeWithCEReactionsSetter):
        (WebCore::jsTestCEReactionsPrototypeFunctionMethodWithCEReactionsBody):
        * bindings/scripts/test/JS/JSTestCEReactionsStringifier.cpp:
        (WebCore::setJSTestCEReactionsStringifierValueSetter):
        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::ElementQueue::processQueue): Added. If there is a script running
        in the stack (i.e. ExecState is not null), catch any exception before executing custom element reactions,
        then re-throw the exception afterwards. ExecState is null when DOM API is invoked via Objective-C bindings
        or when custom element reactions are executed in the backup queue (e.g. for editing operations).
        (WebCore::CustomElementReactionStack::processQueue):
        (WebCore::CustomElementReactionQueue::processBackupQueue):
        * dom/CustomElementReactionQueue.h:
        (WebCore::CustomElementReactionStack::CustomElementReactionStack):
        (WebCore::CustomElementReactionStack::~CustomElementReactionStack):

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

        [LFC][BFC] Apply the "10.6.6 Complicated cases" when computing height and margin for the document renderer
        https://bugs.webkit.org/show_bug.cgi?id=188296

        Reviewed by Simon Fraser.

        The spec is not clear about what to do with the document renderer. It behaves as if it was a formatting context root when
        it comes to computing the content height. Let's apply "10.6.6 Complicated cases" for now.

        * layout/FormattingContext.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::complicatedCases):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin): Deleted.
        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::establishesBlockFormattingContext const):
        * layout/layouttree/LayoutBox.h:

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

        [LFC][Floating] Add FloatingState::bottom() to enable content height computation for formatting roots.
        https://bugs.webkit.org/show_bug.cgi?id=188294

        Reviewed by Simon Fraser.

        "10.6.7 'Auto' heights for block formatting context roots
        ...
        In addition, if the element has any floating descendants whose bottom margin edge is below the element's bottom content edge,
        then the height is increased to include those edges. Only floats that participate in this block formatting context are taken into
        account, e.g., floats inside absolutely positioned descendants or other floats are not..."

        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::bottom const):
        * layout/FloatingState.h:
        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::contentHeightForFormattingContextRoot):

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  Nan Wang  <n_wang@apple.com>

        AX: [iOS] add support to return the attributed string under the element
        https://bugs.webkit.org/show_bug.cgi?id=188276
        <rdar://problem/42872357>

        Reviewed by Chris Fleizach.

        Provided a way on iOS to return the attributed string under the element for 
        better performance.

        Test: accessibility/ios-simulator/attributed-string-for-element.html

        * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
        (-[WebAccessibilityObjectWrapper _stringFromStartMarker:toEndMarker:attributed:]):
        (-[WebAccessibilityObjectWrapper _stringForRange:attributed:]):
        (-[WebAccessibilityObjectWrapper attributedStringForElement]):

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

        [LFC][Floating] Remove redundant LayoutContext member variable.
        https://bugs.webkit.org/show_bug.cgi?id=188286

        Reviewed by Simon Fraser.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::begin):
        (WebCore::Layout::end):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingPair::FloatingPair):
        (WebCore::Layout::Iterator::Iterator):

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

        Move queue processing logic from CustomElementReactionStack to CustomElementReactionQueue
        https://bugs.webkit.org/show_bug.cgi?id=188277

        Reviewed by Wenson Hsieh.

        Moved ensureCurrentQueue, processBackupQueue, ElementQueue, ensureBackupQueue, and backupElementQueue
        from CustomElementReactionStack to CustomElementReactionQueue to simplify CustomElementReactionStack.

        No new tests since there is no behavior change.

        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueueElementUpgrade):
        (WebCore::CustomElementReactionQueue::enqueueConnectedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueDisconnectedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueAdoptedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::enqueueAttributeChangedCallbackIfNeeded):
        (WebCore::CustomElementReactionQueue::ElementQueue::add): Moved from CustomElementReactionStack.
        (WebCore::CustomElementReactionQueue::ElementQueue::invokeAll): Ditto.
        (WebCore::CustomElementReactionQueue::ensureCurrentQueue): Ditto.
        (WebCore::CustomElementReactionQueue::ensureBackupQueue): Ditto.
        (WebCore::CustomElementReactionQueue::processBackupQueue): Ditto.
        (WebCore::CustomElementReactionQueue::backupElementQueue): Ditto.
        * dom/CustomElementReactionQueue.h:
        (WebCore::CustomElementReactionStack::hasCurrentProcessingStack): Deleted. It was never called.

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  Zalan Bujtas  <zalan@apple.com>

        [LFC][Floating] Use displayBox.rectWithMargin().bottom instead of displayBox.bottom() to where applicable.
        https://bugs.webkit.org/show_bug.cgi?id=188274

        Reviewed by Antti Koivisto.

        Float placement uses the margin box.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingPair::bottom const):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):

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

        [LFC][Floating] Right aligned float's horizontal candidate position is miscomputed.
        https://bugs.webkit.org/show_bug.cgi?id=188273

        Reviewed by Antti Koivisto.

        rightAlignedBoxLeft is already shifted with the size of the margin box.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::alignWithFloatings const):

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

        [LFC] Display:Box::rectWithMargin()'s width and height don't include margin left/top.
        https://bugs.webkit.org/show_bug.cgi?id=188272

        Reviewed by Antti Koivisto.

        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::rectWithMargin const):

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

        [LFC][Floating] Containing block of a float could push the candidate position beyond the current float.
        https://bugs.webkit.org/show_bug.cgi?id=188264

        Reviewed by Antti Koivisto.

        <div id=first style="float: left; width: 100px; height: 10px;"></div>
        <div id=second style="float: left; width: 10px; height: 10px;"></div>
        <div style="width: 50px; height: 50px;>
            <div id=third style="float: left; width: 10px; height: 10px;"></div>
        </div>
        In the example above by the time the "third" float comes in, we are already at 110px horizontally. However the containing block of the "third" float forces
        the candidate position at 0px. In such cases intersecting won't work since the candidate position is beyond the last(second) float (horizontally).
        We could either keep going back to the previous floats on this vertical position and eventually intersect with "first" or just compare the horizontal
        positions and ensure that the left/right float is not going to be placed to the left/right of the last float on the current vertical position.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingPair::intersects const):

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

        Implement customElements.upgrade()
        https://bugs.webkit.org/show_bug.cgi?id=183397

        Reviewed by Frédéric Wang.

        Added the support to upgrade custom elements directly. Ordinarily, custom elements get upgraded as they are
        inserted / connected into a document but some script libraries and authors want to be able to upgrade them before that.
        Also see https://github.com/w3c/webcomponents/issues/710

        Implemented the method as specified at:
        https://html.spec.whatwg.org/multipage/custom-elements.html#dom-customelementregistry-upgrade

            When invoked, the upgrade(root) method must run these steps:
            1. Let candidates be a list of all of root's shadow-including inclusive descendant elements,
               in shadow-including tree order.
            2. For each candidate of candidates, try to upgrade candidate.

        Tests: imported/w3c/web-platform-tests/custom-elements/custom-element-registry/upgrade.html

        * dom/CustomElementReactionQueue.cpp:
        (WebCore::CustomElementReactionQueue::enqueueElementUpgradeIfDefined): Removed the assertion that the upgraded element
        is connected since the whole point of this API is to upgrade a disconnected element.
        * dom/CustomElementRegistry.cpp:
        (WebCore::upgradeElementsInShadowIncludingdescendants): Added.
        (WebCore::CustomElementRegistry::upgrade): Added.
        * dom/CustomElementRegistry.h: Forward declare DeferredPromise instead of unnecessarily including JSDOMPromiseDeferred.h.
        * dom/CustomElementRegistry.idl:
        * dom/Element.cpp:
        (WebCore::Element::insertedIntoAncestor): Moved the assertion here.

2018-08-02  Simon Fraser  <simon.fraser@apple.com>

        Convert calc-related enums to 8-bit enum classes
        https://bugs.webkit.org/show_bug.cgi?id=188215

        Reviewed by Zalan Bujtas.

        This shrinks CSSCalcOperation from 48 to 32 bytes.

        * css/CSSCalculationValue.cpp:
        (WebCore::unitCategory):
        (WebCore::determineCategory):
        (WebCore::resolvedTypeForMinOrMax):
        (WebCore::isIntegerResult):
        (WebCore::CSSCalcExpressionNodeParser::parseValue):
        (WebCore::CSSCalcExpressionNodeParser::parseValueMultiplicativeExpression):
        (WebCore::CSSCalcExpressionNodeParser::parseAdditiveValueExpression):
        (WebCore::CSSCalcExpressionNodeParser::parseMinMaxExpression):
        (WebCore::createBlendHalf):
        (WebCore::createCSS):
        * css/CSSCalculationValue.h:
        * css/CSSPrimitiveValue.cpp:
        (WebCore::CSSPrimitiveValue::primitiveType const):
        * css/StyleBuilderConverter.h:
        (WebCore::StyleBuilderConverter::convertTo100PercentMinusLength):
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::CalcParser::consumeNumberRaw):
        (WebCore::CSSPropertyParserHelpers::CalcParser::consumePositiveIntegerRaw):
        (WebCore::CSSPropertyParserHelpers::consumeInteger):
        (WebCore::CSSPropertyParserHelpers::consumePositiveIntegerRaw):
        (WebCore::CSSPropertyParserHelpers::consumeNumberRaw):
        (WebCore::CSSPropertyParserHelpers::consumeNumber):
        (WebCore::CSSPropertyParserHelpers::consumeFontWeightNumber):
        (WebCore::CSSPropertyParserHelpers::consumeLength):
        (WebCore::CSSPropertyParserHelpers::consumePercent):
        (WebCore::CSSPropertyParserHelpers::canConsumeCalcValue):
        (WebCore::CSSPropertyParserHelpers::consumeLengthOrPercent):
        (WebCore::CSSPropertyParserHelpers::consumeAngle):
        (WebCore::CSSPropertyParserHelpers::consumeAngleOrPercent):
        (WebCore::CSSPropertyParserHelpers::consumeTime):
        * platform/CalculationValue.cpp:
        (WebCore::CalcExpressionNumber::operator== const):
        (WebCore::CalcExpressionOperation::evaluate const):
        (WebCore::CalcExpressionOperation::operator== const):
        (WebCore::CalcExpressionOperation::dump const):
        (WebCore::CalcExpressionLength::operator== const):
        (WebCore::CalcExpressionBlendLength::CalcExpressionBlendLength):
        (WebCore::CalcExpressionBlendLength::operator== const):
        (WebCore::operator<<):
        * platform/CalculationValue.h:
        (WebCore::CalcExpressionNumber::CalcExpressionNumber):
        (WebCore::toCalcExpressionNumber):
        (WebCore::CalcExpressionLength::CalcExpressionLength):
        (WebCore::toCalcExpressionLength):
        (WebCore::CalcExpressionOperation::CalcExpressionOperation):
        (WebCore::toCalcExpressionOperation):
        (WebCore::toCalcExpressionBlendLength):
        * platform/Length.cpp:
        (WebCore::convertTo100PercentMinusLength):

2018-08-02  Charlie Turner  <cturner@igalia.com>

        Handle zero-sized ISOMP4 boxes appropriately
        https://bugs.webkit.org/show_bug.cgi?id=188256

        Reviewed by Jer Noble.

        According to ISO/IEC 14496-12:2012(E), when the Box classes' size
        field is zero, the implied size of the box extends to the end of
        the file. If this detail is not taken into account, CENC
        sanitization can incorrectly report an invalid box size, since 0
        != the number of bytes in this box, specifically, the data layout
        of Box is as follows,

        aligned(8) class Box (unsigned int(32) boxtype,
              optional unsigned int(8)[16] extended_type) {
           unsigned int(32) size;
           unsigned int(32) type = boxtype;
           if (size==1) {
             unsigned int(64) largesize;
           } else if (size==0) { // This is the case now handled.
             // box extends to end of file
           }
           if (boxtype==‘uuid’) {
             unsigned int(8)[16] usertype = extended_type;
           }
        }

        Tested by imported/w3c/web-platform-tests/encrypted-media/clearkey-generate-request-disallowed-input.https.html

        * platform/graphics/iso/ISOBox.cpp:
        (WebCore::ISOBox::peekBox): Check if the parsed size is zero, and
        if it is, the size is calculated as the total number of bytes in
        the incoming DataView.
        (WebCore::ISOBox::parse): Ditto.

2018-08-01  Dan Bernstein  <mitz@apple.com>

        Optionally expose Attr::style to JavaScript
        https://bugs.webkit.org/show_bug.cgi?id=188226
        <rdar://problem/42818113>

        Reviewed by Darin Adler.

        Test: TestWebKitAPI/Tests/WebKitCocoa/AttrStyle.mm

        * dom/Attr.cpp: Update comment.
        * dom/Attr.idl: Define the style attribute, enabled at runtime by the AttrStyle feature.

        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setAttrStyleEnabled): Added this accessor.
        (WebCore::RuntimeEnabledFeatures::attrStyleEnabled const): Ditto.

2018-08-02  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r234489.

        Caused 50+ crashes and 60+ API failures on iOS

        Reverted changeset:

        "[WTF] Rename String::format to String::deprecatedFormat"
        https://bugs.webkit.org/show_bug.cgi?id=188191
        https://trac.webkit.org/changeset/234489

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

        [LFC][Floating] Do not pass formatting root to FloatingContext
        https://bugs.webkit.org/show_bug.cgi?id=188257

        Reviewed by Antti Koivisto.

        If we ever need it, we can get it from FloatingState.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::FloatingContext):
        * layout/FloatingContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):

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

        [LFC][Floating] Convert all coordinates relative to the formatting context root.
        https://bugs.webkit.org/show_bug.cgi?id=188249

        Reviewed by Antti Koivisto.

        The idea here is that all the float related computation should be happening in the same coordinate system.
        FloatItem holds the transformed Display::Box for both the layout box and its containing block. 

        * layout/FloatingContext.cpp:
        (WebCore::Layout::begin):
        (WebCore::Layout::end):
        (WebCore::Layout::FloatingContext::computePosition const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingContext::initialVerticalPosition const):
        (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
        (WebCore::Layout::FloatingContext::alignWithFloatings const):
        (WebCore::Layout::FloatingContext::toContainingBlock const):
        (WebCore::Layout::FloatingPair::FloatingPair):
        (WebCore::Layout::FloatingPair::left const):
        (WebCore::Layout::FloatingPair::right const):
        (WebCore::Layout::Iterator::Iterator):
        (WebCore::Layout::previousFloatingIndex):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):
        * layout/FloatingContext.h:
        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::FloatItem::FloatItem):
        (WebCore::Layout::FloatingState::remove):
        (WebCore::Layout::FloatingState::append):
        * layout/FloatingState.h:
        (WebCore::Layout::FloatingState::isEmpty const):
        (WebCore::Layout::FloatingState::FloatItem::layoutBox const):
        (WebCore::Layout::FloatingState::FloatItem::containingBlock const):
        (WebCore::Layout::FloatingState::FloatItem::displayBox const):
        (WebCore::Layout::FloatingState::FloatItem::containingBlockDisplayBox const):
        (WebCore::Layout::FloatingState::floats const):
        (WebCore::Layout::FloatingState::last const):
        (WebCore::Layout::FloatingState::root const):
        (WebCore::Layout::FloatingState::floatings const): Deleted.
        * layout/displaytree/DisplayBox.h:

2018-08-02  Charlie Turner  <cturner@igalia.com>

        [GStreamer] Dynamically adjust blocksize
        https://bugs.webkit.org/show_bug.cgi?id=188194

        Reviewed by Xabier Rodriguez-Calvar.

        Update the blocksize depending on how much is obtained from a read
        of the input stream. This avoids doing too many reads in small
        chunks when larger amounts of data are available and also prevents
        using a very large memory area to read a small chunk of data.

        Adapted from https://bugzilla.gnome.org/show_bug.cgi?id=767833

        No tests new tests since no change in functionality.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (webkit_web_src_init):
        (CachedResourceStreamingClient::checkUpdateBlocksize):
        (CachedResourceStreamingClient::dataReceived):

2018-08-02  Charlie Turner  <cturner@igalia.com>

        [GStreamer] Stop pushing buffers when seeking status changes
        https://bugs.webkit.org/show_bug.cgi?id=188193

        Reviewed by Xabier Rodriguez-Calvar.

        After switching to splitting buffers into smaller block sizes in

            https://bugs.webkit.org/show_bug.cgi?id=182829

        It was found that during the individual buffer pushes, the seeking
        status could change behind our backs from another thread. When
        this happens, buffers from incorrect offsets would find their way
        into appsrc and eventually the demuxer itself, which would start
        parsing from a random place and at best give a confusing error
        message.

        The solution here is break from pushing buffers when the seeking
        status has been has changed. Flushes will clear out what we've
        already delivered into the appsrc, then we must make sure to not
        continue sending buffers in there after the flush.

        No new tests since this is a timing bug.

        * platform/graphics/gstreamer/WebKitWebSourceGStreamer.cpp:
        (CachedResourceStreamingClient::dataReceived):

2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, revert TransformationMatrix::operator== change
        https://bugs.webkit.org/show_bug.cgi?id=188197

        This change partially revert cleaning up of TransformationMatrix since memcmp does not
        follow double comparison algorithm. So semantics was accidentally changed.

        * platform/graphics/transforms/TransformationMatrix.h:
        (WebCore::TransformationMatrix::operator== const):

2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        Unreviewed, rename TransformationMatrix::Identity to TransformationMatrix::identity
        https://bugs.webkit.org/show_bug.cgi?id=188204

        Follow the coding style.

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::transform const):
        (WebCore::GraphicsLayer::childrenTransform const):
        * platform/graphics/transforms/TransformationMatrix.cpp:
        * platform/graphics/transforms/TransformationMatrix.h:

2018-08-01  Yusuke Suzuki  <utatane.tea@gmail.com>

        Add self.queueMicrotask(f) on DOMWindow
        https://bugs.webkit.org/show_bug.cgi?id=188212

        Reviewed by Ryosuke Niwa.

        This patch adds self.queueMicrotask(f) in DOMWindow, which takes a function and enqueue it into microtask queue.
        We do not add this to Worker's global scope since our worker does not support microtasks correctly.

        Tests: js/dom/queue-microtask-window.html

        * bindings/js/JSDOMWindowCustom.cpp:
        (WebCore::JSDOMWindow::queueMicrotask):
        Post a microtask to JSC's microtask mechanism. This will eventually go to WebCore's MicrotaskQueue code.

        * page/DOMWindow.idl:

2018-08-01  Tomas Popela  <tpopela@redhat.com>

        [WTF] Rename String::format to String::deprecatedFormat
        https://bugs.webkit.org/show_bug.cgi?id=188191

        Reviewed by Darin Adler.

        It should be replaced with string concatenation.

        * Modules/indexeddb/IDBKeyData.cpp:
        (WebCore::IDBKeyData::loggingString const):
        * Modules/indexeddb/server/SQLiteIDBBackingStore.cpp:
        (WebCore::IDBServer::SQLiteIDBBackingStore::addRecord):
        * Modules/indexeddb/shared/IDBCursorInfo.cpp:
        (WebCore::IDBCursorInfo::loggingString const):
        * Modules/indexeddb/shared/IDBGetAllRecordsData.cpp:
        (WebCore::IDBGetAllRecordsData::loggingString const):
        * Modules/indexeddb/shared/IDBGetRecordData.cpp:
        (WebCore::IDBGetRecordData::loggingString const):
        * Modules/indexeddb/shared/IDBIndexInfo.cpp:
        (WebCore::IDBIndexInfo::loggingString const):
        (WebCore::IDBIndexInfo::condensedLoggingString const):
        * Modules/indexeddb/shared/IDBIterateCursorData.cpp:
        (WebCore::IDBIterateCursorData::loggingString const):
        * Modules/indexeddb/shared/IDBObjectStoreInfo.cpp:
        (WebCore::IDBObjectStoreInfo::condensedLoggingString const):
        * Modules/indexeddb/shared/IDBResourceIdentifier.cpp:
        (WebCore::IDBResourceIdentifier::loggingString const):
        * Modules/webdatabase/Database.cpp:
        (WebCore::formatErrorMessage):
        * Modules/webdatabase/SQLError.h:
        (WebCore::SQLError::create):
        * Modules/websockets/WebSocket.cpp:
        (WebCore::encodeProtocolString):
        * accessibility/win/AccessibilityObjectWrapperWin.cpp:
        (WebCore::AccessibilityObjectWrapper::accessibilityAttributeValue):
        * css/CSSUnicodeRangeValue.cpp:
        (WebCore::CSSUnicodeRangeValue::customCSSText const):
        * css/MediaQueryEvaluator.cpp:
        (WebCore::aspectRatioValueAsString):
        * css/parser/CSSParserToken.cpp:
        (WebCore::CSSParserToken::serialize const):
        * css/parser/CSSPropertyParserHelpers.cpp:
        (WebCore::CSSPropertyParserHelpers::parseHexColor):
        * dom/Document.cpp:
        (WebCore::Document::lastModified):
        * html/FTPDirectoryDocument.cpp:
        (WebCore::processFilesizeString):
        (WebCore::processFileDateString):
        * html/HTMLMediaElement.h:
        (WTF::ValueToString<WebCore::TextTrackCue::string):
        * html/HTMLSelectElement.cpp:
        (WebCore::HTMLSelectElement::setLength):
        * html/ImageDocument.cpp:
        (WebCore::ImageDocument::imageUpdated):
        * html/canvas/WebGLRenderingContextBase.cpp:
        * html/parser/XSSAuditor.cpp:
        (WebCore::XSSAuditor::init):
        * html/track/VTTCue.cpp:
        (WebCore::VTTCueBox::applyCSSProperties):
        * inspector/InspectorFrontendClientLocal.cpp:
        (WebCore::InspectorFrontendClientLocal::setDockingUnavailable):
        (WebCore::InspectorFrontendClientLocal::setAttachedWindow):
        (WebCore::InspectorFrontendClientLocal::setDebuggingEnabled):
        (WebCore::InspectorFrontendClientLocal::setTimelineProfilingEnabled):
        (WebCore::InspectorFrontendClientLocal::showMainResourceForFrame):
        * inspector/agents/InspectorCSSAgent.cpp:
        * inspector/agents/InspectorIndexedDBAgent.cpp:
        * page/CaptionUserPreferencesMediaAF.cpp:
        (WebCore::CaptionUserPreferencesMediaAF::windowRoundedCornerRadiusCSS const):
        * page/History.cpp:
        (WebCore::History::stateObjectAdded):
        * page/MemoryRelease.cpp:
        (WebCore::logMemoryStatisticsAtTimeOfDeath):
        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::formatByteNumber):
        (WebCore::gcTimerString):
        (WebCore::ResourceUsageOverlay::platformDraw):
        * page/cocoa/ResourceUsageThreadCocoa.mm:
        (WebCore::logFootprintComparison):
        * page/linux/ResourceUsageOverlayLinux.cpp:
        (WebCore::cpuUsageString):
        (WebCore::formatByteNumber):
        (WebCore::gcTimerString):
        * page/scrolling/AxisScrollSnapOffsets.cpp:
        (WebCore::snapOffsetsToString):
        (WebCore::snapOffsetRangesToString):
        (WebCore::snapPortOrAreaToString):
        * platform/DateComponents.cpp:
        (WebCore::DateComponents::toStringForTime const):
        (WebCore::DateComponents::toString const):
        * platform/LocalizedStrings.cpp:
        * platform/animation/TimingFunction.cpp:
        (WebCore::TimingFunction::cssText const):
        * platform/audio/HRTFElevation.cpp:
        (WebCore::HRTFElevation::calculateKernelsForAzimuthElevation):
        * platform/cocoa/KeyEventCocoa.mm:
        (WebCore::keyIdentifierForCharCode):
        * platform/gamepad/mac/HIDGamepad.cpp:
        (WebCore::HIDGamepad::HIDGamepad):
        * platform/glib/UserAgentGLib.cpp:
        (WebCore::platformVersionForUAString):
        * platform/graphics/Color.cpp:
        (WebCore::Color::nameForRenderTreeAsText const):
        * platform/graphics/FloatPolygon.h:
        (WTF::ValueToString<WebCore::FloatPolygonEdge::string):
        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        (WebCore::AVTrackPrivateAVFObjCImpl::id const):
        * platform/graphics/avfoundation/MediaSampleAVFObjC.h:
        (WebCore::MediaSampleAVFObjC::MediaSampleAVFObjC):
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::setName):
        (WebCore::GraphicsLayerCA::setContentsToSolidColor):
        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
        (WebCore::GraphicsLayerCA::updateContentsImage):
        (WebCore::GraphicsLayerCA::updateContentsRects):
        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
        * platform/graphics/gstreamer/GStreamerCommon.cpp:
        (WebCore::simpleBusMessageCallback):
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
        (WebCore::MediaPlayerPrivateGStreamer::load):
        (WebCore::MediaPlayerPrivateGStreamer::handleMessage):
        (WebCore::MediaPlayerPrivateGStreamer::createGSTPlayBin):
        * platform/graphics/gstreamer/mse/AppendPipeline.cpp:
        (WebCore::AppendPipeline::handleStateChangeMessage):
        (WebCore::AppendPipeline::resetPipeline):
        * platform/graphics/gstreamer/mse/MediaPlayerPrivateGStreamerMSE.cpp:
        (WebCore::MediaPlayerPrivateGStreamerMSE::load):
        (WebCore::MediaPlayerPrivateGStreamerMSE::doSeek):
        * platform/graphics/gtk/ImageBufferGtk.cpp:
        (WebCore::encodeImage):
        * platform/gtk/PlatformKeyboardEventGtk.cpp:
        (WebCore::PlatformKeyboardEvent::keyIdentifierForGdkKeyCode):
        * platform/mediastream/gstreamer/GStreamerAudioCaptureSource.cpp:
        (WebCore::GStreamerAudioCaptureSource::create):
        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
        (WebCore::webkitMediaStreamSrcAddPad):
        * platform/mediastream/gstreamer/GStreamerVideoCaptureSource.cpp:
        (WebCore::GStreamerVideoCaptureSource::create):
        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
        (WebCore::GStreamerVideoEncoder::makeElement):
        * platform/mock/MockRealtimeVideoSource.cpp:
        (WebCore::MockRealtimeVideoSource::drawText):
        * platform/mock/mediasource/MockSourceBufferPrivate.cpp:
        * platform/network/ParsedContentRange.cpp:
        (WebCore::ParsedContentRange::headerValue const):
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::NetworkStorageSession::switchToNewTestingSession):
        * platform/sql/SQLiteDatabase.cpp:
        (WebCore::unauthorizedSQLFunction):
        * platform/text/PlatformLocale.cpp:
        (WebCore::DateTimeStringBuilder::visitField):
        * platform/win/GDIObjectCounter.cpp:
        (WebCore::GDIObjectCounter::GDIObjectCounter):
        * platform/win/KeyEventWin.cpp:
        (WebCore::keyIdentifierForWindowsKeyCode):
        * rendering/FloatingObjects.h:
        (WTF::ValueToString<WebCore::FloatingObject::string):
        * rendering/RenderFragmentedFlow.h:
        (WTF::ValueToString<WebCore::RenderFragmentContainer::string):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::logLayerInfo):
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::formatMediaControlsTime const):
        * testing/Internals.cpp:
        (WebCore::Internals::address):
        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::ensureValidRecordsTable):
        (WebCore::RegistrationDatabase::importRecords):

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

        Move all calls to ResourceLoader::start to WebKitLegacy
        https://bugs.webkit.org/show_bug.cgi?id=184946

        Reviewed by Andy Estes.

        This is in preparation for moving ResourceLoader::start to WebKitLegacy along with all ResourceHandle code.
        I move the code that moves m_deferredRequest into m_request into WebKitLegacy, which won't change behavior for
        modern WebKit because modern WebKit never calls ResourceLoader::start, the only place where m_deferredRequest
        is ever set.  This won't change behavior for WebKitLegacy because the same operations happen in the same order.

        * loader/LoaderStrategy.h:
        * loader/ResourceLoader.cpp:
        (WebCore::ResourceLoader::setDefersLoading):
        * loader/ResourceLoader.h:
        (WebCore::ResourceLoader::setRequest):
        (WebCore::ResourceLoader::deferredRequest const):
        (WebCore::ResourceLoader::takeDeferredRequest):

2018-08-01  Nan Wang  <n_wang@apple.com>

        AX: AOM: Add ARIA IDL Attribute Reflection
        https://bugs.webkit.org/show_bug.cgi?id=184676
        <rdar://problem/39476882>

        Reviewed by Chris Fleizach.

        Test: accessibility/ARIA-reflection.html

        * CMakeLists.txt:
        * DerivedSources.make:
        * WebCore.xcodeproj/project.pbxproj:
        * accessibility/AccessibilityRole.idl: Added.
        * accessibility/AriaAttributes.idl: Added.
        * dom/Element.idl:
        * page/RuntimeEnabledFeatures.h:
        (WebCore::RuntimeEnabledFeatures::setAriaReflectionEnabled):
        (WebCore::RuntimeEnabledFeatures::ariaReflectionEnabled const):

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

        [LFC][Floating] Revert back to only one list for the all the floatings.
        https://bugs.webkit.org/show_bug.cgi?id=188232

        Reviewed by Antti Koivisto.

        If the combined floating list turns out to be a performance bottleneck, we can still split it into left and right. However at this point
        having 2 dedicated lists just makes the implementation more complicated.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::begin):
        (WebCore::Layout::end):
        (WebCore::Layout::FloatingPair::FloatingPair):
        (WebCore::Layout::FloatingPair::left const):
        (WebCore::Layout::FloatingPair::right const):
        (WebCore::Layout::Iterator::Iterator):
        (WebCore::Layout::previousFloatingIndex):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):
        (WebCore::Layout::floatingDisplayBox): Deleted.
        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::remove):
        (WebCore::Layout::FloatingState::append):
        * layout/FloatingState.h:
        (WebCore::Layout::FloatingState::isEmpty const):
        (WebCore::Layout::FloatingState::floatings const):
        (WebCore::Layout::FloatingState::last const):

2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Change synchronous request logic using MessageQueue to match with Mac port.
        https://bugs.webkit.org/show_bug.cgi?id=188206

        Reviewed by Alex Christensen.

        Port synchronous request logic from ResourceHandleMac to use MessageQueue for
        client callback invocation. This makes simplify the logic of CurlRequest because
        now every requests are handled in Curl thread and there's no difference between
        sync and async requests.

        Test: Covered by these tests:
        - http\tests\xmlhttprequest\simple-sync.html
        - http\tests\xmlhttprequest\xmlhttprequest-unsafe-redirect.html

        * platform/network/ResourceHandleInternal.h:
        * platform/network/curl/CurlRequest.cpp: Remove synchronous request logics.
        (WebCore::CurlRequest::CurlRequest):
        (WebCore::CurlRequest::invalidateClient):
        (WebCore::CurlRequest::start):
        (WebCore::CurlRequest::cancel):
        (WebCore::CurlRequest::runOnMainThread): Added message queue handling.
        (WebCore::CurlRequest::runOnWorkerThreadIfRequired):
        (WebCore::CurlRequest::didReceiveData):
        (WebCore::CurlRequest::invokeDidReceiveResponseForFile):
        (WebCore::CurlRequest::completeDidReceiveResponse):
        (WebCore::CurlRequest::updateHandlePauseState):
        (WebCore::CurlRequest::isHandlePaused const):
        * platform/network/curl/CurlRequest.h:
        (WebCore::CurlRequest::create):
        (WebCore::CurlRequest::resourceRequest const):
        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::createCurlRequest):
        (WebCore::ResourceHandle::restartRequestWithCredential):
        (WebCore::ResourceHandle::platformLoadResourceSynchronously):
        (WebCore::ResourceHandle::platformContinueSynchronousDidReceiveResponse):
        (WebCore::ResourceHandle::continueAfterDidReceiveResponse):
        (WebCore::ResourceHandle::continueAfterWillSendRequest):
        (WebCore::ResourceHandle::handleDataURL):

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

        [LFC][Floating] Use margin box consistently while placing a floating.
        https://bugs.webkit.org/show_bug.cgi?id=188222

        Reviewed by Antti Koivisto.

        The floating box fits when its margin box fits.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::computePosition const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingContext::initialVerticalPosition const):
        (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
        (WebCore::Layout::FloatingContext::alignWithFloatings const):
        (WebCore::Layout::FloatingPair::intersects const):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::rectWithMargin const):

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

        [LFC] Add FormattingContext::mapToAncestor geometry mapping function
        https://bugs.webkit.org/show_bug.cgi?id=188188

        Reviewed by Antti Koivisto.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::mapToAncestor):
        * layout/FormattingContext.h:
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::clone const):
        * layout/displaytree/DisplayBox.h:

2018-08-01  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Bugfix on ResourceHandle::cancel()
        https://bugs.webkit.org/show_bug.cgi?id=188234

        Reviewed by Darin Adler.
        Trivial bug. The actual request was not cancelled correctly.

        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::cancel):

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

        [LFC][Floating] FloatingState should take the formatting root box.
        https://bugs.webkit.org/show_bug.cgi?id=188214

        Reviewed by Antti Koivisto.

        This will be taken into use when FormattingContext takes all boxes in the coordinate system of the formatting root.

        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::FloatingState):
        (WebCore::Layout::belongsToThisFloatingContext):
        (WebCore::Layout::FloatingState::append):
        * layout/FloatingState.h:
        (WebCore::Layout::FloatingState::create):
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::establishedFormattingState):

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

        [LFC][Floating] Align new floating with the bottom of the existing floatings.
        https://bugs.webkit.org/show_bug.cgi?id=188213

        Reviewed by Antti Koivisto.

        When the incoming floating does not fit at all, align its top with the bottom of the existing floatings.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingPair::bottom const):

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-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-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  Yusuke Suzuki  <utatane.tea@gmail.com>

        Add TransformationMatrix::Identity
        https://bugs.webkit.org/show_bug.cgi?id=188204

        Reviewed by Simon Fraser.

        This patch adds TransformationMatrix::Identity, which is a static const variable holding an identity matrix.

        No behavior change.

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::transform const):
        (WebCore::GraphicsLayer::childrenTransform const):
        (): Deleted.
        * platform/graphics/transforms/TransformationMatrix.cpp:
        * platform/graphics/transforms/TransformationMatrix.h:

2018-08-01  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Make sure that first buffer running time is 0 in GStreamerMediaStreamSource
        https://bugs.webkit.org/show_bug.cgi?id=188210

        This is a live source and the first frame is the beginning of the stream,
        but that doesn't mean that the incoming stream from the camera didn't start
        before. We need to set a pad offset on each srcpad of the source to compensate
        for that. This is the exact same logic as in webrtc GStreamerVideo/Enc/Dec/oder.

        Reviewed by Alejandro G. Castro.

        * platform/mediastream/gstreamer/GStreamerMediaStreamSource.cpp:
        (WebCore::webkit_media_stream_src_init):
        (WebCore::webkitMediaStreamSrcPushVideoSample):
        (WebCore::webkitMediaStreamSrcPushAudioSample):

2018-08-01  Zan Dobersek  <zdobersek@igalia.com>

        [CoordGraphics] Move CoordinatedBackingStore to WebCore
        https://bugs.webkit.org/show_bug.cgi?id=188158

        Reviewed by Carlos Garcia Campos.

        Move the CoordinatedBackingStore class from WebKit to WebCore. It has no
        dependency on anything in the WebKit layer, and it's more suitable to
        future needs to keep it in the WebCore layer.

        * platform/TextureMapper.cmake:
        * platform/graphics/texmap/coordinated/CoordinatedBackingStore.cpp: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.cpp.
        * platform/graphics/texmap/coordinated/CoordinatedBackingStore.h: Renamed from Source/WebKit/Shared/CoordinatedGraphics/CoordinatedBackingStore.h.
        (WebCore::CoordinatedBackingStoreTile::CoordinatedBackingStoreTile):
        (WebCore::CoordinatedBackingStore::rect const):

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

        [WIN] Fix tests for text with initial advances
        https://bugs.webkit.org/show_bug.cgi?id=188099

        Reviewed by Darin Adler.

        Fixup after r234318.

        Tests: fast/text/complex-first-glyph-with-initial-advance.html
               fast/text/initial-advance-in-intermediate-run-complex.html

        * platform/graphics/ComplexTextController.cpp:
        * platform/graphics/FontCascade.cpp:
        (WebCore::FontCascade::drawGlyphBuffer const):

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  Myles C. Maxfield  <mmaxfield@apple.com>

        [Cocoa] Addressing post-review comments on r234158
        https://bugs.webkit.org/show_bug.cgi?id=188202

        Reviewed by Darin Adler.

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

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

        Resource Load Statistics: Remove partitioned cookies for reduced complexity, lower memory footprint, and ability to support more platforms
        https://bugs.webkit.org/show_bug.cgi?id=188109
        <rdar://problem/42664391>

        Reviewed by Brent Fulgham, Chris Dumez, and Alex Christensen.

        Tests: http/tests/resourceLoadStatistics/cookie-deletion.html
               http/tests/resourceLoadStatistics/cookies-with-and-without-user-interaction.html
               http/tests/storageAccess/has-storage-access-from-prevalent-domain-with-user-interaction.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe-pop-window.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-non-sandboxed-iframe.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-and-access-from-right-frame.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction-but-access-from-wrong-frame.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-with-user-interaction.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe-from-prevalent-domain-without-user-interaction.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-iframe.html
               http/tests/storageAccess/request-and-grant-access-cross-origin-sandboxed-nested-iframe.html

        This patch removes cookie partitioning which reduces the model to just
        blocked cookies (in third-party contexts) and first-party cookie access.

        Several of the changes are renaming to reflect that there are no more
        cookie partitions. However, the compile-time check remains for now since
        this change is not ready to ship.

        The test cases mentioned about are not new. They are just renamed to
        reflect the code changes and to shorten their names (as requested by
        non-Cocoa platforms).

        * loader/ResourceLoadStatistics.cpp:
        (WebCore::ResourceLoadStatistics::toString const):
        (WebCore::ResourceLoadStatistics::merge):
            Removed the use of isMarkedForCookiePartitioning.
        * loader/ResourceLoadStatistics.h:
            Removed isMarkedForCookiePartitioning.
        * platform/network/NetworkStorageSession.h:
        * platform/network/ResourceHandle.h:
            Renamed applySniffingPoliciesAndStoragePartitionIfNeeded() to
            applySniffingPoliciesIfNeeded().
        * platform/network/cf/NetworkStorageSessionCFNet.cpp:
        (WebCore::getPartitioningDomain):
        (WebCore::NetworkStorageSession::shouldBlockCookies const):
            Now takes a frame ID and a page ID to be able to support
            the Storage Access API. This was previously handled by
            shouldPartitionCookies() which is now deleted.
        (WebCore::NetworkStorageSession::setPrevalentDomainsToBlockCookiesFor):
            Renamed from setPrevalentDomainsToPartitionOrBlockCookies().
        (WebCore::NetworkStorageSession::removePrevalentDomains):
            No longer needs to clear the member variable for partitioned cookie domains.
        (WebCore::NetworkStorageSession::setCookieStoragePartitioningEnabled): Deleted.
        (WebCore::NetworkStorageSession::cookieStoragePartition const): Deleted.
        (WebCore::NetworkStorageSession::shouldPartitionCookies const): Deleted.
        (WebCore::NetworkStorageSession::setPrevalentDomainsToPartitionOrBlockCookies): Deleted.
            Renamed to setPrevalentDomainsToBlockCookiesFor().
        * platform/network/mac/CookieJarMac.mm:
        (WebCore::cookiesForURL):
            Now calls session.shouldBlockCookies() instead of the
            wrapper cookiesAreBlockedForURL().
        (WebCore::setCookiesFromDOM):
            No longer checks for partition.
        (WebCore::applyPartitionToCookies): Deleted.
        (WebCore::cookiesAreBlockedForURL): Deleted.
            This was just a wrapper for session.shouldBlockCookies().
        (WebCore::cookiesInPartitionForURL): Deleted.
        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::applySniffingPoliciesIfNeeded):
            Renamed from applySniffingPoliciesAndStoragePartitionIfNeeded().
        (WebCore::ResourceHandle::createNSURLConnection):
            Consequence of function name change.
        (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded): Deleted.
            Renamed to applySniffingPoliciesIfNeeded().

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

        [iOS] Spelling suggestions cannot be selected in focused form controls when zoomed in
        https://bugs.webkit.org/show_bug.cgi?id=188107
        <rdar://problem/42354250>

        Reviewed by Tim Horton.

        After r232040, the synthetic click gesture recognizer was enabled when tapping inside of the focused element,
        which allows the page to handle click events inside editable content. However, this means that codepaths in
        EventHandler that are responsible for changing selection due to default click event behaviors on macOS are now
        active on iOS; this conflicts with selection changes due to text interaction gestures, which are the existing
        mechanism for modifying the selection on iOS.

        To address this, we defer selection changes when clicking to text interaction gestures on iOS by tweaking the
        default behavior of a click on iOS to /not/ change selection when moving within the same editable root. This is
        similar to r233311, but in a different codepath that specifically handles selection changes when clicking on
        content that is already selected.

        Test: fast/forms/ios/click-should-not-suppress-misspelling.html

        * page/EventHandler.cpp:
        (WebCore::EventHandler::handleMouseReleaseEvent):

2018-07-31  Yusuke Suzuki  <utatane.tea@gmail.com>

        Clean up TransformationMatrix implementation
        https://bugs.webkit.org/show_bug.cgi?id=188197

        Reviewed by Simon Fraser.

        We perform cleaning up of TransformationMatrix.

        1. We drop user-defined operator= and copy constructor. Default ones works well for TransformationMatrix.
        2. Remove unused setMatrix. We explicitly use memcpy in TransformationMatrix.cpp (only one place).
        3. Use memcmp for implementing operator==.

        In (2) and (3), we use `memcpy(&matrix[0][0], &tmp[0][0], sizeof(Matrix4))` instead of `memcpy(matrix, tmp, sizeof(Matrix4))`,
        since they both are non nullptr and the former is easier to understand.

        * platform/graphics/transforms/TransformationMatrix.cpp:
        (WebCore::TransformationMatrix::multiply):
        * platform/graphics/transforms/TransformationMatrix.h:
        (WebCore::TransformationMatrix::setMatrix):
        (WebCore::TransformationMatrix::operator== const):
        (WebCore::TransformationMatrix::operator =): Deleted.

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  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use static const global variable for TransformationMatrix instead of NeverDestroyed
        https://bugs.webkit.org/show_bug.cgi?id=188195

        Reviewed by Darin Adler.

        Since TransformationMatrix does not have a non-trivial destructor, we can put it
        as static const global variable if its constructor is constexpr. This patch makes
        some of constructors constexpr and makes identityTransform static const global variable
        instead of NeverDestroyed<> + static function. This removes unnecessary static function
        and lazy initialization.

        No behavior change.

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::transform const):
        (WebCore::GraphicsLayer::childrenTransform const):
        (WebCore::identityTransform): Deleted.
        * platform/graphics/transforms/TransformationMatrix.h:
        (WebCore::TransformationMatrix::TransformationMatrix):

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

        [LFC][Floating] Add basic left/right floating positioning.
        https://bugs.webkit.org/show_bug.cgi?id=188148

        Reviewed by Antti Koivisto.

        This patch implements simple floating positioning.
        (Floatings with different containing blocks do not work yet.)

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingPair::isEmpty const):
        (WebCore::Layout::Iterator::current const):
        (WebCore::Layout::Iterator::verticalPosition const):
        (WebCore::Layout::FloatingContext::FloatingContext):
        (WebCore::Layout::FloatingContext::computePosition const):
        (WebCore::Layout::FloatingContext::floatingPosition const):
        (WebCore::Layout::FloatingContext::initialVerticalPosition const):
        (WebCore::Layout::FloatingContext::alignWithContainingBlock const):
        (WebCore::Layout::FloatingContext::alignWithFloatings const):
        (WebCore::Layout::floatingDisplayBox):
        (WebCore::Layout::FloatingPair::FloatingPair):
        (WebCore::Layout::FloatingPair::left const):
        (WebCore::Layout::FloatingPair::right const):
        (WebCore::Layout::FloatingPair::intersects const):
        (WebCore::Layout::Iterator::Iterator):
        (WebCore::Layout::Iterator::operator++):
        (WebCore::Layout::Iterator::set):
        (WebCore::Layout::FloatingContext::computePosition): Deleted.
        * layout/FloatingContext.h:
        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::append):
        * layout/FloatingState.h:
        (WebCore::Layout::FloatingState::floatings const):
        (WebCore::Layout::FloatingState::last const):
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        * layout/displaytree/DisplayBox.cpp:
        (WebCore::Display::Box::Rect::Rect):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::Rect::intersects const):
        (WebCore::Display::Box::rect const):

2018-07-31  Rob Buis  <rbuis@igalia.com>

        Remove ResourceResponse::cacheBodyKey API
        https://bugs.webkit.org/show_bug.cgi?id=188192

        Reviewed by Frédéric Wang.

        Removed unused API.

        No new tests needed since this API is not used.

        * platform/network/ResourceResponseBase.h:
        (WebCore::ResourceResponseBase::encode const):
        (WebCore::ResourceResponseBase::decode):
        (WebCore::ResourceResponseBase::cacheBodyKey const): Deleted.
        (WebCore::ResourceResponseBase::setCacheBodyKey): Deleted.

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

        Shrink GraphicsLayerCA
        https://bugs.webkit.org/show_bug.cgi?id=188141

        Reviewed by Zalan Bujtas.
        
        Shrink GraphicsLayerCA from 1040 to 880 bytes by:
        * moving all the clone-related stuff into the lazily-allocated m_layerClones
        * moving all the animation-related stuff into the lazily-allocated m_animations
        * making enums be 8-bit
        * re-ordering data members

        * page/cocoa/ResourceUsageOverlayCocoa.mm:
        (WebCore::ResourceUsageOverlay::platformInitialize):
        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::GraphicsLayer::GraphicsLayer):
        (WebCore::operator<<):
        * platform/graphics/GraphicsLayer.h:
        * platform/graphics/GraphicsLayerClient.h:
        * platform/graphics/WindRule.h:
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
        (WebCore::GraphicsLayerCA::moveOrCopyAnimations):
        (WebCore::GraphicsLayerCA::addProcessingActionForAnimation):
        (WebCore::GraphicsLayerCA::setContentsToSolidColor):
        (WebCore::GraphicsLayerCA::setContentsToImage):
        (WebCore::GraphicsLayerCA::setContentsToPlatformLayer):
        (WebCore::GraphicsLayerCA::contentsLayerForMedia const):
        (WebCore::GraphicsLayerCA::layerDidDisplay):
        (WebCore::layerTypeForCustomBackdropAppearance):
        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
        (WebCore::GraphicsLayerCA::updateGeometry):
        (WebCore::GraphicsLayerCA::updateMasksToBounds):
        (WebCore::GraphicsLayerCA::updateContentsVisibility):
        (WebCore::GraphicsLayerCA::updateContentsOpaque):
        (WebCore::GraphicsLayerCA::updateBackfaceVisibility):
        (WebCore::GraphicsLayerCA::updateFilters):
        (WebCore::GraphicsLayerCA::updateBackdropFilters):
        (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
        (WebCore::GraphicsLayerCA::updateDrawsContent):
        (WebCore::GraphicsLayerCA::updateCoverage):
        (WebCore::GraphicsLayerCA::updateDebugIndicators):
        (WebCore::GraphicsLayerCA::updateContentsImage):
        (WebCore::GraphicsLayerCA::updateContentsPlatformLayer):
        (WebCore::GraphicsLayerCA::updateContentsColorLayer):
        (WebCore::GraphicsLayerCA::updateContentsRects):
        (WebCore::GraphicsLayerCA::updateMasksToBoundsRect):
        (WebCore::GraphicsLayerCA::updateMaskLayer):
        (WebCore::GraphicsLayerCA::updateAnimations):
        (WebCore::GraphicsLayerCA::isRunningTransformAnimation const):
        (WebCore::GraphicsLayerCA::ensureLayerAnimations):
        (WebCore::GraphicsLayerCA::createTransformAnimationsFromKeyframes):
        * platform/graphics/ca/GraphicsLayerCA.h:
        (WebCore::GraphicsLayerCA::animationIsRunning const):
        (WebCore::GraphicsLayerCA::primaryLayerClones const): Deleted.
        * platform/graphics/ca/PlatformCALayerClient.h:
        (WebCore::PlatformCALayerClient::platformCALayerContentsOrientation const):
        * platform/graphics/ca/TileCoverageMap.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.h:
        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
        (PlatformCALayerCocoa::PlatformCALayerCocoa):
        (PlatformCALayerCocoa::requiresCustomAppearanceUpdateOnBoundsChange const):
        (PlatformCALayerCocoa::updateCustomAppearance):
        (PlatformCALayer::drawLayerContents):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::updateCustomAppearance):
        (WebCore::RenderLayerBacking::updateConfiguration):
        * rendering/RenderLayerCompositor.cpp:
        (WebCore::RenderLayerCompositor::rootBackgroundColorOrTransparencyChanged):
        (WebCore::RenderLayerCompositor::updateOverflowControlsLayers):

2018-07-30  Justin Fan  <justin_fan@apple.com>

        [WebGL2] Support compilation of GLSL ES version 300 shaders
        https://bugs.webkit.org/show_bug.cgi?id=187982
        <rdar://problem/42564229>

        Reviewed by Dean Jackson.

        Test: fast/canvas/webgl/webgl2-glsl3-compile.html

        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::create): Rename 'useGLES3' to 'isWebGL2' (everywhere) to make more sense.
        * platform/graphics/GraphicsContext3DAttributes.h: Rename 'useGLES3' to 'isWebGL2'.
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::setPixelFormat): Back WebGL2 contexts with OpenGL 4 for full OpenGL ES 3 support. 
        (WebCore::GraphicsContext3D::GraphicsContext3D): Request correct GLSL output version and WebGL 2 for ANGLE shader compilation.
        * platform/graphics/opengl/GraphicsContext3DOpenGLCommon.cpp:
        (WebCore::GraphicsContext3D::checkVaryingsPacking const): MAX_VARYING_FLOATS is deprecated in OpenGL 3+.
        * platform/graphics/texmap/GraphicsContext3DTextureMapper.cpp: Rename 'useGLES3' to 'isWebGL2'.
        (WebCore::GraphicsContext3D::create):
        (WebCore::GraphicsContext3D::GraphicsContext3D):

2018-07-30  Justin Fan  <justin_fan@apple.com>

        Match GraphicsContext3D with correct virtual screen using registryID
        https://bugs.webkit.org/show_bug.cgi?id=188072
        <rdar://problem/42634940>

        Reviewed by Dean Jackson.

        Follow up to https://bugs.webkit.org/show_bug.cgi?id=187750. Rather than matching rendererIDs, 
        which can vary between processes, match GPU to display using registryID that is unique to a GPU, 
        which was added to CGL in MacOS 10.13. 

        No new tests. Manually tested on MacBookPro13,3 and iMacPro1,1 with Apple DisplayPort Cinema Display
        and RX 580 external GPU. 

        * platform/PlatformScreen.h:
        * platform/ScreenProperties.h:
        (WebCore::ScreenData::encode const):
        (WebCore::ScreenData::decode):
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::setGPUByRegistryID):
        (WebCore::setGPUByDisplayMask):
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        (WebCore::GraphicsContext3D::screenDidChange):
        (WebCore::identifyAndSetCurrentGPU): Deleted.
        * platform/mac/PlatformScreenMac.mm:
        (WebCore::collectScreenProperties):
        (WebCore::primaryRegistryID):
        (WebCore::registryIDForDisplay):
        (WebCore::registryIDForDisplayMask):
        (WebCore::rendererIDForDisplayMask): Deleted.
        (WebCore::rendererIDForDisplay): Deleted.
        (WebCore::primaryRendererID): Deleted.

2018-07-30  Rob Buis  <rbuis@igalia.com>

        Merge PlatformCookieJar functions into NetworkStorageSession
        https://bugs.webkit.org/show_bug.cgi?id=188137

        Reviewed by Alex Christensen.

        No new tests -- no change in WebKit functionality.

        * PlatformMac.cmake: Remove CookieJarMac.mm reference
        * SourcesCocoa.txt: Remove CookieJarMac.mm reference
        * WebCore.xcodeproj/project.pbxproj:
        * loader/CookieJar.cpp: Remove PlatformCookieJar.h reference.
        * platform/Curl.cmake: Remove CookieJarCurl.cpp reference.
        * platform/SourcesSoup.txt: Remove CookieJarSoup.cpp reference.
        * platform/network/CacheValidation.cpp: Adapt callsites to use
        NetworkStorageSession instead of CookieJar functions.

        (WebCore::headerValueForVary):
        * platform/network/NetworkStorageSession.h: Add PlatformCookieJar
        functions.

        * platform/network/PlatformCookieJar.h: Removed.
        * platform/network/SocketStreamHandleImpl.cpp: Adapt callsites to
        use NetworkStorageSession instead of CookieJar functions.
        (WebCore::cookieDataForHandshake):
        * platform/network/cf/CookieJarCFNet.cpp: Removed.
        * platform/network/cf/NetworkStorageSessionCFNet.cpp: Move functions
        from CookieJarCFNet.cpp.
        (WebCore::cookieDomain):
        (WebCore::canonicalCookieTime):
        (WebCore::cookieCreatedTime):
        (WebCore::cookieExpirationTime):
        (WebCore::cookieName):
        (WebCore::cookiePath):
        (WebCore::cookieValue):
        (WebCore::filterCookies):
        (WebCore::copyCookiesForURLWithFirstPartyURL):
        (WebCore::createCookies):
        (WebCore::NetworkStorageSession::setCookiesFromDOM const):
        (WebCore::containsSecureCookies):
        (WebCore::NetworkStorageSession::cookiesForDOM const):
        (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
        (WebCore::NetworkStorageSession::cookiesEnabled const):
        (WebCore::NetworkStorageSession::getRawCookies const):
        (WebCore::NetworkStorageSession::deleteCookie const):
        (WebCore::NetworkStorageSession::getHostnamesWithCookies):
        (WebCore::NetworkStorageSession::deleteAllCookies):
        (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
        (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
        * platform/network/cocoa/NetworkStorageSessionCocoa.mm: Move functions
        from CookieJarMac.mm.
        (WebCore::httpCookies):
        (WebCore::deleteHTTPCookie):
        (WebCore::policyProperties):
        (WebCore::cookiesForURL):
        (WebCore::setHTTPCookiesForURL):
        (WebCore::httpCookiesForURL):
        (WebCore::filterCookies):
        (WebCore::applyPartitionToCookies):
        (WebCore::cookiesAreBlockedForURL):
        (WebCore::cookiesInPartitionForURL):
        (WebCore::cookiesForSession):
        (WebCore::deleteAllHTTPCookies):
        (WebCore::NetworkStorageSession::cookiesForDOM const):
        (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
        (WebCore::NetworkStorageSession::setCookiesFromDOM const):
        (WebCore::httpCookieAcceptPolicy):
        (WebCore::NetworkStorageSession::cookiesEnabled const):
        (WebCore::NetworkStorageSession::getRawCookies const):
        (WebCore::NetworkStorageSession::deleteCookie const):
        (WebCore::NetworkStorageSession::getHostnamesWithCookies):
        (WebCore::NetworkStorageSession::deleteAllCookies):
        (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
        (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
        * platform/network/curl/CookieJarCurl.cpp: Removed.
        * platform/network/curl/CookieJarCurl.h:
        * platform/network/curl/NetworkStorageSessionCurl.cpp: Merge functions
        from CookieJarCurl.cpp.
        (WebCore::NetworkStorageSession::setCookiesFromDOM const):
        (WebCore::NetworkStorageSession::cookiesEnabled const):
        (WebCore::NetworkStorageSession::cookiesForDOM const):
        (WebCore::NetworkStorageSession::deleteCookie const):
        (WebCore::NetworkStorageSession::deleteAllCookies):
        (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
        (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
        (WebCore::NetworkStorageSession::getHostnamesWithCookies):
        (WebCore::NetworkStorageSession::getRawCookies const):
        (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):
        * platform/network/mac/CookieJarMac.mm: Removed.
        * platform/network/mac/WebCoreResourceHandleAsOperationQueueDelegate.mm:
        * platform/network/soup/CookieJarSoup.cpp: Removed.
        * platform/network/soup/NetworkStorageSessionSoup.cpp: Merge functions
        from CookieJarSoup.cpp.
        (WebCore::NetworkStorageSession::cookiesEnabled const):
        (WebCore::httpOnlyCookieExists):
        (WebCore::NetworkStorageSession::setCookiesFromDOM const):
        (WebCore::NetworkStorageSession::deleteCookie const):
        (WebCore::NetworkStorageSession::deleteAllCookies):
        (WebCore::NetworkStorageSession::deleteAllCookiesModifiedSince):
        (WebCore::NetworkStorageSession::deleteCookiesForHostnames):
        (WebCore::NetworkStorageSession::getHostnamesWithCookies):
        (WebCore::NetworkStorageSession::getRawCookies const):
        (WebCore::cookiesForSession):
        (WebCore::NetworkStorageSession::cookiesForDOM const):
        (WebCore::NetworkStorageSession::cookieRequestHeaderFieldValue const):

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

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

        Unreviewed, roll r233496 and r233571 now that all known issues have been fixed via
        dependency bugs.

        Test: media/track/video-track-addition-and-frame-removal.html

        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.cpp:
        (WebCore::WebKitMediaKeySession::suspend):
        (WebCore::WebKitMediaKeySession::resume):
        (WebCore::WebKitMediaKeySession::stop):
        * Modules/encryptedmedia/legacy/WebKitMediaKeySession.h:
        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::removeSourceBuffer):
        (WebCore::MediaSource::suspend):
        (WebCore::MediaSource::resume):
        * Modules/mediasource/MediaSource.h:
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::suspend):
        (WebCore::SourceBuffer::resume):
        (WebCore::SourceBuffer::stop):
        * Modules/mediasource/SourceBuffer.h:
        * Modules/mediasource/SourceBufferList.cpp:
        (WebCore::SourceBufferList::SourceBufferList):
        (WebCore::SourceBufferList::canSuspendForDocumentSuspension const):
        (WebCore::SourceBufferList::suspend):
        (WebCore::SourceBufferList::resume):
        (WebCore::SourceBufferList::stop):
        (WebCore::SourceBufferList::activeDOMObjectName const):
        * Modules/mediasource/SourceBufferList.h:
        * Modules/mediasource/SourceBufferList.idl:
        * dom/Document.h:
        (WebCore::Document::hasBrowsingContext const):
        * dom/GenericEventQueue.cpp:
        (WebCore::GenericEventQueue::dispatchOneEvent):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::prepareForLoad):
        (WebCore::HTMLMediaElement::selectMediaResource):
        (WebCore::HTMLMediaElement::prepareToPlay):
        (WebCore::HTMLMediaElement::playInternal):
        (WebCore::HTMLMediaElement::pauseInternal):
        (WebCore::HTMLMediaElement::sourceWasAdded):
        * html/track/AudioTrackList.cpp:
        (AudioTrackList::activeDOMObjectName const):
        * html/track/AudioTrackList.h:
        * html/track/AudioTrackList.idl:
        * html/track/TextTrackList.cpp:
        (TextTrackList::activeDOMObjectName const):
        * html/track/TextTrackList.h:
        * html/track/TextTrackList.idl:
        * html/track/TrackListBase.cpp:
        (WebCore::TrackListBase::TrackListBase):
        (WebCore::TrackListBase::canSuspendForDocumentSuspension const):
        (WebCore::TrackListBase::suspend):
        (WebCore::TrackListBase::resume):
        (WebCore::TrackListBase::stop):
        * html/track/TrackListBase.h:
        * html/track/VideoTrackList.cpp:
        (VideoTrackList::activeDOMObjectName const):
        * html/track/VideoTrackList.h:
        * html/track/VideoTrackList.idl:

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

        Unreviewed internal build fix after r234347.

        * html/StepRange.cpp:
        (WebCore::StepRange::StepRange):

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

        Shrink GraphicsLayer by making m_transform and m_childrenTransform be unique_ptrs
        https://bugs.webkit.org/show_bug.cgi?id=188143

        Reviewed by Zalan Bujtas.

        m_transform and m_childrenTransform are usually identity; save space by making
        these unique_ptrs. The getters still return references by returning a reference
        to a NeverDestroyed<TransformationMatrix> if necessary.
        
        Shrinks GraphicsLayerCA from 840 to 640 bytes.

        * platform/graphics/GraphicsLayer.cpp:
        (WebCore::identityTransform):
        (WebCore::GraphicsLayer::transform const):
        (WebCore::GraphicsLayer::setTransform):
        (WebCore::GraphicsLayer::childrenTransform const):
        (WebCore::GraphicsLayer::setChildrenTransform):
        (WebCore::GraphicsLayer::dumpProperties const):
        * platform/graphics/GraphicsLayer.h:
        (WebCore::GraphicsLayer::hasNonIdentityTransform const):
        (WebCore::GraphicsLayer::hasNonIdentityChildrenTransform const):
        (WebCore::GraphicsLayer::transform const): Deleted.
        (WebCore::GraphicsLayer::setTransform): Deleted.
        (WebCore::GraphicsLayer::childrenTransform const): Deleted.
        (WebCore::GraphicsLayer::setChildrenTransform): Deleted.
        (WebCore::GraphicsLayer::hasFlattenedPerspectiveTransform): Deleted. It was unused.
        * platform/graphics/ca/GraphicsLayerCA.cpp:
        (WebCore::GraphicsLayerCA::setTransform):
        (WebCore::GraphicsLayerCA::setChildrenTransform):
        (WebCore::GraphicsLayerCA::layerTransform const):
        (WebCore::GraphicsLayerCA::updateTransform):
        (WebCore::GraphicsLayerCA::updateChildrenTransform):
        (WebCore::GraphicsLayerCA::removeCAAnimationFromLayer):

2018-07-30  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Make codecparsers optionnal
        https://bugs.webkit.org/show_bug.cgi?id=188010

        And avoid building libWebRTC if it won't be used. While there is no other
        WebRTC backend, it makes no sense to expose an option.

        Error out when WEBRTC or MEDIA_STREAM is enabled but GStreamer < 1.10

        Reviewed by Alejandro G. Castro.

        * platform/GStreamer.cmake:

2018-07-28  Darin Adler  <darin@apple.com>

        [Cocoa] Update more WebCore Objective-C code to be ARC compatible
        https://bugs.webkit.org/show_bug.cgi?id=188140

        Reviewed by Sam Weinig.

        This make sure we don't put any Objective-C objects into HashMap/Set
        data structures, which doesn't work under ARC at this time. We could
        fix that some day, but it's pretty simple to change code not to rely
        on it, for now, and not as simple to support it in HashMap/Set.

        * accessibility/mac/WebAccessibilityObjectWrapperBase.mm:
        (-[WebAccessibilityObjectWrapperBase updateObjectBackingStore]):
        Use CFRetain/CFAutorelease instead of retain/autorelease.

        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (createAccessibilityRoleMap): Use CFStringRef in a HashMap rather than
        NSString * for string constants.
        (roleValueToNSString): Updated for above change.

        * bridge/objc/WebScriptObject.mm:
        (-[WebScriptObject stringRepresentation]): Updated since objectValue
        is now CFTypeRef rather than NSObject *.

        * bridge/objc/objc_instance.mm:
        (ObjcInstance::create): Use CFTypeRef instead of id for the key types
        in a HashMap.
        (ObjcInstance::~ObjcInstance): Updated for the above change.
        (ObjcInstance::invokeObjcMethod): Updated since objectValue is now
        CFTypeRef.
        (ObjcInstance::invokeDefaultMethod): Ditto.
        (ObjcInstance::setValueOfUndefinedField): Ditto.
        * bridge/objc/objc_runtime.mm:
        (JSC::Bindings::ObjcArray::setValueAt const): Ditto.

        * bridge/objc/objc_utility.h: Use #pragma once. Use CFTypeRef instead
        of NSObject * for objectValue, since it's in a union and ARC does not
        support strong Objective-C object pointers in a union.

        * bridge/objc/objc_utility.mm:
        (JSC::Bindings::convertValueToObjcValue): Updated since objectValue is
        now CFTypeRef.

        * editing/cocoa/HTMLConverter.mm:
        (HTMLConverter::_processElement): Use CFTypeRef rather than NSTextTable
        for a HashMap.
        (HTMLConverter::_exitElement): Ditto.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::attributesForAttributedStringConversion): Use CFRetain rather
        than -[NSObject retain] in a workaround for an overrelease.

        * editing/mac/DictionaryLookup.h: Removed code to make this usable from
        non-Objective-C source files. Use tuples rather than out arguments
        for the results of the various functions.

        * editing/mac/DictionaryLookup.mm:
        (WebCore::DictionaryLookup::rangeForSelection): Return a tuple rather
        than using an out argument for options.
        (WebCore::DictionaryLookup::rangeAtHitTestResult): Ditto.
        (WebCore::DictionaryLookup::stringForPDFSelection): Ditto.
        (WebCore::showPopupOrCreateAnimationController): Removed use of typedef
        PlatformAnimationController.
        (WebCore::DictionaryLookup::animationControllerForPopup): Ditto.

        * html/HTMLMediaElement.h: Put the videoFullscreenLayer function inside
        an __OBJC__ ifdef since we can't do the type conversion without the
        full Objective-C type.

        * page/mac/EventHandlerMac.mm:
        (WebCore::selfRetainingNSScrollViewScrollWheel): Use CFRetain/CFRelease
        instead of retain/release.
        (WebCore::EventHandler::selectClosestWordFromHitTestResultBasedOnLookup):
        Updated to use tuple return value from DictionaryLookup.

        * page/scrolling/ScrollingStateNode.h: Replaced direct use of PlatformLayer*
        in a union with use of a "typless" void* pointer and added helper functions
        to convert in both directions.
        * page/scrolling/cocoa/ScrollingStateNode.mm:
        (WebCore::LayerRepresentation::retainPlatformLayer): Use CFRetain instead
        of retain.
        (WebCore::LayerRepresentation::releasePlatformLayer): Use CFRelease instead
        of release.
        (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
        (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.
        * page/scrolling/coordinatedgraphics/ScrollingStateNodeCoordinatedGraphics.cpp:
        (WebCore::LayerRepresentation::retainPlatformLayer): Updated argument type.
        (WebCore::LayerRepresentation::releasePlatformLayer): Ditto.
        (WebCore::LayerRepresentation::makePlatformLayerTyped): Added.
        (WebCore::LayerRepresentation::makePlatformLayerTypeless): Ditto.

        * platform/gamepad/cocoa/GameControllerGamepadProvider.h: Use CFTypeRef
        instad of GCController * for key type of HashMap.
        * platform/gamepad/cocoa/GameControllerGamepadProvider.mm:
        (WebCore::GameControllerGamepadProvider::controllerDidConnect): Updated
        for the above change.
        (WebCore::GameControllerGamepadProvider::controllerDidDisconnect): Ditto.

        * platform/graphics/avfoundation/AVTrackPrivateAVFObjCImpl.mm:
        Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
        strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
        types under ARC.
        (WebCore::AVTrackPrivateAVFObjCImpl::audioKind const): Added checks
        for the constants.
        (WebCore::AVTrackPrivateAVFObjCImpl::videoKind const): Ditto.
        (WebCore::AVTrackPrivateAVFObjCImpl::label const): Ditto.

        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.h:
        Use #pragma once and use CFTypeRef instead of AVMediaSelectionOption *
        in the key to a HashMap.
        * platform/graphics/avfoundation/MediaSelectionGroupAVFObjC.mm:
        (WebCore::MediaSelectionGroupAVFObjC::updateOptions): Updated for
        the above change.

        * platform/graphics/avfoundation/objc/ImageDecoderAVFObjC.mm:
        Use SOFT_LINK_CONSTANT_MAY_FAIL instead of SOFT_LINK_POINTER_OPTIONAL for
        strings, since SOFT_LINK_POINTER_OPTIONAL does not work for Objective-C
        types under ARC.
        (WebCore::customSchemeURL): Removed unnecessary use of
        NeverDestroyed<RetainPtr>. Can just use a straight pointer without calling
        release, and that works with or without ARC.
        (WebCore::imageDecoderAssetOptions): Ditto. Here, had to add a retain,
        which we'll remove when we turn on ARC. Added canLoad checks, needed
        because of SOFT_LINK_CONSTANT_MAY_FAIL.
        (WebCore::ImageDecoderAVFObjC::firstEnabledTrack): Added canLoad check,
        needed because of SOFT_LINK_CONSTANT_MAY_FAIL.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.h:
        Use CFTypeRef instead of AVAssetResourceLoadingRequest in HashMap.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
        (WebCore::MediaPlayerPrivateAVFoundationObjC::shouldWaitForLoadingOfResource):
        Updated for above.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::didCancelLoadingRequest): Ditto.
        (WebCore::MediaPlayerPrivateAVFoundationObjC::didStopLoadingRequest): Ditto.

        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.h:
        Use CFTypeRef instead of AVSampleBufferAudioRenderer in HashMap.
        * platform/graphics/avfoundation/objc/MediaPlayerPrivateMediaSourceAVFObjC.mm:
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setVolume): Updated for above.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setMuted): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setPreservesPitch): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::setHasAvailableAudioSample): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::addAudioRenderer): Ditto.
        (WebCore::MediaPlayerPrivateMediaSourceAVFObjC::removeAudioRenderer): Ditto.

        * platform/graphics/metal/GPUDrawableMetal.mm: Updated include; under ARC, it's
        not safe to call a method on a class without seeing its interface.

        * platform/mac/VideoFullscreenInterfaceMac.mm: Added an explicit
        __unsafe_unretained for a delegate. Could consider moving to weak, but for now
        this preserves the current behavior and compiles under ARC.

        * platform/mac/WebCoreFullScreenPlaceholderView.h: Use strong for the contents,
        weak for the target, and changed the action to be hard-coded instead of an
        arbitrary selector. If we find we need the flexibility again later, we can do
        it with a block, which is more ARC-friendly than calling an arbitrary selector.
        * platform/mac/WebCoreFullScreenPlaceholderView.mm:
        (-[WebCoreFullScreenPlaceholderView initWithFrame:]): Call function directly
        instead of taking advantage of "using".
        (-[WebCoreFullScreenPlaceholderView mouseDown:]): Call cancelOperation: on the
        target rather than performing an arbitrary selector.

        * platform/mac/WebCoreObjCExtras.mm:
        (WebCoreObjCScheduleDeallocateOnMainThread): Use sel_registerName instead of
        @selector, since @selector is not supported under ARC.

        * platform/network/ResourceHandle.h: Use a return value rather than using an
        inout argument in applySniffingPoliciesAndStoragePartitionIfNeeded.

        * platform/network/cocoa/CookieStorageObserver.mm:
        (WebCore::CookieStorageObserver::startObserving): Removed unnecessary
        assertion of repondsToSelector since we are about to dispatch it immediately
        after. Call the selector in the conventional way instead of using performSelector.

        * platform/network/cocoa/WebCoreNSURLSession.h: Use #pragma once and use
        CFTypeRef instead of an Objective-C type. Also use an explicit __unsafe_unretained
        for the session in the data task.
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (-[WebCoreNSURLSession dealloc]): Updated for the above.
        (-[WebCoreNSURLSession taskCompleted:]): Ditto.
        (-[WebCoreNSURLSession invalidateAndCancel]): Ditto.
        (-[WebCoreNSURLSession getTasksWithCompletionHandler:]): Ditto.
        (-[WebCoreNSURLSession getAllTasksWithCompletionHandler:]): Ditto.
        (-[WebCoreNSURLSession dataTaskWithRequest:]): Ditto.
        (-[WebCoreNSURLSession dataTaskWithURL:]): Ditto.

        * platform/network/mac/ResourceHandleMac.mm:
        (WebCore::ResourceHandle::applySniffingPoliciesAndStoragePartitionIfNeeded):
        Use a return value instead of an inout argument. Also use bridging casts.
        (WebCore::ResourceHandle::createNSURLConnection): Updated for the change above.
        Also use a bridging cast.
        (WebCore::ResourceHandle::schedule): Use a bridging cast.
        (WebCore::ResourceHandle::unschedule): Ditto.

        * platform/network/mac/WebCoreURLResponse.mm:
        (WebCore::adjustMIMETypeIfNecessary): Use a bridging cast.

        * testing/Internals.cpp:
        (WebCore::Internals::rangeForDictionaryLookupAtLocation): Moved the macOS
        version of this function out of this file ...
        * testing/Internals.mm:
        (WebCore::Internals::rangeForDictionaryLookupAtLocation): ... to here.

2018-07-29  Yusuke Suzuki  <utatane.tea@gmail.com>

        Use static global variables instead of static NeverDestroyed inside function if possible
        https://bugs.webkit.org/show_bug.cgi?id=188146

        Reviewed by Darin Adler.

        This patch leverages constexpr constructors / trivial destructors more to remove unnecessary `static NeverDestroyed`
        inside a function. It simplifies the code, removes the unnecessary function, and ensures the initialization at
        a program loader phase.

        We make StepRange::StepDescription constructor constexpr to remove bunch of `static NeverDestroyed<const StepRange::StepDescription>`.
        And we use `static Lock` since WTF::Lock has constexpr constructor.

        No behavior change.

        * dom/MessagePort.cpp:
        (WebCore::MessagePort::deref const):
        (WebCore::MessagePort::isExistingMessagePortLocallyReachable):
        (WebCore::MessagePort::notifyMessageAvailable):
        (WebCore::MessagePort::MessagePort):
        (WebCore::MessagePort::~MessagePort):
        (WebCore::allMessagePortsLock): Deleted.
        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::contextIdentifier const):
        (WebCore::ScriptExecutionContext::removeFromContextsMap):
        (WebCore::ScriptExecutionContext::~ScriptExecutionContext):
        (WebCore::ScriptExecutionContext::postTaskTo):
        (WebCore::allScriptExecutionContextsMapLock): Deleted.
        * html/DateInputType.cpp:
        (WebCore::DateInputType::createStepRange const):
        * html/DateTimeInputType.cpp:
        (WebCore::DateTimeInputType::createStepRange const):
        * html/DateTimeLocalInputType.cpp:
        (WebCore::DateTimeLocalInputType::createStepRange const):
        * html/MonthInputType.cpp:
        (WebCore::MonthInputType::createStepRange const):
        * html/RangeInputType.cpp:
        (WebCore::RangeInputType::createStepRange const):
        * html/StepRange.h:
        (WebCore::StepRange::StepDescription::StepDescription):
        * html/TimeInputType.cpp:
        (WebCore::TimeInputType::createStepRange const):
        * html/WeekInputType.cpp:
        (WebCore::WeekInputType::createStepRange const):
        * page/SecurityPolicy.cpp:
        (WebCore::originAccessMap):
        (WebCore::SecurityPolicy::isAccessWhiteListed):
        (WebCore::SecurityPolicy::addOriginAccessWhitelistEntry):
        (WebCore::SecurityPolicy::removeOriginAccessWhitelistEntry):
        (WebCore::SecurityPolicy::resetOriginAccessWhitelists):
        (WebCore::originAccessMapLock): Deleted.
        * platform/SchemeRegistry.cpp:
        (WebCore::allBuiltinSchemes):
        (WebCore::builtinLocalURLSchemes):
        (WebCore::localURLSchemes):
        (WebCore::displayIsolatedURLSchemes):
        (WebCore::builtinSecureSchemes):
        (WebCore::secureSchemes):
        (WebCore::builtinSchemesWithUniqueOrigins):
        (WebCore::schemesWithUniqueOrigins):
        (WebCore::builtinCanDisplayOnlyIfCanRequestSchemes):
        (WebCore::canDisplayOnlyIfCanRequestSchemes):
        (WebCore::SchemeRegistry::registerURLSchemeAsLocal):
        (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsLocal):
        (WebCore::ContentSecurityPolicyBypassingSchemes):
        (WebCore::cachePartitioningSchemes):
        (WebCore::serviceWorkerSchemes):
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsLocal):
        (WebCore::SchemeRegistry::registerURLSchemeAsNoAccess):
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsNoAccess):
        (WebCore::SchemeRegistry::registerURLSchemeAsDisplayIsolated):
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsDisplayIsolated):
        (WebCore::SchemeRegistry::registerURLSchemeAsSecure):
        (WebCore::SchemeRegistry::shouldTreatURLSchemeAsSecure):
        (WebCore::SchemeRegistry::canDisplayOnlyIfCanRequest):
        (WebCore::SchemeRegistry::registerAsCanDisplayOnlyIfCanRequest):
        (WebCore::SchemeRegistry::registerURLSchemeAsBypassingContentSecurityPolicy):
        (WebCore::SchemeRegistry::removeURLSchemeRegisteredAsBypassingContentSecurityPolicy):
        (WebCore::SchemeRegistry::schemeShouldBypassContentSecurityPolicy):
        (WebCore::SchemeRegistry::registerURLSchemeAsCachePartitioned):
        (WebCore::SchemeRegistry::shouldPartitionCacheForURLScheme):
        (WebCore::SchemeRegistry::registerURLSchemeServiceWorkersCanHandle):
        (WebCore::SchemeRegistry::canServiceWorkersHandleURLScheme):
        (WebCore::SchemeRegistry::isServiceWorkerContainerCustomScheme):
        (WebCore::schemeRegistryLock): Deleted.

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

        [Curl] Fix the bug when client reject the redirect on WebKitLegacy.
        https://bugs.webkit.org/show_bug.cgi?id=188130

        Reviewed by Darin Adler.

        ResourceHandle for Curl port has a bug when a client returns en empty request which
        indicates the redirecti is rejected by the client. It should be quit the task immediately,
        but it kept doing the job. Fixed.
        NetworkDataTask implementation did the right thing and there's no bug for them. 

        Test: http/tests/xmlhttprequest/xmlhttprequest-unsafe-redirect-expected.txt

        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::continueAfterWillSendRequest):

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-24  Simon Fraser  <simon.fraser@apple.com>

        Animation stops with object-fit:contain on an animated 2d canvas
        https://bugs.webkit.org/show_bug.cgi?id=187840

        Reviewed by Zalan Bujtas.
        
        If a canvas has object-fit: cover or contain, repaints need to mapped through
        the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
        
        Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
        all but RenderVideo just pass the RenderReplaced's intrinsicSize.

        Test: fast/repaint/canvas-object-fit.html

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::didDraw):
        * rendering/RenderHTMLCanvas.cpp:
        (WebCore::RenderHTMLCanvas::paintReplaced):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::updateInnerContentRect):
        (WebCore::RenderImage::paintReplaced):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::contentsBox const):
        * rendering/RenderReplaced.h:
        (WebCore::RenderReplaced::replacedContentRect const):
        * rendering/shapes/ShapeOutsideInfo.cpp:
        (WebCore::ShapeOutsideInfo::createShapeForImage const):

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-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-27  Chris Dumez  <cdumez@apple.com>

        Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable()
        https://bugs.webkit.org/show_bug.cgi?id=188097
        <rdar://problem/42558823>

        Reviewed by Eric Carlson.

        Fix thread-safety issues related to RealtimeMediaSource::audioSamplesAvailable(). RealtimeMediaSource::audioSamplesAvailable()
        is called on a background thread but iterates over observers that may get destroyed concurrently on the main thread.

        To address the issue:
        - Introduce a Lock to protect m_observer accesses
        - Copy observers to a Vector before iterating over them

        * platform/mediastream/MediaStreamTrackPrivate.cpp:
        (WebCore::MediaStreamTrackPrivate::forEachObserver const):
        (WebCore::MediaStreamTrackPrivate::addObserver):
        (WebCore::MediaStreamTrackPrivate::removeObserver):
        (WebCore::MediaStreamTrackPrivate::setEnabled):
        (WebCore::MediaStreamTrackPrivate::endTrack):
        (WebCore::MediaStreamTrackPrivate::sourceStarted):
        (WebCore::MediaStreamTrackPrivate::sourceStopped):
        (WebCore::MediaStreamTrackPrivate::sourceMutedChanged):
        (WebCore::MediaStreamTrackPrivate::sourceSettingsChanged):
        (WebCore::MediaStreamTrackPrivate::videoSampleAvailable):
        (WebCore::MediaStreamTrackPrivate::audioSamplesAvailable):
        (WebCore::MediaStreamTrackPrivate::updateReadyState):
        * platform/mediastream/MediaStreamTrackPrivate.h:
        (WebCore::MediaStreamTrackPrivate::Observer::sampleBufferUpdated):
        (WebCore::MediaStreamTrackPrivate::Observer::audioSamplesAvailable):
        * platform/mediastream/RealtimeMediaSource.cpp:
        (WebCore::RealtimeMediaSource::addObserver):
        (WebCore::RealtimeMediaSource::removeObserver):
        (WebCore::RealtimeMediaSource::forEachObserver const):
        (WebCore::RealtimeMediaSource::notifyMutedObservers const):
        (WebCore::RealtimeMediaSource::settingsDidChange):
        (WebCore::RealtimeMediaSource::videoSampleAvailable):
        (WebCore::RealtimeMediaSource::audioSamplesAvailable):
        (WebCore::RealtimeMediaSource::start):
        (WebCore::RealtimeMediaSource::requestStop):
        (WebCore::RealtimeMediaSource::captureFailed):
        * platform/mediastream/RealtimeMediaSource.h:
        * platform/mediastream/mac/AudioTrackPrivateMediaStreamCocoa.cpp:
        (WebCore::AudioTrackPrivateMediaStreamCocoa::audioSamplesAvailable):
        * platform/mediastream/mac/RealtimeOutgoingAudioSourceCocoa.cpp:
        * platform/mediastream/mac/WebAudioSourceProviderAVFObjC.mm:

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

        Don't include WebPageProxy.h just for UndoOrRedo
        https://bugs.webkit.org/show_bug.cgi?id=188086

        Reviewed by Saam Barati.

        * platform/DragItem.h:

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

        Make CompletionHandler more const correct
        https://bugs.webkit.org/show_bug.cgi?id=186543

        Reviewed by Saam Barati.

        * dom/messageports/MessagePortChannel.cpp:
        (WebCore::MessagePortChannel::checkRemotePortForActivity):
        * dom/messageports/MessagePortChannelProviderImpl.cpp:
        (WebCore::MessagePortChannelProviderImpl::checkRemotePortForActivity):
        * loader/DocumentLoader.cpp:
        (WebCore::DocumentLoader::responseReceived):
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::loadURL):
        (WebCore::FrameLoader::loadWithDocumentLoader):
        (WebCore::FrameLoader::loadPostRequest):
        * platform/network/cocoa/WebCoreNSURLSession.mm:
        (WebCore::WebCoreNSURLSessionDataTaskClient::redirectReceived):
        * workers/service/server/RegistrationDatabase.cpp:
        (WebCore::RegistrationDatabase::pushChanges):
        (WebCore::RegistrationDatabase::clearAll):
        * workers/service/server/SWServer.cpp:
        (WebCore::SWServer::matchAll):
        * workers/service/server/SWServer.h:
        * workers/service/server/SWServerWorker.cpp:
        (WebCore::SWServerWorker::matchAll):
        * workers/service/server/SWServerWorker.h:

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-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-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-27  Basuke Suzuki  <Basuke.Suzuki@sony.com>

        [Curl] Crash on synchronous request via ResourceHandle.
        https://bugs.webkit.org/show_bug.cgi?id=188033

        Reviewed by Alex Christensen.

        The timing of instantiation of delegate was wrong. Move it inside `delegate` getter().
        This bug was introduced at r228577.

        Test: http/tests/xmlhttprequest/simple-sync.html

        * platform/network/curl/ResourceHandleCurl.cpp:
        (WebCore::ResourceHandle::start):
        (WebCore::ResourceHandle::delegate):

2018-07-03  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r233461.

        assertions triggered on ios11 Debug wk2

        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-27  Chris Dumez  <cdumez@apple.com>

        [Media] Avoid unnecessarily constructing *TrackList objects
        https://bugs.webkit.org/show_bug.cgi?id=188094

        Reviewed by Eric Carlson.

        Avoid unnecessarily constructing *TrackList objects as this is preventing us from making them
        ActiveDOMObjects.

        * Modules/mediasource/MediaSource.cpp:
        (WebCore::MediaSource::removeSourceBuffer):
        * Modules/mediasource/SourceBuffer.cpp:
        (WebCore::SourceBuffer::sourceBufferPrivateDidReceiveInitializationSegment):
        * html/HTMLMediaElement.cpp:
        (WebCore::HTMLMediaElement::addAudioTrack):
        (WebCore::HTMLMediaElement::addTextTrack):
        (WebCore::HTMLMediaElement::addVideoTrack):
        (WebCore::HTMLMediaElement::ensureAudioTracks):
        (WebCore::HTMLMediaElement::ensureTextTracks):
        (WebCore::HTMLMediaElement::ensureVideoTracks):
        (WebCore::HTMLMediaElement::setSelectedTextTrack):
        (WebCore::HTMLMediaElement::audioTracks): Deleted.
        (WebCore::HTMLMediaElement::textTracks): Deleted.
        (WebCore::HTMLMediaElement::videoTracks): Deleted.
        * html/HTMLMediaElement.h:
        (WebCore::HTMLMediaElement::audioTracks const):
        (WebCore::HTMLMediaElement::textTracks const):
        (WebCore::HTMLMediaElement::videoTracks const):
        * html/HTMLMediaElement.idl:
        * html/shadow/MediaControlElements.cpp:
        (WebCore::MediaControlClosedCaptionsTrackListElement::updateDisplay):
        (WebCore::MediaControlClosedCaptionsTrackListElement::rebuildTrackListMenu):
        (WebCore::MediaControlTextTrackContainerElement::updateTextStrokeStyle):
        * html/track/TextTrack.cpp:
        (WebCore::TextTrack::setKind):
        (WebCore::TextTrack::trackIndex):
        (WebCore::TextTrack::trackIndexRelativeToRenderedTracks):
        (WebCore::TextTrack::setLanguage):
        * html/track/VideoTrack.cpp:
        (WebCore::VideoTrack::setKind):
        (WebCore::VideoTrack::setLanguage):
        * platform/cocoa/PlaybackSessionModelMediaElement.mm:
        (WebCore::PlaybackSessionModelMediaElement::setMediaElement):
        (WebCore::PlaybackSessionModelMediaElement::updateMediaSelectionOptions):

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

        [Curl] Set correct source info to ResourceResponse.
        https://bugs.webkit.org/show_bug.cgi?id=188069

        Reviewed by Fujii Hironori.

        ResourceResponseBase::Source::Network must be set by each ports. Curl port
        didn't set this.

        Test: http/tests/cache/disk-cache/disk-cache-302-status-code.html

        * platform/network/curl/ResourceResponseCurl.cpp:
        (WebCore::ResourceResponse::ResourceResponse):

2018-07-26  Andy VanWagoner  <andy@vanwagoner.family>

        [INTL] Remove INTL sub-feature compile flags
        https://bugs.webkit.org/show_bug.cgi?id=188081

        Reviewed by Michael Catanzaro.

        Compile time feature flags for INTL sub features were removed, and are covered by existing tests.

        * Configurations/FeatureDefines.xcconfig:

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  Ryan Haddad  <ryanhaddad@apple.com>

        Unreviewed, rolling out r234281.

        Broke internal builds.

        Reverted changeset:

        "[Datalist] Add button to TextFieldInputs with a datalist"
        https://bugs.webkit.org/show_bug.cgi?id=187741
        https://trac.webkit.org/changeset/234281

2018-07-26  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist] Add button to TextFieldInputs with a datalist
        https://bugs.webkit.org/show_bug.cgi?id=187741

        Reviewed by Tim Horton.

        TextFieldInputs that have an associated datalist element should be drawn as
        combo boxes. However, we cannot use NSComboBox for this control, as NSComboBox
        is not height-resizable. Furthermore, the input should also be able to contain
        additional elements, such as the stepper for type=number and the cancel button
        for type=search. For these reasons, we draw a button at the end of the input,
        mimicking appearance of a combo box.

        The list-button -webkit-appearance value was added to display the new button.

        Tests: fast/forms/datalist/datalist-searchinput-appearance.html
               fast/forms/datalist/datalist-textinput-appearance.html

        * Resources/ListButtonArrow.png: Added.
        * Resources/ListButtonArrow@2x.png: Added.
        * WebCore.xcodeproj/project.pbxproj:
        * css/CSSPrimitiveValueMappings.h:
        (WebCore::CSSPrimitiveValue::CSSPrimitiveValue):
        * css/CSSProperties.json:
        * css/CSSValueKeywords.in:
        * css/html.css:
        (input::-webkit-list-button):
        * html/HTMLInputElement.cpp:
        (WebCore::HTMLInputElement::dataListButtonElement const):
        (WebCore::HTMLInputElement::isShowingList const):
        * html/HTMLInputElement.h:
        * html/InputType.h:
        (WebCore::InputType::dataListButtonElement const):
        (WebCore::InputType::isShowingList const):
        * html/TextFieldInputType.cpp:
        (WebCore::TextFieldInputType::needsContainer const):
        (WebCore::TextFieldInputType::createShadowSubtree):
        (WebCore::TextFieldInputType::destroyShadowSubtree):
        (WebCore::TextFieldInputType::listAttributeTargetChanged):
        (WebCore::TextFieldInputType::dataListButtonElement const):
        (WebCore::TextFieldInputType::dataListButtonElementWasClicked):
        (WebCore::TextFieldInputType::didCloseSuggestions):
        (WebCore::TextFieldInputType::isShowingList const):
        * html/TextFieldInputType.h:
        * html/shadow/DataListButtonElement.cpp: Added.
        (WebCore::DataListButtonElement::create):
        (WebCore::DataListButtonElement::DataListButtonElement):
        (WebCore::DataListButtonElement::~DataListButtonElement):
        (WebCore::DataListButtonElement::defaultEventHandler):
        * html/shadow/DataListButtonElement.h: Added.
        * platform/ThemeTypes.h:
        * rendering/RenderTheme.cpp:
        (WebCore::RenderTheme::adjustStyle):
        (WebCore::RenderTheme::adjustListButtonStyle const):
        * rendering/RenderTheme.h:
        * rendering/RenderThemeMac.h:
        * rendering/RenderThemeMac.mm:
        (-[WebListButtonCell drawWithFrame:inView:]):
        (WebCore::RenderThemeMac::paintListButtonForInput):
        (WebCore::RenderThemeMac::adjustListButtonStyle const):
        (WebCore::RenderThemeMac::paintTextField):
        (WebCore::RenderThemeMac::paintSearchField):
        (WebCore::RenderThemeMac::paintSearchFieldCancelButton):
        (WebCore::RenderThemeMac::listButton const):

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

        [Web Animations] Accelerated animations don't respect a positive delay value
        https://bugs.webkit.org/show_bug.cgi?id=186930
        <rdar://problem/41393393>

        Reviewed by Dean Jackson.

        Test: webanimations/accelerated-animation-with-delay.html

        We would mistakenly clear the list of pending accelerated actions in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
        even if we failed to proceed because of the target element's renderer not being composited yet. Now, we clear the list after
        we've established we can apply them, and if we can't we inform the animation with a call to acceleratedStateDidChange() which
        will in turn call into the document timeline so that we may consider these animations on the next tick.

        For this to work correctly we must make a change to DocumentTimeline::applyPendingAcceleratedAnimations() which only cleared
        its list of pending accelerated animations _after_ iterating through them, which would be problematic since we would now add
        animations to this list. That list is now copied and cleared prior to iterating through its members.

        We also fix the naming of the m_pendingAcceleratedActions copy in KeyframeEffectReadOnly::applyPendingAcceleratedActions()
        to have a more similar name.

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::applyPendingAcceleratedAnimations):
        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::applyPendingAcceleratedActions):

2018-07-26  Ross Kirsling  <ross.kirsling@sony.com>

        String(View) should have a splitAllowingEmptyEntries function instead of a flag parameter
        https://bugs.webkit.org/show_bug.cgi?id=187963

        Reviewed by Alex Christensen.

        * Modules/applepay/cocoa/PaymentContactCocoa.mm:
        (WebCore::convert):
        * Modules/cache/DOMCache.cpp:
        (WebCore::hasResponseVaryStarHeaderValue):
        * Modules/cache/DOMCacheEngine.cpp:
        (WebCore::DOMCacheEngine::queryCacheMatch):
        * Modules/mediastream/PeerConnectionBackend.cpp:
        (WebCore::filterICECandidate):
        (WebCore::PeerConnectionBackend::filterSDP const):
        * Modules/websockets/WebSocketHandshake.cpp:
        (WebCore::WebSocketHandshake::checkResponseHeaders):
        * accessibility/AccessibilityObject.h:
        (WebCore::AccessibilityObject::determineARIADropEffects):
        * accessibility/AccessibilityRenderObject.cpp:
        (WebCore::AccessibilityRenderObject::determineARIADropEffects):
        * accessibility/AccessibilityRenderObject.h:
        * accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
        (-[WebAccessibilityObjectWrapper accessibilityAttributeValue:]):
        * editing/cocoa/DataDetection.mm:
        (WebCore::DataDetection::shouldCancelDefaultAction):
        * editing/markup.cpp:
        (WebCore::fillContainerFromString):
        (WebCore::createFragmentFromText):
        * html/EmailInputType.cpp:
        (WebCore::EmailInputType::typeMismatchFor const):
        (WebCore::EmailInputType::sanitizeValue const):
        * html/HTMLInputElement.cpp:
        (WebCore::parseAcceptAttribute):
        * html/ValidationMessage.cpp:
        (WebCore::ValidationMessage::setMessageDOMAndStartTimer):
        * html/canvas/WebGLRenderingContextBase.cpp:
        (WebCore::WebGLRenderingContextBase::compileShader):
        * inspector/agents/InspectorDOMAgent.cpp:
        (WebCore::InspectorDOMAgent::nodeForPath):
        * loader/FormSubmission.cpp:
        (WebCore::encodingFromAcceptCharset):
        * loader/ResourceTiming.cpp:
        (WebCore::passesTimingAllowCheck):
        * page/WindowFeatures.cpp:
        (WebCore::parseDisabledAdaptations):
        (WebCore::parseDialogFeaturesMap):
        * platform/URL.cpp:
        (WebCore::isIPv4Address):
        (WebCore::isIPv6Address):
        * platform/graphics/GLContext.cpp:
        (WebCore::GLContext::version):
        * platform/graphics/freetype/FontCacheFreeType.cpp:
        (WebCore::patternToFamilies):
        * platform/graphics/gstreamer/GStreamerCommon.cpp:
        (WebCore::extractGStreamerOptionsFromCommandLine):
        * platform/graphics/opengl/Extensions3DOpenGLCommon.cpp:
        (WebCore::Extensions3DOpenGLCommon::Extensions3DOpenGLCommon):
        (WebCore::Extensions3DOpenGLCommon::initializeAvailableExtensions):
        * platform/gtk/PasteboardHelper.cpp:
        (WebCore::PasteboardHelper::fillSelectionData):
        * platform/gtk/SelectionData.cpp:
        (WebCore::SelectionData::setURIList):
        * platform/network/CacheValidation.cpp:
        (WebCore::collectVaryingRequestHeaders):
        * platform/network/HTTPParsers.cpp:
        (WebCore::filenameFromHTTPContentDisposition):
        (WebCore::parseXFrameOptionsHeader):
        (WebCore::parseAccessControlExposeHeadersAllowList):
        * platform/network/curl/CookieUtil.cpp:
        (WebCore::CookieUtil::parseCookieHeader):
        * platform/network/curl/CurlCacheEntry.cpp:
        (WebCore::CurlCacheEntry::loadResponseHeaders):
        * platform/network/curl/CurlCacheManager.cpp:
        (WebCore::CurlCacheManager::loadIndex):
        * platform/network/soup/CookieJarSoup.cpp:
        (WebCore::setCookiesFromDOM):
        * svg/SVGAnimationElement.cpp:
        (WebCore::SVGAnimationElement::parseAttribute):
        * svg/SVGToOTFFontConversion.cpp:
        (WebCore::SVGToOTFFontConverter::appendOS2Table):
        * svg/animation/SVGSMILElement.cpp:
        (WebCore::SVGSMILElement::parseBeginOrEnd):
        * testing/MockCDMFactory.cpp:
        (WebCore::MockCDM::sanitizeResponse const):
        (WebCore::MockCDMInstance::updateLicense):
        Update split/splitAllowingEmptyEntries usage.

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  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-26  Timothy Hatcher  <timothy@apple.com>

        Use the Page's appearance when converting pasteboard attributed strings.
        https://bugs.webkit.org/show_bug.cgi?id=188067
        rdar://problem/42632246

        Reviewed by Wenson Hsieh.

        * editing/cocoa/WebContentReaderCocoa.mm:
        (WebCore::createFragment): Create a LocalDefaultSystemAppearance based on the Page.

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-04  Darin Adler  <darin@apple.com>

        Improve WebGPU implementation, including using Metal Objective-C protocols more simply and correctly
        https://bugs.webkit.org/show_bug.cgi?id=187333

        Reviewed by Sam Weinig.

        - Used a new OBJC_PROTOCOL macro to handle things in the Metal API that are protocols.
          The code previously had used OBJC_CLASS, but that created unrelated classes.
          Fixing this allows removing many typecasts that were in the existing code, makes it
          ARC-compatible, and also allowed the compiler to detect a couple mistakes where we
          were calling methods that don't exist.

        - Eliminated use of separate heap-allocated, reference-counted objects to
          hold pointers to Metal objects.

        - Reduced the use of the WebGPU wrappers to pass around arguments inside the code.
          They are now used only as part of the DOM binding; the inner GPU objects are used
          whenever possible. This cuts down the number of separate functions needed a bit,
          since we don't always need accessors for the things inside the wrappers.

        - Used references rather than pointers in many cases.

        - Took out three kinds of null checks: 1) Unneeded ones since Objective-C has the
          "do nothing and return 0" behavior for methods without return values and that return
          integer scalars. 2) Checks that aren't needed because the code has clear, invariant
          guarantees that the pointer won't be null. 3) The simplest variant of (2), checks
          that can be obviated by using reference types instead of pointer types.

        - For Metal-specific functions and data members, used the function name metal() and
          the data member name m_metal rather than longer wordier names with the word "platform"
          in them. We could use "platform" if these objects were platform-specific objects used
          in a cross-platform way that needed a common name. But in this case it's clearer to
          call them "metal" since we are dropping down to the metal with Metal API, and
          shared platform-independent code will not be accessing these.

        - Fixed the common mistake of using "unsigned long" in our C++ code to match IDL.
          The "unsigned long" type in IDL correponds to the "unsigned" type in WebKit code.

        - Used "const" more in the GPU functions that are wrappers around Metal objects to
          reflect the fact that these have semantics of smart pointers; most operations can be
          done without changing which object is pointed to. This allows us to use const
          references to pass things around without reference count churn.

        - Reduced includes.

        - Added "explicit" keywords where appropriate.

        - Removed unused functions. In particular, removed non-Metal stub versions of the
          functions in the GPU classes: the right way to start a new port is to clone the
          Metal-specific files and turn the into stubs if needed, it does not make it
          significantly more convenient to have stubs in the platform independent files,
          especially ones that are not compiled for any platform.

        - Removed most the WEBCORE_EXPORT in the GPU headers; left only what's needed to
          support testing with TestWebKitAPI.

        - Fixed two storage leaks in GPUDevice by adding missing adoptNS.

        * PlatformMac.cmake: Moved files from platform/graphics/cocoa to platform/graphics/metal.
        * SourcesCocoa.txt: Ditto.
        * WebCore.xcodeproj/project.pbxproj: Ditto. Fixed paths on some files and groups/directories.
        Made the platform files that abstract GPU all be "project" visible, not "private", since
        they don't need to be visible outside WebCore. Removed reference to FontSelectionKeywordValues.h,
        which does not seem to be a source file, a derived source file, or mentioned in any change log.

        * bindings/js/JSWebGPURenderPassAttachmentDescriptorCustom.cpp:
        (WebCore::toJSNewlyCreated): Create the correct wrapper for a
        WebGPURenderPassDepthAttachmentDescriptor. The old code would instead
        create a WebGPURenderPassAttachmentDescriptor wrapper, which can't be
        used to access the clearDepth attribute.

        * html/canvas/WebGPUBuffer.cpp:
        (WebCore::WebGPUBuffer::create): Use more references rather than pointers for things
        that are never null. Added comment about possibly returning null on failure in future.
        (WebCore::WebGPUBuffer::WebGPUBuffer): Updated to store the GPUBuffer inside the class
        instead of in a separate reference counted object.
        * html/canvas/WebGPUBuffer.h: Ditto.

        * html/canvas/WebGPUCommandBuffer.cpp:
        (WebCore::WebGPUCommandBuffer::create): Use references and lower level types.
        (WebCore::WebGPUCommandBuffer::WebGPUCommandBuffer): Store the GPUCommandBuffer
        inside the class.
        (WebCore::WebGPUCommandBuffer::commit): Removed unneeded null checks.
        (WebCore::WebGPUCommandBuffer::presentDrawable): Ditto.
        (WebCore::WebGPUCommandBuffer::createRenderCommandEncoderWithDescriptor):
        Removed unneeded local variable.
        (WebCore::WebGPUCommandBuffer::createComputeCommandEncoder): Ditto.
        (WebCore::WebGPUCommandBuffer::completed): Store the DOMPromiseProxy in this
        class, not in GPUCommandBuffer.
        * html/canvas/WebGPUCommandBuffer.h: Ditto.

        * html/canvas/WebGPUCommandQueue.cpp:
        (WebCore::WebGPUCommandQueue::create): Use references and lower level types.
        (WebCore::WebGPUCommandQueue::WebGPUCommandQueue): Store the GPUCommandQueue
        inside the class.
        (WebCore::WebGPUCommandQueue::createCommandBuffer): Ditto.
        * html/canvas/WebGPUCommandQueue.h: Ditto.
        * html/canvas/WebGPUCommandQueue.idl: The return value of createCommandBuffer
        is no longer nullable.

        * html/canvas/WebGPUComputeCommandEncoder.cpp:
        (WebCore::WebGPUComputeCommandEncoder::create): More of the same.
        (WebCore::WebGPUComputeCommandEncoder::WebGPUComputeCommandEncoder): Ditto.
        (WebCore::WebGPUComputeCommandEncoder::setComputePipelineState): Ditto.
        (WebCore::WebGPUComputeCommandEncoder::setBuffer): Ditto.
        (WebCore::WebGPUComputeCommandEncoder::dispatch): Ditto.
        (WebCore::WebGPUComputeCommandEncoder::endEncoding): Ditto.
        * html/canvas/WebGPUComputeCommandEncoder.h: Ditto.

        * html/canvas/WebGPUComputePipelineState.cpp:
        (WebCore::WebGPUComputePipelineState::create): More of the same.
        (WebCore::WebGPUComputePipelineState::WebGPUComputePipelineState): Ditto.
        * html/canvas/WebGPUComputePipelineState.h: Ditto.

        * html/canvas/WebGPUDepthStencilDescriptor.cpp:
        (WebCore::WebGPUDepthStencilDescriptor::create): More of the same.
        (WebCore::WebGPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
        (WebCore::WebGPUDepthStencilDescriptor::setDepthWriteEnabled): Ditto.
        (WebCore::WebGPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
        (WebCore::WebGPUDepthStencilDescriptor::setDepthCompareFunction): Ditto.
        * html/canvas/WebGPUDepthStencilDescriptor.h: Ditto. Also fixed a bug
        where m_depthCompareFunction was uninitialized in newly created objects.

        * html/canvas/WebGPUDepthStencilState.cpp:
        (WebCore::WebGPUDepthStencilState::create): More of the same.
        (WebCore::WebGPUDepthStencilState::WebGPUDepthStencilState): Ditto.
        (WebCore::WebGPUDepthStencilState::label const): Ditto.
        (WebCore::WebGPUDepthStencilState::setLabel): Ditto.
        * html/canvas/WebGPUDepthStencilState.h: Ditto.

        * html/canvas/WebGPUDrawable.cpp:
        (WebCore::WebGPUDrawable::create): More of the same.
        (WebCore::WebGPUDrawable::WebGPUDrawable): Ditto.
        * html/canvas/WebGPUDrawable.h: Ditto.

        * html/canvas/WebGPUEnums.cpp: Removed some stray const.
        * html/canvas/WebGPUEnums.h: Ditto.

        * html/canvas/WebGPUFunction.cpp:
        (WebCore::WebGPUFunction::create): More of the same.
        (WebCore::WebGPUFunction::WebGPUFunction): Ditto.
        * html/canvas/WebGPUFunction.h: Ditto.

        * html/canvas/WebGPULibrary.cpp:
        (WebCore::WebGPULibrary::create): More of the same.
        (WebCore::WebGPULibrary::WebGPULibrary): Ditto.
        (WebCore::WebGPULibrary::functionNames const): Ditto.
        (WebCore::WebGPULibrary::functionWithName const): Ditto.
        * html/canvas/WebGPULibrary.h: Ditto.

        * html/canvas/WebGPUObject.cpp:
        (WebCore::WebGPUObject::WebGPUObject):
        (WebCore::WebGPUObject::deleteObject): Deleted this unused function.
        We can bring it back later if we find we need it the way we did with the
        WebGL implementation, but currently it's a never-called stub. Also
        deleted the isDeleted and m_deleted for the same reason.
        * html/canvas/WebGPUObject.h: Ditto.

        * html/canvas/WebGPURenderCommandEncoder.cpp:
        (WebCore::WebGPURenderCommandEncoder::create): More of the same.
        (WebCore::WebGPURenderCommandEncoder::WebGPURenderCommandEncoder): Ditto.
        (WebCore::WebGPURenderCommandEncoder::setRenderPipelineState): Ditto.
        (WebCore::WebGPURenderCommandEncoder::setDepthStencilState): Ditto.
        (WebCore::WebGPURenderCommandEncoder::setVertexBuffer): Ditto.
        (WebCore::WebGPURenderCommandEncoder::setFragmentBuffer): Ditto.
        (WebCore::WebGPURenderCommandEncoder::drawPrimitives): Ditto.
        (WebCore::WebGPURenderCommandEncoder::endEncoding): Ditto.
        * html/canvas/WebGPURenderCommandEncoder.h: Ditto.

        * html/canvas/WebGPURenderPassAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassAttachmentDescriptor::WebGPURenderPassAttachmentDescriptor):
        More of the same.
        (WebCore::WebGPURenderPassAttachmentDescriptor::loadAction const): Ditto.
        (WebCore::WebGPURenderPassAttachmentDescriptor::setLoadAction): Ditto.
        (WebCore::WebGPURenderPassAttachmentDescriptor::storeAction const): Ditto.
        (WebCore::WebGPURenderPassAttachmentDescriptor::setStoreAction): Ditto.
        (WebCore::WebGPURenderPassAttachmentDescriptor::texture const): Ditto.
        (WebCore::WebGPURenderPassAttachmentDescriptor::setTexture): Ditto.
        * html/canvas/WebGPURenderPassAttachmentDescriptor.h: Ditto.

        * html/canvas/WebGPURenderPassColorAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::create): More of the same.
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::WebGPURenderPassColorAttachmentDescriptor): Ditto.
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::descriptor const): Ditto.
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
        (WebCore::WebGPURenderPassColorAttachmentDescriptor::setClearColor): Ditto.
        * html/canvas/WebGPURenderPassColorAttachmentDescriptor.h: Ditto.

        * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::create): More of the same.
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::WebGPURenderPassDepthAttachmentDescriptor): Ditto.
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::setClearDepth): Ditto.
        (WebCore::WebGPURenderPassDepthAttachmentDescriptor::descriptor const): Ditto.
        * html/canvas/WebGPURenderPassDepthAttachmentDescriptor.h: Ditto.

        * html/canvas/WebGPURenderPassDescriptor.cpp:
        (WebCore::WebGPURenderPassDescriptor::create): More of the same.
        (WebCore::WebGPURenderPassDescriptor::depthAttachment): Ditto.
        (WebCore::WebGPURenderPassDescriptor::colorAttachments): Ditto.
        * html/canvas/WebGPURenderPassDescriptor.h: Ditto.

        * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.cpp:
        (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::create): More of the same.
        (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::WebGPURenderPipelineColorAttachmentDescriptor): Ditto.
        (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
        (WebCore::WebGPURenderPipelineColorAttachmentDescriptor::setPixelFormat): Ditto.
        * html/canvas/WebGPURenderPipelineColorAttachmentDescriptor.h: Ditto.

        * html/canvas/WebGPURenderPipelineDescriptor.cpp:
        (WebCore::WebGPURenderPipelineDescriptor::create): More of the same.
        (WebCore::WebGPURenderPipelineDescriptor::vertexFunction const): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::setVertexFunction): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::fragmentFunction const): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::setFragmentFunction): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::colorAttachments): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::setDepthAttachmentPixelFormat): Ditto.
        (WebCore::WebGPURenderPipelineDescriptor::reset): Ditto.
        * html/canvas/WebGPURenderPipelineDescriptor.h: Ditto.

        * html/canvas/WebGPURenderPipelineState.cpp:
        (WebCore::WebGPURenderPipelineState::create): More of the same.
        (WebCore::WebGPURenderPipelineState::WebGPURenderPipelineState): Ditto.
        (WebCore::WebGPURenderPipelineState::label const): Ditto.
        (WebCore::WebGPURenderPipelineState::setLabel): Ditto.
        * html/canvas/WebGPURenderPipelineState.h: Ditto.

        * html/canvas/WebGPURenderingContext.cpp:
        (WebCore::WebGPURenderingContext::create): More of the same.
        (WebCore::WebGPURenderingContext::WebGPURenderingContext): Ditto.
        (WebCore::WebGPURenderingContext::initializeNewContext): Ditto.
        (WebCore::WebGPURenderingContext::platformLayer const): Ditto.
        (WebCore::WebGPURenderingContext::markLayerComposited): Ditto.
        (WebCore::WebGPURenderingContext::reshape): Ditto.
        (WebCore::WebGPURenderingContext::createLibrary): Ditto.
        (WebCore::WebGPURenderingContext::createRenderPipelineState): Ditto.
        (WebCore::WebGPURenderingContext::createDepthStencilState): Ditto.
        (WebCore::WebGPURenderingContext::createComputePipelineState): Ditto.
        (WebCore::WebGPURenderingContext::createCommandQueue): Ditto.
        (WebCore::WebGPURenderingContext::nextDrawable): Ditto.
        (WebCore::WebGPURenderingContext::createBuffer): Ditto.
        (WebCore::WebGPURenderingContext::createTexture): Ditto.
        * html/canvas/WebGPURenderingContext.h: Made many functions final and
        private.
        * html/canvas/WebGPURenderingContext.idl: The return value of most of
        the create functions are no longer nullable.

        * html/canvas/WebGPUSize.h: Use "unsigned" instead of "unsigned long".

        * html/canvas/WebGPUTexture.cpp:
        (WebCore::WebGPUTexture::createFromDrawableTexture): More of the same.
        (WebCore::WebGPUTexture::create): Ditto.
        (WebCore::WebGPUTexture::WebGPUTexture): Ditto.
        * html/canvas/WebGPUTexture.h: Ditto.

        * html/canvas/WebGPUTextureDescriptor.cpp:
        (WebCore::WebGPUTextureDescriptor::create): More of the same.
        (WebCore::WebGPUTextureDescriptor::WebGPUTextureDescriptor): Ditto.
        (WebCore::WebGPUTextureDescriptor::width const): Ditto.
        (WebCore::WebGPUTextureDescriptor::setWidth): Ditto.
        (WebCore::WebGPUTextureDescriptor::height const): Ditto.
        (WebCore::WebGPUTextureDescriptor::setHeight): Ditto.
        (WebCore::WebGPUTextureDescriptor::sampleCount const): Ditto.
        (WebCore::WebGPUTextureDescriptor::setSampleCount): Ditto.
        (WebCore::WebGPUTextureDescriptor::textureType const): Ditto.
        (WebCore::WebGPUTextureDescriptor::setTextureType): Ditto.
        (WebCore::WebGPUTextureDescriptor::storageMode const): Ditto.
        (WebCore::WebGPUTextureDescriptor::setStorageMode): Ditto.
        (WebCore::WebGPUTextureDescriptor::usage const): Ditto.
        (WebCore::WebGPUTextureDescriptor::setUsage): Ditto.
        * html/canvas/WebGPUTextureDescriptor.h: Ditto.

        * platform/graphics/metal/GPUBufferMetal.mm: Moved from "cocoa" directory.
        (WebCore::GPUBuffer::GPUBuffer): Simplify code using references and the
        "metal" naming.

        * platform/graphics/metal/GPUCommandBufferMetal.mm:
        (WebCore::GPUCommandBuffer::GPUCommandBuffer): Take a function to be called as the
        completed handler and set it up.
        (WebCore::GPUCommandBuffer::presentDrawable const): Ditto.
        (WebCore::GPUCommandBuffer::commit const): Ditto.
        (WebCore::GPUCommandBuffer::addCompletedHandler): Deleted.

        * platform/graphics/metal/GPUCommandQueueMetal.mm:
        (WebCore::GPUCommandQueue::GPUCommandQueue): Ditto. Also rewrote label handling a bit.
        (WebCore::GPUCommandQueue::label const): Ditto.
        (WebCore::GPUCommandQueue::setLabel const): Ditto.

        * platform/graphics/metal/GPUComputeCommandEncoderMetal.mm:
        (WebCore::GPUComputeCommandEncoder::GPUComputeCommandEncoder): Ditto.
        (WebCore::GPUComputeCommandEncoder::setComputePipelineState const): Ditto.
        (WebCore::GPUComputeCommandEncoder::setBuffer const): Ditto.
        (WebCore::GPUComputeCommandEncoder::dispatch const): Ditto.
        (WebCore::GPUComputeCommandEncoder::endEncoding const): Ditto.

        * platform/graphics/metal/GPUComputePipelineStateMetal.mm:
        (WebCore::GPUComputePipelineState::GPUComputePipelineState): Ditto.

        * platform/graphics/metal/GPUDepthStencilDescriptorMetal.mm:
        (WebCore::GPUDepthStencilDescriptor::GPUDepthStencilDescriptor): Ditto.
        (WebCore::GPUDepthStencilDescriptor::depthWriteEnabled const): Ditto.
        (WebCore::GPUDepthStencilDescriptor::setDepthWriteEnabled const): Ditto.
        (WebCore::GPUDepthStencilDescriptor::depthCompareFunction const): Ditto.
        (WebCore::GPUDepthStencilDescriptor::setDepthCompareFunction const): Ditto.

        * platform/graphics/metal/GPUDepthStencilStateMetal.mm:
        (WebCore::GPUDepthStencilState::GPUDepthStencilState): Ditto.
        (WebCore::GPUDepthStencilState::label const): Ditto.
        (WebCore::GPUDepthStencilState::setLabel const): Ditto. This is one of the
        functions that was calling a method that does not exist. Added a comment.

        * platform/graphics/metal/GPUDeviceMetal.mm:
        (WebCore::GPUDevice::GPUDevice): Ditto. Also fixed two storage leaks where
        we neglected to do adoptNS on the result of MTLCreateSystemDefaultDevice and
        on the result of -[[WebGPULayer alloc] initWithGPUDevice:].
        (WebCore::GPUDevice::reshape const): Ditto.
        (WebCore::GPUDevice::platformLayer const): Ditto.
        (WebCore::GPUDevice::operator! const): Ditto.

        * platform/graphics/metal/GPUDrawableMetal.mm:
        (WebCore::GPUDrawable::GPUDrawable): Ditto.
        (WebCore::GPUDrawable::release): Ditto.
        (WebCore::GPUDrawable::metal const): Ditto.
        (WebCore::GPUDrawable::texture const): Ditto.

        * platform/graphics/metal/GPUFunctionMetal.mm:
        (WebCore::GPUFunction::GPUFunction): Ditto.
        (WebCore::GPUFunction::name const): Ditto.
        (WebCore::GPUFunction::metal const): Ditto.
        (WebCore::GPUFunction::operator! const): Ditto.

        * platform/graphics/metal/GPULibraryMetal.mm:
        (WebCore::GPULibrary::GPULibrary): Ditto.
        (WebCore::GPULibrary::label const): Ditto.
        (WebCore::GPULibrary::setLabel const): Ditto.
        (WebCore::GPULibrary::functionNames const): Ditto.
        (WebCore::GPULibrary::metal const): Ditto.

        * platform/graphics/metal/GPURenderCommandEncoderMetal.mm:
        (WebCore::GPURenderCommandEncoder::GPURenderCommandEncoder): Ditto.
        (WebCore::GPURenderCommandEncoder::setRenderPipelineState const): Ditto.
        (WebCore::GPURenderCommandEncoder::setDepthStencilState const): Ditto.
        (WebCore::GPURenderCommandEncoder::setVertexBuffer const): Ditto.
        (WebCore::GPURenderCommandEncoder::setFragmentBuffer const): Ditto.
        (WebCore::GPURenderCommandEncoder::drawPrimitives const): Ditto.
        (WebCore::GPURenderCommandEncoder::endEncoding const): Ditto.

        * platform/graphics/metal/GPURenderPassAttachmentDescriptorMetal.mm:
        (WebCore::GPURenderPassAttachmentDescriptor::GPURenderPassAttachmentDescriptor): Ditto.
        (WebCore::GPURenderPassAttachmentDescriptor::loadAction const): Ditto.
        (WebCore::GPURenderPassAttachmentDescriptor::setLoadAction const): Ditto.
        (WebCore::GPURenderPassAttachmentDescriptor::storeAction const): Ditto.
        (WebCore::GPURenderPassAttachmentDescriptor::setStoreAction const): Ditto.
        (WebCore::GPURenderPassAttachmentDescriptor::setTexture const): Ditto.

        * platform/graphics/metal/GPURenderPassColorAttachmentDescriptorMetal.mm:
        (WebCore::GPURenderPassColorAttachmentDescriptor::GPURenderPassColorAttachmentDescriptor): Ditto.
        (WebCore::GPURenderPassColorAttachmentDescriptor::clearColor const): Ditto.
        (WebCore::GPURenderPassColorAttachmentDescriptor::setClearColor const): Ditto.
        (WebCore::GPURenderPassColorAttachmentDescriptor::metal const): Ditto.

        * platform/graphics/metal/GPURenderPassDepthAttachmentDescriptorMetal.mm:
        (WebCore::GPURenderPassDepthAttachmentDescriptor::GPURenderPassDepthAttachmentDescriptor): Ditto.
        (WebCore::GPURenderPassDepthAttachmentDescriptor::clearDepth const): Ditto.
        (WebCore::GPURenderPassDepthAttachmentDescriptor::setClearDepth const): Ditto.
        (WebCore::GPURenderPassDepthAttachmentDescriptor::metal const): Ditto.

        * platform/graphics/metal/GPURenderPassDescriptorMetal.mm:
        (WebCore::GPURenderPassDescriptor::GPURenderPassDescriptor): Ditto.
        (WebCore::GPURenderPassDescriptor::colorAttachments const): Ditto.
        (WebCore::GPURenderPassDescriptor::depthAttachment const): Ditto.
        (WebCore::GPURenderPassDescriptor::metal const): Ditto.

        * platform/graphics/metal/GPURenderPipelineColorAttachmentDescriptorMetal.mm:
        (WebCore::GPURenderPipelineColorAttachmentDescriptor::GPURenderPipelineColorAttachmentDescriptor): Ditto.
        (WebCore::GPURenderPipelineColorAttachmentDescriptor::pixelFormat const): Ditto.
        (WebCore::GPURenderPipelineColorAttachmentDescriptor::setPixelFormat const): Ditto.
        (WebCore::GPURenderPipelineColorAttachmentDescriptor::metal const): Ditto.

        * platform/graphics/metal/GPURenderPipelineDescriptorMetal.mm:
        (WebCore::GPURenderPipelineDescriptor::GPURenderPipelineDescriptor): Ditto.
        (WebCore::GPURenderPipelineDescriptor::depthAttachmentPixelFormat const): Ditto.
        (WebCore::GPURenderPipelineDescriptor::setDepthAttachmentPixelFormat const): Ditto.
        (WebCore::GPURenderPipelineDescriptor::setVertexFunction const): Ditto.
        (WebCore::GPURenderPipelineDescriptor::setFragmentFunction const): Ditto.
        (WebCore::GPURenderPipelineDescriptor::colorAttachments const): Ditto.
        (WebCore::GPURenderPipelineDescriptor::reset const): Ditto.
        (WebCore::GPURenderPipelineDescriptor::metal const): Ditto.

        * platform/graphics/metal/GPURenderPipelineStateMetal.mm:
        (WebCore::GPURenderPipelineState::GPURenderPipelineState): Ditto.
        (WebCore::GPURenderPipelineState::label const): Ditto.
        (WebCore::GPURenderPipelineState::setLabel const): Ditto. This is one of the
        functions that was calling a method that does not exist. Added a comment.
        (WebCore::GPURenderPipelineState::metal const): Ditto.

        * platform/graphics/metal/GPUTextureDescriptorMetal.mm:
        (WebCore::GPUTextureDescriptor::GPUTextureDescriptor): Ditto.
        (WebCore::GPUTextureDescriptor::width const): Ditto.
        (WebCore::GPUTextureDescriptor::setWidth const): Ditto.
        (WebCore::GPUTextureDescriptor::height const): Ditto.
        (WebCore::GPUTextureDescriptor::setHeight const): Ditto.
        (WebCore::GPUTextureDescriptor::sampleCount const): Ditto.
        (WebCore::GPUTextureDescriptor::setSampleCount const): Ditto.
        (WebCore::GPUTextureDescriptor::textureType const): Ditto.
        (WebCore::GPUTextureDescriptor::setTextureType const): Ditto.
        (WebCore::GPUTextureDescriptor::storageMode const): Ditto.
        (WebCore::GPUTextureDescriptor::setStorageMode const): Ditto.
        (WebCore::GPUTextureDescriptor::usage const): Ditto.
        (WebCore::GPUTextureDescriptor::setUsage const): Ditto.
        (WebCore::GPUTextureDescriptor::metal const): Ditto.

        * platform/graphics/metal/GPUTextureMetal.mm:
        (WebCore::GPUTexture::GPUTexture): Ditto.
        (WebCore::GPUTexture::width const): Ditto.
        (WebCore::GPUTexture::height const): Ditto.
        (WebCore::GPUTexture::metal const): Ditto.

        * platform/graphics/gpu/GPUBuffer.cpp: Removed unused stubs.
        (WebCore::GPUBuffer::length const): Moved this function here since it has
        a useful platform-independent implementation.

        * platform/graphics/gpu/GPUBuffer.h: Use OBJC_PROTOCOL for MTLBuffer.
        Did the other thigs mentioned above: USE(METAL), remove WEBCORE_EXPORT,
        no longer be RefCounted, etc.

        * platform/graphics/gpu/GPUCommandBuffer.cpp: Ditto.
        * platform/graphics/gpu/GPUCommandBuffer.h: Ditto. Use OBJC_PROTOCOL
        for MTLCommandBuffer.

        * platform/graphics/gpu/GPUCommandQueue.cpp: Ditto.
        * platform/graphics/gpu/GPUCommandQueue.h: Ditto. Use OBJC_PROTOCOL for
        MTLCommandQueue.

        * platform/graphics/gpu/GPUComputeCommandEncoder.cpp: Ditto.
        * platform/graphics/gpu/GPUComputeCommandEncoder.h: Ditto. Use OBJC_PROTOCOL for
        MTLComputeCommandEncoder.

        * platform/graphics/gpu/GPUComputePipelineState.cpp: Ditto.
        * platform/graphics/gpu/GPUComputePipelineState.h: Ditto. Use OBJC_PROTOCOL for
        MTLComputePipelineState.

        * platform/graphics/gpu/GPUDepthStencilDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPUDepthStencilDescriptor.h: Ditto.

        * platform/graphics/gpu/GPUDepthStencilState.cpp: Ditto.
        * platform/graphics/gpu/GPUDepthStencilState.h: Ditto. Use OBJC_PROTOCOL for
        MTLDepthStencilState.

        * platform/graphics/gpu/GPUDevice.cpp: Ditto.
        * platform/graphics/gpu/GPUDevice.h: Ditto. Use OBJC_PROTOCOL for MTLDevice.

        * platform/graphics/gpu/GPUDrawable.cpp: Ditto.
        * platform/graphics/gpu/GPUDrawable.h: Ditto. Use OBJC_PROTOCOL for
        MTLDrawable and MTLTexture.

        * platform/graphics/gpu/GPUEnums.h: Tweaked formatting.

        * platform/graphics/gpu/GPUFunction.cpp: Ditto.
        * platform/graphics/gpu/GPUFunction.h: Ditto. Use OBJC_PROTOCOL for
        MTLFunction.

        * platform/graphics/gpu/GPULibrary.cpp: Ditto.
        * platform/graphics/gpu/GPULibrary.h: Ditto. Use OBJC_PROTOCOL for
        MTLLibrary.

        * platform/graphics/gpu/GPURenderCommandEncoder.cpp: Ditto.
        * platform/graphics/gpu/GPURenderCommandEncoder.h: Ditto.
        Use OBJC_PROTOCOL for MTLRenderCommandEncoder.

        * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPassAttachmentDescriptor.h: Ditto.

        * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPassColorAttachmentDescriptor.h: Ditto.

        * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPassDepthAttachmentDescriptor.h: Ditto.

        * platform/graphics/gpu/GPURenderPassDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPassDescriptor.h: Ditto.

        * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPipelineColorAttachmentDescriptor.h: Ditto.

        * platform/graphics/gpu/GPURenderPipelineDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPipelineDescriptor.h: Ditto.

        * platform/graphics/gpu/GPURenderPipelineState.cpp: Ditto.
        * platform/graphics/gpu/GPURenderPipelineState.h: Ditto. Use OBJC_PROTOCOL
        for MTLRenderPipelineState.

        * platform/graphics/gpu/GPUSize.h: Use "unsigned" instead of "unsigned long".

        * platform/graphics/gpu/GPUTexture.cpp: Ditto.
        * platform/graphics/gpu/GPUTexture.h: Ditto. Use OBJC_PROTOCOL for
        MTLTexture.

        * platform/graphics/gpu/GPUTextureDescriptor.cpp: Ditto.
        * platform/graphics/gpu/GPUTextureDescriptor.h: Ditto.

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

        [LFC][Floating] Add skeleton for basic positioning.
        https://bugs.webkit.org/show_bug.cgi?id=187974

        Reviewed by Antti Koivisto.

        Add floating boxes to an empty floating context.

        * layout/FloatingContext.cpp:
        (WebCore::Layout::FloatingContext::FloatingContext):
        (WebCore::Layout::FloatingContext::computePosition):
        * layout/FloatingContext.h:
        (WebCore::Layout::FloatingContext::floatingState const):
        (WebCore::Layout::FloatingContext::layoutContext const):
        * layout/FloatingState.cpp:
        (WebCore::Layout::FloatingState::FloatingState):
        (WebCore::Layout::FloatingState::append):
        * layout/FloatingState.h:
        (WebCore::Layout::FloatingState::create):
        (WebCore::Layout::FloatingState::isEmpty const):
        (WebCore::Layout::FloatingState::layoutContext const):
        * layout/FormattingState.h:
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::establishedFormattingState):
        * layout/LayoutContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layout const):
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::computeFloatingPosition const):
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/blockformatting/BlockInvalidation.cpp:
        (WebCore::Layout::invalidationStopsAtFormattingContextBoundary):
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::isLeftFloatingPositioned const):
        (WebCore::Layout::Box::isRightFloatingPositioned const):
        * layout/layouttree/LayoutBox.h:

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

        [LFC][BFC] Do not try to access containing block's height during descendant height computation
        https://bugs.webkit.org/show_bug.cgi?id=187970

        Reviewed by Antti Koivisto.

        Mostly becasue in BFC, we compute the descendents' height first so the containing block's height is probably not computed yet.

        * layout/FormattingContextGeometry.cpp:
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::inlineReplacedWidthAndMargin):

2018-07-26  Frederic Wang  <fwang@igalia.com>

        Unreviewed, add bug references into FIXME comments for CSSOM View API

        * dom/Element.idl:
        * page/ScrollToOptions.idl:

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

        [LFC][BFC] assert-not-implemented-yet on inflow non-replaced height when style is not fixed/auto.
        https://bugs.webkit.org/show_bug.cgi?id=187969

        Reviewed by Antti Koivisto.

        Assert on unsupported height types when computing inflow non-replaced height.

        * layout/blockformatting/BlockFormattingContextGeometry.cpp:
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowNonReplacedHeightAndMargin):

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

        [Web Animations] REGRESSION: transition added immediately after element creation doesn't work
        https://bugs.webkit.org/show_bug.cgi?id=187942

        Reviewed by Dean Jackson.

        Tests: webanimations/accelerated-transition-by-removing-property.html
               webanimations/partly-accelerated-transition-by-removing-property.html

        The Style::TreeResolver::createAnimatedElementUpdate() function expected a flag to be set that indicates that
        running animations on an element should yield a change in composited state for that element's layer. We did not
        have code accounting for this flag in the Web Animations engine. We now have a resolveAnimationsForElement()
        method on DocumentTimeline which looks at all animations resolved on the element and see if all of them are
        running accelerated and whether at least one of them is pending. In that case, we set the shouldRecompositeLayer
        flag in createAnimatedElementUpdate() to true which guarantees the element's layer will have a backing when
        we attempt to start the animation in KeyframeEffectReadOnly::applyPendingAcceleratedActions() where we would
        have previously failed to have layer-backed renderer to perform an accelerated animation on (under certain
        circumstances, see test).

        * animation/DocumentTimeline.cpp:
        (WebCore::DocumentTimeline::resolveAnimationsForElement):
        * animation/DocumentTimeline.h:
        * animation/KeyframeEffectReadOnly.h:
        (WebCore::KeyframeEffectReadOnly::hasPendingAcceleratedAction const):
        * style/StyleTreeResolver.cpp:
        (WebCore::Style::TreeResolver::createAnimatedElementUpdate):

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

        Allow ActiveDOMObject's canSuspend / suspend / resume overrides to destroy ActiveDOMObjects
        https://bugs.webkit.org/show_bug.cgi?id=188025

        Reviewed by Alex Christensen.

        Apply the same logic as in ScriptExecutionContext::stopActiveDOMObjects() to support destruction of
        ActiveDOMObjects while we're calling ActiveDOMObject's canSuspend / suspend / resume overrides.

        We copy m_activeDOMObjects into a Vector and iterate over the copy instead of m_activeDOMObjects.
        Since ActiveDOMObject is not RefCounted or CanMakeWeakPtr, we verify that the raw pointer is still
        valid by checking if m_activeDOMObjects still contains it, as we iterate. This is safe as the
        ActiveDOMObject destructor removes the object from ScriptExecutionContext::m_activeDOMObjects.
        New ActiveDOMObjects with the same pointer value cannot be created while we iterate as we already
        prevent the construction of new ActiveDOMObjects while we iterate via RELEASE_ASSERT().

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
        (WebCore::ScriptExecutionContext::forEachActiveDOMObject const):
        (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
        (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
        (WebCore::ScriptExecutionContext::stopActiveDOMObjects):
        (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
        * dom/ScriptExecutionContext.h:

2018-07-25  Justin Fan  <justin_fan@apple.com>

        Systems with no NSScreens hitting assertion in rendererIDForDisplay when creating WebGL context
        https://bugs.webkit.org/show_bug.cgi?id=188023
        <rdar://problem/42476622>

        Reviewed by Simon Fraser.

        On systems with no NSScreens, PlatformScreenMac's screenData map is not populated; rendererIDForDisplay
        will thus hit an assertion rather than returning 0. Removing the assertion for now. 

        Covered by existing tests.

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

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

        Build fix after r234215. Unreviewed.

        * rendering/RenderTheme.cpp:

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  Chris Dumez  <cdumez@apple.com>

        navigator.userAgent may return outdated value after webView.customUserAgent is set
        https://bugs.webkit.org/show_bug.cgi?id=188009
        <rdar://problem/42566456>

        Reviewed by Alex Christensen.

        Invalidate the navigator.userAgent cache whenever the user agent gets changed to avoid exposing
        outdated values to JavaScript.

        * page/Navigator.cpp:
        (WebCore::Navigator::userAgentChanged):
        * page/Navigator.h:
        * page/NavigatorID.idl:
        * page/Page.cpp:
        (WebCore::Page::userAgentChanged):
        * page/Page.h:

2018-07-25  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r234187.

        the layout test added with this change is flaky on the bots

        Reverted changeset:

        "Animation stops with object-fit:contain on an animated 2d
        canvas"
        https://bugs.webkit.org/show_bug.cgi?id=187840
        https://trac.webkit.org/changeset/234187

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

        Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT
        https://bugs.webkit.org/show_bug.cgi?id=187978

        Reviewed by Eric Carlson.

        Turn assertion preventing removal of ActiveDOMObjects while we iterate over them into a RELEASE_ASSERT.
        If code does this, this leads to hard to investigate crashes such as rdar://problem/42160890. With a
        release assertion, we would find the culprits right away. The assertion guarding against addition of
        ActiveDOMObjects while we iterate is already a RELEASE_ASSERT.

        * dom/ScriptExecutionContext.cpp:
        (WebCore::ScriptExecutionContext::canSuspendActiveDOMObjectsForDocumentSuspension):
        (WebCore::ScriptExecutionContext::suspendActiveDOMObjects):
        (WebCore::ScriptExecutionContext::resumeActiveDOMObjects):
        (WebCore::ScriptExecutionContext::willDestroyActiveDOMObject):
        * dom/ScriptExecutionContext.h:

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

        REGRESSION (r219757): Accessing response getter of XHR instance from IFRAME sets constructor to Object from the IFRAME
        https://bugs.webkit.org/show_bug.cgi?id=187411
        <rdar://problem/41920593>

        Reviewed by Sam Weinig.

        Update JSXMLHttpRequest::response() to use the XMLHttpRequest's global object exec when constructing a JSONObject
        for the response instead of the caller's exec.

        Test: http/tests/xmlhttprequest/xhr-response-constructor-subframe.html

        * bindings/js/JSXMLHttpRequestCustom.cpp:
        (WebCore::JSXMLHttpRequest::response const):

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

        Animation stops with object-fit:contain on an animated 2d canvas
        https://bugs.webkit.org/show_bug.cgi?id=187840

        Reviewed by Zalan Bujtas.
        
        If a canvas has object-fit: cover or contain, repaints need to mapped through
        the rect that is used to position the canvas in the element bounds, which is replacedContentRect().
        
        Add a version of replacedContentRect() that doesn't require passing the intrinsicSize() since
        all but RenderVideo just pass the RenderReplaced's intrinsicSize.

        Test: fast/repaint/canvas-object-fit.html

        * html/HTMLCanvasElement.cpp:
        (WebCore::HTMLCanvasElement::didDraw):
        * rendering/RenderHTMLCanvas.cpp:
        (WebCore::RenderHTMLCanvas::paintReplaced):
        * rendering/RenderImage.cpp:
        (WebCore::RenderImage::updateInnerContentRect):
        (WebCore::RenderImage::paintReplaced):
        * rendering/RenderLayerBacking.cpp:
        (WebCore::RenderLayerBacking::contentsBox const):
        * rendering/RenderReplaced.h:
        (WebCore::RenderReplaced::replacedContentRect const):
        * rendering/shapes/ShapeOutsideInfo.cpp:
        (WebCore::ShapeOutsideInfo::createShapeForImage const):

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

        [Curl] Add support for wss:// websockets
        https://bugs.webkit.org/show_bug.cgi?id=172630

        Reviewed by Fujii Hironori.

        To support secure WebSocket connection, it is almost rewritten by using existing
        backend for CurlHandle to handle TLS connection and proxy support.

        Test: http/tests/websocket/tests/hybi/simple-wss.html

        * platform/network/curl/CurlContext.cpp:
        (WebCore::CurlSocketHandle::CurlSocketHandle):
        (WebCore::CurlSocketHandle::connect):
        (WebCore::CurlSocketHandle::send):
        (WebCore::CurlSocketHandle::receive):
        (WebCore::CurlSocketHandle::wait):
        * platform/network/curl/CurlContext.h:
        * platform/network/curl/SocketStreamHandleImpl.h:
        (WebCore::SocketStreamHandleImpl::SocketData::SocketData): Deleted.
        * platform/network/curl/SocketStreamHandleImplCurl.cpp:
        (WebCore::SocketStreamHandleImpl::SocketStreamHandleImpl):
        (WebCore::SocketStreamHandleImpl::~SocketStreamHandleImpl):
        (WebCore::SocketStreamHandleImpl::platformSendInternal):
        (WebCore::SocketStreamHandleImpl::platformClose):
        (WebCore::SocketStreamHandleImpl::threadEntryPoint):
        (WebCore::SocketStreamHandleImpl::handleError):
        (WebCore::SocketStreamHandleImpl::stopThread):
        (WebCore::createCopy): Deleted.
        (WebCore::SocketStreamHandleImpl::readData): Deleted.
        (WebCore::SocketStreamHandleImpl::sendData): Deleted.
        (WebCore::SocketStreamHandleImpl::waitForAvailableData): Deleted.
        (WebCore::SocketStreamHandleImpl::startThread): Deleted.
        (WebCore::SocketStreamHandleImpl::didReceiveData): Deleted.
        (WebCore::SocketStreamHandleImpl::didOpenSocket): Deleted.

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-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  Aditya Keerthi  <akeerthi@apple.com>

        [Datalist][macOS] Display suggestions for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=187794

        Reviewed by Tim Horton.

        * html/ColorInputType.cpp:
        (WebCore::ColorInputType::shouldRespectListAttribute):

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

        Unreviewed, rolling out r234121.

        Caused perf test failures.

        Reverted changeset:

        "We should cache the compiled sandbox profile in a data vault"
        https://bugs.webkit.org/show_bug.cgi?id=184991
        https://trac.webkit.org/changeset/234121

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

        [Web Animations] Add an ASSERT() to check the contract that a CSSTransition has a valid effect in setTimingProperties()
        https://bugs.webkit.org/show_bug.cgi?id=187954

        Reviewed by Dean Jackson.

        * animation/CSSTransition.cpp:
        (WebCore::CSSTransition::setTimingProperties):

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

        [Web Animations] Crash when setting an animation style on an existing animation that had its effect set to null
        https://bugs.webkit.org/show_bug.cgi?id=187953

        Reviewed by Dean Jackson.

        Test: webanimations/setting-css-animation-timing-property-via-style-after-clearing-effect.html

        Ensure that we have a valid effect before proceeding to update its timing. 

        * animation/CSSAnimation.cpp:
        (WebCore::CSSAnimation::syncPropertiesWithBackingAnimation):

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

        [MediaStream] Restructure getDisplayMedia classes
        https://bugs.webkit.org/show_bug.cgi?id=187905
        <rdar://problem/42500215>

        Unreviewed build fix.

        * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp: 

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

        [Web Animations] Crash when setting "animation: none" after clearing an animation's effect
        https://bugs.webkit.org/show_bug.cgi?id=187952

        Reviewed by Dean Jackson.

        Test: webanimations/setting-css-animation-none-after-clearing-effect.html

        We need to ensure that the animation we're trying to remove has not had its effect cleared via the
        Web Animations API since its creation before trying to check its phase.

        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::cancelOrRemoveDeclarativeAnimation):

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

        [Web Animations] Crash accessing CSSAnimation::bindingsCurrentTime when effect has been set to null
        https://bugs.webkit.org/show_bug.cgi?id=187950
        <rdar://problem/42515747>

        Reviewed by Dean Jackson.

        Test: webanimations/accessing-current-time-after-clearing-css-animation-effect.html

        While a CSSAnimation has an effect created for it by the implementation, the developer may yet manipulate
        its effect via the Web Animations API and set it to null. As such, we must not assume it's always non-null.

        * animation/CSSAnimation.cpp:
        (WebCore::CSSAnimation::bindingsCurrentTime const):

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

        [LFC][IFC] BlockContainer::establishesInlineFormattingContext should only check the first inflow child.
        https://bugs.webkit.org/show_bug.cgi?id=187965

        Reviewed by Antti Koivisto.

        * layout/layouttree/LayoutBlockContainer.cpp:
        (WebCore::Layout::BlockContainer::establishesInlineFormattingContext const):

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-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-24  Daniel Bates  <dabates@apple.com>

        Rename Document::firstPartyForSameSiteCookies() to siteForCookies()
        https://bugs.webkit.org/show_bug.cgi?id=187892

        Reviewed by Dean Jackson.

        Standardize on the spec. language "site for cookies" for the names of the setter and getter
        on Document. The latest description of Same-Site cookies is in <https://httpwg.org/http-extensions/rfc6265bis.html>.

        No functionality changed. So, no new tests.

        * dom/Document.h:
        (WebCore::Document::siteForCookies const):
        (WebCore::Document::setSiteForCookies):
        (WebCore::Document::firstPartyForSameSiteCookies const): Deleted.
        (WebCore::Document::setFirstPartyForSameSiteCookies): Deleted.
        * loader/FrameLoader.cpp:
        (WebCore::FrameLoader::setFirstPartyForCookies):
        (WebCore::FrameLoader::addSameSiteInfoToRequestIfNeeded):
        * workers/service/context/ServiceWorkerThreadProxy.cpp:
        (WebCore::createPageForServiceWorker):
        * xml/XSLTProcessor.cpp:
        (WebCore::XSLTProcessor::createDocumentFromSource):

2018-07-24  Ross Kirsling  <ross.kirsling@sony.com>

        WebCore::URL::hostIsIPAddress needs a Windows implementation
        https://bugs.webkit.org/show_bug.cgi?id=187859

        Reviewed by Fujii Hironori.

        * platform/URL.cpp:
        (WebCore::isIPv4Address): Added.
        (WebCore::isIPv6Address): Added.
        (WebCore::URL::hostIsIPAddress):
        Turn this stub into a platform-agnostic default implementation.

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

        [MediaStream] Restructure getDisplayMedia classes
        https://bugs.webkit.org/show_bug.cgi?id=187905

        Reviewed by Dean Jackson.

        No new tests, no functional changes.

        * platform/mediastream/CaptureDeviceManager.h:
        (WebCore::CaptureDeviceManager::refreshCaptureDevices): Deleted, no need for it to be a 
        virtual method.
        * platform/mediastream/mac/AVCaptureDeviceManager.h:

        * platform/mediastream/gstreamer/GStreamerCaptureDeviceManager.h: refreshCaptureDevices is
        no longer virtual.

        * platform/mediastream/mac/DisplayCaptureManagerCocoa.cpp:
        (WebCore::DisplayCaptureManagerCocoa::captureDevices):
        (WebCore::DisplayCaptureManagerCocoa::updateDisplayCaptureDevices): Moved functionality 
        to ScreenDisplayCaptureSourceMac.
        (WebCore::DisplayCaptureManagerCocoa::screenCaptureDeviceWithPersistentID): Ditto.
        (WebCore::displayReconfigurationCallBack): Deleted, moved to ScreenDisplayCaptureSourceMac.
        (WebCore::DisplayCaptureManagerCocoa::~DisplayCaptureManagerCocoa): Deleted.
        (WebCore::DisplayCaptureManagerCocoa::refreshCaptureDevices): Deleted.
        * platform/mediastream/mac/DisplayCaptureManagerCocoa.h:

        * platform/mediastream/mac/DisplayCaptureSourceCocoa.cpp:
        (WebCore::roundUpToMacroblockMultiple): Moved from ScreenDisplayCaptureSourceMac.
        (WebCore::DisplayCaptureSourceCocoa::applySize): Ditto.
        (WebCore::DisplayCaptureSourceCocoa::sampleBufferFromPixelBuffer): Ditto.
        (WebCore::DisplayCaptureSourceCocoa::pixelBufferFromIOSurface): Ditto.
        * platform/mediastream/mac/DisplayCaptureSourceCocoa.h:

        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.h:
        * platform/mediastream/mac/ScreenDisplayCaptureSourceMac.mm:
        (WebCore::updateDisplayID):
        (WebCore::ScreenDisplayCaptureSourceMac::createDisplayStream): Fix log message.
        (WebCore::ScreenDisplayCaptureSourceMac::startDisplayStream): Ditto.
        (WebCore::ScreenDisplayCaptureSourceMac::applySize): Update for base class changes.
        (WebCore::ScreenDisplayCaptureSourceMac::applyFrameRate): Ditto.
        (WebCore::ScreenDisplayCaptureSourceMac::frameAvailable): Ditto.
        (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDeviceWithPersistentID): Moved from
        DisplayCaptureManagerCocoa.
        (WebCore::ScreenDisplayCaptureSourceMac::screenCaptureDevices): Ditto.
        (WebCore::roundUpToMacroblockMultiple): Moved to DisplayCaptureSourceCocoa.
        (WebCore::ScreenDisplayCaptureSourceMac::updateDisplayID): Ditto.
        (WebCore::ScreenDisplayCaptureSourceMac::sampleBufferFromPixelBuffer): Ditto.
        (WebCore::ScreenDisplayCaptureSourceMac::pixelBufferFromIOSurface): Ditto.

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

        [LFC] Move geometry data structures to a dedicated file
        https://bugs.webkit.org/show_bug.cgi?id=187939

        Reviewed by Antti Koivisto.

        * WebCore.xcodeproj/project.pbxproj:
        * layout/FormattingContext.h:
        (WebCore::Layout::FormattingContext::Geometry::Position::operator LayoutPoint const): Deleted.
        * 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::floatingNonReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingNonReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingReplacedWidthAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowVerticalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::outOfFlowHorizontalGeometry):
        (WebCore::Layout::FormattingContext::Geometry::floatingHeightAndMargin):
        (WebCore::Layout::FormattingContext::Geometry::floatingWidthAndMargin):
        (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/blockformatting/BlockFormattingContext.h:
        * 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):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowHeightAndMargin):
        (WebCore::Layout::BlockFormattingContext::Geometry::inFlowWidthAndMargin):
        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::setHorizontalMargin):
        (WebCore::Display::Box::setVerticalMargin):
        (WebCore::Display::Box::setVerticalNonCollapsedMargin):
        (WebCore::Display::Box::setBorder):
        (WebCore::Display::Box::setPadding):

2018-07-24  Thibault Saunier  <tsaunier@igalia.com>

        [GStreamer] Implement bitrate modulation support in GStreamer based libwebrtc Encoders
        https://bugs.webkit.org/show_bug.cgi?id=187643

        Reviewed by Philippe Normand.

        Problem being that we do not have a proper unified encoder API in GStreamer, some work
        started at https://bugzilla.gnome.org/show_bug.cgi?id=796716 but it is quite controversial
        and meanwhile we should just move forward working around that limitation.

        Source/WebCore:
        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp:
        (WebCore::GStreamerVideoEncoder::GStreamerVideoEncoder):
        (WebCore::GStreamerVideoEncoder::InitEncode):
        (WebCore::GStreamerVideoEncoder::getBitrateSetter):
        (WebCore::GStreamerVideoEncoder::createEncoder):
        (WebCore::GStreamerVideoEncoder::AddCodecIfSupported):
        (WebCore::GStreamerVideoEncoder::SetRestrictionCaps):
        (WebCore::GStreamerVideoEncoder::CreateEncoder): Deleted.

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-24  Zan Dobersek  <zdobersek@igalia.com>

        [TextureMapper] Separate repaint counter state from debug visuals
        https://bugs.webkit.org/show_bug.cgi?id=187946

        Reviewed by Carlos Garcia Campos.

        Instead of managing the repaint counter visibility along with the
        debug border visuals, do that together with the repaint count value.

        TextureMapperLayer::setRepaintCount() is renamed to setRepaintCounter()
        and now also sets the repaint counter visibility state instead of the
        setDebugVisuals() method.

        GraphicsLayerTextureMapper implementation is adjusted appropriately.
        The unused setRepaintCount() method is also removed.

        CoordinatedGraphicsLayerState now holds repaint counter state (both
        visibility and count value) in a struct that's separate from debug
        border state. CoordinatedGraphicsLayer implementation now updates
        that state accordingly.

        No new tests -- no change in behavior.

        * platform/graphics/texmap/GraphicsLayerTextureMapper.cpp:
        (WebCore::GraphicsLayerTextureMapper::setShowRepaintCounter):
        (WebCore::GraphicsLayerTextureMapper::commitLayerChanges):
        (WebCore::GraphicsLayerTextureMapper::setRepaintCount): Deleted.
        * platform/graphics/texmap/GraphicsLayerTextureMapper.h:
        * platform/graphics/texmap/TextureMapperLayer.cpp:
        (WebCore::TextureMapperLayer::setDebugVisuals):
        (WebCore::TextureMapperLayer::setRepaintCounter):
        (WebCore::TextureMapperLayer::setRepaintCount): Deleted.
        * platform/graphics/texmap/TextureMapperLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::didUpdateTileBuffers):
        (WebCore::CoordinatedGraphicsLayer::setShowRepaintCounter):
        (WebCore::CoordinatedGraphicsLayer::syncLayerState):
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsState.h:
        (WebCore::CoordinatedGraphicsLayerState::CoordinatedGraphicsLayerState):
        (WebCore::DebugVisuals::DebugVisuals): Deleted.

2018-07-24  Thibault Saunier  <tsaunier@igalia.com>

        [WPE][GTK] Implement PeerConnection API on top of libwebrtc
        https://bugs.webkit.org/show_bug.cgi?id=186932

        Reviewed by Philippe Normand.

        Enabled many webrtc tests.

        * platform/GStreamer.cmake: Build new files
        * platform/graphics/gstreamer/GStreamerCommon.cpp: Fix minor style issues
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp: Add a way to give precise name to pipelines
        and give useful names to pipelines with sources comming from a PeerConnection
        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.h: Ditto.
        * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.cpp: Added. Implement a subclass of webrtc::VideoFrame
        to represent a kNative GStreamer video frame.
        * platform/mediastream/gstreamer/GStreamerVideoFrameLibWebRTC.h: Added. Ditto.
        * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.cpp: Handle incoming audio samples from libwebrtc.
        * platform/mediastream/gstreamer/RealtimeIncomingAudioSourceLibWebRTC.h: Ditto.
        * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.cpp: Handle incoming video frames from libwebrtc.
        * platform/mediastream/gstreamer/RealtimeIncomingVideoSourceLibWebRTC.h: Ditto.
        * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.cpp: Handle passing locally captured audio sample to libwebrtc.
        * platform/mediastream/gstreamer/RealtimeOutgoingAudioSourceLibWebRTC.h: Ditto.
        * platform/mediastream/gstreamer/RealtimeOutgoingVideoSourceLibWebRTC.cpp: Handle passing locally captured vidoe frames to libwebrtc.
        * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.cpp: Added. Implement a video decoder factory and LibWebRTC Video decoders based on GStreamer.
        * platform/mediastream/libwebrtc/GStreamerVideoDecoderFactory.h: Added. Ditto.
        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.cpp: Added. Implement a video encoder factory and LibWebRTC H264/VP8 Video encoders based on GStreamer.
        * platform/mediastream/libwebrtc/GStreamerVideoEncoderFactory.h: Added. Ditto.
        * platform/mediastream/libwebrtc/LibWebRTCAudioFormat.h: Add information about signness of the LibWebRTC audio format.
        * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.cpp: Add support for newly added Encoder/Decoder factories.
        * platform/mediastream/libwebrtc/LibWebRTCProviderGlib.h: Ditto.

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

        [css-masking] Black backdrop on -webkit-clip-path on SVG root
        https://bugs.webkit.org/show_bug.cgi?id=187880

        Reviewed by Simon Fraser.

        For SVG document root elements, we currently clip twice:
        In RenderLayer and SVGRenderSupport.
        Avoid clipping in RenderLayer which currently clips before we established a
        backdrop for an SVG document.

        Tests: svg/clip-path/clip-path-on-svg-005-expected.svg
               svg/clip-path/clip-path-on-svg-005.svg

        * rendering/RenderLayer.cpp:
        (WebCore::RenderLayer::setupClipPath): Skip actual clipping.

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

        [Nicosia] Add TextureMapperAnimations member to CompositingLayer::LayerState
        https://bugs.webkit.org/show_bug.cgi?id=187941

        Reviewed by Carlos Garcia Campos.

        Nicosia::CompositingLayer::LayerState gains a TextureMapperAnimations
        member that will be assigned a list of all active animations during each
        layer flush. Despite the name, TextureMapperAnimations doesn't depend on
        any other TextureMapper class. It might be renamed and moved in the
        future, but for now it's used as-is.

        In CoordinatedGraphicsLayer, the syncAnimations() method now flips on
        the animationsChanged flag in the LayerState::Delta struct. This causes
        all the active animations to be copied over into the layer state in
        flushCompositingStateForThisLayerOnly().

        * platform/graphics/nicosia/NicosiaPlatformLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::syncAnimations):
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):

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

        [Nicosia] Add FilterOperations member to CompositionLayer::LayerState
        https://bugs.webkit.org/show_bug.cgi?id=187901

        Reviewed by Carlos Garcia Campos.

        Nicosia::CompositionLayer::LayerState gains a FilterOperations member
        that can be assigned the list of filter operations for a given layer.
        The corresponding filtersChanged boolean is added to LayerState::Delta.

        CoordinatedGraphicsLayer::syncFilters() flips on that delta member,
        which in turn causes the FilterOperations value to be updated during
        the layer flush, in flushCompositingStateForThisLayerOnly().

        * platform/graphics/nicosia/NicosiaPlatformLayer.h:
        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::syncFilters):
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):

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

        [CoordGraphics] Use adjusted position, anchor point, size values for Nicosia::CompositionLayer state
        https://bugs.webkit.org/show_bug.cgi?id=187899

        Reviewed by Carlos Garcia Campos.

        As is done for the CoordinatedGraphicsLayerState, the scale-adjusted
        position, anchor point and size values should be used when updating the
        corresponding Nicosia::CompositionLayer::LayerState members.

        * platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp:
        (WebCore::CoordinatedGraphicsLayer::flushCompositingStateForThisLayerOnly):

2018-07-23  Manuel Rego Casasnovas  <rego@igalia.com>

        [css-grid] Add support for calc() in gutter properties
        https://bugs.webkit.org/show_bug.cgi?id=187902

        Reviewed by Simon Fraser.

        The parsing was already accepting calc() in grid row and column gaps,
        however the code was not taking that into account properly.
        If the calc() had a percentage it was ignored and that's wrong.

        The fix is just a change in the ceck at RenderGrid::availableSpaceForGutters().

        Tests: imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002-rtl.html
               imported/w3c/web-platform-tests/css/css-grid/abspos/grid-positioned-items-gaps-002.html
               imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-011.html
               imported/w3c/web-platform-tests/css/css-grid/alignment/grid-gutters-012.html

        * rendering/RenderGrid.cpp:
        (WebCore::RenderGrid::availableSpaceForGutters const):

2018-07-23  Aditya Keerthi  <akeerthi@apple.com>

        Remove extraneous #endif in html.css
        https://bugs.webkit.org/show_bug.cgi?id=187934

        Reviewed by Tim Horton.

        * css/html.css: Remove extraneous #endif.

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-23  Ben Richards  <benton_richards@apple.com>

        We should cache the compiled sandbox profile in a data vault
        https://bugs.webkit.org/show_bug.cgi?id=184991

        Reviewed by Ryosuke Niwa.

        Added functionality to FileHandle so that it can lock a file while open.
        Added a function to FileSystem to delete non empty directories.

        * platform/FileHandle.cpp:
        (WebCore::FileHandle::FileHandle):
        (WebCore::FileHandle::open):
        (WebCore::FileHandle::close):
        * platform/FileHandle.h:
        * platform/FileSystem.h:
        * platform/cocoa/FileSystemCocoa.mm:
        (WebCore::FileSystem::deleteNonEmptyDirectory):

2018-07-23  Justin Fan  <justin_fan@apple.com>

        [macOS] Ensure that WebGL contexts are always set to an accelerated virtual screen
        https://bugs.webkit.org/show_bug.cgi?id=187923

        Reviewed by Dean Jackson.

        On eGPU displays, it is possible that CGL does not match the preferred renderer. 
        In this case, and when the web process is blocked from accessing the window server, 
        3D contexts *may* default to the software renderer. Ensure that even if this occurs,
        we set the context to use a hardware-accelerated renderer/virtual screen.

        No new tests. Existing behavior covered by existing tests.
        Requires multiple screens, at least one attached to an eGPU, to stress. 

        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::identifyAndSetCurrentGPU):

2018-07-23  Sam Weinig  <sam@webkit.org>

        Convert some obvious never-null pointers to references in the editing code
        https://bugs.webkit.org/show_bug.cgi?id=187914

        Reviewed by Dean Jackson.

        Fixup trivial cases of never-null pointers that really should be references.

        * editing/ApplyStyleCommand.cpp:
        (WebCore::ApplyStyleCommand::shouldApplyInlineStyleToRun):
        (WebCore::ApplyStyleCommand::removeInlineStyleFromElement):
        (WebCore::ApplyStyleCommand::removeImplicitlyStyledElement):
        (WebCore::ApplyStyleCommand::removeCSSStyle):
        (WebCore::ApplyStyleCommand::applyInlineStyleToPushDown):
        (WebCore::ApplyStyleCommand::applyInlineStyleChange):
        * editing/EditingStyle.cpp:
        (WebCore::EditingStyle::overrideWithStyle):
        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
        (WebCore::EditingStyle::conflictsWithImplicitStyleOfElement const):
        (WebCore::EditingStyle::conflictsWithImplicitStyleOfAttributes const):
        (WebCore::EditingStyle::extractConflictingImplicitStyleOfAttributes const):
        (WebCore::EditingStyle::styleIsPresentInComputedStyleOfNode const):
        (WebCore::EditingStyle::elementIsStyledSpanOrHTMLEquivalent):
        (WebCore::EditingStyle::mergeInlineStyleOfElement):
        (WebCore::EditingStyle::wrappingStyleForSerialization):
        (WebCore::EditingStyle::legacyFontSize const):
        (WebCore::StyleChange::StyleChange):
        (WebCore::StyleChange::extractTextStyles):
        (WebCore::legacyFontSizeFromCSSValue):
        * editing/EditingStyle.h:
        (WebCore::EditingStyle::conflictsWithInlineStyleOfElement const):
        * editing/Editor.cpp:
        (WebCore::Editor::selectionStartCSSPropertyValue):
        * editing/ReplaceSelectionCommand.cpp:
        (WebCore::ReplaceSelectionCommand::removeRedundantStylesAndKeepStyleSpanInline):
        (WebCore::isInlineNodeWithStyle):
        * editing/markup.cpp:
        (WebCore::StyledMarkupAccumulator::appendElement):
        (WebCore::StyledMarkupAccumulator::serializeNodes):

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-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-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-23  Zalan Bujtas  <zalan@apple.com>

        [LCF][IFC] Add support for hyphenation.
        https://bugs.webkit.org/show_bug.cgi?id=187913

        Reviewed by Antti Koivisto.

        Move the hyphenation logic over from SimpleLineLayout::TextFragmentIterator.

        * layout/inlineformatting/textlayout/Runs.h:
        (WebCore::Layout::TextRun::hasHyphen const):
        (WebCore::Layout::LayoutRun::setHasHyphen):
        (WebCore::Layout::LayoutRun::hasHyphen const):
        (WebCore::Layout::LayoutRun::LayoutRun):
        (WebCore::Layout::TextRun::createNonWhitespaceRunWithHyphen):
        (WebCore::Layout::TextRun::TextRun):
        * layout/inlineformatting/textlayout/TextContentProvider.cpp:
        (WebCore::Layout::TextContentProvider::findTextItemSlow const):
        (WebCore::Layout::TextContentProvider::width const):
        (WebCore::Layout::TextContentProvider::hyphenPositionBefore const):
        * layout/inlineformatting/textlayout/TextContentProvider.h:
        * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
        (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
        (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
        (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
        (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
        (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
        (WebCore::Layout::SimpleLineBreaker::Line::append):
        (WebCore::Layout::SimpleLineBreaker::Line::reset):
        (WebCore::Layout::SimpleLineBreaker::Style::Style):
        (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
        (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
        (WebCore::Layout::SimpleLineBreaker::hyphenPositionBefore const):
        (WebCore::Layout::SimpleLineBreaker::adjustSplitPositionWithHyphenation const):
        (WebCore::Layout::SimpleLineBreaker::split const):
        * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:

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

        [Web Animations] Querying the current time of a finished CSSAnimation after removing its target leads to a crash
        https://bugs.webkit.org/show_bug.cgi?id=187906

        Reviewed by Dean Jackson.

        Test: webanimations/accessing-current-time-after-finished-css-animation-target-removal.html

        Because we carelessly look at a CSSAnimation's effect's timing in DeclarativeAnimation::bindingsCurrentTime
        without checking that the effect is non-null, we can crash in the case where the animation is finished and
        its target element has been removed, which caused the effect to be set to null.

        We do not actually fix the lack of a null check, which will be the scope of a different patch, but instead
        ensure that we do _not_ set the animation's effect to null when its target is removed, which used to be
        performed via a call to WebAnimation::remove(). Instead, we introduce AnimationTimeline::elementWasRemoved()
        which notifies the timeline of an element being removed such that we may stop referencing any animation
        targeting this element from the various data structures holding strong references to the animation in question,
        and we then cancel the animation silently, which is a new option that ensures promises aren't resolved or
        rejected as a result.

        Finally, the WebAnimation and AnimationEffectReadOnly classes established a ref-cycle as WebAnimation has
        `RefPtr<AnimationEffectReadOnly> m_effect` and AnimationEffectReadOnly has `RefPtr<WebAnimation> m_animation`.
        While it is correct that WebAnimation owns its effect, which is established by the DOM API, the
        reverse is not correct since we only hold the reverse internally for the benefit of our implementation.
        As such, we change AnimationEffectReadOnly's m_animation to be a WeakPtr<WebAnimation>. This means not
        calling WebAnimation::remove() and simply removing the animation from the animation maps on the timeline
        is sufficient to guarantee that the document timeline will not leak (and with it the document).

        * animation/AnimationEffectReadOnly.h:
        (WebCore::AnimationEffectReadOnly::setAnimation):
        * animation/AnimationTimeline.cpp:
        (WebCore::AnimationTimeline::elementWasRemoved):
        * animation/AnimationTimeline.h:
        * animation/WebAnimation.cpp:
        (WebCore::WebAnimation::cancel):
        (WebCore::WebAnimation::resetPendingTasks):
        * animation/WebAnimation.h:
        * dom/Element.cpp:
        (WebCore::Element::removedFromAncestor):
        * rendering/updating/RenderTreeUpdater.cpp:
        (WebCore::RenderTreeUpdater::tearDownRenderers):

2018-07-23  Aditya Keerthi  <akeerthi@apple.com>

        [iOS] Add support for input[type=color]
        https://bugs.webkit.org/show_bug.cgi?id=187871

        Reviewed by Tim Horton.

        * css/html.css: Remove unwanted styling for color inputs with a list attribute.
        * html/ColorInputType.cpp: Make the element focusable.
        (WebCore::ColorInputType::isMouseFocusable const):
        (WebCore::ColorInputType::isKeyboardFocusable const):
        * html/ColorInputType.h:
        * html/HTMLInputElement.h: Expose isColorControl() to WebKit.
        * page/Chrome.cpp:
        (WebCore::Chrome::createColorChooser):

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-22  Zalan Bujtas  <zalan@apple.com>

        [LFC][IFC] Add center/right/justify line alignment support.
        https://bugs.webkit.org/show_bug.cgi?id=187890

        Reviewed by Antti Koivisto.

        Move over some more code from simple line layout.
        (though text-align: justify is more preformant as now expansion opportunities are added as we process the text runs
        -as opposed to iterting through the runs again when we reach the end of the line.) 

        * layout/inlineformatting/textlayout/Runs.h:
        (WebCore::Layout::LayoutRun::setLeft):
        (WebCore::Layout::LayoutRun::setExpansion):
        * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp:
        (WebCore::Layout::SimpleLineBreaker::Line::Line):
        (WebCore::Layout::SimpleLineBreaker::Line::setTextAlign):
        (WebCore::Layout::SimpleLineBreaker::Line::adjustedLeftForTextAlign const):
        (WebCore::Layout::SimpleLineBreaker::Line::justifyRuns):
        (WebCore::Layout::SimpleLineBreaker::Line::adjustRunsForTextAlign):
        (WebCore::Layout::expansionOpportunity):
        (WebCore::Layout::expansionBehavior):
        (WebCore::Layout::SimpleLineBreaker::Line::collectExpansionOpportunities):
        (WebCore::Layout::SimpleLineBreaker::Line::closeLastRun):
        (WebCore::Layout::SimpleLineBreaker::Line::append):
        (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
        (WebCore::Layout::SimpleLineBreaker::Line::reset):
        (WebCore::Layout::SimpleLineBreaker::Style::Style):
        (WebCore::Layout::SimpleLineBreaker::handleLineEnd):
        (WebCore::Layout::SimpleLineBreaker::handleLineStart):
        (WebCore::Layout::isTextAlignRight):
        (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
        * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h:
        (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
        (WebCore::Layout::SimpleLineBreaker::Line::setCollapseWhitespace):

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

        [LFC][IFC] Add verification for inline text runs.
        https://bugs.webkit.org/show_bug.cgi?id=187879

        Reviewed by Antti Koivisto.

        * layout/Verification.cpp:
        (WebCore::Layout::outputMismatchingSimpleLineInformationIfNeeded):
        (WebCore::Layout::outputMismatchingComplexLineInformationIfNeeded):
        (WebCore::Layout::outputMismatchingBlockBoxInformationIfNeeded):
        (WebCore::Layout::verifyAndOutputSubtree):
        (WebCore::Layout::outputMismatchingBoxInformationIfNeeded): Deleted.
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::layout const):
        * layout/inlineformatting/InlineFormattingState.h:
        (WebCore::Layout::InlineFormattingState::addLayoutRuns):
        (WebCore::Layout::InlineFormattingState::layoutRuns const):
        * layout/layouttree/LayoutTreeBuilder.cpp:
        (WebCore::Layout::outputLayoutBox):
        (WebCore::Layout::outputLayoutTree):
        (WebCore::Layout::TreeBuilder::showLayoutTree):

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

        [LFC] Do not use virtual methods to construct floating/formatting states.
        https://bugs.webkit.org/show_bug.cgi?id=187875

        Reviewed by Antti Koivisto.

        LayoutContext::establishedFormattingState() does not require FormattingContext anymore only the root of the context.

        * layout/FormattingContext.cpp:
        (WebCore::Layout::FormattingContext::layoutOutOfFlowDescendants const):
        * layout/FormattingContext.h:
        * layout/LayoutContext.cpp:
        (WebCore::Layout::LayoutContext::layoutFormattingContextSubtree):
        (WebCore::Layout::LayoutContext::formattingStateForBox const):
        (WebCore::Layout::LayoutContext::establishedFormattingState):
        * layout/LayoutContext.h:
        * layout/blockformatting/BlockFormattingContext.cpp:
        (WebCore::Layout::BlockFormattingContext::layoutFormattingContextRoot const):
        (WebCore::Layout::BlockFormattingContext::instrinsicWidthConstraints const):
        (WebCore::Layout::BlockFormattingContext::createFormattingState const): Deleted.
        (WebCore::Layout::BlockFormattingContext::createOrFindFloatingState const): Deleted.
        * layout/blockformatting/BlockFormattingContext.h:
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::createFormattingState const): Deleted.
        (WebCore::Layout::InlineFormattingContext::createOrFindFloatingState const): Deleted.
        * layout/inlineformatting/InlineFormattingContext.h:

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

        [LFC][BFC] Do not collapse top/bottom margin with first/last inflow child from a non-block formatting context.
        https://bugs.webkit.org/show_bug.cgi?id=187867

        Reviewed by Antti Koivisto.

        The box's top/bottom margin never collapses with a non-block inflow child.

        * layout/blockformatting/BlockMarginCollapse.cpp:
        (WebCore::Layout::isMarginTopCollapsedWithSibling):
        (WebCore::Layout::isMarginBottomCollapsedWithSibling):
        (WebCore::Layout::isMarginTopCollapsedWithParent):
        (WebCore::Layout::isMarginBottomCollapsedThrough):
        (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::isMarginBottomCollapsedWithParent):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::collapsedMarginBottomFromLastChild):
        (WebCore::Layout::BlockFormattingContext::MarginCollapse::nonCollapsedMarginBottom):
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::establishesBlockFormattingContextOnly const): <div style="overflow: hidden">foobar</div> establishes both inline and block formatting context (inline wins though).
        * layout/layouttree/LayoutBox.h: establishesBlockFormattingContext() does not need to be virtual since we can determine it by looking at the box's style. -while in case
        of inline formatting context, it is about the content.

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-20  Justin Fan  <justin_fan@apple.com>

        Safari WebGL does not consistently provide correct GPU context on eGPU systems
        https://bugs.webkit.org/show_bug.cgi?id=187750
        <rdar://problem/39531436>

        Reviewed by Dean Jackson.

        Move GraphicsContext3DManager into its own class, and notify it when page/Chrome receives a 
        windowScreenDidChange message. Add a private data struct to track which hostWindow created each context.
        Upon notification, Manager updates the contexts that match the hostWindow with the
        provided displayID. Each context matches displayID to rendererID (set during process creation 
        if window server is blocked), which is matched to a virtual screen, and updates its GPU accordingly.

        No new tests. This requires multiple GPUs or eGPUs, each with attached display(s), to test.

        * WebCore.xcodeproj/project.pbxproj:
        * page/Chrome.cpp:
        (WebCore::Chrome::windowScreenDidChange): Now calls GraphicsContext3DManager::screenDidChange().
        * platform/PlatformScreen.h:
        * platform/ScreenProperties.h: Add rendererID to struct.
        (WebCore::ScreenData::encode const):
        (WebCore::ScreenData::decode):
        * platform/graphics/GraphicsContext3D.h:
        * platform/graphics/GraphicsContext3DManager.cpp: Added (copied out of GraphicsContext3DCocoa.mm).
        (WebCore::attachToAppleGraphicsControl):
        (WebCore::hasMuxCapability):
        (WebCore::hasMuxableGPU):
        (WebCore::GraphicsContext3DManager::sharedManager):
        (WebCore::displayWasReconfigured):
        (WebCore::GraphicsContext3DManager::updateAllContexts):
        (WebCore::GraphicsContext3DManager::screenDidChange):
        (WebCore::GraphicsContext3DManager::addContext):
        (WebCore::GraphicsContext3DManager::removeContext):
        (WebCore::GraphicsContext3DManager::hostWindowForContext const):
        (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance):
        (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance):
        (WebCore::GraphicsContext3DManager::updateHighPerformanceState):
        (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired):
        (WebCore::GraphicsContext3DManager::recycleContextIfNecessary):
        * platform/graphics/GraphicsContext3DManager.h: Added (copied out of GraphicsContext3DCocoa.mm).
        (WebCore::GraphicsContext3DManager::hasTooManyContexts const):
        (WebCore::GraphicsContext3DManager::GraphicsContext3DManager):
        * platform/graphics/cocoa/GraphicsContext3DCocoa.mm:
        (WebCore::GraphicsContext3D::create):
        (WebCore::GraphicsContext3D::createShared):
        (WebCore::identifyAndSetCurrentGPU): Now matches rendererIDs to determine virtual screen. 
        (WebCore::GraphicsContext3D::GraphicsContext3D):
        (WebCore::GraphicsContext3D::~GraphicsContext3D):
        (WebCore::GraphicsContext3D::setContextVisibility):
        (WebCore::GraphicsContext3D::simulateContextChanged):
        (WebCore::GraphicsContext3D::screenDidChange):
        (WebCore::attachToAppleGraphicsControl): Deleted.
        (WebCore::hasMuxCapability): Deleted.
        (WebCore::hasMuxableGPU): Deleted.
        (WebCore::GraphicsContext3DManager::GraphicsContext3DManager): Deleted.
        (WebCore::GraphicsContext3DManager::hasTooManyContexts const): Deleted.
        (WebCore::manager): Deleted.
        (WebCore::displayWasReconfigured): Deleted.
        (WebCore::GraphicsContext3DManager::updateAllContexts): Deleted.
        (WebCore::GraphicsContext3DManager::addContext): Deleted.
        (WebCore::GraphicsContext3DManager::removeContext): Deleted.
        (WebCore::GraphicsContext3DManager::addContextRequiringHighPerformance): Deleted.
        (WebCore::GraphicsContext3DManager::removeContextRequiringHighPerformance): Deleted.
        (WebCore::GraphicsContext3DManager::updateHighPerformanceState): Deleted.
        (WebCore::GraphicsContext3DManager::disableHighPerformanceGPUTimerFired): Deleted.
        (WebCore::GraphicsContext3DManager::recycleContextIfNecessary): Deleted.
        * platform/mac/PlatformScreenMac.mm: Provide a display's rendererID.
        (WebCore::rendererIDForDisplayMask):
        (WebCore::collectScreenProperties):
        (WebCore::rendererIDForDisplay):
        (WebCore::primaryRendererID):

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  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-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-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-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-20  Antoine Quint  <graouts@apple.com>

        DeclarativeAnimation should suspend, resume, & stop m_eventQueue
        https://bugs.webkit.org/show_bug.cgi?id=187216
        <rdar://problem/41669739>

        Reviewed by Ryosuke Niwa.

        Suspend, resume and close the GenericEventQueue for DeclarativeAnimation as instructed through the DOMActiveObject protocol.

        * animation/DeclarativeAnimation.cpp:
        (WebCore::DeclarativeAnimation::stop):
        (WebCore::DeclarativeAnimation::suspend):
        (WebCore::DeclarativeAnimation::resume):
        * animation/DeclarativeAnimation.h:
        * animation/WebAnimation.h:

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

        [LFC][Inline formatting context] Add basic text content handling.
        https://bugs.webkit.org/show_bug.cgi?id=187860

        Reviewed by Antti Koivisto.

        InlineFormattingContext::layout() walks through the formatting root's descendant list in a post-order fashion and
        feeds the TextContentProvider.
        Eventually this would turn into a more generic loop where we stop and process the text content when finding a non-text content box (float, inline-box etc), but right now
        this is about text content only.

        * layout/displaytree/DisplayBox.h:
        (WebCore::Display::Box::contentBoxBottom const):
        (WebCore::Display::Box::contentBoxRight const):
        * layout/inlineformatting/InlineFormattingContext.cpp:
        (WebCore::Layout::InlineFormattingContext::layout const):
        * layout/inlineformatting/textlayout/TextContentProvider.cpp:
        (WebCore::Layout::TextContentProvider::textRuns): Add a helper function to support the case when all we need is just the run list in one go.
        * layout/inlineformatting/textlayout/TextContentProvider.h:
        * layout/layouttree/LayoutBox.cpp:
        (WebCore::Layout::Box::isDescendantOf const):
        * layout/layouttree/LayoutBox.h:
        * layout/layouttree/LayoutInlineBox.h:
        (WebCore::Layout::InlineBox::textContent const):

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  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-19  Antoine Quint  <graouts@apple.com>

        Flaky crash in AnimationTimeline::cancelOrRemoveDeclarativeAnimation
        https://bugs.webkit.org/show_bug.cgi?id=187530
        <rdar://problem/42095186>

        Reviewed by Dean Jackson.

        We would crash in cancelOrRemoveDeclarativeAnimation() because updateCSSAnimationsForElement() would pass
        nullptr values due to the return value of cssAnimationsByName.take(nameOfAnimationToRemove). This is because
        we would create animations for animation names that may be empty or not match an existing @keyframes rule.
        Not only was that wasteful, but it was also non-compliant, and as a result of fixing this we're actually
        seeing a progression in the CSS Animations WPT tests.

        * animation/AnimationTimeline.cpp:
        (WebCore::shouldConsiderAnimation): New function that performs all required steps to see if a provided animation
        is valid and has a name that is not "none", not the empty string and matches the name of a @keyframes rule.
        (WebCore::AnimationTimeline::updateCSSAnimationsForElement):
        * animation/KeyframeEffectReadOnly.cpp:
        (WebCore::KeyframeEffectReadOnly::computeCSSAnimationBlendingKeyframes): We no longer need to check whether we have
        an empty animation name since we're no longer creating CSSAnimation objects in that circumstance.
        * css/StyleResolver.cpp:
        (WebCore::StyleResolver::isAnimationNameValid): Add a new method that checks whether the provided animation name
        a known @keyframes rule.
        * css/StyleResolver.h:

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-19  Dean Jackson  <dino@apple.com>

        CrashTracer: com.apple.WebKit.WebContent.Development at com.apple.WebCore: std::optional<WTF::Vector<WebCore::PluginInfo, 0ul, WTF::CrashOnOverflow, 16ul> >::operator* & + 73
        https://bugs.webkit.org/show_bug.cgi?id=187820
        <rdar://problem/42017759>

        Reviewed by Antoine Quint.

        Speculative fix for this crash, which is accessing an optional without checking
        if it exists. The crash logs didn't point to a reproducible test case.

        * plugins/PluginData.cpp:
        (WebCore::PluginData::supportsWebVisibleMimeTypeForURL const): Return false if
        the optional doesn't exist.

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-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-19  David Fenton  <david_fenton@apple.com>

        Unreviewed, rolling out r233994.

        Caused EWS and bot failures due to assertions added

        Reverted changeset:

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

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-19  Zalan Bujtas  <zalan@apple.com>

        [LFC] Introduce simple line breaker.
        https://bugs.webkit.org/show_bug.cgi?id=187688

        Reviewed by Antti Koivisto.

        This patch takes the simple line layout implementation and refactors it in a way it is no longer requires a RenderBlockFlow object to run on.
        Also this patch decouples text run generation and line breaking (and this implementation is going to replace the current simple line layout codebase)

        TextContentProvider: Acts both as the container for all the text content (including hard line breaks) and as an iterator for the generated text runs.
        SimpleTextRunGenerator: TextContentProvider uses it as the text run generator for simple content (in the future we'll have a ComplexTextRunGenerator).
        SimpleLineBreaker: Input -> text runs + line constraints; Output -> layout runs after line breaking.

        * Sources.txt:
        * WebCore.xcodeproj/project.pbxproj:
        * layout/inlineformatting/textlayout/ContentProvider.cpp: Added.
        (WebCore::Layout::TextContentProvider::TextItem::Style::Style):
        (WebCore::Layout::TextContentProvider::ContentProvider):
        (WebCore::Layout::TextContentProvider::~ContentProvider):
        (WebCore::Layout::TextContentProvider::appendText):
        (WebCore::Layout::TextContentProvider::appendLineBreak):
        (WebCore::Layout::TextContentProvider::width const):
        (WebCore::Layout::TextContentProvider::textWidth const):
        (WebCore::Layout::TextContentProvider::fixedPitchWidth const):
        (WebCore::Layout::TextContentProvider::toTextItemIndex const):
        (WebCore::Layout::TextContentProvider::length const):
        (WebCore::Layout::TextContentProvider::iterator):
        (WebCore::Layout::TextContentProvider::findNextRun):
        (WebCore::Layout::TextContentProvider::current const):
        * layout/inlineformatting/textlayout/ContentProvider.h: Added.
        (WebCore::Layout::TextContentProvider::textContent const):
        (WebCore::Layout::TextContentProvider::hardLineBreaks const):
        (WebCore::Layout::TextContentProvider::Iterator::current const):
        (WebCore::Layout::TextContentProvider::contains const):
        (WebCore::Layout::TextContentProvider::Iterator::Iterator):
        (WebCore::Layout::TextContentProvider::Iterator::operator++):
        * layout/inlineformatting/textlayout/Runs.h: Added.
        (WebCore::Layout::TextRun::isWhitespace const):
        (WebCore::Layout::TextRun::isNonWhitespace const):
        (WebCore::Layout::TextRun::isLineBreak const):
        (WebCore::Layout::TextRun::isSoftLineBreak const):
        (WebCore::Layout::TextRun::isHardLineBreak const):
        (WebCore::Layout::TextRun::isValid const):
        (WebCore::Layout::TextRun::isCollapsed const):
        (WebCore::Layout::TextRun::type const):
        (WebCore::Layout::TextRun::setIsCollapsed):
        (WebCore::Layout::TextRun::setWidth):
        (WebCore::Layout::LayoutRun::start const):
        (WebCore::Layout::LayoutRun::end const):
        (WebCore::Layout::LayoutRun::length const):
        (WebCore::Layout::LayoutRun::left const):
        (WebCore::Layout::LayoutRun::right const):
        (WebCore::Layout::LayoutRun::width const):
        (WebCore::Layout::LayoutRun::isEndOfLine const):
        (WebCore::Layout::LayoutRun::setEnd):
        (WebCore::Layout::LayoutRun::setRight):
        (WebCore::Layout::LayoutRun::setIsEndOfLine):
        (WebCore::Layout::LayoutRun::LayoutRun):
        (WebCore::Layout::TextRun::createWhitespaceRun):
        (WebCore::Layout::TextRun::createNonWhitespaceRun):
        (WebCore::Layout::TextRun::createSoftLineBreakRun):
        (WebCore::Layout::TextRun::createHardLineBreakRun):
        (WebCore::Layout::TextRun::TextRun):
        (WebCore::Layout::TextRun::start const):
        (WebCore::Layout::TextRun::end const):
        (WebCore::Layout::TextRun::length const):
        (WebCore::Layout::TextRun::width const):
        * layout/inlineformatting/textlayout/simple/SimpleContentProvider.cpp: Added.
        (WebCore::Layout::SimpleContentProvider::SimpleContentProvider):
        (WebCore::Layout::SimpleContentProvider::current const):
        (WebCore::Layout::SimpleContentProvider::reset):
        (WebCore::Layout::SimpleContentProvider::findNextRun):
        (WebCore::Layout::SimpleContentProvider::moveToNextBreakablePosition):
        (WebCore::Layout::SimpleContentProvider::moveToNextNonWhitespacePosition):
        (WebCore::Layout::SimpleContentProvider::isAtLineBreak const):
        (WebCore::Layout::SimpleContentProvider::isAtSoftLineBreak const):
        * layout/inlineformatting/textlayout/simple/SimpleContentProvider.h: Added.
        (WebCore::Layout::SimpleContentProvider::Iterator::reset):
        (WebCore::Layout::SimpleContentProvider::Position::operator== const):
        (WebCore::Layout::SimpleContentProvider::Position::operator< const):
        (WebCore::Layout::SimpleContentProvider::Position::operator ContentPosition const):
        (WebCore::Layout::SimpleContentProvider::Position::resetItemPosition):
        (WebCore::Layout::SimpleContentProvider::Position::contentPosition const):
        (WebCore::Layout::SimpleContentProvider::Position::itemPosition const):
        (WebCore::Layout::SimpleContentProvider::Iterator<T>::Iterator):
        (WebCore::Layout::SimpleContentProvider::Iterator<T>::current const):
        (WebCore::Layout::SimpleContentProvider::Iterator<T>::operator):
        (WebCore::Layout::SimpleContentProvider::Position::operator++):
        (WebCore::Layout::SimpleContentProvider::Position::operator+=):
        * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.cpp: Added.
        (WebCore::Layout::SimpleLineBreaker::TextRunList::TextRunList):
        (WebCore::Layout::SimpleLineBreaker::Line::Line):
        (WebCore::Layout::adjustedEndPosition):
        (WebCore::Layout::SimpleLineBreaker::Line::append):
        (WebCore::Layout::SimpleLineBreaker::Line::collapseTrailingWhitespace):
        (WebCore::Layout::SimpleLineBreaker::Line::reset):
        (WebCore::Layout::SimpleLineBreaker::Style::Style):
        (WebCore::Layout::SimpleLineBreaker::SimpleLineBreaker):
        (WebCore::Layout::SimpleLineBreaker::runs):
        (WebCore::Layout::SimpleLineBreaker::createRunsForLine):
        (WebCore::Layout::SimpleLineBreaker::handleOverflownRun):
        (WebCore::Layout::SimpleLineBreaker::collapseLeadingWhitespace):
        (WebCore::Layout::SimpleLineBreaker::collapseTrailingWhitespace):
        (WebCore::Layout::SimpleLineBreaker::splitTextRun):
        (WebCore::Layout::SimpleLineBreaker::split const):
        (WebCore::Layout::SimpleLineBreaker::availableWidth const):
        (WebCore::Layout::SimpleLineBreaker::verticalPosition const):
        * layout/inlineformatting/textlayout/simple/SimpleLineBreaker.h: Added.
        (WebCore::Layout::SimpleLineBreaker::TextRunList::overrideCurrent):
        (WebCore::Layout::SimpleLineBreaker::TextRunList::isCurrentOverridden const):
        (WebCore::Layout::SimpleLineBreaker::Line::availableWidth const):
        (WebCore::Layout::SimpleLineBreaker::Line::hasContent const):
        (WebCore::Layout::SimpleLineBreaker::Line::setAvailableWidth):
        (WebCore::Layout::SimpleLineBreaker::Line::hasTrailingWhitespace const):
        (WebCore::Layout::SimpleLineBreaker::Line::isWhitespaceOnly const):
        (WebCore::Layout::SimpleLineBreaker::wrapContentOnOverflow const):
        (WebCore::Layout::SimpleLineBreaker::TextRunList::current const):
        (WebCore::Layout::SimpleLineBreaker::TextRunList::operator++):

2018-07-19  Keith Rollin  <krollin@apple.com>

        Remove duplicate compilation of WebKitNSImageExtras.mm
        https://bugs.webkit.org/show_bug.cgi?id=187782

        Reviewed by Alex Christensen.

        WebKitNSImageExtras.mm gets compiled twice, once because it's in
        WebCore.xcodeproj/project.pbxproj and once because it's in
        Webcore/SourcesCocoa.txt. This can lead to duplicate definition
        errors, particularly when building with LTO enabled. Fix this by
        removing the entry from the Xcode project.

        No new tests -- no change in WebKit functionality.

        * WebCore.xcodeproj/project.pbxproj:

2018-07-19  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 throu